Fix follow-mouse clicks on undraggable mode/header lines.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
22294a56
EZ
12012-11-24 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
4 highlighting on the frame was cleared. Prevents assertion
5 violations when repeatedly clicking on the "Top" link of the
6 "bread-crumbs" in Info buffers.
7
6d4e8f62 82012-11-23 Paul Eggert <eggert@cs.ucla.edu>
259719a6 9 Eli Zaretskii <eliz@gnu.org>
6d4e8f62
PE
10
11 Fix a race condition with glib (Bug#8855).
259719a6
EZ
12 The symptom is a diagnostic "GLib-WARNING **: In call to
13 g_spawn_sync(), exit status of a child process was requested but
14 SIGCHLD action was set to SIG_IGN and ECHILD was received by
15 waitpid(), so exit status can't be returned." The diagnostic
16 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
17 The real bug is a race condition between Emacs and glib: Emacs
18 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
19 so that glib can't find it. Work around the bug by invoking
20 waitpid only on subprocesses that Emacs itself creates.
6d4e8f62 21
259719a6 22 This is a backport from the trunk, consisting of:
6d4e8f62
PE
23
24 * w32proc.c (create_child): Don't clip the PID of the child
25 process to fit into an Emacs integer, as this is no longer a
26 restriction.
27 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
28 reaping only the process specified by PID argument, if that is
29 positive. Use PID instead of dead_child to know which process to
30 reap. Wait for the child to die only if WNOHANG is not in
31 OPTIONS.
32 (sys_select): Don't set dead_child.
33
34 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
35 as it is no longer needed.
36
37 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
38 no longer needed.
259719a6
EZ
39 (create_process, record_child_status_change): Don't use special
40 value -1 in pid field, as the caller now must know the pid rather
41 than having the callee infer it. The inference was sometimes
42 incorrect anyway, due to another race.
6d4e8f62
PE
43 (create_process): Set new 'alive' member if child is created.
44 (process_status_retrieved): New function.
45 (record_child_status_change): Use it.
46 Accept negative 1st argument, which means to wait for the
47 processes that Emacs already knows about. Move special-case code
48 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
49 processes that have already been waited for, by testing and
259719a6
EZ
50 clearing new 'alive' member. Remove the setting of
51 record_at_most_one_child for the !WNOHANG case.
6d4e8f62
PE
52 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
53 now does this internally.
54 (handle_child_signal): Let record_child_status_change do all
55 the work, since we do not want to reap all exited child processes,
56 only the child processes that Emacs itself created.
57 * process.h (Lisp_Process): New boolean member 'alive'.
58
8654a41b
EZ
592012-11-23 Eli Zaretskii <eliz@gnu.org>
60
24becea4
EZ
61 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
62 between bpos_covered and bpos_max. This fixes cursor display when
63 several display strings follow each other.
64
8654a41b
EZ
65 * .gdbinit (pgx): If the glyph's object is a string, display the
66 pointer to string data, rather than the value of the string object
67 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
68
cb5867b1
EZ
692012-11-21 Eli Zaretskii <eliz@gnu.org>
70
71 * indent.c (Fvertical_motion): If the starting position is covered
72 by a display string, return to one position before that, to avoid
73 overshooting it inside move_it_to. (Bug#12930)
74
a16ac13f
DC
752012-11-20 Daniel Colascione <dancol@dancol.org>
76
77 * w32fns.c (Fx_file_dialog):
78 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
79 cygwin_convert_file_name*.
80
81 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
82 Rename cygwin_convert_path* to cygwin_convert_file_name*.
83
4ffea447
KB
842012-11-20 Ken Brown <kbrown@cornell.edu>
85
86 * emacs.c (main): Set the G_SLICE environment variable for all
87 Cygwin builds, not just GTK builds. See
88 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
89
88c4a13c
EZ
902012-11-19 Eli Zaretskii <eliz@gnu.org>
91
92 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Don't mix declaration of
93 w32_note_current_window with code. (Backport from trunk.)
94
95 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
96 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
97 Define for the MSVC compiler.
98
99 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing
100 semi-colon.
101
273ac8d1
EZ
1022012-11-18 Eli Zaretskii <eliz@gnu.org>
103
104 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
105 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
106 dostounix_filename. Prevents crashes down the road, because
107 dostounix_filename assumes it gets a unibyte string. Reported by
108 Michel de Ruiter <michel@sentient.nl>, see
109 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
110
d8715cdf
EZ
1112012-11-17 Eli Zaretskii <eliz@gnu.org>
112
113 * w32select.c: Include w32common.h before w32term.h, so that
114 windows.h gets included before w32term.h uses some of its
115 features, see below.
116
117 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
118 typedefs.
119 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
120 prototypes.
121 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
122
7436fc63
JD
1232012-11-17 Jan Djärv <jan.h.d@swipnet.se>
124
125 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
126 (ns_select): Return at once if events are held (Bug#12834).
127
86dcf21c 1282012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
129
130 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
131 Needed following 2012-10-20 change. (Bug#12902)
132
d56f2e49
GM
1332012-11-16 Glenn Morris <rgm@gnu.org>
134
135 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
136
5c2a7148
SM
1372012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
138
139 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
140
730b2d8f
EZ
1412012-11-14 Eli Zaretskii <eliz@gnu.org>
142
143 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
144 use the same value of thread handle.
145 (start_timer_thread): If the timer thread exited (due to error),
146 clean up by closing the two handles it used. Duplicate the caller
147 thread's handle here, so it gets duplicated only once, when
148 launching the timer thread. Set priority of the timer thread, not
149 the caller thread.
150 (getitimer): Don't duplicate the caller thread's handle here.
151 (Bug#12832)
152
f99c65e5
JD
1532012-11-13 Jan Djärv <jan.h.d@swipnet.se>
154
155 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
156 called (Bug#12834).
157
32520273
EZ
1582012-11-12 Eli Zaretskii <eliz@gnu.org>
159
160 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
161 passed to pint2str and pint2hrstr to be at most the size of the
162 frame's decode_mode_spec_buffer. This avoids crashes with very
163 large values of FIELD_WIDTH argument to decode_mode_spec.
164 (Bug#12867)
165
fdaf534a
MR
1662012-11-07 Martin Rudalics <rudalics@gmx.at>
167
168 * window.c (Fsplit_window_internal): Set combination limit of
169 new parent window to t iff Vwindow_combination_limit is t;
170 fixing a regression introduced with the change from 2012-09-22.
5c2a7148
SM
171 (Fwindow_combination_limit, Fset_window_combination_limit):
172 Fix doc-strings.
fdaf534a 173
acf93bcf
EZ
1742012-11-06 Eli Zaretskii <eliz@gnu.org>
175
176 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
177 amount when the scroll margins are too large. When scrolling
178 backwards in the buffer, give up if cannot reach point or the
5c2a7148
SM
179 scroll margin within a reasonable number of screen lines.
180 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
181 point is positioned many lines beyond the window top/bottom.
182 (Bug#12811)
183
508f51f5
EZ
1842012-11-05 Eli Zaretskii <eliz@gnu.org>
185
186 * ralloc.c (relinquish): If real_morecore fails to return memory
187 to the system, don't crash; instead, leave the last heap
188 unchanged and return. (Bug#12774)
189
67b50ba4 1902012-11-03 Eli Zaretskii <eliz@gnu.org>
ad10696b 191
1d4341f9
EZ
192 * lisp.mk: Adjust comments to the fact that term/internal is now
193 loaded from loadup.el.
ad10696b 194
b3cf17f6
EZ
195 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
196 (msdos_fatal_signal): New function.
197 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
198 its argument list.
199
200 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
201 for GCC versions before 4.
202 (emacs_raise): Define to call msdos_fatal_signal.
67b50ba4
EZ
203
204 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
205 iterator when starting in the middle of a display or overlay
206 string. (Bug#12745)
207
858f0f24
EZ
2082012-11-03 Jan Djärv <jan.h.d@swipnet.se>
209
210 * widget.c (resize_cb): New function.
211 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
212 (EmacsFrameResize): Check if all is up to date before changing frame
213 size.
214
7e8b50d9
EZ
2152012-11-01 Eli Zaretskii <eliz@gnu.org>
216
217 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
218
322aea6d
PE
2192012-10-31 Paul Eggert <eggert@cs.ucla.edu>
220
221 Fix crash when using Emacs as commit editor for git (Bug#12697).
222 * callproc.c (setpgrp): Remove macro, as we now use setpgid
223 and it is configured in conf_post.h.
224 (Fcall_process): Don't invoke both setsid and setpgid; the former
225 is enough, if it exists.
226 * callproc.c (Fcall_process, child_setup):
227 * process.c (create_process): Use setpgid.
228 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
229 for the real thing.
230 * dispnew.c (init_display): Initialize the foreground group
231 if we are running a tty display.
232 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
233 * lisp.h (init_foreground_group): New decl.
234 * sysdep.c (inherited_pgroup): New static var.
235 (init_foreground_group, tcsetpgrp_without_stopping)
236 (narrow_foreground_group, widen_foreground_group): New functions.
237 (init_sys_modes): Narrow foreground group.
238 (reset_sys_modes): Widen foreground group.
239
220cb2bd
MA
2402012-10-31 Michael Albinus <michael.albinus@gmx.de>
241
242 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
243
218e997a
MR
2442012-10-31 Martin Rudalics <rudalics@gmx.at>
245
246 * minibuf.c (read_minibuf): Restore current buffer since
247 choose_minibuf_frame calling Fset_frame_selected_window may
248 change it (Bug#12766).
249
02615da0
JD
2502012-10-30 Jan Djärv <jan.h.d@swipnet.se>
251
252 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
253
aee5b18e
KH
2542012-10-30 Kenichi Handa <handa@gnu.org>
255
256 * font.c (Ffont_at): If WINDOW is specified and it is not
257 displaying the current buffer, signal an error.
258
ba116008
DC
2592012-10-29 Daniel Colascione <dancol@dancol.org>
260
5c2a7148
SM
261 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
262 In preparation for fixing bug#12739, move these functions from
ba116008
DC
263 here...
264
265 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
266 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
267 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 268
640bf8ad
EZ
2692012-10-28 Eli Zaretskii <eliz@gnu.org>
270
271 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
272 (timer_loop, getitimer, setitimer): Use it instead of
273 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
274 'clock'.
275 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
276 literal 10000.
277
64ccff5f
JD
2782012-10-28 Jan Djärv <jan.h.d@swipnet.se>
279
280 * nsterm.m (NO_APPDEFINED_DATA): New define.
281 (last_appdefined_event_data): New variable
282 (last_appdefined_event): Remove.
283 (ns_select): Initialize t from last_appdefined_event_data instead
284 of [last_appdefined_event data1].
285 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
286 remove last_appdefined_event (Bug#12698).
287
e483264c
SM
2882012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
289
290 * frame.c (x_set_font): Catch internal error.
291
6c16c13e
EZ
2922012-10-27 Eli Zaretskii <eliz@gnu.org>
293
e483264c
SM
294 Avoid overflow in w32 implementation of interval timers.
295 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
296 actually executes.
297 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
298 'volatile ULONGLONG' types. All the other data which was
299 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
300 (GetThreadTimes_Proc): New typedef.
301 (w32_get_timer_time): New function, returns a suitable time value
302 for the timer.
303 (timer_loop): Enter critical section when accessing ULONGLONG
304 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
305 atomic. Call 'w32_get_timer_time' instead of 'clock'.
306 Remove unused variable.
6c16c13e
EZ
307 (init_timers): Initialize s_pfn_Get_Thread_Times.
308 (start_timer_thread): Don't assign itimer->caller_thread here.
309 (getitimer): Assign itimer->caller_thread here.
310 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 311 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 312
ccc83f50
EZ
3132012-10-26 Eli Zaretskii <eliz@gnu.org>
314
315 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
316 mouse movement events if the menu bar is active. This avoids
317 producing a busy "hour-glass" cursor by Windows if the mouse
318 pointer is positioned over a tooltip shown for some menu item.
319
69deda53
PE
3202012-10-25 Paul Eggert <eggert@cs.ucla.edu>
321
322 Don't assume process IDs fit in int.
323 * emacs.c (shut_down_emacs) [!DOS_NT]:
324 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
325 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
326 Use pid_t, not int, to store process IDs, as 'int'
327 is not wide enough on a few platforms (e.g., AIX and IRIX).
328
7e70a152
KH
3292012-10-23 Kenichi Handa <handa@gnu.org>
330
331 The following change is to make face-font-rescale-alist work
332 correctly for non-ASCII fonts.
333
334 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
335 (font_open_for_lface): Handle Vface_font_rescale_alist.
336
49238e7f
CY
3372012-10-23 Chong Yidong <cyd@gnu.org>
338
339 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
340
5ec86886
JD
3412012-10-21 Jan Djärv <jan.h.d@swipnet.se>
342
ef446959
JD
343 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
344 for screen font.
345 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
346
5ec86886
JD
347 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
348 event (Bug#12681).
349
ee7a418d
GM
3502012-10-21 Glenn Morris <rgm@gnu.org>
351
352 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
353
4973679b
PE
3542012-10-20 Paul Eggert <eggert@cs.ucla.edu>
355
356 Port to OpenBSD 5.1.
357 * frame.c (Fmouse_position, Fmouse_pixel_position):
358 * xdisp.c (produce_stretch_glyph):
359 Declare local vars only when they're needed.
360 This is clearer and avoids a warning on OpenBSD about unused vars.
361 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
362 This is safer, and avoids OpenBSD warnings about unused vars.
363 * keyboard.c (record_menu_key): Remove unnecessary decl.
364 (poll_timer): Define only if POLL_FOR_INPUT is defined.
365 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
366 as our definition clashes with OpenBSD's.
367 * xfaces.c (load_face_colors, check_lface_attrs)
368 (get_lface_attributes_no_remap, get_lface_attributes)
369 (lface_fully_specified_p, x_supports_face_attributes_p)
370 (tty_supports_face_attributes_p, face_fontset, realize_face)
371 (realize_x_face, realize_tty_face):
372 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
373 merely Lisp_Object *. This is more informative and avoids
374 a warning on OpenBSD about accessing beyond an object's size.
375
c664f463
CY
3762012-10-20 Chong Yidong <cyd@gnu.org>
377
378 * lread.c (Fload): Doc fix (Bug#12592).
379
6ec83f92 3802012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
381
382 * font.c (Ffont_at): Fix previous change.
383
d2824928
EZ
3842012-10-19 Eli Zaretskii <eliz@gnu.org>
385
e483264c
SM
386 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
387 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
388 for the reasons.
389
d2824928
EZ
390 * alloc.c (NSTATICS): Decrease to 0x800.
391
f60d391f
SM
3922012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
393
394 * fns.c (Fnreverse): Include the problem element when signalling an
395 error (bug#12677).
396
1a9327d5
JD
3972012-10-18 Jan Djärv <jan.h.d@swipnet.se>
398
399 * nsterm.m (ns_select): Check writefds before call to
400 FD_ISSET (Bug#12668).
401
14145a1e
DC
4022012-10-18 Daniel Colascione <dancol@dancol.org>
403
404 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
405 (staticpro): If we run out of staticpro slots, die with an
406 informative error instead of just calling emacs_abort.
407
1f76f6f5
MR
4082012-10-18 Martin Rudalics <rudalics@gmx.at>
409
410 Fix two flaws reported by Dmitry Antipov.
411 * window.c (Ftemp_output_buffer_show): Remove.
412 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
413 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
414
fcf14875
EZ
4152012-10-17 Eli Zaretskii <eliz@gnu.org>
416
1f76f6f5
MR
417 * makefile.w32-in ($(BLD)/w32.$(O)):
418 ($(BLD)/vm-limit.$(O)):
419 ($(BLD)/term.$(O)):
420 ($(BLD)/unexw32.$(O)):
421 ($(BLD)/fileio.$(O)):
a68089e4
EZ
422 ($(BLD)/dispnew.$(O)): Update dependencies.
423
424 * w32term.h (w32_initialize_display_info, initialize_w32_display):
425 Add prototypes.
426
427 * w32proc.c: Include ctype.h.
428
429 * w32.h (init_environment, check_windows_init_file)
430 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
431 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
432 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
433 (sys_link): Add prototypes.
434
435 * w32.c: Include w32select.h.
436 (sys_access, e_malloc, sys_select): Add prototypes.
437 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
438
439 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
440
441 * unexw32.c: Include lisp.h and w32.h.
442
443 * term.c [WINDOWSNT]: Include w32term.h.
444
445 * process.c [WINDOWSNT]: Add prototype of sys_select.
446
447 * fileio.c [WINDOWSNT]: Include w32.h.
448
449 * dispnew.c [WINDOWSNT]: Include w32.h.
450
fcf14875
EZ
451 * cygw32.c (Fcygwin_convert_path_to_windows)
452 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
453 Lisp_Object values. (Bug#12661)
454
455 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
456 to Lisp_Object. (Bug#12661)
457
fe0b1ec4
KH
4582012-10-17 Kenichi Handa <handa@gnu.org>
459
460 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
461 invalidate.
462
d556ebf9
DA
4632012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
464
465 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 466 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 467
f0863a54
DA
4682012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
469
470 Do not verify indirection counters of killed buffers (Bug#12579).
471 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
472 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
473
12fbe755
DA
4742012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
475
476 * alloc.c (Fmake_byte_code): Fix typo in comment.
477 * print.c (print_interval): Define as static to match prototype.
478 * indent.c (disptab_matches_widthtab, recompute_width_table):
479 Convert to eassert.
480
61655b89
DA
4812012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
482
483 * editfns.c (get_system_name): Remove.
484 * lisp.h (get_system_name): Remove prototype.
485 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
486 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
487
9520f2f2
DC
4882012-10-15 Daniel Colascione <dancol@dancol.org>
489
490 * dbusbind.c: Add comment explaining reason for previous change.
491
dca778d5
MR
4922012-10-15 Martin Rudalics <rudalics@gmx.at>
493
494 * window.c (Fwindow_end): Rewrite check whether cached position
495 can be used (Bug#12600).
496 (resize_frame_windows, grow_mini_window, shrink_mini_window):
497 Set windows_or_buffers_changed.
498
3e0341b0
DC
4992012-10-15 Daniel Colascione <dancol@dancol.org>
500
501 * dbusbind.c: Fix cygw32 build break when compiling with dbus
502 enabled by undefining the symbol "interface", which the platform
503 headers define to something incompatible.
504
33d4113c
DC
5052012-10-14 Daniel Colascione <dancol@dancol.org>
506
507 * image.c (init_tiff_functions, init_imagemagick_functions)
508 (init_svg_functions): Fix cygw32 build break by using these
509 functions only when WINDOWSNT _and_ HAVE_NTGUI.
510
a36fb15e
JD
5112012-10-14 Jan Djärv <jan.h.d@swipnet.se>
512
513 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
514
537f336d
JD
5152012-10-13 Jan Djärv <jan.h.d@swipnet.se>
516
517 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
518
0ba06a77
KH
5192012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
520
521 * coding.c (detect_coding): Set coding->id before calling
522 this->detector.
523
ce2fe65a
AS
5242012-10-13 Andreas Schwab <schwab@linux-m68k.org>
525
526 * fileio.c: Formatting fixes.
527
d6453ce4
PE
5282012-10-13 Paul Eggert <eggert@cs.ucla.edu>
529
530 Fix some stat-related races.
531 * fileio.c (Fwrite_region): Avoid race condition if a file is
532 removed or renamed by some other process immediately after Emacs
533 writes it but before Emacs stats it. Do not assume that stat (or
534 fstat) succeeds.
535 * image.c (slurp_file): Resolve the file name with fopen + fstat
536 rather than stat + fopen.
537 (pbm_read_file) [0]: Remove unused code with stat race.
538 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
539 Remove ineffective code with stat race.
540
06485aa8
SM
5412012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
542
543 * doc.c (get_doc_string): Don't signal an error if the file is missing.
544
167e3640
JD
5452012-10-12 Jan Djärv <jan.h.d@swipnet.se>
546
547 * nsterm.m (hold_event_q): New static variable.
548 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
549 ! q_event_ptr.
550 (hold_event): New function.
551 (ns_read_socket): If hold_event_q have events, store them and
552 return (Bug#12384).
553 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
554 is zero (Bug#12384).
555
c40239df
JB
5562012-10-12 Juanma Barranquero <lekktu@gmail.com>
557
558 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
559
bb385a92
EZ
5602012-10-12 Eli Zaretskii <eliz@gnu.org>
561
2a9f1099
EZ
562 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
563
bb385a92
EZ
564 * fileio.c (check_existing): New function.
565 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
566 instead of calling 'stat', when what's needed is to check whether
567 a file exists. This avoids expensive system calls on MS-Windows.
568 (Bug#12587)
569
8599b23a 570 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
571
572 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
573 determine whether a file exists and is not a directory.
574
575 * lisp.h (check_existing): Add prototype.
576
2b9c2e68
JD
5772012-10-12 Jan Djärv <jan.h.d@swipnet.se>
578
579 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
580
81749a23
GM
5812012-10-12 Glenn Morris <rgm@gnu.org>
582
583 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
584
5253a5fd
SM
5852012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
586
389a94a5
SM
587 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
588
5253a5fd
SM
589 * eval.c (Fautoload): Remember previous autoload status in load-history.
590
7cded46f
PE
5912012-10-11 Paul Eggert <eggert@cs.ucla.edu>
592
593 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
594 * lread.c (load_each_byte, new_backquote_flag, readchar)
595 (read_filtered_event, lisp_file_lexically_bound_p)
596 (safe_to_load_version, Fload, complete_filename_p, openp)
597 (build_load_history, readevalloop, read_escape, read1)
598 (string_to_number, read_vector, read_list):
599 * macros.c (Fstart_kbd_macro):
600 * marker.c (CONSIDER):
601 * menu.c (parse_single_submenu, digest_single_submenu)
602 (find_and_return_menu_selection, Fx_popup_menu):
603 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
604 (Ftry_completion):
605 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
606 (ns_menu_show):
607 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
608 (xmenu_show, xdialog_show):
609 Use bool for booleans.
610 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
611 as it's not a predicate. All uses changed. Omit unnecessary
612 buffer termination.
613
549c3414
DA
6142012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
615
616 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
617 (save_excursion_restore): Do not restore mark if it was not saved.
618
e85aafe7
PE
6192012-10-11 Paul Eggert <eggert@cs.ucla.edu>
620
fd2f90cf
PE
621 * marker.c (cached_modiff): EMACS_INT, not int.
622
c1af190b
PE
623 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
624 instead of having a wrong decl.
e85aafe7
PE
625 * nsmenu.m (waiting_for_input): Remove wrong decl.
626
e738ca56
PE
6272012-10-10 Paul Eggert <eggert@cs.ucla.edu>
628
9fa1de30
PE
629 keyboard.c, keymap.c: Use bool for booleans.
630 * dispnew.c (sit_for): Distinguish between 3-way display_option
631 and boolean do_display.
632 * keyboard.c (single_kboard, this_command_key_count_reset)
633 (waiting_for_input, echoing, immediate_quit, input_pending)
634 (interrupt_input, interrupts_deferred, pop_kboard)
635 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
636 (command_loop_1, adjust_point_for_property)
637 (safe_run_hooks_error, input_polling_used, read_char):
638 (help_char_p, readable_events, kbd_buffer_events_waiting)
639 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
640 (lucid_event_type_list_p, get_input_pending):
641 (gobble_input, menu_separator_name_p, menu_bar_item)
642 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
643 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
644 (keyremap_step, test_undefined, read_key_sequence)
645 (detect_input_pending, detect_input_pending_ignore_squeezables)
646 (detect_input_pending_run_timers, requeued_events_pending_p)
647 (quit_throw_to_read_char, Fset_input_interrupt_mode):
648 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
649 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
650 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
651 (accessible_keymaps_1, Fkey_description, push_key_description):
652 (shadow_lookup, struct where_is_internal_data)
653 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
654 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
655 (describe_map, describe_vector):
656 * menu.c (single_menu_item):
657 * nsmenu.m (ns_update_menubar):
658 * process.c (wait_reading_process_output):
659 * search.c (scan_buffer, scan_newline):
660 Use bool for boolean.
661 * keyboard.c (timers_run, swallow_events)
662 (detect_input_pending_run_timers):
663 * process.c (wait_reading_process_output):
664 Use unsigned for counter where wraparound-on-overflow is desired,
665 since unsigned is guaranteed to have that behavior and signed is not.
666 (read_char): Use ptrdiff_t for string length.
667 (get_input_pending): Remove first argument, since it was always
668 the same pointer-to-int (now pointer-to-boolean) &input_pending,
669 and behave as if it had that value. Return new value of
670 input_pending. All callers changed.
671 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
672 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
673 a string length.
674 * keymap.c (push_key_description): Omit last arg, which was always 1.
675 All callers changed.
676
e738ca56
PE
677 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
678
29f21cdf
JB
6792012-10-10 Juanma Barranquero <lekktu@gmail.com>
680
681 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
682 ($(BLD)/term.$(O)): Update dependencies.
683
6aea7528
DA
6842012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
685
686 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
687 * lisp.h (enum pvec_type): Adjust comments and omit explicit
688 initializer for PVEC_NORMAL_VECTOR.
689
5f3f57be
PE
6902012-10-10 Paul Eggert <eggert@cs.ucla.edu>
691
692 Clean out old termopts cruft.
693 * termopts.h (flow_control, meta_key): Remove unused decls.
694 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
695 Don't include termopts.h.
696
3e98c68e
DA
6972012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
698
699 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
700
77e344e5
PE
7012012-10-10 Paul Eggert <eggert@cs.ucla.edu>
702
703 * commands.h (immediate_quit): Remove duplicate decl.
704
5683d7cd
JD
7052012-10-09 Jan Djärv <jan.h.d@swipnet.se>
706
707 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
708 caching.
709 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 710 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 711
cf5fc6db
EZ
7122012-10-09 Eli Zaretskii <eliz@gnu.org>
713
b15736e6
EZ
714 * w32fns.c (w32_last_error): Change the return value to DWORD, to
715 match what GetLastError returns. Explain why the function is
716 needed.
717
cf5fc6db
EZ
718 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
719 'is_tooltip_frame', to avoid confusion with its global namesake.
720
f99714ce
DC
7212012-10-08 Daniel Colascione <dancol@dancol.org>
722
723 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
724 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
725 build that caused Emacs to display the hourglass cursor forever.
f99714ce 726
fd59cb29
GM
727 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
728 which is broken under remote desktop, calculate the number of
729 colors available for a display based on the display's number of
730 planes and number of bits per pixel per plane. (bug#10397).
731
62c480c9 7322012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 733
62c480c9
JD
734 * nsfont.m (Vfonts_in_cache): New variable.
735 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
736 are used. Add cached fonts to Vfonts_in_cache.
737 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
738
607446ba
JB
7392012-10-08 Juanma Barranquero <lekktu@gmail.com>
740
fd5125ad
JB
741 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
742 in nt/config.nt.
46979e0b
JB
743 (FONT_H): Define after FRAME_H.
744 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
745 Update dependencies.
fd5125ad 746
607446ba
JB
747 * w32term.c: Remove leftover declaration of keyboard_codepage.
748
b6f4e300
EZ
7492012-10-08 Eli Zaretskii <eliz@gnu.org>
750
c54ebba4
EZ
751 * makefile.w32-in (FONT_H): Add $(FRAME_H).
752 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
753 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
754 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
755 ($(BLD)/unexw32.$(O)):
756 ($(BLD)/w32.$(O)):
757 ($(BLD)/w32console.$(O)):
758 ($(BLD)/w32fns.$(O)):
759 ($(BLD)/w32heap.$(O)):
760 ($(BLD)/w32menu.$(O)):
15c720a3 761 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 762
b6f4e300
EZ
763 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
764 'const char *'.
765 (x_to_w32_color): Don't modify the argument, modify a copy instead.
766
501199a3
DC
7672012-10-08 Daniel Colascione <dancol@dancol.org>
768
769 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
770 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
771 accidental message numbering hole. Change other messages to
772 match.
773
774 * w32select.h (HAVE_W32SELECT): Remove.
775
776 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 777 w32common.h instead of w32heap.h.
501199a3
DC
778
779 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
780 (get_allocation_unit, get_processor_type, get_w32_major_version)
781 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
782 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
783 (OS_NT, os_subtype, cache_system_info): Move declarations to
784 w32common.
785
786 * w32heap.c: Include w32common.h.
787 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
788 (w32_minor_version, w32_build_number, w32_subtype):
789 Remove duplicate definitions.
501199a3
DC
790
791 * w32fns.c: Include w32common.h; include w32heap.h only in
792 WINDOWSNT.
793
794 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
795 Use `report_file_error' instead of `error' in order to better
796 inform users of what went wrong. Increase NTGUI_UNICODE file
797 dialog box file name length to 32k, the maximum allowed by the NT
798 kernel.
799
800 * w32common.h: New file.
801 (ROUND_UP, ROUND_DOWN, get_page_size)
802 (get_allocation_unit, get_processor_type, get_w32_major_version)
803 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
804 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
805 (OS_NT, os_subtype, cache_system_info): Move here.
806
807 * unexw32.c, unexcw.c: Include w32common.h.
808
809 * emacs.c (main): Use (defined (WINDOWSNT) || defined
810 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
811 to call syms_of_w32select.
812
813 * cygw32.h: Remove obsolete EXFUN declarations.
814
815 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
816
817 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
818 of w32inevt.o from SOME_MACHINE_OBJECTS.
819
93aa5c81
DC
8202012-10-08 Daniel Colascione <dancol@dancol.org>
821
822 * image.c: Permanent fix for JPEG compilation issue --- limit
823 jpeglib `boolean' redefinition to Cygwin builds.
824
d424f3d8
EZ
8252012-10-08 Eli Zaretskii <eliz@gnu.org>
826
8ee4c6ce
EZ
827 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
828
d424f3d8
EZ
829 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
830 Cygwin.
831
e08348a0
DC
8322012-10-08 Daniel Colascione <dancol@dancol.org>
833
834 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
835 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
836 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
837 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
838 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
839 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
840 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
841 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
842 now a supported configuration.
843
844 * Makefile.in: consolidate image variables into LIBIMAGE; add
845 W32_OBJ and W32_LIBS. Compile new files.
846
847 * conf_post.h:
848 (_DebPrint) declare tracing facility for W32 debugging. We need
849 to unify tracing later.
850
851 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
852 unconditional use of W32 Unicode functions. Cygwin runs only on
853 100% Unicode operating systems.
854
855 * cygw32.c: New file. Define Cygwin-specific facilities.
856 (Fcygwin_convert_path_to_windows)
857 (Fcygwin_convert_path_from_windows): New user functions for
858 accessing Cygwin path-munging routines.
859
860 * cygw32.h: New file.
861 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
862 UTF-16LE strings temporarily inside non-Lisp-visible string
863 objects.
864
865 (w32_strerror): Just what it says on the tin.
866
867 * emacs.c: Make the NS fork-then-exec code for daemon-launching
868 also run for Cygwin; both systems have the same problem with using
869 GUI facilities in a forked child. Also call syms_of_cygw32,
870 syms_of_w32select in correct places.
871
872 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
873 needs fork-then-exec for daemon launching.
874
875 * font.h: Include frame.h.
876
877 * image.c: Use the image library cache machinery only when we're
878 compiling for native WINDOWSNT; Cygwin can use shared libraries
879 like any other Unixlike system.
880
881 * keyboard.c: Clarify a comment regarding the input loop.
882
883 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
884 functions directly instead of trying to detect at runtime that our
885 host operating system supports them. We make this change for two
886 reasons: Cygwin lacks support for the multibyte character
887 conversion functions used by the legacy menu code, and Cygwin
888 never needs to rely on non-Unicode APIs.
889
890 * unexw32.c (hinst): Declare extern.
891
892 * w32.c: Change header order;
893 (w32_strerror): Move to w32fns.c because we need it for
894 non-WINDOWSNT builds.
895
896 * w32.h: Add #error macro to make sure we don't include w32.h for
897 Cygwin builds. Remove w32select declarations.
898
899 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 900 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
901
902 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
903 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
904 POSIXy alternative.
905 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
906 (w32_major_version, w32_minor_version, w32_build_number)
907 (os_subtype, sound_type): Define here
908 (w32_defined_color): Make color parameter const for consistency
909 with other _defined_color functions.
910 (w32_createwindow): Unconditionally call w32_init_class instead of
911 doing so only when hprevinst is non-NULL. Plumbing hprevinst
912 through the code is complex and unnecessary because class
913 registration is practically free.
914 (w32_name_of_message): New EMACSDEBUG-only function.
915 (Fset_message_beep): Move here
916 (Fx_open_connection): Require that the display name for Windows be
917 "w32" for consistency, emacsclient disambiguation, and maybe, one
918 day, multi-window-system support.
919 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
920 Cygwin files for W32 GUI facilities, since these clearly don't
921 expect Cygwin names.
922 (_DebPrint): Define.
923 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
924 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
925 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
926 (w32_last_error): Remove.
927
928 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
929
930 * w32heap.c (syspage_mask): Declare here.
931 (cache_system_info): Remove.
932
933 * w32inevt.c (faked_key): Define globally, not statically.
934 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
935 (w32_console_toggle_lock_key): Move to w32fns.c.
936
937 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
938
939 * w32proc.c (_DebPrint): Move to w32fns.c.
940 * w32select.c: Include string.h, stdio.h for Cygwin.
941 * w32select.h: New File.
942
943 * w32term.c: Include io.h for non-CYGWIN builds; needed for
944 get_osfhandle.
945 (w32_message_fd): New variable. Under Cygwin, holds the file
946 descriptor the system used to tell us about pending thread
947 messages.
948
949 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
950 that prevented compilation under non-WINDOWSNT systems.
951
952 (w32_initialize): Open /dev/windows and assign it to
953 w32_message_fd. Provide w32 feature.
954
955 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
956 (WM_EMACS_INPUT_READY): add.
957 (prepend_msg, w32_message_fd): Declare globally.
958
959 * w32xfns.c:
960 (keyboard_handle): Use only when WINDOWSNT.
961 (notify_msg_ready): New function. Posts a message to the main
962 thread's message queue under CYGWIN, which wakes up the main
963 thread from select(2) by making the /dev/windows file descriptor
964 ready. Under WINDOWSNT, it sets an event the same way the old
965 code did.
966
967 (post, prepend_msg): Actually call notify_msg_ready instead of
968 setting the input event directly.
969
98daa893
EZ
9702012-10-07 Eli Zaretskii <eliz@gnu.org>
971
972 * ralloc.c (relinquish): If a heap is ready to be relinquished,
973 but it still has blocs in it, don't return it to the system,
974 instead of aborting. (Bug#12402)
975
3bc0a2f7
JD
9762012-10-07 Jan Djärv <jan.h.d@swipnet.se>
977
8ad5b73b 978 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 979
335f5ae4
JD
980 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
981 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
982 (syms_of_nsterm): Remove comment about Panther and above for
983 ns-antialias-text.
335f5ae4
JD
984 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
985 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
986 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
987
988 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
989 MAC_OS_X_VERSION_10_4.
990
8ad5b73b
JD
991 * nsmenu.m (fillWithWidgetValue:): Remove code for <
992 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
993
994 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
995
996 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
997 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
998
3bc0a2f7
JD
999 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1000 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
1001 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1002 Remove ns_in_resize check.
3bc0a2f7
JD
1003 (ns_clear_frame_area): Remove resize handle code.
1004
1005 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
1006 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1007 Remove ns_in_resize check.
3bc0a2f7 1008
c622b48f
PE
10092012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1010
1011 Improve sys_siglist detection.
1012 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1013 defined as a macro, as is done in Solaris.
1014 (sys_siglist_entries): New macro.
1015 (save_strsignal): Use it.
1016 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1017 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1018
04fafa46
JD
10192012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1020
1021 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1022 fullscreen/Fullscreen.
1023
1024 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1025 tobar_height is new.
1026
1027 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1028 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1029 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1030 (windowDidResize:): Check for correct window if old style fullscreen.
1031 Capitalize word in comment. Remove incorrect comment.
1032 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1033 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1034 error in drawing background.
1f9f395d 1035 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
1036 Set toolbar values to zero, save old height in tobar_height.
1037 Restore tool bar height when leaving fullscreen.
1038 (canBecomeMainWindow): New function.
1039
c6e21c03
PE
10402012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1041
1042 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1043
0d9f584b
EZ
10442012-10-05 Eli Zaretskii <eliz@gnu.org>
1045
a65fbb5f
EZ
1046 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1047
0d9f584b 1048 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
1049 that time stamps of directories could also be changed.
1050 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
1051 FILE_WRITE_ATTRIBUTES access rights.
1052
1053 * fileio.c (Fset_file_times): Special-case ignoring errors for
1054 directories only on MSDOS, not on MS-Windows.
1055
e8757f09 10562012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
1057
1058 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1059
7604f298
EZ
10602012-10-04 Eli Zaretskii <eliz@gnu.org>
1061
1062 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1063 see whether CreateFile failed.
1064
88d69b7d
PE
10652012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1066
1067 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1068 to avoid similar races.
1069 * keyboard.c (pending_signals): Now bool, not int.
1070
7509f454
PE
1071 Port timers to OpenBSD, plus check for timer failures.
1072 OpenBSD problem reported by Han Boetes.
1073 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1074 and/or setitimer.
1075 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1076 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1077 like OpenBSD, which has timer_settime but does not declare it.
1078 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1079 whether to use itimerspec-related primitives. All uses of
1080 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1081
a3c5c0c5
PE
10822012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1083
1084 * profiler.c (handle_profiler_signal): Fix a malloc race
1085 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1086
914e743b
JD
10872012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1088
1089 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1090
d8ab37a8
EZ
10912012-10-02 Eli Zaretskii <eliz@gnu.org>
1092
1093 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1094 consistent with the change in return value of 'safe_strsignal'.
1095
b3ecad33
PE
10962012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1097
0a99eee1
PE
1098 Prefer plain 'static' to 'static inline' (Bug#12541).
1099 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1100 (bidi_set_sor_type, bidi_push_embedding_level)
1101 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1102 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1103 (bidi_cache_search, bidi_cache_ensure_space)
1104 (bidi_cache_iterator_state, bidi_cache_find)
1105 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1106 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1107 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1108 Now 'static', not 'static inline'.
1109
b3ecad33
PE
1110 Count overruns when profiling; change units to ns.
1111 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1112 Give extra weight to samples after overruns, to attempt to count
1113 the time more accurately.
1114 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1115 the underlying primitives nominally do ns.
1116 (Fprofiler_cpu_start): Document the change. Mention that
1117 the sampling intervals are only approximate.
1118
090cf9db
SM
11192012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1120
1121 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1122
1123 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1124 case for the special 0 coding-system.
1125
1126 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1127 (Fmake_overlay): Remove redundant tests.
64edc777 1128 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 1129
81550bf4
JB
11302012-10-02 Juanma Barranquero <lekktu@gmail.com>
1131
1132 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1133 Update dependencies.
1134
aa1ba90e
PE
11352012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1136
1137 Fix a malloc race condition involving strsignal.
1138 A signal can arrive in the middle of a malloc, and Emacs's signal
1139 handler can invoke strsignal, which can invoke malloc, which is
1140 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1141 Fix it by altering the signal handler so that it does not invoke
1142 strsignal.
1143 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1144 * process.c (status_message): Use const pointer, in case strsignal
1145 is #defined to safe_strsignal.
1146 * sysdep.c (sys_siglist, init_signals): Always define and
1147 initialize a substitute sys_siglist if the system does not define
1148 one, even if HAVE_STRSIGNAL.
1149 (safe_strsignal): Rename from strsignal. Always define,
1150 using sys_siglist. Return a const pointer.
1151 * syssignal.h (safe_strsignal): New decl.
1152 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1153
ace917bd
EZ
11542012-10-01 Eli Zaretskii <eliz@gnu.org>
1155
1156 * w32proc.c (timer_loop): Fix code that waits for timer
1157 expiration, to avoid high CPU usage.
1158
9eb71b9c
SM
11592012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1160
1161 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1162 (sweep_weak_table): Remove redundant prototypes.
1163
b3317662
FP
11642012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1165
1166 * emacs.c: Move the inclusion of TERM_HEADER after including
1167 windows.h on WINDOWSNT. This avoids compilation problems with
1168 MSVC.
1169
f0e5f225
EZ
11702012-10-01 Eli Zaretskii <eliz@gnu.org>
1171
2d7d1608
EZ
1172 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1173 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1174 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1175 as the previous version used 'void *'.
1176
1177 * ralloc.c (ROUNDUP): Fix last change.
1178 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1179 'size_t'.
1180
f0e5f225
EZ
1181 * w32proc.c <disable_itimers>: New static flag.
1182 (init_timers): Initialize it to zero, after creating the critical
1183 sections used by the timer threads.
1184 (term_timers): Set to 1 before deleting the critical sections.
1185 (getitimer, setitimer): If disable_itimers is non-zero, return an
1186 error indication without doing anything. Reported by Fabrice
1187 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
1188 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1189 return results.
1190 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1191 support timers.
f0e5f225
EZ
1192
1193 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1194 term_ntproc after all the other bookkeeping, to get timers working
1195 as long as possible.
1196
82ef37c1
PE
11972012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1198
b3a4c387
PE
1199 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1200 Suggested by Juri Linkov in
1201 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1202
b0ab8123
PE
1203 Prefer plain 'static' to 'static inline' (Bug#12541).
1204 With static functions, modern compilers inline pretty well by
1205 themselves; advice from programmers often hurts as much as it helps.
1206 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1207 this change shrinks the text size of the Emacs executable by 1.1%
1208 without affecting CPU significantly in my benchmark.
1209 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1210 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1211 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1212 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1213 (bset_auto_fill_function, bset_auto_save_file_format)
1214 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1215 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1216 (bset_cache_long_line_scans, bset_case_fold_search)
1217 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1218 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1219 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1220 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1221 (bset_header_line_format, bset_indicate_buffer_boundaries)
1222 (bset_indicate_empty_lines, bset_invisibility_spec)
1223 (bset_left_fringe_width, bset_major_mode, bset_mark)
1224 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1225 (bset_name, bset_overwrite_mode, bset_pt_marker)
1226 (bset_right_fringe_width, bset_save_length)
1227 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1228 (bset_scroll_up_aggressively, bset_selective_display)
1229 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1230 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1231 (set_buffer_overlays_after):
1232 * category.c (bset_category_table):
1233 * charset.c (read_hex):
1234 * coding.c (produce_composition, produce_charset)
1235 (handle_composition_annotation, handle_charset_annotation)
1236 (char_encodable_p):
1237 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1238 (assign_row, set_frame_matrix_frame, make_current)
1239 (add_row_entry):
1240 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1241 * fns.c (maybe_resize_hash_table):
1242 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1243 * gmalloc.c (register_heapinfo):
1244 * image.c (lookup_image_type):
1245 * intervals.c (set_interval_object, set_interval_left)
1246 (set_interval_right, copy_interval_parent, rotate_right)
1247 (rotate_left, balance_possible_root_interval):
1248 * keyboard.c (kset_echo_string, kset_kbd_queue)
1249 (kset_keyboard_translate_table, kset_last_prefix_arg)
1250 (kset_last_repeatable_command, kset_local_function_key_map)
1251 (kset_overriding_terminal_local_map, kset_real_last_command)
1252 (kset_system_key_syms, clear_event, set_prop):
1253 * lread.c (digit_to_number):
1254 * marker.c (attach_marker, live_buffer, set_marker_internal):
1255 * nsterm.m (ns_compute_glyph_string_overhangs):
1256 * process.c (pset_buffer, pset_command)
1257 (pset_decode_coding_system, pset_decoding_buf)
1258 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1259 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1260 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1261 * syntax.c (bset_syntax_table, dec_bytepos):
1262 * terminal.c (tset_param_alist):
1263 * textprop.c (interval_has_some_properties)
1264 (interval_has_some_properties_list):
1265 * window.c (wset_combination_limit, wset_dedicated)
1266 (wset_display_table, wset_hchild, wset_left_fringe_width)
1267 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1268 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1269 (wset_right_fringe_width, wset_right_margin_cols)
1270 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1271 (wset_vertical_scroll_bar_type, wset_window_parameters):
1272 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1273 (wset_column_number_displayed, wset_region_showing)
1274 (window_box_edges, run_window_scroll_functions)
1275 (append_glyph_string_lists, prepend_glyph_string_lists)
1276 (append_glyph_string, set_glyph_string_background_width)
1277 (append_glyph, append_composite_glyph)
1278 (take_vertical_position_into_account):
1279 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1280 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1281 (lface_hash, lface_same_font_attributes_p, lookup_face):
1282 * xml.c (libxml2_loaded_p):
1283 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1284 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1285 Now 'static', not 'static inline'.
1286
05584c31
PE
1287 * bidi.c: Tune.
1288 (bidi_copy_it): Do the whole copy with a single memcpy.
1289 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1290
86ec63ba
PE
1291 Revert the FOLLOW-SYMLINKS change for file-attributes.
1292 Doing it right would require several changes to Tramp, and there's
1293 not enough time to get that tested before the freeze today.
1294 * dired.c (directory_files_internal, Ffile_attributes):
1295 Undo last change.
1296
82ef37c1
PE
1297 * frame.c (x_report_frame_params): Port better to wider ints.
1298 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1299 or that pointers can be printed in 15 decimal digits.
1300 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1301
62aba0d4
FP
13022012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1303
1304 Support x64 build on MS-Windows.
1305 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1306 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1307 compatibility with x64.
5e4daaf3 1308 (x_get_focus_frame): Add prototype.
62aba0d4
FP
1309
1310 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1311 defining an XRectangle structure.
1312
1313 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1314 arithmetics for compatibility with x64.
1315
1316 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1317 compatibility with x64.
1318
1319 * w32heap.h: Adjust prototypes and declarations.
1320
1321 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1322 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1323 DWORD, long, and unsigned long, for compatibility with x64.
1324 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1325 (sbrk): Argument is now of type ptrdiff_t.
1326
1327 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1328 less than 0x0500.
1329 (w32_msg_pump): Use WPARAM type for 'result'.
1330
1331 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1332 architecture.
1333 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1334 compatibility with x64.
1335
1336 * vm-limit.c (lim_data): Now size_t.
1337 (check_memory_limits): Adjust prototypes of real_morecore and
1338 __morecore to receive argument of type ptrdiff_t. Use size_t for
1339 five_percent and data_size.
1340
1341 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1342 variables, for compatibility with x64.
1343 (rva_to_section, offset_to_section, relocate_offset)
1344 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1345 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1346 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1347 for compatibility with x64.
1348
1349 * sysdep.c (STDERR_FILENO): Define if not already defined.
1350
1351 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1352 (__morecore): Argument type is now ptrdiff_t.
1353 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1354 (relinquish): Use ptrdiff_t type for 'excess'.
1355 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1356
1357 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1358 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1359 instead of a literal number.
1360
1361 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1362 (min): Define only if not already defined.
1363
1364 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1365 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1366 hosts.
1367
1368 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1369 'bitmaps' is a pointer.
1370
1371 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1372
1373 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1374
e7a2937b
PE
13752012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1376
1377 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1378 * dired.c (directory_files_internal, Ffile_attributes):
1379 New arg follow_symlinks. All uses changed.
1380
b43d62ae
SM
13812012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1382
1383 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1384
c06c382a
EZ
13852012-09-30 Eli Zaretskii <eliz@gnu.org>
1386
1387 Support atimers and CPU profiler via profile.c on MS-Windows.
1388 * w32proc.c (sig_mask, crit_sig): New static variables.
1389 (sys_signal): Support SIGALRM and SIGPROF.
1390 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 1391 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
1392 sigfillset, and sigprocmask are no longer no-ops.
1393 (sigismember): New function.
1394 (struct itimer_data): New definition.
1395 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1396 (crit_prof): New static variables.
1397 (MAX_SINGLE_SLEEP): New definition.
1398 (timer_loop, stop_timer_thread, term_timers, init_timers)
1399 (start_timer_thread, getitimer, setitimer): New functions.
1400 (alarm): No longer a no-op, calls setitimer.
1401
1402 * w32.c (term_ntproc): Call term_timers.
1403 (init_ntproc): Make sure all signals are unblocked at startup, to
1404 erase any traces of dumping. Call init_timers.
1405
1406 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1407 Windows-specific code to display the hourglass mouse pointer is no
1408 longer used.
1409 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1410 to hourglass timer expiration.
1411 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1412 Remove, no longer used.
b43d62ae
SM
1413 (w32_note_current_window, show_hourglass, hide_hourglass):
1414 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
1415 window systems.
1416 (syms_of_w32fns): Don't initialize hourglass_timer.
1417
1418 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1419 WINDOWSNT as well.
1420 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1421
1422 * w32.h (init_timers, term_timers): Add prototypes.
1423
95402d5f
KH
14242012-09-30 Kenichi Handa <handa@gnu.org>
1425
1426 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1427 to the buffer relocation which may be caused by ccl_driver.
1428
dd946752
JD
14292012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1430
d7e642cc
JD
1431 * xfns.c (Fx_file_dialog): Update comment.
1432
1433 * w32fns.c (Fx_file_dialog): Update comment.
1434
1435 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1436 Initialize panel name field if OSX >= 10.6.
1437
1438 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1439
dd946752
JD
1440 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1441
1442 * nsterm.m (NEW_STYLE_FS): New define.
1443 (ns_fullscreen_hook, windowWillEnterFullScreen)
1444 (windowDidEnterFullScreen, windowWillExitFullScreen)
1445 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1446 (setFSValue): New functions.
1447 (EmacsFSWindow): New implementation.
1448 (canBecomeKeyWindow): New function for EmacsFSWindow.
1449 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1450 (dealloc): Release nonfs_window if in fullscreen.
1451 (updateFrameSize:): Call windowDidMove to update top/left.
1452 (windowWillResize:toSize:): Check if frame is still maximized.
1453 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1454 next_maximized, maximized_width, maximized_height and nonfs_window.
1455 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1456 tbar_height.
1457 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 1458 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
1459
1460 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1461 (EmacsView): Add variables for fullscreen.
1462 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1463 (EmacsFSWindow): New interface for fullscreen.
1464
427730eb
JB
14652012-09-30 Juanma Barranquero <lekktu@gmail.com>
1466
1467 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1468
48de8b12
CY
14692012-09-30 Chong Yidong <cyd@gnu.org>
1470
1471 * fns.c (Frandom): Doc fix.
1472
5938d519
MR
14732012-09-30 Martin Rudalics <rudalics@gmx.at>
1474
1475 * window.c (Vwindow_combination_limit): New default value.
1476 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1477
cb5b0266
PE
14782012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1479
1480 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1481 Suggested by Eli Zaretskii in
1482 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1483
84f72efd
EZ
14842012-09-30 Eli Zaretskii <eliz@gnu.org>
1485
1486 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1487 HAVE_TIMER_SETTIME is defined.
1488
9d4dcdc9
PE
14892012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1490
d89460ed
PE
1491 Profiler improvements: more-accurate timers, overflow checks.
1492 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1493 signal.h, setjmp.h. Include systime.h instead.
1494 (saturated_add): New function.
1495 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1496 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1497 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1498 New static vars.
84f72efd 1499 (enum profiler_cpu_running): New enum.
d89460ed
PE
1500 (profiler_cpu_running): Now of that enum type, not bool.
1501 All uses changed to store the new value.
1502 (handle_profiler_signal): Rename from sigprof_handler_1,
1503 for consistency with other handlers. Do not check whether
1504 cpu_log is a hash-table if garbage collecting, since it
1505 doesn't matter in that case.
1506 (deliver_profiler_signal): Rename from sigprof_handler,
1507 for consistency with other handlers.
1508 (setup_cpu_timer): New function, with much of what used to be in
1509 Fprofiler_cpu_start. Check for out-of-range argument.
1510 Prefer timer_settime if available, and prefer
1511 thread cputime clocks, then process cputime clocks, then
1512 monotonic clocks, to the old realtime clock. Use make_timeval
1513 to round more-correctly when falling back to setitimer.
1514 (Fprofiler_cpu_start): Use it.
1515 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1516 Don't assume that passing NULL as the 2nd argument of setitimer
1517 is the same as passing a pointer to all-zero storage.
1518 Ignore SIGPROF afterwards.
1519 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1520 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1521 non-fatal signal handlers. Ignore SIGPROF on startup.
1522 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1523 in profiler.c, since sysdep.c now uses it.
1524
9d4dcdc9
PE
1525 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1526 Suggested by Eli Zaretskii in
1527 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1528
8e5691a0
JB
15292012-09-29 Juanma Barranquero <lekktu@gmail.com>
1530
1531 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1532
e7c1b6ef
SM
15332012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1534
1535 * lisp.h (struct backtrace): Remove indirection for `function' field.
1536 * xdisp.c (redisplay_internal):
1537 * profiler.c (record_backtrace, sigprof_handler_1):
1538 * alloc.c (Fgarbage_collect):
1539 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1540 (Fbacktrace_frame): Adjust accordingly.
1541
e61d39cd 15422012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
1543
1544 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1545 (Frun_hook_with_args_until_failure): Doc fixes.
1546
404043ea
EZ
15472012-09-28 Eli Zaretskii <eliz@gnu.org>
1548
1549 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1550 Qautomatic_redisplay and change the symbol name. All users changed.
1551
704d3f45
TM
15522012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1553
1554 * profiler.c (sigprof_handler): Fix race condition.
1555
757140ff
GM
15562012-09-28 Glenn Morris <rgm@gnu.org>
1557
1558 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1559
a615a3ae
PE
15602012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1561
1562 Check more robustly for timer_settime.
89d17fd0
PE
1563 * Makefile.in (LIB_TIMER_TIME): New macro.
1564 (LIBES): Add it.
a615a3ae
PE
1565 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1566 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1567 call timer_settime.
1568
3670daf7
TM
15692012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1570
1571 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1572
6a586b7f
JB
15732012-09-26 Juanma Barranquero <lekktu@gmail.com>
1574
1575 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1576
41c8bfcf
PE
15772012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1578
1579 * character.h (MAYBE_UNIFY_CHAR): Remove.
1580 * charset.c, charset.h (maybe_unify_char): Now static.
1581 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1582 Since this stuff is now private to charset.c, there's no need for
1583 a public macro and no need to inline by hand.
1584
3a880af4
SM
15852012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1586 Stefan Monnier <monnier@iro.umontreal.ca>
1587 Juanma Barranquero <lekktu@gmail.com>
611b7507 1588
3a880af4
SM
1589 * profiler.c: New file.
1590 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
1591 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1592 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
1593 * emacs.c (main): Call syms_of_profiler.
1594 * alloc.c (Qautomatic_gc): New constant.
1595 (MALLOC_PROBE): New macro.
1596 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1597 (total_bytes_of_live_objects): New function.
1598 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1599 Call malloc_probe for the memory profiler.
1600 (syms_of_alloc): Define Qautomatic_gc.
1601 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1602 race condition.
1603 (struct backtrace): Move definition...
1604 * lisp.h (struct backtrace): ..here.
1605 (Qautomatic_gc, profiler_memory_running): Declare vars.
1606 (malloc_probe, syms_of_profiler): Declare functions.
1607 * xdisp.c (Qautomatic_redisplay): New constant.
1608 (redisplay_internal): Record itself in backtrace_list.
1609 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 1610
5938d519 16112012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
16122012-09-25 Juanma Barranquero <lekktu@gmail.com>
1613
1614 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1615
e26fd2e4
PE
16162012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1617
1618 Prefer POSIX timers if available.
1619 They avoid a race if the timer is too close to the current time.
1620 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1621 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 1622 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 1623
eedec3ee
EZ
16242012-09-25 Eli Zaretskii <eliz@gnu.org>
1625
1626 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1627 CHAR_STRING_ADVANCE.
1628 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1629 STRING_CHAR_ADVANCE.
1630
aa15c6bb
JB
16312012-09-25 Juanma Barranquero <lekktu@gmail.com>
1632
1633 Move Vlibrary_cache to emacs.c and reset before dumping.
1634
1635 * lisp.h (reset_image_types): Declare.
1636 [WINDOWSNT] (Vlibrary_cache): Declare.
1637
1638 * image.c (reset_image_types): New function.
1639
1640 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1641 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1642 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1643
1644 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1645 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1646
1647 * w32.h (Vlibrary_cache): Do not declare.
1648
54d629be
EZ
16492012-09-25 Eli Zaretskii <eliz@gnu.org>
1650
16b22fef
EZ
1651 * w32proc.c (sys_signal): Handle all signals defined by the
1652 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1653 handlers for signals supported by Windows. Don't override
1654 term_ntproc as the handler for SIGABRT.
1655 (sigaction): Rewrite to call sys_signal instead of duplicating its
1656 code.
1657 (sys_kill): Improve commentary.
1658
1659 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1660 consistency with a signature of a signal handler. All callers
1661 changed.
1662 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1663 install term_ntproc as a signal handler for SIGABRT, as that
1664 should be done by the dumped Emacs.
1665
1666 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1667
1668 * w32select.c (term_w32select): Protect against repeated
1669 invocation by setting clipboard_owner to NULL after calling
1670 DestroyWindow.
1671
1672 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1673 and term_ntproc to their modified signatures.
1674
54d629be
EZ
1675 * character.c (char_string, string_char): Remove calls to
1676 MAYBE_UNIFY_CHAR. See the discussion starting at
1677 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1678 for the details.
1679
59f7af81
CY
16802012-09-25 Chong Yidong <cyd@gnu.org>
1681
1682 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1683
22e8cf4a
SM
16842012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1685
1686 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1687 when encountering an unknown bytecode.
1688
578098f3
PE
16892012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1690
1691 image.c, indent.c: Use bool for booleans.
1692 * dispextern.h (struct image_type): Members valid_p, load, init
1693 now return bool, not int. All uses changed.
1694 * image.c: Omit unnecessary static decls.
1695 (x_create_bitmap_mask, x_build_heuristic_mask):
1696 Return void, not int, since callers don't care about the return value.
1697 (x_create_bitmap_mask, define_image_type, valid_image_p)
1698 (struct image_keyword, parse_image_spec, image_spec_value)
1699 (check_image_size, image_background)
1700 (image_background_transparent, x_clear_image_1)
1701 (postprocess_image, lookup_image, x_check_image_size)
1702 (x_create_x_image_and_pixmap, xbm_image_p)
1703 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1704 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1705 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1706 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1707 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1708 (png_image_p, init_png_functions, png_load_body, png_load)
1709 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1710 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1711 (init_gif_functions, gif_load, imagemagick_image_p)
1712 (imagemagick_load_image, imagemagick_load, svg_image_p)
1713 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1714 (gs_load):
1715 * nsimage.m (ns_load_image):
1716 * nsterm.m (ns_defined_color):
1717 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1718 * xfns.c (x_defined_color):
1719 * xterm.c (x_alloc_lighter_color_for_widget)
1720 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1721 (x_alloc_lighter_color):
1722 * indent.c (disptab_matches_widthtab, current_column)
1723 (scan_for_column, string_display_width, indented_beyond_p)
1724 (compute_motion, vmotion, Fvertical_motion):
1725 Use bool for booleans.
1726
a5f2b6ec
CY
17272012-09-24 Chong Yidong <cyd@gnu.org>
1728
1729 * chartab.c (Fset_char_table_default): Obsolete function removed.
1730
18e27ea8
PE
17312012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1732
afea8a8a
PE
1733 Move pid_t related decls out of lisp.h.
1734 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1735 (interruptible_wait_for_termination):
1736 Move these decls from lisp.h to syswait.h, since they use pid_t.
1737 Needed on FreeBSD; see Herbert J. Skuhra in
1738 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1739 * callproc.c: Include syswait.h.
1740
18e27ea8
PE
1741 gnutls.c, gtkutil.c: Use bool for boolean.
1742 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1743 (emacs_gnutls_handle_error):
1744 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1745 (xg_hide_tooltip, xg_create_frame_widgets)
1746 (create_dialog, xg_uses_old_file_dialog)
1747 (xg_get_file_with_chooser, xg_get_file_with_selection)
1748 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1749 (xg_item_label_same_p, xg_update_menubar)
1750 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1751 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1752 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1753 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1754 (update_frame_tool_bar, free_frame_tool_bar):
1755 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1756 * nsmenu.m (ns_update_menubar):
1757 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1758 * xfns.c (Fx_show_tip) [USE_GTK]:
1759 Use bool for boolean.
1760 * gtkutil.c (xg_update_frame_menubar):
1761 * xmenu.c (update_frame_menubar):
1762 Return void, not int, since caller ignores return value.
1763 * gtkutil.c (xg_change_toolbar_position):
1764 Return void, not 1.
1765
af0e9f75
JB
17662012-09-23 Juanma Barranquero <lekktu@gmail.com>
1767
1768 * makefile.w32-in (BLOCKINPUT_H): Remove.
1769 (SYSSIGNAL_H): New macro.
1770 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1771 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1772 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1773 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1774 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1775 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1776 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1777 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1778 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1779 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1780 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1781 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1782 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1783 ($(BLD)/w32xfns.$(O)): Update dependencies.
1784
5101529e
EZ
17852012-09-23 Eli Zaretskii <eliz@gnu.org>
1786
1787 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1788 fatal_error_backtrace.
1789
1790 * w32proc.c (sys_kill): Undo last change: don't do anything when
1791 invoked to deliver SIGABRT to our own process. This is now
1792 handled by emacs_raise.
1793
2c3ee0ad
JB
17942012-09-23 Juanma Barranquero <lekktu@gmail.com>
1795
1796 * w32term.c (w32_read_socket): Remove leftover reference to
1797 interrupt_input_pending.
1798
62a1d661
PE
17992012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1800
1801 Do not use SA_NODEFER.
1802 Problem reported by Dani Moncayo in
1803 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1804 * alloc.c (die):
1805 * sysdep.c (emacs_abort): Do not reset signal handler.
1806 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1807 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1808 wanted even on POSIXish hosts, and it doesn't work on Windows.
1809
a0942b9a
JD
18102012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1811
1812 * xterm.c (x_term_init): Call fixup_locale before and after calling
1813 gtk_init (Bug#12392).
1814
d07ff9db
CY
18152012-09-23 Chong Yidong <cyd@gnu.org>
1816
1817 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1818 Vdynamic_library_alist.
1819
1820 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1821 (Fgnutls_available_p): Caller changed.
1822
1823 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1824 (Flibxml_parse_xml_region): Likewise.
1825
1826 * dispextern.h (struct image_type): Remove arg from init function.
1827
1828 * image.c (Finit_image_library, lookup_image_type)
1829 (define_image_type): Remove now-unneeded second arg.
1830 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1831 (init_tiff_functions, init_gif_functions, init_svg_functions):
1832 Arglist and w32_delayed_load calling convention changed.
1833 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 1834 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 1835
4d7e6e51
PE
18362012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1837
1838 Simplify and avoid signal-handling races (Bug#12471).
1839 * alloc.c (die):
1840 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1841 Avoid recursive loop if there's a fatal error in the function itself.
1842 * atimer.c (pending_atimers):
1843 * blockinput.h: Don't include "atimer.h"; no longer needed.
1844 (interrupt_input_pending): Remove. All uses removed.
1845 pending_signals now counts both atimers and ordinary interrupts.
1846 This is less racy than having three separate pending-signal flags.
1847 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1848 (input_blocked_p):
1849 Rename from their upper-case counterparts BLOCK_INPUT,
1850 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1851 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1852 This makes it easier to access volatile variables more accurately.
1853 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1854 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1855 that's more reliable if the code is buggy and sets
1856 interrupt_input_blocked to a negative value. All uses changed.
1857 * atimer.c (deliver_alarm_signal):
1858 Remove. No need to deliver this to the parent; any thread can
1859 handle this signal now. All uses replaced by underlying handler.
1860 * atimer.c (turn_on_atimers):
1861 * dispnew.c (handle_window_change_signal):
1862 * emacs.c (handle_danger_signal):
1863 * keyboard.c (kbd_buffer_get_event):
1864 Don't reestablish signal handler; not needed with sigaction.
1865 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1866 (UNBLOCK_INPUT_TO):
1867 Rework to avoid unnecessary accesses to volatile variables.
1868 (UNBLOCK_INPUT_TO): Now a function.
1869 (totally_unblock_input, unblock_input): New decls.
1870 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1871 (init_data): Remove. Necessary stuff now done in init_signal.
1872 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1873 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1874 (fatal_error_code): Remove; no longer needed.
1875 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1876 it doesn't always backtrace. All uses changed. No need to reset
1877 signal to default, since sigaction and/or die does that for us now.
1878 Use emacs_raise (FOO), not kill (getpid (), FOO).
1879 (main): Check more-accurately whether we're dumping.
1880 Move fatal-error setup to sysdep.c
1881 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1882 * gtkutil.c (xg_get_file_name, xg_get_font):
1883 Remove no-longer-needed signal-mask manipulation.
1884 * keyboard.c, process.c (POLL_FOR_INPUT):
1885 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1886 * keyboard.c (read_avail_input): Remove.
1887 All uses replaced by gobble_input.
1888 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1889 (kbd_buffer_store_event_hold, gobble_input):
1890 (record_asynch_buffer_change) [USABLE_SIGIO]:
1891 (store_user_signal_events):
1892 No need to mess with signal mask.
1893 (gobble_input): If blocking input and there are terminals, simply
1894 set pending_signals to 1 and return. All hooks changed to not
1895 worry about whether input is blocked.
1896 (process_pending_signals): Clear pending_signals before processing
1897 them, in case a signal comes in while we're processing.
1898 By convention callers now test pending_signals before calling us.
1899 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1900 New functions, to support changes to blockinput.h.
1901 (handle_input_available_signal): Now extern.
1902 (reinvoke_input_signal): Remove. All uses replaced by
1903 handle_async_input.
1904 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
1905 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1906 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
1907 Clear sigmask reliably, even if Fsignal returns, which it can.
1908 Omit unnecessary accesses to volatile var.
1909 (quit_throw_to_read_char): No need to restore sigmask.
1910 * keyboard.c (gobble_input, handle_user_signal):
1911 * process.c (wait_reading_process_output):
1912 Call signal-handling code rather than killing ourselves.
1913 * lisp.h: Include <float.h>, for...
1914 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1915 (pending_signals): Now volatile.
1916 (syms_of_data): Now const if IEEE floating point.
1917 (handle_input_available_signal) [USABLE_SIGIO]:
1918 (terminate_due_to_signal, record_child_status_change): New decls.
1919 * process.c (create_process): Avoid disaster if memory is exhausted
1920 while we're processing a vfork, by tightening the critical section
1921 around the vfork.
1922 (send_process_frame, process_sent_to, handle_pipe_signal)
1923 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1924 ignores SIGPIPE.
1925 (send_process): No need for setjmp/longjmp any more, since the
1926 SIGPIPE stuff is now gone. Instead, report an error if errno
1927 is EPIPE.
1928 (record_child_status_change): Now extern. PID and W are now args.
1929 Return void, not bool. All callers changed.
1930 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1931 Remove. All uses removed. This bug should be fixed now in a
1932 different way.
1933 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1934 and record the child status change directly. This avoids the
1935 need to futz with the signal mask.
1936 (process_fatal_action): Move here from emacs.c.
1937 (emacs_sigaction_flags): New function, containing
1938 much of what used to be in emacs_sigaction_init.
1939 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1940 caught by emacs, to make races less likely.
1941 (deliver_process_signal): Rename from handle_on_main_thread.
1942 All uses changed.
1943 (BACKTRACE_LIMIT_MAX): Now at top level.
1944 (thread_backtrace_buffer, threadback_backtrace_pointers):
1945 New static vars.
1946 (deliver_thread_signal, deliver_fatal_thread_signal):
1947 New functions, for more-accurate delivery of thread-specific signals.
1948 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1949 (deliver_arith_signal): Handle in this thread, not
1950 in the main thread, since it's triggered by this thread.
1951 (maybe_fatal_sig): New function.
1952 (init_signals): New arg DUMPING so that we can be more accurate
1953 about whether we're dumping. Caller changed.
1954 Treat thread-specific signals differently from process-general signals.
1955 Block all signals while handling fatal error; that's safer.
1956 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1957 on IEEE hosts.
1958 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1959 Ignore SIGPIPE unless batch.
1960 (emacs_backtrace): Output backtrace for the appropriate thread,
1961 which is not necessarily the main thread.
1962 * syssignal.h: Include <stdbool.h>.
1963 (emacs_raise): New macro.
1964 * xterm.c (x_connection_signal): Remove; no longer needed
1965 now that we use sigaction.
1966 (x_connection_closed): No need to mess with sigmask now.
1967 (x_initialize): No need to reset SIGPIPE handler here, since
1968 init_signals does this for us now.
1969
8f4635e9
JD
19702012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1971
1972 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 1973 background rect may be larger (Bug#12245).
8f4635e9 1974
3296976d
CY
19752012-09-23 Chong Yidong <cyd@gnu.org>
1976
1977 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1978
d41e491e
PE
19792012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1980
1981 * .gdbinit: Just stop at fatal_error_backtrace.
1982 See Stefan Monnier's request in
1983 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1984 Remove no-longer-used query of system type.
1985
c88b867f
CY
19862012-09-22 Chong Yidong <cyd@gnu.org>
1987
1988 * search.c (Freplace_match): Doc fix (Bug#12325).
1989
1990 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1991
1992 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1993 (Fline_end_position): Doc fix.
1994
1995 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1996
bb4d86b4
CY
19972012-09-22 Chong Yidong <cyd@gnu.org>
1998
1999 * dispextern.h (struct image_type): Add new slot, storing a type
2000 initialization function.
2001
2002 * image.c (define_image_type): Call the image initializer function
2003 if it is defined. Arguments and return value changed.
2004 (valid_image_p, make_image): Callers changed.
2005 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
2006 (gif_type, imagemagick_type, svg_type, gs_type):
2007 Add initialization functions.
bb4d86b4
CY
2008 (Finit_image_library): Call lookup_image_type.
2009 (CHECK_LIB_AVAILABLE): Macro deleted.
2010 (lookup_image_type): Call define_image_type here, rather than via
2011 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2012 (syms_of_image): Move define_image_type calls for xbm_type and
2013 pbm_type to lookup_image_type.
2014
df9685f3
EZ
20152012-09-22 Eli Zaretskii <eliz@gnu.org>
2016
2017 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2018 'idle_timers' from here ...
2019 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2020 lists, to avoid infloops when the timer does something stupid,
2021 like reinvoke itself with the same or smaller time-out.
2022 (Bug#12447)
2023
8e17c9ba
MR
20242012-09-22 Martin Rudalics <rudalics@gmx.at>
2025
2026 * window.c (Fsplit_window_internal): Handle only Qt value of
2027 Vwindow_combination_limit separately.
2028 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
2029 (Vwindow_combination_limit): New default value.
2030 Rewrite doc-string.
8e17c9ba 2031
589bd69b
EZ
20322012-09-22 Eli Zaretskii <eliz@gnu.org>
2033
2034 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2035 the new overlay string. (Bug#10159)
2036
01108e3f
PE
20372012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2038
2039 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2040 or that fprintf is async-signal-safe. POSIX doesn't require
2041 either assumption.
2042
82f8cd94
CY
20432012-09-22 Chong Yidong <cyd@gnu.org>
2044
2045 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2046 (Bug#8207).
2047
3cccbd87
KH
20482012-09-22 Kenichi Handa <handa@gnu.org>
2049
2050 * composite.c (composition_reseat_it): Handle the case that a
2051 grapheme cluster is not covered by a single font (Bug#12352).
2052
09c01941
CY
20532012-09-21 Chong Yidong <cyd@gnu.org>
2054
2055 * image.c (define_image_type): Avoid adding duplicate types to
2056 image_types (Bug#12463). Suggested by Jörg Walter.
2057
acfa068f 20582012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
2059
2060 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2061 (print_load_command_name): Add case LC_DATA_IN_CODE.
2062 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2063
acfa068f 20642012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
2065
2066 * eval.c (Frun_hook_with_args_until_success)
2067 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2068
acfa068f 20692012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
2070
2071 * fileio.c (Ffile_selinux_context): Only call freecon when
2072 lgetfilecon succeeded.
2073 (Fset_file_selinux_context): Likewise. (Bug#12444)
2074
acfa068f 20752012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
2076
2077 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2078 reordering, locate the cursor by calling set_cursor_from_row; if
2079 that fails, clear the desired glyph matrix before returning a
2080 failure indication to the caller. Fixes leaving garbled display
2081 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
2082 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2083 scrolling through multibyte text.
aa36e4d2 2084
e99f70c8
SM
20852012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2086
2087 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2088 calling mark_vectorlike since that's the one that marks the window.
2089 (mark_discard_killed_buffers): Mark the final cdr.
2090 * window.h (struct window): Move prev/next_buffers to the
2091 non-standard fields.
2092 * window.c (make_window): Initialize prev/next_buffers manually.
2093
f75beb47
PE
20942012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2095
2096 Omit unused arg EXPECTED from socket hooks.
2097 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2098 * nsterm.m (ns_term_init):
2099 * termhooks.h (struct terminal.read_socket_hook):
2100 * w32inevt.c (w32_console_read_socket):
2101 * w32term.c (w32_read_socket):
2102 * xterm.c (XTread_socket):
2103 Omit unused arg EXPECTED. All callers changed.
2104 (store_user_signal_events): Return void, not int, since callers no
2105 longer care about the return value. All uses changed.
2106
b019b76a
JB
21072012-09-20 Juanma Barranquero <lekktu@gmail.com>
2108
2109 * w32gui.h (XParseGeometry): Do not declare.
2110
05642592
PE
21112012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2112
e4bce92a 2113 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 2114 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
2115 <http://bugs.gnu.org/12471#8> (last line).
2116
05642592
PE
2117 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2118 (XParseGeometry): Now static. Substitute extremal values for
2119 values that are out of range.
2120
e543ae91
JD
21212012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2122
2123 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2124
2125 * nsfns.m (XParseGeometry): Remove.
2126 (Fx_create_frame): Call x_set_offset to correctly interpret
2127 top_pos in geometry.
2128
3a880af4 2129 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
2130 (Fx_parse_geometry): If there is a space in string, call
2131 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2132
45ba16c7
EZ
21332012-09-17 Eli Zaretskii <eliz@gnu.org>
2134
c8b9f1bc
EZ
2135 * search.c (scan_buffer): Use character positions in calls to
2136 region_cache_forward and region_cache_backward, not byte
2137 positions. (Bug#12196)
2138
b4c932a2
EZ
2139 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2140 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2141
45ba16c7
EZ
2142 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2143 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2144 emacs_blocked_malloc, now deleted.
2145
eeceac93
PE
21462012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2147
2148 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2149 The workaround was for improving performance on Solaris 2.4, but
2150 is getting in the way now. Emacs will still work if someone is
2151 still running Solaris 2.4 in a museum somewhere; Sun dropped
2152 support for Solaris 2.4 in 2003.
2153 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2154 * process.c (create_process) [HAVE_WORKING_VFORK]:
2155 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2156 since Emacs no longer uses vfork on that platform.
2157
78f83752
GM
21582012-09-17 Glenn Morris <rgm@gnu.org>
2159
2160 * emacs.c: Use COPYRIGHT.
2161
634b8cac
PE
21622012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2163
0caaedb1
PE
2164 Remove configure's --without-sync-input option (Bug#12450).
2165 When auditing signal-handling in preparation for cleaning it up,
2166 I found that SYNC_INPUT has race conditions and would be a real
2167 pain to fix. Since it's an undocumented and deprecated
2168 configure-time option, now seems like a good time to remove it.
2169 Also see <http://bugs.gnu.org/11080#16>.
2170 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2171 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2172 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2173 (malloc_hysteresis):
2174 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2175 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2176 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2177 (dont_register_blocks, bytes_used_when_reconsidered)
2178 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2179 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2180 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 2181 Remove. All uses removed.
0caaedb1
PE
2182 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2183 implementation, one that depends on whether the new macro
2184 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2185 is defined.
2186 * atimer.c (run_timers, handle_alarm_signal):
2187 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2188 (handle_async_input, process_pending_signals)
2189 (handle_input_available_signal, init_keyboard):
2190 * nsterm.m (ns_read_socket):
2191 * process.c (wait_reading_process_output):
2192 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2193 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2194 (emacs_write):
2195 * xterm.c (XTread_socket):
2196 Assume SYNC_INPUT.
2197 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2198 * eval.c (handling_signal): Remove. All uses removed.
2199 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2200 All uses replaced with the SYNC_INPUT version.
2201 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2202 Remove decls.
2203 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2204 Now static.
2205
634b8cac
PE
2206 * font.c (Ffont_shape_gstring): Remove unused local.
2207
83da1b55
GM
22082012-09-16 Glenn Morris <rgm@gnu.org>
2209
518650a5
GM
2210 * Makefile.in (clean): No longer run nextstep's clean.
2211
83da1b55
GM
2212 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2213 (ns_frag): Remove.
2214 (ns-app): Move here from ns.mk, and simplify.
2215 (clean): Simplify nextstep entry.
2216 * ns.mk: Remove file.
2217
85a43e2e
KH
22182012-09-17 Kenichi Handa <handa@gnu.org>
2219
2220 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2221 not covert the last few charactes.
2222
ba13e616 22232012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
2224
2225 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2226 here, but just check the validity of glyphs in the glyph-string.
2227
a8c729af
MR
22282012-09-16 Martin Rudalics <rudalics@gmx.at>
2229
3a880af4
SM
2230 * window.c (Fwindow_parameter, Fset_window_parameter):
2231 Accept any window as argument (Bug#12452).
a8c729af 2232
c077c059
JD
22332012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2234
2235 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2236 to ns_term_init to avoid memory leak.
2237
2238 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2239 explicit retain/release.
2240 (ns_term_init): Only allow one display. Initialize outerpool and
2241 ns_*_types.
2242
39a57ad0
PE
22432012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2244
2245 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2246 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2247 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2248 the Microsoft problem in a different way, by altering ../nt/config.nt.
2249
7105c8cb
EZ
22502012-09-15 Eli Zaretskii <eliz@gnu.org>
2251
2252 * w32xfns.c:
2253 * w32uniscribe.c:
2254 * w32term.c:
2255 * w32select.c:
2256 * w32reg.c:
2257 * w32proc.c:
2258 * w32menu.c:
2259 * w32inevt.c:
2260 * w32heap.c:
2261 * w32font.c:
2262 * w32fns.c:
2263 * w32console.c:
2264 * w32.c:
2265 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2266 by lisp.h. This completes removal of setjmp.h inclusion
2267 erroneously announced in the previous commit. (Bug#12446)
2268
2269 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2270 more accurate.
2271
2272 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2273 not defined as a macro. The latter happens on MS-Windows.
2274 (Bug#12446)
2275
0328b6de
PE
22762012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2277
2278 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2279 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 2280 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
2281 only reason for the instance was because "lisp.h" was included.
2282 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2283 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2284 and _longjmp with the new symbols. Emacs already uses _setjmp if
2285 available, so this change affects only POSIXish hosts that have
2286 sigsetjmp but not _setjmp, such as some versions of Solaris and
2287 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2288 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2289 (png_load_body) [HAVE_PNG]:
2290 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2291 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2292 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2293 since PNG requires jmp_buf. This is the only exception to the
2294 general rule that we now use sys_setjmp and sys_longjmp.
2295 This exception is OK since this code does not change the signal
2296 mask or longjmp out of a signal handler.
2297
2af03429
PE
22982012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2299
2300 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2301 Include "syssignal.h", for 'main_thread'.
2302
2f294edf
DA
23032012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2304
2305 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
2306 * insdel.c (replace_range, replace_range_2):
2307 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
2308 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2309 Remove redundant check before calling offset_intervals.
2310
6b533e9c
MR
23112012-09-14 Martin Rudalics <rudalics@gmx.at>
2312
2313 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2314 current buffer (Bug#12387).
2315
2a7931e3
JB
23162012-09-14 Juanma Barranquero <lekktu@gmail.com>
2317
2318 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2319
c18e885b
PE
23202012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2321
2322 Use a more backwards-compatible timer format (Bug#12430).
2323 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2324 vector element, not from the 4th, since PSECS is now at the end.
2325 (Fcurrent_idle_time): Doc fix.
2326
d59a1afb
DA
23272012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2328
2329 Function to mark objects and remove killed buffers at once.
2330 * alloc.c (discard_killed_buffers): Rename to ...
2331 (mark_discard_killed buffers) ... new name. Add marking
2332 of remaining objects. Fix comment. Adjust users.
2333 (mark_object): Do not touch frame buffer lists here.
2334 * frame.c (delete_frame): Reset frame buffer lists here.
2335
5f0cb45a
PE
23362012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2337
8ea47e3a
PE
2338 Better workaround for GNOME bug when --enable-gcc-warnings.
2339 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2340 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2341 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2342
4a4bbad2
PE
2343 Simplify SIGIO usage (Bug#12408).
2344 The code that dealt with SIGIO was crufty and confusing, e.g., it
2345 played tricks like "#undef SIGIO" but these tricks were not used
2346 consistently. Simplify mostly by not #undeffing standard symbols,
2347 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2348 or not as we please) rather than "defined SIGIO" (standard symbol
2349 that we probably shouldn't #undef).
2350 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2351 Modules that need it can include it.
2352 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2353 * dispextern.h (ignore_sigio): New decl.
2354 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2355 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2356 * emacs.c (shut_down_emacs):
2357 * keyboard.c (kbd_buffer_store_event_hold):
2358 Use ignore_sigio rather than invoking 'signal' directly.
2359 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2360 for FIONREAD.
2361 (FIONREAD, SIGIO): Do not #undef.
2362 (tty_read_avail_input): Use #error rather than a syntax error.
2363 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2364 for I_PIPE, used by SETUP_SLAVE_PTY.
2365 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2366 * sysdep.c (croak): Remove; no longer needed. This bit of
2367 temporary code, with Fred N. Fish's comment that it's temporary,
2368 has been in Emacs since at least 1992!
2369 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2370 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2371 * syssignal.h (croak): Remove decl.
2372 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2373 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2374 now that we're termios-only.
2375 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2376 * term.c (dissociate_if_controlling_tty): Use #error rather than
2377 a run-time error.
2378
5f0cb45a
PE
2379 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2380 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2381 to work around GNOME bug 683906.
2382 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2383 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2384 This works around GCC bug 54561.
2385
40bce90b
PE
23862012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2387
2388 More fixes for 'volatile' and setjmp/longjmp.
2389 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2390 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2391 (png_load_body) [HAVE_PNG]:
2392 (jpeg_load_body) [HAVE_JPEG]:
2393 New function, with most of the old parent function's body.
2394 (png_load) [HAVE_PNG]:
2395 (jpeg_load) [HAVE_JPEG]:
2396 Invoke the new function, to avoid longjmp munging our locals.
2397 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2398 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2399 longjmp is passed 2, as the C standard doesn't guarantee this.
2400 Instead, store the failure code into mgr->failure_code.
2401
bfeae2cf
SM
24022012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2403
2404 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2405 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2406 (syms_of_keyboard): Remove support for unread-command-char.
2407
8099e36b
EZ
24082012-09-12 Eli Zaretskii <eliz@gnu.org>
2409
2410 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2411 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2412 violation. (Bug#12426)
2413
92547ff9
PE
24142012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2415
2416 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2417
45b82ad0
SM
24182012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2419
2420 * eval.c: Add `inhibit-debugger'.
2421 (Qinhibit_debugger): New symbol.
2422 (call_debugger): Bind it instead of Qdebug_on_error.
2423 (maybe_call_debugger): Test Vinhibit_debugger.
2424 (syms_of_eval): Define inhibit-debugger.
2425 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2426 (syms_of_xdisp): Remove inhibit-debug-on-message.
2427
5779a1dc
PE
24282012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2429
50f2e553
PE
2430 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2431 If a nonvolatile local variable is written before a _longjmp to
2432 the frame containing the variable, and is read after the _longjmp,
2433 the value read is indeterminate. Some local variables of type
2434 'struct handler' and 'struct catchtag' are used in this way, so
2435 mark each of their slots as volatile if the slot can be set before
2436 _longjmp and read afterwards.
2437 * lisp.h (struct handler): var and chosen_clause are now volatile.
2438 (struct catchtag): val, next, and pdlcount are now volatile.
2439
ae1d87e2
PE
2440 * bidi.c (bidi_push_it, bidi_pop_it):
2441 * fns.c (copy_hash_table):
2442 * image.c (define_image_type):
2443 * keyboard.c (kbd_buffer_store_event_hold):
2444 * process.c (Fprocess_send_eof):
2445 * xfaces.c (x_create_gc) [HAVE_NS]:
2446 * xgselect.c (xg_select):
2447 Prefer assignment to memcpy when either will do.
2448
5779a1dc
PE
2449 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2450 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2451 time an item is removed. No need to mark this function 'inline';
2452 the compiler knows better than we do.
2453
c4c9756b
JD
24542012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2455
2456 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2457 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2458 to change_frame_size (Bug#12388).
2459 (windowDidResize:): Pass YES to updateFrameSize.
2460
2461 * nsterm.h: Add delay parameter to updateFrameSize.
2462
d73e321c
DA
24632012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2464
2465 Discard killed buffers from deleted window and frame objects.
2466 This reduces an amount of references to killed buffers and
2467 helps GC to reclaim them faster.
2468 * alloc.c (discard_killed_buffers): New function.
2469 (mark_object): Use it for deleted windows and frames.
2470 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 2471 or deleted frame, restore its global binding.
d73e321c
DA
2472 * data.c (swap_in_global_binding): Add GC notice.
2473 (swap_in_symval_forwarding): Use convenient set_blv_where.
2474 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2475 * window.h: ... to here.
2476
e578f381
DA
24772012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2478
2479 Convenient macro to check whether the buffer is live.
2480 * buffer.h (BUFFER_LIVE_P): New macro.
2481 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2482 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2483
3057e615
YM
24842012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2485
2486 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2487 composition cases (Bug#12364).
2488
2489 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2490 overhang of succeeding glyphs overlapping box cursor.
2491
2492 * w32term.c (x_draw_glyph_string): Likewise.
2493
6fda35f2
PE
24942012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2495
c990426a
PE
2496 Simplify, document, and port floating-point (Bug#12381).
2497 The porting part of this patch fixes bugs on non-IEEE platforms
2498 with frexp, ldexp, logb.
2499 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2500 Now static.
2501 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2502 support, by removing commented-out code and briefly listing the
2503 C89 functions excluded. The commented-out stuff was confusing
2504 maintenance, e.g., we thought we needed cbrt but it was commented out.
2505 (logb): Remove decl; no longer needed.
2506 (isfinite): New macro, if not already supplied.
2507 (isnan): Don't replace any existing macro.
2508 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2509 are present on all C89 platforms.
2510 (Ffrexp): Do not special-case zero, as frexp does the right thing
2511 for that case.
2512 (Flogb): Do not use logb, as it doesn't have the desired meaning
2513 on hosts that use non-base-2 floating point. Instead, stick with
2514 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2515 frexp, to avoid getting an unspecified result.
2516
6fda35f2
PE
2517 * xdisp.c (Qinhibit_debug_on_message): Now static.
2518
16130a58
JD
25192012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2520
2521 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2522 NSBezierPath (Bug#12131).
2523
d105a573
CY
25242012-09-10 Chong Yidong <cyd@gnu.org>
2525
2526 * fns.c (Fdelq, Fdelete): Doc fix.
2527
ff55dfe8
PE
25282012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2529
2530 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2531 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2532
e7032e7c
SM
25332012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2534
2535 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2536 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2537 Use it.
2538
e9957956
EZ
25392012-09-09 Eli Zaretskii <eliz@gnu.org>
2540
aba05ce9
EZ
2541 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2542 left fringe if the window has a left margin. This avoids leaving
2543 traces of the cursor because its leftmost pixel is not drawn over.
2544
e9957956
EZ
2545 * dispnew.c (update_window_line): When the left margin area of a
2546 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2547 that screen line. (Bug#12277)
2548
f6196b87
PE
25492012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2550
2551 Assume C89 or later for math functions (Bug#12381).
2552 This simplifies the code, and makes it a bit smaller and faster,
2553 and (most important) makes it easier to clean up signal handling
2554 since we can stop worring about floating-point exceptions in
2555 library code. That was a problem before C89, but the problem
2556 went away many years ago on all practical Emacs targets.
2557 * data.c, image.c, lread.c, print.c:
2558 Don't include <math.h>; no longer needed.
2559 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2560 might be autoconfigured, as that never happens.
2561 * data.c (fmod):
2562 * doprnt.c (DBL_MAX_10_EXP):
2563 * print.c (DBL_DIG):
2564 Remove. C89 or later always defines these.
2565 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2566 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2567 (arith_error, domain_error, domain_error2):
2568 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2569 no longer needed -- we simply return what C returns. All uses removed.
2570 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2571 the wrapped code.
2572 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2573 Remove. All uses expanded, as these macros are no longer used
2574 more than once and are now more trouble than they're worth.
2575 (Ftan): Use tan, not sin / cos.
2576 (Flogb): Assume C89 frexp.
2577 (fmod_float): Assume C89 fmod.
2578 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2579 (init_floatfns): Remove. All uses removed.
2580
9d7f1863
JD
25812012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2582
2583 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2584 compositeToPoint for OSX < 10.6 (Bug#12390).
2585
eabf0404
PE
25862012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2587
2588 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2589 This produces more-accurate results.
2590
0b3b1d23
JD
25912012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2592
2593 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2594 changes (Bug#12088).
2595
6dcef6ec
CY
25962012-09-08 Chong Yidong <cyd@gnu.org>
2597
2598 * syntax.c (Fstring_to_syntax): Doc fix.
2599
aa7d57c5
JD
26002012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2601
2602 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2603 in the internal border.
2604 (x_set_window_size): Remove static variables and their usage.
2605 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
2606 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2607 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
2608 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2609 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2610 (ns_fix_rect_ibw): Remove.
2611 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2612 (ns_dumpglyphs_box_or_relief): Ditto.
2613 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2614 adjustment.
2615 (ns_dumpglyphs_image): Ditto.
fc0c31f8 2616 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
2617 border adjustment.
2618 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2619 their usage. Add fringe_extended_p and its use as in other terms.
2620 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2621 scroll bar was removed.
2622 (updateFrameSize): New function.
2623 (windowDidResize): Move code to updateFrameSize and call it.
2624
2625 * nsterm.h (EmacsView): Add updateFrameSize.
2626
1a5432bc
CY
26272012-09-07 Chong Yidong <cyd@gnu.org>
2628
b4f5313e
CY
2629 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2630
1a5432bc
CY
2631 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2632
1a4f1e9b
PE
26332012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2634
2635 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
2636 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2637 Problem introduced when merging patches. Noted by Eli Zaretskii in
2638 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
2639 * floatfns.c: Comment fix.
2640 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2641 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2642 and anyway the declaration is harmless even if SIGDANGER is not defined.
2643 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2644 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2645 source files not surprisingly expected syssignal.h to define, or
2646 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2647 Include <sys/ioctl.h>, for FIONREAD.
2648 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2649 This eliminates a problem whereby other files mysteriously had
2650 to include "syssignal.h" before including "systty.h" if they
2651 wanted to use "#ifdef SIGIO".
2652
bc8000ff
EZ
26532012-09-07 Eli Zaretskii <eliz@gnu.org>
2654
3e6d6928
EZ
2655 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2656
2657 * w32.c (sigemptyset): Empty the set.
2658 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2659
bc8000ff
EZ
2660 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2661
b4fa72f2
DA
26622012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2663
2664 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2665 (mark_object): Likewise for frame objects.
2666
30730c93
PE
26672012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2668
2669 * syssignal.h (handle_on_main_thread): Always declare,
2670 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2671 This ports to platforms without HAVE_PTHREAD.
2672
2fe28299
PE
26732012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2674
2675 Signal-handler cleanup (Bug#12327).
2676 Emacs's signal handlers were written in the old 4.2BSD style with
2677 sigblock and sigmask and so forth, and this led to some
2678 inefficiencies and confusion. Rewrite these to use
2679 pthread_sigmask etc. without copying signal sets around. Also,
2680 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2681 'signal', and instead use functions that do not attempt to take
2682 over the system name space. This patch causes Emacs's text
2683 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2684 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2685 Do not include <signal.h> or "syssignal.h", as these
2686 modules do not use signals.
2687 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2688 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2689 Do not include <signal.h>, as "syssignal.h" does that for us now.
2690 * atimer.c (sigmask_atimers): New function.
2691 (block_atimers, unblock_atimers): New functions,
2692 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2693 All uses replaced.
2694 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2695 no longer needed here.
2696 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 2697 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
2698 * sysdep.c (struct save_signal): New member 'action', replacing
2699 old member 'handler'.
2700 (save_signal_handlers, restore_signal_handlers):
2701 Use sigaction instead of 'signal' to save and restore.
2702 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2703 New function. All users of 'signal' modified to use set_sighandler
2704 if they're writeonly, and to use sys_signal if they're read+write.
2705 (emacs_sigaction_init, forwarded_signal): New functions.
2706 (sys_signal): Remove. All uses replaced by calls to sigaction
2707 and emacs_sigaction_init, or by direct calls to 'signal'.
2708 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2709 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2710 all uses replaced by pthread_sigmask etc. calls.
2711 * syssignal.h: Include <signal.h>.
2712 (emacs_sigaction_init, forwarded_signal): New decls.
2713 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2714 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2715 (sigmask, sys_sigmask): Remove; no longer needed.
2716 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2717 (sigblock, sigunblock, sigfree):
2718 (sigsetmask) [!defined sigsetmask]:
2719 Remove. All uses replaced by pthread_sigmask.
2720 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2721 no longer need to be replaced, and its typical old uses
2722 are now done via emacs_sigaction_init and sigaction.
2723 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2724 (sys_sigdel): Remove; unused.
2725 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2726
0216c128
EZ
27272012-09-06 Eli Zaretskii <eliz@gnu.org>
2728
2729 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2730 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2731
c752cfa9
DA
27322012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2733
2734 Explicitly mark buffer_defaults and buffer_local_symbols.
2735 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2736 mark_local_symbols here.
2737 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2738 since special buffers aren't marked here any more.
2739 (allocate_buffer): Chain new buffer with all_buffers here...
2740 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2741 not here.
2742 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2743 (syms_of_buffer): Remove staticpro of the above.
2744 (init_buffer_once): Set names for buffer_defaults and
2745 buffer_local_symbols.
2746
a864ef14
PE
27472012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2748
2749 Use bool for booleans in font-related modules.
2750 * font.c (font_intern_prop, font_style_to_value)
2751 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2752 (generate_otf_features, font_check_otf_features, font_check_otf)
2753 (font_match_p, font_list_entities, font_at):
2754 * fontset.c (fontset_id_valid_p, reorder_font_vector
2755 (fontset_find_font, Fset_fontset_font)
2756 (face_suitable_for_char_p) [0]:
2757 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2758 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2759 (m17n_flt_initialized, ftfont_shape_by_flt):
2760 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2761 * nsfont.m (nsfont_draw):
2762 * w32font.c (w32font_draw):
2763 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2764 Use bool for booleans.
2765 * font.h: Adjust to above API changes.
2766 (struct font, struct font_driver, struct font_driver_list):
2767 Use bool for booleans.
2768 (struct font): Remove useless member encoding_type.
2769 All users removed.
2770 * fontset.c, xftfont.c: Omit unnecessary static decls.
2771
0699fc18
DA
27722012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2773
2774 * alloc.c (mark_object): Revert window marking code
2775 since it's unsafe for the Fset_window_configuration.
2776
20ef56db
PE
27772012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2778
2fe28299 2779 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
2780 Be more systematic about preserving errno whenever a signal
2781 handler returns, even if it's not in the main thread. Do this by
2782 renaming signal handlers to distinguish between signal delivery
2783 and signal handling. All uses changed.
2784 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2785 * data.c (deliver_arith_signal): Rename from arith_error.
2786 * dispnew.c (deliver_window_change_signal): Rename from
2787 window_change_signal.
2788 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2789 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2790 * keyboard.c (deliver_input_available_signal): Rename from
2791 input_available_signal.
2792 (deliver_user_signal): Rename from handle_user_signal.
2793 (deliver_interrupt_signal): Rename from interrupt_signal.
2794 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2795 (deliver_child_signal): Rename from sigchld_handler.
2796 * atimer.c (handle_alarm_signal):
2797 * data.c (handle_arith_signal):
2798 * dispnew.c (handle_window_change_signal):
2799 * emacs.c (handle_fatal_signal, handle_danger_signal):
2800 * keyboard.c (handle_input_available_signal):
2801 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2802 * process.c (handle_pipe_signal, handle_child_signal):
2803 New functions, with the actual signal-handling code taken from the
2804 original respective signal handlers, sans the sporadic attempts to
2805 preserve errno, since that's now done by handle_on_main_thread.
2806 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2807 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2808 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2809 Move to sysdep.c.
2810 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2811 Move initialization of main_thread to sysdep.c's init_signals.
2812 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2813 our usage, and simplifies the mainline code.
2814 (record_child_status_change): New static function, as a helper
2815 for handle_child_signal, and with most of the old child handler's
2816 contents.
2817 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2818 (handle_child_signal): Use the above.
2819 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2820 Moved here from emacs.c.
2821 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2822 code moved here from emacs.c's main function.
2823 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
2824 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2825 This lets callers save and restore errno properly.
20ef56db 2826
e3ccf108
DA
28272012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2828
2829 Remove redundant or unused things here and there.
2830 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2831 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2832 * editfns.c (Fcompare_buffer_substrings): Likewise.
2833 * frame.h (struct terminal, struct font_driver_list):
2834 Remove redundant declarations.
2835 * window.h (Qleft, Qright): Likewise.
2836
697e1e39
DA
28372012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2838
2839 Do not mark objects from deleted buffers, windows and frames.
2840 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2841 (mark_object): Likewise for windows and frames.
2842
c1ca42ca
DA
28432012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2844
2845 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2846 buffer_defaults and buffer_local_symbols as valid objects.
2847 Return special value to denote them.
2848
014d93be
PE
28492012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2850
f75d7a91
PE
2851 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2852 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2853 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2854 (file_name_absolute_p, Fsubstitute_in_file_name):
2855 (check_executable, check_writable, Ffile_accessible_directory_p)
2856 (Fset_file_selinux_context, Fdefault_file_modes)
2857 (Finsert_file_contents, choose_write_coding_system)
2858 (Fwrite_region, build_annotations, a_write, e_write)
2859 (Fdo_auto_save):
2860 * filelock.c (boot_time_initialized, get_boot_time)
2861 (get_boot_time_1, lock_file_1, within_one_second):
2862 * floatfns.c (in_float):
2863 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2864 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2865 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2866 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2867 * window.c (compare_window_configurations):
2868 Use bool for booleans.
2869 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2870 (Fdefault_file_modes): Now mode_t, not int, for modes.
2871 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2872 (internal_delete_file): Now returns void, not a (boolean) int,
2873 since nobody was looking at the return value.
2874 * lisp.h, window.h: Adjust to above API changes.
2875
014d93be
PE
2876 * xdisp.c (set_message): Simplify and reindent last change.
2877
776f29e1
JB
28782012-09-05 Juanma Barranquero <lekktu@gmail.com>
2879
2880 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2881
7f7e0167
LI
28822012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2883
2884 * eval.c (call_debugger): Make the function non-static so that we
2885 can call it from set_message.
2886
2887 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2888 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2889
cf29dd84
PE
28902012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2891
2892 Give more-useful info on a fatal error (Bug#12328).
2893 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2894 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2895 of doing the work ourselves.
2896 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2897 do most of the work.
2898 (fatal_error_backtrace): New function, taken from the guts
2899 of the old fatal_error_signal, but with a new option to output
2900 a backtrace.
2901 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2902 info about the signal than just its number.
2903 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2904 * sysdep.c: Include <execinfo.h>
2905 (emacs_backtrace): New function, taken partly from the previous
2906 code of the 'die' function.
2907 (emacs_abort): Call fatal_error_backtrace rather than abort.
2908
972debf2
SM
29092012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2910
2911 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2912 eager (load-time) macro-expansion.
2913 * lisp.mk (lisp): Add macroexp.
2914
1088b922
PE
29152012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2916
2917 Simplify redefinition of 'abort' (Bug#12316).
2918 Do not try to redefine the 'abort' function. Instead, redo
2919 the code so that it calls 'emacs_abort' rather than 'abort'.
2920 This removes the need for the NO_ABORT configure-time macro
2921 and makes it easier to change the abort code to do a backtrace.
2922 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2923 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2924 Remove; sysdep.c's emacs_abort now takes its place.
2925 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2926 'abort' changed to use 'emacs_abort'.
2927 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2928 (abort) [!defined abort]: Rename to ...
2929 (emacs_abort): ... new name.
2930 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2931 the place of the old 'abort' in emacs.c.
2932 * w32.c, w32fns.c (abort): Do not #undef.
2933 * w32.c (emacs_abort): Rename from w32_abort.
2934
30934d33
EZ
29352012-09-04 Eli Zaretskii <eliz@gnu.org>
2936
2937 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2938 offsets[j].dv, since the y axis of the screen coordinates points
2939 down, while the y axis of the font definition coordinates points
2940 up. This fixes display of Arabic diacritics such as KASRA and
2941 KASRATAN. (Bug#11860)
2942
af26b72c
PE
29432012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2944
2945 Be more systematic about _setjmp vs setjmp.
2946 * alloc.c (test_setjmp, mark_stack):
2947 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2948 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2949 (png_load, my_error_exit, jpeg_load):
2950 * process.c (send_process_trap, send_process):
2951 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2952 The underscored versions are up to 30x faster on some hosts.
2953 Formerly, the code used setjmp+longjmp sometimes and
2954 _setjmp+_longjmp at other times, with no particular reason to
2955 prefer setjmp+longjmp.
2956
26d4541d
PE
29572012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2958
d42f4f0f 2959 Fix minor problem found by static checking.
26d4541d 2960 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 2961
c5e28e39
MR
29622012-09-03 Martin Rudalics <rudalics@gmx.at>
2963
2964 * buffer.c (Fdelete_all_overlays): New function.
2965
3eab3ca9
CY
29662012-09-03 Chong Yidong <cyd@gnu.org>
2967
2968 * gtkutil.c: Add extern decl for Qxft.
2969
c04889f8
PE
29702012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2971
1882aa38
PE
2972 * emacs.c, eval.c: Use bool for boolean.
2973 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2974 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2975 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2976 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2977 (main, decode_env_path, Fdaemon_initialized):
2978 * eval.c (call_debugger, Finteractive_p, interactive_p):
2979 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2980 (maybe_call_debugger, Fbacktrace):
2981 * process.c (read_process_output, exec_sentinel):
2982 Use bool for booleans.
2983 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2984 All callers changed.
2985 * eval.c (interactive_p): Omit always-true boolean argument
2986 EXCLUDE_SUBRS_P. All callers changed.
2987 * dispextern.h, lisp.h: Reflect above API changes.
2988 * firstfile.c (dummy): Use the address of 'main', whose signature
2989 won't change, instead of the address of 'initialize', whose
2990 signature just changed from int to bool.
2991 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2992 * msdos.c (fatal_error_in_progress): ... from here.
2993 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2994 of incrementing it.
2995 (redisplay_internal, unwind_redisplay): Simply clear
2996 REDISPLAYING_P when unwinding, instead of saving its previous,
2997 always-false value and then restoring it.
2998
a411ac43
PE
2999 Clean up some extern decls.
3000 Mostly, this hoists extern decls out of .c files and into .h files.
3001 That way, we're more likely to catch errors if the interfaces change.
3002 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3003 declare xg_mark_data.
3004 * dispextern.h (x_frame_parm_handlers):
3005 * font.h (Qxft):
3006 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3007 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3008 (Qultra_bold, Qoblique, Qitalic):
3009 Move extern decl here from .c file.
3010 * alloc.c (xg_mark_data) [USE_GTK]:
3011 * doc.c (Qclosure):
3012 * eval.c (Qlexical_binding):
3013 * fns.c (time) [!HAVE_UNISTD_H]:
3014 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3015 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3016 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3017 * lread.c (Qinternal_interpreter_environment):
3018 * minibuf.c (Qbuffer):
3019 * process.c (QCfamily, QCfilter):
3020 * widget.c (free_frame_faces):
3021 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3022 * xfont.c (x_clear_errors):
3023 * xterm.c (x_frame_parm_handlers):
3024 Remove now-redundant extern decls.
3025 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3026 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3027 Now static.
3028 * xfaces.c: Remove unnecessary static decls.
3029 * xterm.c (updating_frame): Remove decl of nonexistent object.
3030
c04889f8
PE
3031 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3032 when building globals.h, as the objects that are not built on
3033 this host are not needed to compile C files on this host.
3034
8b339673
JD
30352012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3036
3037 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3038
3039 * frame.h: Add missing prototype for x_wm_set_size_hint.
3040
a08d4ba7
PE
30412012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3042
3043 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3044 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3045 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3046 (Fsubstitute_command_keys):
3047 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3048 (save_excursion_save, save_excursion_restore)
3049 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3050 (format_time_string, general_insert_function)
3051 (make_buffer_string, make_buffer_string_both)
3052 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3053 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3054 (copy_text, insert_1, insert_1_both, insert_from_string)
3055 (insert_from_string_before_markers, insert_from_string_1)
3056 (insert_from_buffer, insert_from_buffer_1, replace_range)
3057 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3058 (del_range_2, modify_region):
3059 * intervals.c (intervals_equal, balance_possible_root_interval)
3060 (adjust_intervals_for_insertion, merge_properties_sticky)
3061 (graft_intervals_into_buffer, lookup_char_property)
3062 (adjust_for_invis_intang, set_point_both)
3063 (get_property_and_range, compare_string_intervals)
3064 (set_intervals_multibyte_1, set_intervals_multibyte):
3065 * keyboard.c (decode_timer):
3066 Use bool for boolean.
3067 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3068 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3069
48c948de
CY
30702012-09-02 Chong Yidong <cyd@gnu.org>
3071
3072 * keymap.c (push_key_description): Print M-TAB as C-M-i
3073 (Bug#11758).
3074
6c49a40b
JB
30752012-09-02 Juanma Barranquero <lekktu@gmail.com>
3076
3077 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3078 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3079 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3080 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3081 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3082 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3083 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3084
4dfbd238
EZ
30852012-09-01 Eli Zaretskii <eliz@gnu.org>
3086
7e510e28
EZ
3087 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3088 more than one grapheme cluster passed to the shaper: compute the
3089 offset adjustment values separately for each cluster. (Bug#11860)
3090
4dfbd238
EZ
3091 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3092 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3093 about implicit conversions from integer to pointer.
3094
86571ae0
DC
30952012-09-01 Daniel Colascione <dancol@dancol.org>
3096
3097 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3098 system used too early.
3099
0e23ef9d
PE
31002012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3101
3102 Better seed support for (random).
3103 * emacs.c (main): Call init_random.
3104 * fns.c (Frandom): Set the seed from a string argument, if given.
3105 Remove long-obsolete Gentzel cruft.
3106 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3107 (init_random): New function.
3108
17a2cbbd
DC
31092012-09-01 Daniel Colascione <dancol@dancol.org>
3110
3111 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3112 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3113 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3114 x_wm_set_size_hint, x_query_colors, x_real_positions,
3115 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3116 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3117 all of which have been moved to common code.
3118
3119 * xfaces.c: Include TERM_HEADER instead of listing all possible
3120 window-system headers.
3121
3122 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3123 to match header.
3124
3125 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3126 directly accessing frame internals.
3127
f18cbb28 3128 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
3129 globals_of_w32font.
3130
3131 * process.c: Include TERM_HEADER instead of listing all possible
3132 window-system headers.
3133
3a880af4
SM
3134 * nsterm.h: Remove declarations now in frame.h.
3135 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
3136
3137 * menu.c: Include TERM_HEADER instead of listing all possible
3138 window-system headers.
3139
3140 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3141 window system.
3142
3143 * keyboard.c: Include TERM_HEADER instead of listing all possible
3144 window-system headers.
3145
3146 * image.c: Include TERM_HEADER instead of listing all possible
3147 window-system headers. Declare Vlibrary_cache when compiling for
3148 Windows.
3149
3150 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3151 window system declarations.
3152
3153 * frame.h: Move common functions here: set_frame_menubar,
3154 x_set_window_size, x_sync, x_get_focus_frame,
3155 x_set_mouse_position, x_set_mouse_pixel_position,
3156 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3157 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3158 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3159 x_activate_menubar, x_real_positions, x_bitmap_icon,
3160 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3161 and x_query_colors.
3162
3163 * frame.c: Include TERM_HEADER instead of listing all possible
3164 window-system headers.
3165
3166 * font.c: Include TERM_HEADER instead of listing all possible
3167 window-system headers.
3168
3169 * emacs.c: Include TERM_HEADER.
3170
f18cbb28
EZ
3171 * dispnew.c: Include TERM_HEADER instead of listing all possible
3172 window-system headers.
17a2cbbd 3173
f18cbb28 3174 * ccl.h: Include character.h.
17a2cbbd
DC
3175
3176 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3177 the current window system; include in list of objects to link into
3178 Emacs.
3179
c650a5de
DA
31802012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3181
3182 Remove mark_ttys function and fix tty_display_info initialization.
3183 * lisp.h (mark_ttys): Remove prototype.
3184 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3185 to mark_ttys because all possible values of 'top_frame' slot are
3186 the frames which are reachable from Vframe_list.
3187 * term.c (mark_ttys): Remove.
3188 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3189
4e0f6479
DA
31902012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3191
3192 Change struct frame bitfields from unsigned char to unsigned.
3193 * frame.h (struct frame): Change type of 'display_preempted',
3194 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3195 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3196 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3197 bitfields from unsigned char to unsigned.
3198
8b96a52c
DA
31992012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3200
3201 Remove unused member of struct x_output and struct w32_output.
3202 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3203 * w32term.h (struct w32_output): Likewise.
3204
b4444c8a
JD
32052012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3206
3207 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3208 does not become zero (Bug#12234).
3209
b98521db
PE
32102012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3211
3212 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3213 for GCC 4.7.1 x86-64.
3214
31d02438
GM
32152012-08-30 Glenn Morris <rgm@gnu.org>
3216
3217 * lread.c (init_lread): For out-of-tree builds, only add the
3218 source directory's site-lisp dir to the load-path if it exists,
3219 consistent with in-tree builds. (Bug#12302)
3220
7f8941d8
JD
32212012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3222
3223 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 3224 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
3225 (windowShouldClose:): Set window_closed.
3226 (dealloc): New member, free button_values.
fc0c31f8
JB
3227 (process_dialog:): Make member function. Remove window argument,
3228 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
3229 in button_values.
3230 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 3231 with tag. Remove return self, declare return value as void.
7f8941d8
JD
3232 (addString:row:): Remove return self, declare return value as void.
3233 (addSplit): Remove return self, declare return value as void.
3234 (clicked:): Remove return self, declare return value as void.
fc0c31f8 3235 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
3236 (initFromContents:isQuestion:): Adjust call to process_dialog.
3237 Code formatting change.
3238 (timeout_handler:): Set timer_fired to YES.
3239 (runDialogAt:): Set timer_fired to NO.
3240 Handle click on close button as quit.
3241
3242 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3243 Add window_closed and button_values. Add void as return value for
3244 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3245 Add process_dialog as new member.
3246
eada0861 32472012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 3248
eada0861
GM
3249 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3250 is not one of the heaps we manage. (Bug#12242)
3251
32522012-08-28 Glenn Morris <rgm@gnu.org>
3253
3254 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3255
457294dd
MR
32562012-08-28 Martin Rudalics <rudalics@gmx.at>
3257
3258 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
3259 auto-buffer-name window parameter. Install revision of reverted
3260 fix.
457294dd 3261
4f2daf31
DA
32622012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3263
3264 Do not allow to set major mode for a dead buffer.
3265 * buffer.c (Fset_buffer_major_mode): Signal an error
3266 if the buffer is dead.
3267 (Fother_buffer, other_buffer_safely): Remove redundant
3268 nested declaration.
3269
66322887
DA
32702012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3271
3272 Always use set_buffer_if_live to restore original buffer at unwind.
3273 * buffer.h (record_unwind_current_buffer): New function.
3274 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3275 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3276 * undo.c, window.c: Adjust users.
3277 * buffer.c (set_buffer_if_live): Fix comment.
3278
a3d794a1
DA
32792012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3280
3281 Fix usage of set_buffer_internal.
3282 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3283 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3284 * coding.c (decode_coding): Omit redundant test.
3285 * fileio.c (decide_coding_unwind): Likewise.
3286 * fns.c (secure_hash): Likewise.
3287 * insdel.c (modify_region): Likewise.
3288 * keyboard.c (command_loop_1): Likewise.
3289 * print.c (PRINTFINISH): Likewise.
3290 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3291
59ea14cd
PE
32922012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3293
3294 * dispnew.c: Use bool for boolean.
3295 (frame_garbaged, display_completed, delayed_size_change)
3296 (fonts_changed_p, add_window_display_history)
3297 (add_frame_display_history, verify_row_hash)
3298 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3299 (row_equal_p, realloc_glyph_pool)
3300 (allocate_matrices_for_frame_redisplay)
3301 (showing_window_margins_p)
3302 (adjust_frame_glyphs_for_frame_redisplay)
3303 (build_frame_matrix_from_leaf_window, make_current)
3304 (mirrored_line_dance, mirror_line_dance, update_frame)
3305 (update_window_tree, update_single_window)
3306 (check_current_matrix_flags, update_window, update_text_area)
3307 (update_window_line, set_window_update_flags, scrolling_window)
3308 (update_frame_1, scrolling, buffer_posn_from_coords)
3309 (do_pending_window_change, change_frame_size)
3310 (change_frame_size_1, sit_for):
3311 Use bool for boolean.
3312 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3313 and remove last int (actually boolean) argument, which was always 0.
3314 All callers changed.
3315 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3316 * dispextern.h (struct composition_it): Use bool for boolean.
3317 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3318 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3319 * dired.c (file_name_completion):
3320 Use bool for boolean. (This was missed in an earlier change.)
3321
95072a94
MR
33222012-08-27 Martin Rudalics <rudalics@gmx.at>
3323
3324 * window.c (Fset_window_configuration): Revert first part of
3325 last change.
3326
0f19feff
JD
33272012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3328
3329 * nsterm.h (NSPanel): New class variable dialog_return.
3330
3a880af4
SM
3331 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3332 Initialize dialog_return.
0f19feff
JD
3333 (windowShouldClose:): Use stop instead of stopModalWithCode.
3334 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3335 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3336 event.
3337 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3338 modal loop returns.
3339
f10fe38f
PE
33402012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3341
de1339b0
PE
3342 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3343 * composite.c (find_composition, composition_gstring_p)
3344 (composition_reseat_it, find_automatic_composition):
3345 * data.c (let_shadows_buffer_binding_p)
3346 (let_shadows_global_binding_p, set_internal, make_blv)
3347 (Fmake_variable_buffer_local, Fmake_local_variable)
3348 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3349 (cons_to_signed, arith_driver):
3350 * dbusbind.c (xd_in_read_queued_messages):
3351 * dired.c (directory_files_internal, file_name_completion):
3352 Use bool for booleans.
3353 * dired.c (file_name_completion):
3354 * process.h (fd_callback):
3355 Omit int (actually boolean) argument. It wasn't being used.
3356 All uses changed.
3357 * composite.h, lisp.h: Reflect above API changes.
3358
f10fe38f
PE
3359 * cmds.c, coding.c: Use bool for booleans.
3360 * cmds.c (move_point, Fself_insert_command):
3361 * coding.h (struct composition status, struct coding_system):
3362 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3363 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3364 (emacs_mule_char, decode_coding_emacs_mule)
3365 (encode_coding_emacs_mule, detect_coding_iso_2022)
3366 (decode_coding_iso_2022, encode_invocation_designation)
3367 (encode_designation_at_bol, encode_coding_iso_2022)
3368 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3369 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3370 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3371 (encode_coding_raw_text, detect_coding_charset)
3372 (decode_coding_charset, encode_coding_charset, detect_eol)
3373 (detect_coding, get_translation_table, produce_chars)
3374 (consume_chars, reused_workbuf_in_use)
3375 (make_conversion_work_buffer, code_conversion_save)
3376 (decode_coding_object, encode_coding_object)
3377 (detect_coding_system, char_encodable_p)
3378 (Funencodable_char_position, code_convert_region)
3379 (code_convert_string, code_convert_string_norecord)
3380 (Fset_coding_system_priority):
3381 * fileio.c (Finsert_file_contents):
3382 Use bool for booleans.
3383 * coding.h, lisp.h: Reflect above API changes.
3384 * coding.c: Remove unnecessary static function decls.
3385 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3386 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3387 not a boolean 'int', since callers never look at the return value.
3388 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3389 * coding.h (decoding_buffer_size, encoding_buffer_size)
3390 (emacs_mule_string_char): Remove unused extern decls.
3391 (struct iso_2022_spec, struct coding_system):
3392 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3393 (struct emacs_mule_spec): Remove unused field 'full_support'.
3394 All initializations removed.
3395 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3396
5474c384
DA
33972012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3398
f10fe38f 3399 Fix spare memory change (Bug#12286).
5474c384
DA
3400 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3401 (valid_lisp_object_p): Likewise.
3402
c4b6914d
MR
34032012-08-27 Martin Rudalics <rudalics@gmx.at>
3404
3405 * window.c (Fset_window_configuration): Record any window's old
3406 buffer if it's replaced (see Bug#8789). If the new current
3407 buffer doesn't appear in the selected window, go to its old
3408 point (Bug#12208).
3409
35aaa1ea
DA
34102012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3411
3412 Special MEM_TYPE_SPARE to denote reserved memory.
3413 * alloc.c (enum mem_type): New memory type.
3414 (refill_memory_reserve): Use new type for spare memory.
3415 This prevents live_cons_p and live_string_p from incorrect
3416 detection of uninitialized objects from spare memory as live.
3417
6af64513
PE
34182012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3419
8b2e00a3
PE
3420 Spelling fixes.
3421 * Makefile.in (.PHONY): versioclean -> versionclean.
3422
b52d6985
PE
3423 Remove unused external symbols.
3424 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3425 * window.c (Qwindow_valid_p, decode_valid_window):
3426 Now static, not extern.
3427 * data.c (Qinterval): Remove; unused.
3428 (syms_of_data): Do not define 'interval'.
3429 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3430 * window.h (decode_valid_window):
3431 Remove decls.
3432
d5172d4f
PE
3433 * character.c, charset.c, chartab.c: Use bool for booleans.
3434 * character.c (lisp_string_width, string_count_byte8)
3435 (string_escape_byte8):
3436 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3437 (load_charset_map_from_file, map_charset_chars)
3438 (Fdefine_charset_internal, define_charset_internal)
3439 (Fdeclare_equiv_charset, find_charsets_in_text)
3440 (Ffind_charset_region, char_charset, Fiso_charset):
3441 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3442 (sub_char_table_set, sub_char_table_set_range)
3443 (char_table_set_range, optimize_sub_char_table)
3444 (map_sub_char_table):
3445 Use bool for boolean.
3446 * character.c (str_to_unibyte): Omit last boolean argument; it was
3447 always 0. All callers changed.
3448 * character.h, charset.h: Adjust to match previous changes.
3449 * character.h (char_printable_p): Remove decl of nonexistent function.
3450 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3451 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3452 are all boolean, so make them single-bit bitfields.
3453
6af64513
PE
3454 * lisp.h (ASET): Remove attempt to detect side effects.
3455 It was meant to be temporary and it often doesn't work,
3456 because when IDX has side effects the behavior of IDX==IDX
3457 is undefined. See Stefan Monnier in
3458 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3459
e1f29348
BR
34602012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3461
3462 * lisp.h (functionp): New function (extracted from Ffunctionp).
3463 (FUNCTIONP): Use it.
3464 * eval.c (Ffunctionp): Use it.
3465
17c05d74
PE
34662012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3467
0f46bc75
PE
3468 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3469 as that's faster and simpler than static storage. Don't bother
3470 with the g_main_context_query overhead if g_main_context_pending
3471 says no events are pending.
3472 (gfds, gfds_size): Remove these static vars.
3473 (xgselect_initialize): Remove; no longer needed.
3474 All uses and decls removed.
3475
ee4c0f69
PE
3476 * emacs.c (fatal_error_signal_hook): Remove.
3477 All uses removed. This leftover from old code was always 0.
3478
17c05d74
PE
3479 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3480 * casefiddle.c (casify_object, casify_region):
3481 * casetab.c (set_case_table):
3482 * category.c, category.h (word_boundary_p):
3483 * category.h (CHAR_HAS_CATEGORY):
3484 Use bool for booleans, instead of int.
3485
391ceac5
EZ
34862012-08-25 Eli Zaretskii <eliz@gnu.org>
3487
3488 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3489
2f221583
PE
34902012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3491
f4a681b0
PE
3492 On assertion failure, print backtrace if available.
3493 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3494 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3495 * Makefile.in (LIB_EXECINFO): New macro.
3496 (LIBES): Use it.
3497
2f221583
PE
3498 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3499 * bytecode.c (exec_byte_code):
3500 * callint.c (check_mark, Fcall_interactively):
3501 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3502 (getenv_internal, sync_process_alive, call_process_exited):
3503 * lisp.h (USE_SAFE_ALLOCA):
3504 Use bool for booleans, instead of int.
3505 * lisp.h, process.h: Adjust prototypes to match above changes.
3506 * callint.c (Fcall_interactively): Don't assume the mark's
3507 offset fits in 'int'.
3508
37ef52bb
PE
35092012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3510
3511 * buffer.c, buffer.h: Use bool for boolean.
3512 * buffer.c (reset_buffer_local_variables)
3513 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3514 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3515 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3516 (overlay_touches_p, overlay_strings, Foverlay_put)
3517 (report_overlay_modification, call_overlay_mod_hooks):
3518 (mmap_enlarge, mmap_set_vars):
3519 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3520 Use bool for booleans, instead of int.
3521 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3522 since the 1-or-0 return value is always ignored anyway.
3523 (mmap_initialized_p):
3524 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3525 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3526
2cc21167
PE
35272012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3528
3529 * bidi.c: Use bool for boolean.
3530 This is a bit more readable, and makes the text segment of bidi.o
3531 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3532 Presumably it's faster too.
3533 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3534 Now bool.
3535 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3536 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3537 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3538 (bidi_explicit_dir_char, bidi_level_of_next_char)
3539 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3540 Use bool for booleans, instead of int.
3541 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3542 (bidi_unshelve_cache): Adjust decls to match code.
3543
7db4ddf4
MR
35442012-08-23 Martin Rudalics <rudalics@gmx.at>
3545
3546 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3547 argument.
3548
b1bb8011
PE
35492012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3550
3551 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3552 * atimer.h: Include <stdbool.h>.
3553
ff687885
DN
35542012-08-22 Dan Nicolaescu <dann@gnu.org>
3555
3556 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3557 compile time tests instead of run time tests on systems that do
3558 not use them.
3559 (FRAME_MAC_P): Remove leftover from deleted code.
3560 * frame.c (syms_of_frame): Remove leftover from deleted code.
3561
4ce7a138
JD
35622012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3563
3564 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3565
d733ec6d
PE
35662012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3567
3568 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3569 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 3570 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
3571 (fontset_add): Return void, for FONTSET_ADD.
3572
d0d2d26f
PE
35732012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3574
fce31d69
PE
3575 * alloc.c: Use bool for booleans.
3576 (gc_in_progress, abort_on_gc)
3577 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3578 (dont_register_blocks) [GC_MALLOC_CHECK]:
3579 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3580 (check_string_bytes, make_specified_string, memory_full)
3581 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3582 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3583 (mark_stack, valid_pointer_p, make_pure_string)
3584 (Fgarbage_collect, survives_gc_p, gc_sweep):
3585 Use bool for booleans, instead of int.
3586 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3587 Remove unused local.
3588 * alloc.c (PURE_POINTER_P):
3589 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3590 * editfns.c (Fformat):
3591 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3592 (Fdo_auto_save):
3593 * fns.c (sweep_weak_table):
3594 * lisp.h (suppress_checking, push_message, survives_gc_p)
3595 (make_pure_string, gc_in_progress, abort_on_gc):
3596 * lread.c (readchar, read1):
3597 * print.c (Fprin1_to_string):
3598 * xdisp.c (push_message):
3599 Use bool for booleans affected directly or indirectly by
3600 alloc.c's changes.
3601
d0d2d26f
PE
3602 Make recently-introduced setters macros.
3603 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3604 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3605 (set_fontset_default, set_fontset_fallback): Rename from their
3606 upper-case counterparts, and make them functions rather than macros.
3607 This is more consistent with the other recently-introduced setters.
3608 These don't need to be inline, since they're local.
3609
d18e2bb6
JD
36102012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3611
3612 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3613 the loop (Bug#12247).
3614
1b9d9d16
PE
36152012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3616
3617 * lisp.h (vcopy): Use memcpy rather than our own loop.
3618 This fixes a performance regression introduced by the recent
3619 addition of vcopy. This means 'vcopy' will need to be modified
3620 for a copying collector, but that's OK. Also, tighten the
3621 checking in the assertion.
3622
b2f09701
EZ
36232012-08-21 Eli Zaretskii <eliz@gnu.org>
3624
3625 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3626 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3627 non-base glyph for the width of the base character, according to
e1f29348
BR
3628 what x_draw_composite_glyph_string_foreground expects.
3629 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
3630 expectations, to produce correct width of the composed character.
3631 Reverse the sign of the DU offset produced by ScriptPlace.
3632
9b994fed
PE
36332012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3634
3635 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3636
086ca913
DA
36372012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3638
3639 Avoid direct writes to contents member of struct Lisp_Vector.
3640 * lisp.h (vcopy): New function to copy data into vector.
3641 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3642 * fns.c (Ffillarray): Use ASET.
3643 * keyboard.c (timer_check_2): Use AREF and ASET.
3644 (append_tool_bar_item, Frecent_keys): Use vcopy.
3645 * lread.c (read_vector): Use ASET.
3646 * msdos.c (Frecent_doskeys): Use vcopy.
3647 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3648 (Finternal_merge_in_global_face): Use ASET and vcopy.
3649 * xfont.c (xfont_list_pattern): Likewise.
3650
5481664a
MR
36512012-08-21 Martin Rudalics <rudalics@gmx.at>
3652
3653 * window.c (Fwindow_point): For the selected window always return
3654 the position of its buffer's point.
3655 (Fset_window_point): For the selected window always go in its
3656 buffer to the specified position.
3657
6d470bdd
DA
36582012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3659
3660 Setter macros for fontsets.
3661 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3662 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3663 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3664 Adjust users.
3665
24564fe1
GM
36662012-08-20 Glenn Morris <rgm@gnu.org>
3667
3668 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3669 Don't assume that `ln -f' works.
3670
0a05a035
EZ
36712012-08-20 Eli Zaretskii <eliz@gnu.org>
3672
3673 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3674 and later about non-assignments with no effect. See discussion at
3675 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3676 details.
3677
e46f2325
DA
36782012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3679
3680 Inline setter functions for Lisp_Objects slots of struct specbinding.
3681 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3682 Adjust users.
3683
734fbd86
MR
36842012-08-20 Martin Rudalics <rudalics@gmx.at>
3685
3686 * window.c (select_window): Always make selected window's buffer
3687 current.
3688
f1a95992
DA
36892012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3690
3691 Use AREF and ASET for docstrings of category tables.
3692 * category.h (CATEGORY_DOCSTRING): Use AREF.
3693 (SET_CATEGORY_DOCSTRING): Use ASET.
3694 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3695
e83064be
DA
36962012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3697
3698 Inline setter functions for hash table members.
3699 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3700 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3701 (set_hash_key_and_value, set_hash_index, set_hash_next)
3702 (set_hash_hash): New functions.
3703 * charset.c, fns.c: Adjust users.
3704
4ce60d2e
DA
37052012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3706
3707 Inline getter and setter functions for per-buffer values.
3708 * buffer.h (per_buffer_default, set_per_buffer_default)
3709 (per_buffer_value, set_per_buffer_value): New functions.
3710 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3711 * buffer.c, data.c: Adjust users.
3712
c06c9690
JB
37132012-08-20 Juanma Barranquero <lekktu@gmail.com>
3714
3715 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3716
32bd4250
PE
37172012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3718
bad03192 3719 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
3720 as gnulib does this if the system doesn't.
3721 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
3722 Remove declaration. MS-Windows declares it on stdlib.h which is
3723 included by conf_post.h.
b69a6d22
PE
3724 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3725 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3726 * vm-limit.c: Include <unistd.h>, for 'environ'.
3727
22d7feb2
PE
3728 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3729 (start_of_data): Remove decl; mem-limits.h provides it.
3730
32bd4250
PE
3731 * xdisp.c (handle_invisible_prop): Make it a bit faster
3732 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3733
450809af
CY
37342012-08-19 Chong Yidong <cyd@gnu.org>
3735
3736 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3737 ends (Bug#3874).
3738
9e677988
AS
37392012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3740
6b1319ce
AS
3741 * .gdbinit: Use call instead of set when calling a function in the
3742 inferior.
3743
9e677988
AS
3744 * data.c (set_internal): Don't use set_blv_found.
3745 (Fkill_local_variable): Likewise.
3746
d7191076
AA
37472012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3748
3749 * nsfont.m (ns_ascii_average_width): Ensure the string
3750 ascii_printable is initialized with a null-terminated character
3751 array. Otherwise, it can contain undesired extra characters.
3752
e757f1c6
PE
37532012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3754
3755 port new setting code to Sun C 5.8 2005/10/13
3756 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3757 Return void, not Lisp_Object. Otherwise, the compiler
3758 complains about (A?B:C) where B is void and C is Lisp_Object
3759 when compiling CHAR_TABLE_SET, due to the recent change to
3760 the API of sub_char_table_set_contents.
3761
a999ce26
CY
37622012-08-18 Chong Yidong <cyd@gnu.org>
3763
3764 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3765 for the string case (Bug#3874).
3766
3f22b86f
PE
37672012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3768
39eb03f1
PE
3769 * buffer.h (BSET): Remove (Bug#12215).
3770 Replace all uses with calls to new setter functions.
3771 (bset_bidi_paragraph_direction, bset_case_canon_table)
3772 (bset_case_eqv_table, bset_directory, bset_display_count)
3773 (bset_display_time, bset_downcase_table)
3774 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3775 (bset_last_selected_window, bset_local_var_alist)
3776 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3777 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3778 (bset_width_table):
3779 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3780 (bset_auto_fill_function, bset_auto_save_file_format)
3781 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3782 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3783 (bset_cache_long_line_scans, bset_case_fold_search)
3784 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3785 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3786 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3787 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3788 (bset_header_line_format, bset_indicate_buffer_boundaries)
3789 (bset_indicate_empty_lines, bset_invisibility_spec)
3790 (bset_left_fringe_width, bset_major_mode, bset_mark)
3791 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3792 (bset_name, bset_overwrite_mode, bset_pt_marker)
3793 (bset_right_fringe_width, bset_save_length)
3794 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3795 (bset_scroll_up_aggressively, bset_selective_display)
3796 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3797 (bset_word_wrap, bset_zv_marker):
3798 * category.c (bset_category_table):
3799 * syntax.c (bset_syntax_table):
3800 New setter functions.
3801
6a09a33b
PE
3802 * process.h (PSET): Remove (Bug#12215).
3803 Replace all uses with calls to new setter functions.
3804 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3805 (PROCESS_INLINE): New macro.
3806 (pset_childp): New setter function.
3807 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3808 * process.c (PROCESS_INLINE):
3809 Define to EXTERN_INLINE, so that the corresponding functions
3810 are compiled into code.
3811 (pset_buffer, pset_command, pset_decode_coding_system)
3812 (pset_decoding_buf, pset_encode_coding_system)
3813 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3814 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3815 (pset_type, pset_write_queue): New setter functions.
3816
e8c17b81
PE
3817 * window.h (WSET): Remove (Bug#12215).
3818 Replace all uses with calls to new setter functions.
3819 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3820 (WINDOW_INLINE): New macro.
3821 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3822 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3823 (wset_total_lines, wset_vertical_scroll_bar)
3824 (wset_window_end_pos, wset_window_end_valid)
3825 (wset_window_end_vpos): New setter functions.
3826 * window.c (WINDOW_INLINE):
3827 Define to EXTERN_INLINE, so that the corresponding functions
3828 are compiled into code.
3829 (wset_combination_limit, wset_dedicated, wset_display_table)
3830 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3831 (wset_new_normal, wset_new_total, wset_next_buffers)
3832 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3833 (wset_prev_buffers, wset_right_fringe_width)
3834 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3835 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3836 (wset_window_parameters):
3837 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3838 (wset_column_number_displayed, wset_region_showing):
3839 New setter functions.
3840
3f22b86f
PE
3841 * termhooks.h (TSET): Remove (Bug#12215).
3842 Replace all uses with calls to new setter functions.
3843 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3844 (TERMHOOKS_INLINE): New macro.
3845 (tset_charset_list, tset_selection_alist): New setter functions.
3846 * terminal.c (TERMHOOKS_INLINE):
3847 Define to EXTERN_INLINE, so that the corresponding functions
3848 are compiled into code.
3849 (tset_param_alist): New setter function.
3850
742af32f
PE
38512012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3852
15dbb4d6
PE
3853 * keyboard.h (KSET): Remove (Bug#12215).
3854 Replace all uses with calls to new setter functions.
3855 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3856 (KEYBOARD_INLINE): New macro.
3857 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3858 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3859 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3860 New setter functions.
3861 * keyboard.c (KEYBOARD_INLINE):
3862 Define to EXTERN_INLINE, so that the corresponding functions
3863 are compiled into code.
3864 (kset_echo_string, kset_kbd_queue)
3865 (kset_keyboard_translate_table, kset_last_prefix_arg)
3866 (kset_last_repeatable_command, kset_local_function_key_map)
3867 (kset_overriding_terminal_local_map, kset_real_last_command)
3868 (kset_system_key_syms): New setter functions.
3869
f00af5b1
PE
3870 * frame.h (FSET): Remove (Bug#12215).
3871 Replace all uses with calls to new setter functions.
3872 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3873 (FRAME_INLINE): New macro.
3874 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3875 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3876 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3877 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3878 (fset_param_alist, fset_root_window, fset_scroll_bars)
3879 (fset_selected_window, fset_title, fset_tool_bar_items)
3880 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3881 * frame.c (FRAME_INLINE):
3882 Define to EXTERN_INLINE, so that the corresponding functions
3883 are compiled into code.
3884 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3885
0c94c8d6
PE
3886 A few more naming-convention fixes for getters and setters.
3887 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3888 and rename from buffer_overlays_set_before.
3889 (set_buffer_overlays_after): Move here from buffer.h, and rename
3890 from buffer_overlays_set_after.
3891 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3892 All uses changed.
3893 (set_buffer_intervals): Rename from buffer_set_intervals.
3894 * intervals.c (set_interval_object): Move here from intervals.h,
3895 and rename from interval_set_object.
3896 (set_interval_left): Move here from intervals.h, and rename from
3897 interval_set_left.
3898 (set_interval_right): Move here from intervals.h, and rename from
3899 interval_set_right.
3900 (copy_interval_parent): Move here from intervals.h, and rename from
3901 interval_copy_parent.
3902 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3903 (set_interval_plist): Rename from interval_set_plist.
3904 Return void, not Lisp_Object, since no caller uses the result.
3905 * lisp.h (string_intervals): Rename from string_get_intervals.
3906 (set_string_intervals): Rename from string_set_intervals.
3907
34dabdb7
PE
3908 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3909 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 3910 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
3911 All uses changed. See the end of
3912 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3913
742af32f
PE
3914 * lisp.h (CSET): Remove (Bug#12215).
3915 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3916 (set_char_table_purpose): New functions,
3917 replacing CSET. All uses changed. For example, replace
3918 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 3919 "set_char_table_parent (char_table, parent);".
742af32f
PE
3920 The old version was confusing because it used the same name
3921 'parent' for two different things.
3922
a04e2c62
DA
39232012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3924
3925 Functions to get and set Lisp_Object fields of buffer-local variables.
3926 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3927 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3928 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3929 * data.c, eval.c, frame.c: Adjust users.
3930
383dcbf9
CY
39312012-08-17 Chong Yidong <cyd@gnu.org>
3932
3933 * xfaces.c (merge_face_vectors): If the target font specfies a
3934 font spec, make the font's attributes take precedence over
3935 directly-specified attributes.
3936 (merge_face_ref): Recognize :font.
3937
44386687
DA
39382012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3939
3940 Do not use memcpy for copying intervals.
3941 * intervals.c (reproduce_interval): New function.
3942 (reproduce_tree, reproduce_tree_obj): Use it.
3943 (reproduce_tree_obj): Remove prototype.
3944
927c7216
PE
39452012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3946
3947 * lisp.h (duration_to_sec_usec): Remove unused decl.
3948
93044f7b
AA
39492012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3950
3951 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3952 to an allocated instance of NSString, not to the class itself.
3953
9851e4a5
JB
39542012-08-17 Juanma Barranquero <lekktu@gmail.com>
3955
3956 * makefile.w32-in (C_CTYPE_H): New macro.
3957 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3958 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3959 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3960
620f13b0
PE
39612012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3962
3963 Use ASCII tests for character types.
3964 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3965 * xfns.c, xterm.c:
3966 Don't include <ctype.h>; was not needed.
3967 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3968 * sysdep.c, xfaces.c:
3969 Include <c-ctype.h> instead of <ctype.h>.
3970 * nsterm.m: Include <c-ctype.h>.
3971 * charset.c (read_hex):
3972 * doc.c (Fsnarf_documentation):
3973 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3974 (DRIVE_LETTER) [DOS_NT]:
3975 (Ffile_name_directory, Fexpand_file_name)
3976 (Fsubstitute_in_file_name):
3977 * font.c (font_parse_xlfd, font_parse_fcname):
3978 * frame.c (x_set_font_backend):
3979 * gtkutil.c (xg_get_font):
3980 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3981 * nsimage.m (hexchar):
3982 * nsterm.m (ns_xlfd_to_fontname):
3983 * sysdep.c (system_process_attributes):
3984 * xfaces.c (hash_string_case_insensitive):
3985 Use C-locale tests instead of locale-specific tests for character
3986 types, since we want the ASCII interpretation here, not the
3987 interpretation suitable for whatever happens to be the current locale.
3988
52162052
MR
39892012-08-16 Martin Rudalics <rudalics@gmx.at>
3990
3991 Consistently check windows for validity/liveness
3992 (Bug#11984, Bug#12025, Bug#12026).
3993 * lisp.h (CHECK_VALID_WINDOW): New macro.
3994 * window.c (decode_window): Rename to decode_live_window.
3995 (decode_valid_window, Fwindow_valid_p): New functions.
3996 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3997 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3998 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3999 (Fwindow_prev_sibling, Fwindow_combination_limit)
4000 (Fset_window_combination_limit, Fwindow_use_time)
4001 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4002 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4003 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4004 (Fwindow_hscroll, Fset_window_hscroll)
4005 (Fwindow_redisplay_end_trigger)
4006 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4007 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4008 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4009 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4010 (Fwindow_end, Fset_window_point, Fset_window_start)
4011 (Fpos_visible_in_window_p, Fwindow_line_height)
4012 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4013 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4014 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4015 (Fset_window_parameter, Fwindow_display_table)
4016 (Fset_window_display_table, Fdelete_other_windows_internal)
4017 (Fset_window_buffer, Fset_window_new_total)
4018 (Fset_window_new_normal, Fdelete_window_internal)
4019 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4020 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4021 (Fwindow_scroll_bars): Check whether argument window is a valid or
4022 live window. Update doc-strings.
4023 (syms_of_window): New symbol Qwindow_valid_p.
4024 * keyboard.c (Fposn_at_x_y): Check whether argument
4025 frame_or_window denotes a valid window.
4026
2751c80f
DA
40272012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4028
4029 Fix previous char table change.
4030 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4031 * chartab.c (optimize_sub_char_table): Likewise.
4032
032a42c8
CY
40332012-08-16 Chong Yidong <cyd@gnu.org>
4034
a2d19368
CY
4035 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4036
032a42c8
CY
4037 * xfont.c (xfont_open):
4038 * xftfont.c (xftfont_open): Set the font's max_width field.
4039
4040 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4041 min_width to space_width and average_width to the average over
4042 printable ASCII characters.
4043 (ns_char_width): Code cleanup.
4044 (ns_ascii_average_width): New utility function.
4045
4046 * font.h (struct font): Update comments.
4047
a098c930
DA
40482012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4049
032a42c8 4050 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
4051 * lisp.h (CSET): New macro.
4052 (char_table_set_extras, char_table_set_contents)
4053 (sub_char_table_set_contents): New function.
4054 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4055 * syntax.c: Adjust users.
4056
8be3a09c
SM
40572012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4058
4059 * eval.c (eval_sub): Bind lexical-binding.
4060 * lread.c (Qlexical_binding): Make non-static.
4061
ac4845a6
JD
40622012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4063
ddee6515
JD
4064 * nsmenu.m (popupSession): Remove.
4065 (pop_down_menu): Remove endModalSession.
4066 (timeout_handler:): New method.
4067 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4068 Call runModalForWindow. Check timer_fired when it returns.
4069 If not set, cancel timer and break out of loop.
4070 Otherwise loop again, with a new timeout.
4071
4072 * nsterm.m: Include fcntl.h if present.
4073 (fd_entry, t_readfds, inNsSelect): Remove.
4074 (select_writefds, select_valid, select_timeout, selfds)
4075 (select_mutex, apploopnr): Add.
4076 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4077 Otherwise call kbd_buffer_store_event.
4078 (ns_send_appdefined): Remove release of fd_entry.
4079 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4080 Increment and decrement apploopnr.
4081 (ns_select): If no file descriptors, just do a NSTimer.
4082 Otherwise copy read/write masks and start select thread (fd_handler).
4083 Start main loop and wait for application defined event.
4084 Inform select thread to stop selecting after main loop is exited.
4085 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 4086 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
4087 (fd_handler:): Loop forever, wait for info from the main thread
4088 to either start or stop selecting. When select returns, send
4089 and appdefined event.
4090 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4091 If not call kbd_buffer_store_event.
4092
4093 * nsterm.h (EmacsApp): fd_handler takes id argument.
4094 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4095
ac4845a6
JD
4096 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4097
eb424fe3
EZ
40982012-08-15 Eli Zaretskii <eliz@gnu.org>
4099
4100 * region-cache.c (move_cache_gap): Update gap_len using the actual
4101 growth of the boundaries array. Do not change cache_len.
4102 (Bug#12196)
4103
4e6a86c6
DA
41042012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4105
4106 Generalize and cleanup font subsystem checks.
4107 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
4108 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4109 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 4110
5bf192ca
DA
41112012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4112
4113 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4114
f2045622
CY
41152012-08-15 Chong Yidong <cyd@gnu.org>
4116
8be3a09c
SM
4117 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4118 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4119 extract the font descriptor instead of just the font name.
4120 In that case, return a font spec instead of a string.
f2045622
CY
4121 (x_last_font_name): Move to this file from xfns.c.
4122
4123 * xfns.c (Fx_select_font): The return value can also be a font
4124 spec. Move x_last_font_name management to gtkutil.c.
4125
4126 * xfaces.c: Make font weight and style symbols non-static.
4127
7f6feb56
SM
41282012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4129
4130 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4131 (bug#12117).
4132
fecbd8ff
SM
41332012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4134
4135 * alloc.c (Fgarbage_collect): Use plural form consistently.
4136
9b8d5165
EZ
41372012-08-14 Eli Zaretskii <eliz@gnu.org>
4138
4139 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4140 iteration through the command loop. Fixes a problem whereby mouse
4141 movements are ignored until the first mouse click.
4142
f5d9e83a
PE
41432012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4144
4145 Use bool, not int, for Lisp booleans.
4146 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4147 makes Emacs a bit smaller and presumably a bit faster.
4148 * lisp.h: Include <stdbool.h>.
4149 (struct Lisp_Boolfwd, defvar_bool):
4150 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4151 * regex.c [!emacs]: Include <stdbool.h>.
4152 (false, true): Remove; <stdbool.h> does this for us now.
4153
55802e4a
CY
41542012-08-14 Chong Yidong <cyd@gnu.org>
4155
4abcdac8
CY
4156 * character.c (Fcharacterp): Doc fix (Bug#12076).
4157
4158 * data.c (Findirect_variable): Doc fix (Bug#11040).
4159
55802e4a
CY
4160 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4161
4162 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 4163 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 4164
8e99d072
BR
41652012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4166
4167 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4168 (bug#12022).
4169
08908aca
MR
41702012-08-14 Martin Rudalics <rudalics@gmx.at>
4171
4172 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4173 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4174 * minibuf.c (choose_minibuf_frame, read_minibuf):
4175 * w32fns.c (x_create_tip_frame):
4176 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4177 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4178
56120d6f
PE
41792012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4180
4181 * intervals.c (offset_intervals): Remove obsolete comment.
4182
67b77c0b
AS
41832012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4184
4185 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4186
f48b82fd
GR
41872012-08-14 Gergely Risko <gergely@risko.hu>
4188
4189 * coding.c (decode_coding): Record buffer modification before
4190 disabling undo_list (Bug#11773).
4191
fd318b54
DA
41922012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4193
4194 Revert and cleanup some recent overlay changes.
4195 * buffer.h (enum overlay_type): Remove.
4196 (buffer_get_overlays, buffer_set_overlays): Likewise.
4197 (buffer_set_overlays_before, buffer_set_overlays_after):
4198 New function. Adjust users.
4199 (unchain_both): Add eassert.
4200
41a62dd9
DA
42012012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4202
4203 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4204
5884c324
PE
42052012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4206
4207 * gtkutil.c (xg_mark_data): Don't assume C99.
4208
ca06f160
JD
42092012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4210
4211 * gtkutil.c (xg_frame_tb_info): New struct.
4212 (TB_INFO_KEY): New define.
4213 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4214 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4215 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4216 if not present.
4217 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 4218 is up to date. Otherwise store new data.
ca06f160
JD
4219 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4220
7864a3f7
DA
42212012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4222
4223 Use KSET for write access to Lisp_Object members of struct kboard.
4224 * keyboard.h (KSET): New macro.
4225 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4226 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4227 * xterm.c: Adjust users.
4228
4c31be61
DA
42292012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4230
4231 Use BSET for write access to Lisp_Object members of struct buffer.
4232 * buffer.h (BSET): New macro.
4233 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4234 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4235 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4236 * window.c, xdisp.c, xfns.c: Adjust users.
4237
14ae4239
BT
42382012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4239
4240 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4241
32bcadb4
JD
42422012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4243
3d29b2ce 4244 * nsterm.m (not_in_argv): New function.
fc0c31f8 4245 (application:openFile, application:openTempFile:):
3d29b2ce
JD
4246 (application:openFileWithoutUI:, application:openFiles:): Open file
4247 if not_in_argv returns non-zero (bug#12171).
4248
32bcadb4 4249 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
4250 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4251 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
4252 (xg_get_font_name): Use those functions/macros here.
4253 Reported by Frans Oilinki <moilinki@gmail.com>.
4254
9ff9402d 42552012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
4256
4257 * unexmacosx.c (copy_data_segment): Copy initialized data in
4258 statically linked libraries from input file rather than memory.
4259
db74a5fc
YM
4260 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4261 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4262 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4263
25e65510
GM
42642012-08-10 Glenn Morris <rgm@gnu.org>
4265
4266 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4267 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4268
7961135c
DA
42692012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4270
4271 Fix last change to allow compilation with low optimization levels.
4272 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4273 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4274
42b3a444
DA
42752012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4276
4277 Use common inline syntax in intervals.h.
4278 * intervals.h (INTERVALS_INLINE): New macro.
4279 Change all users from LISP_INLINE.
4280
9fb0c957
DA
42812012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4282
4283 Define Qnone once for all platforms.
4284 * frame.c (Qnone): Define here.
4285 (syms_of_frame): DEFSYM it.
4286 * lisp.h (Qnone): New declaration.
4287 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4288 * xfns.c: Remove duplication. Adjust users.
4289
65e8ee52
DA
42902012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4291
4292 Remove unused macros from intervals.h.
4293 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4294 * intervals.c: Adjust comment.
4295
9b855fd6
EZ
42962012-08-10 Eli Zaretskii <eliz@gnu.org>
4297
4298 * w32fns.c <w32_unicode_gui>: New static variable.
4299 (globals_of_w32fns): Initialize it according to os_subtype.
4300 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4301 testing os_subtype.
4302
39cb9e56 43032012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
4304 Eli Zaretskii <eliz@gnu.org>
4305
4306 Fix bug #10299 with Unicode characters sent by customized
4307 keyboards created by MSKLC.
4308 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4309 (w32_init_class): Use it to initialize the Emacs class with either
4310 ANSI or Unicode API calls.
4311 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4312 later.
4313 (w32_wnd_proc): If the character code sent by WM_CHAR or
4314 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4315 original message. Call DefWindowProcW on NT and later.
4316
9374581a
GM
43172012-08-10 Glenn Morris <rgm@gnu.org>
4318
4b94e8cf
GM
4319 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4320
9374581a
GM
4321 * lisp.h (DIRECTORY_SEP): Let configure set it.
4322
a2752828
DA
43232012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4324
4325 Use TSET for write access to Lisp_Object slots of struct terminal.
4326 * termhooks.h (TSET): New macro.
4327 * coding.c, terminal.c, xselect.c: Adjust users.
4328
cc92c454
SM
43292012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4330
4331 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4332 the failing expression, include them in the error message.
4333 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4334 * lisp.h (internal_condition_case_n): Update declaration.
4335
4cb3e6b3
DA
43362012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4337
4338 Inline functions to examine and change buffer overlays.
4339 * buffer.c (unchain_both): New function.
4340 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4341 (buffer_has_overlays): New function.
4342 (enum overlay_type): New enum.
4343 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4344 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4345
8707c1e5
DA
43462012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4347
4348 Inline functions to examine and change buffer intervals.
4349 * alloc.c (mark_interval_tree): Remove.
4350 (MARK_INTERVAL_TREE): Simplify.
4351 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4352 * intervals.c (buffer_balance_intervals): New function.
4353 (graft_intervals_into_buffer): Adjust indentation.
4354 (set_intervals_multibyte): Simplify.
4355 * buffer.h (BUF_INTERVALS): Remove.
4356 (buffer_get_intervals, buffer_set_intervals): New function.
4357 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4358 * intervals.c, textprop.c: Adjust users.
4359
ad8c997f
DA
43602012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4361
4362 Inline functions to examine and change string intervals.
4363 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4364 (string_get_intervals, string_set_intervals): New function.
4365 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4366 * lread.c, print.c, textprop.c: Adjust users.
4367
32ac3a6b
GM
43682012-08-08 Glenn Morris <rgm@gnu.org>
4369
4370 * lisp.mk (lisp): Remove language/persian.elc.
4371
77c7bcb1
DA
43722012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4373
4374 Cleanup intervals.
4375 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4376 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
4377 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4378 Adjust comment. Move under #if 0.
77c7bcb1
DA
4379 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4380 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4381
9c08a8d4
DA
43822012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4383
4384 Check total length of intervals with eassert.
4385 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4386 * intervals.c: Change all users to eassert.
4387
26d16b35
EZ
43882012-08-07 Eli Zaretskii <eliz@gnu.org>
4389
14ae4239
BT
4390 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4391 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
4392 INTERNAL_FIELD in Lisp_Cons.
4393
c644523b
DA
43942012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4395
4396 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4397 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4398 name since all xname users are fixed long time ago. Do not
4399 use INTERNAL_FIELD.
4400 (set_symbol_name, set_symbol_function, set_symbol_plist):
4401 (set_symbol_next, set_overlay_plist): New function.
4402 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4403 (struct Lisp_Overlay): Likewise.
4404 (CVAR, MVAR, SVAR): Remove.
4405 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4406 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4407 * xterm.c: Adjust users.
4408 * .gdbinit: Change to use name field of struct Lisp_Symbol
4409 where appropriate.
4410
6a3d20cc
DA
44112012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4412
4413 Basic functions to set Lisp_Object and pointer slots of intervals.
4414 * intervals.h (interval_set_parent, interval_set_object):
4415 (interval_set_left, interval_set_right, interval_set_plist):
4416 (interval_copy_parent): New function.
4417 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
4418 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4419 Adjust indentation.
6a3d20cc
DA
4420 (INTERVAL_SIZE): Remove. Adjust users.
4421 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4422
4d2b044c
DA
44232012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4424
4425 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4426 * process.h (PGET): Remove.
4427 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4428 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4429
d3d50620
DA
44302012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4431
4432 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4433 * window.h (WGET): Remove.
4434 (struct window): Do not use INTERNAL_FIELD.
4435 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4436 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4437 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4438 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4439 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4440 Adjust users.
4441
d10a51dc
CY
44422012-08-07 Chong Yidong <cyd@gnu.org>
4443
4444 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4445 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4446 (Fdelete_window_internal): Signal an error if the window is not on
4447 a live frame (Bug#12025).
4448
e69b0960
DA
44492012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4450
4451 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4452 * frame.h (FGET): Remove.
4453 (struct frame): Do not use INTERNAL_FIELD.
4454 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4455 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4456 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4457 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4458
25a20a3a
JB
44592012-08-06 Juanma Barranquero <lekktu@gmail.com>
4460
4461 * w32.c: Silence compiler warnings.
4462 (map_w32_filename): Remove unused variable `is_fat'.
4463 (chase_symlinks): Add parentheses around expression.
4464
1c6f11f4
GM
44652012-08-06 Glenn Morris <rgm@gnu.org>
4466
1db4583a
GM
4467 * sysdep.c: Respect BROKEN_GETWD.
4468
1c6f11f4
GM
4469 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4470 Let configure handle it.
4471 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4472
2b90362b
DA
44732012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4474
4475 Use GCALIGNMENT where appropriate.
4476 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4477 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4478 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4479
5f50daf2
EZ
44802012-08-06 Eli Zaretskii <eliz@gnu.org>
4481
14ae4239
BT
4482 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4483 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 4484
cbcc7007
SM
44852012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4486
4487 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4488 that should be sufficient for everyone.
4489
4d365fa4
JD
44902012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4491
4492 * keyboard.c (timer_check_2): Add break so timer_check returns next
4493 timeout.
4494
dd86bd82
DA
44952012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4496
4497 Fix Windows build errors introduced after converting to WGET and WSET.
4498 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4499 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4500
054e1668
JD
45012012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4502
4503 * nsterm.m (ns_frame_rehighlight): Use FSET.
4504
4505 * nsmenu.m (ns_update_menubar): Use FSET.
4506
21238f11
DA
45072012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4508
4509 Separate read and write access to Lisp_Object slots of Lisp_Process.
4510 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4511 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4512
077288cf
DA
45132012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4514
4515 Separate read and write access to Lisp_Object slots of struct window.
4516 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4517 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4518 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4519 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4520 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4521 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4522 Adjust users.
4523
71688bd7
DA
45242012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4525
4526 Fix Windows build errors introduced after converting to FGET and FSET.
4527 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4528 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4529 (w32_judge_scroll_bars): Change to use FSET.
4530 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4531
f99bac93
DA
45322012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4533
4534 Fix replacement typo.
4535 * window.c (replace_window): Set root_window instead of
4536 selected_window. This fixes a total window subsystem
4537 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4538
8c2a0f2d
GM
45392012-08-06 Glenn Morris <rgm@gnu.org>
4540
4541 * lisp.mk (lisp): Add language/persian.elc.
4542
edd74c35
DA
45432012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4544
4545 Separate read and write access to Lisp_Object slots of struct frame.
4546 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4547 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4548 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4549 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4550 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4551
8671676c
AS
45522012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4553
4554 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4555
663e2b3f
DA
45562012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4557
4558 Generalize common compile-time constants.
4559 * lisp.h (header_size, bool_header_size, word_size): Now here.
4560 (struct Lisp_Vector): Add comment.
4561 (struct Lisp_Bool_Vector): Move up to define handy constants.
4562 (VECSIZE, PSEUDOVECSIZE): Simplify.
4563 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4564 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4565 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4566 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4567 * xfont.c, xmenu.c: Use word_size where appropriate.
4568
d32e47af
LM
45692012-08-05 Lawrence Mitchell <wence@gmx.li>
4570
4571 * search.c (Freplace_match): Treat \? in the replacement text
4572 literally (Bug#8161).
4573
e5d9c0d1
CY
45742012-08-05 Chong Yidong <cyd@gnu.org>
4575
4576 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4577 * frame.c (Vdelete_frame_functions):
4578 * emacs.c (Vkill_emacs_hook): Doc fix.
4579
8da0576b
EZ
45802012-08-04 Eli Zaretskii <eliz@gnu.org>
4581
4582 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4583 --with-x-toolkit=no builds.
4584 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4585
02676e5d
CY
45862012-08-04 Chong Yidong <cyd@gnu.org>
4587
4588 * syntax.c (Fmodify_syntax_entry): Doc fix.
4589
97147da9
EZ
45902012-08-04 Eli Zaretskii <eliz@gnu.org>
4591
76151e2c
EZ
4592 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4593 * w32.c (init_environment): Change the default values of many
4594 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
4595 them into environment when they were not already defined.
4596 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 4597 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
4598 (check_windows_init_file): Now external, not static.
4599 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
4600 called when Vload_path is already set up.
4601
4602 * w32.h (check_windows_init_file): Add prototype.
4603
4604 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4605 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4606 compatibility with Posix platforms.
4607 (main): Move the call to check_windows_init_file to here from
4608 w32.c.
4609 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4610 any, in the DEFALT argument into the root of the Emacs build or
4611 installation tree, as appropriate.
4612
4613 * callproc.c (init_callproc_1): Call decode_env_path instead of
4614 doing its equivalent by hand.
4615 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4616 the code that sets Vexec_path run on MS-Windows.
4617
4618 * lread.c (init_lread): Add comments to #ifdef's.
4619
97147da9
EZ
4620 * msdos.c (dos_set_window_size, IT_update_begin)
4621 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4622 instead of direct references.
4623
185ee146
PE
46242012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4625
4626 Export DEFAULT_REHASH_* to GDB.
4627 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4628 Now constants, not macros.
4629
8834c57a
PE
46302012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4631
98c6f1e3
PE
4632 Remove unnecessary casts involving pointers.
4633 These casts are no longer needed now that we assume C89 or later,
4634 since they involve casting to or from void *.
4635 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4636 (make_pure_float, make_pure_vector):
4637 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4638 * macros.c (Fstart_kbd_macro):
4639 * menu.c (find_and_return_menu_selection):
4640 * minibuf.c (read_minibuf_noninteractive):
4641 * sysdep.c (closedir):
4642 * xdisp.c (x_produce_glyphs):
4643 * xfaces.c (compare_fonts_by_sort_order):
4644 * xfns.c (x_real_positions, select_visual):
4645 * xselect.c (x_stop_queuing_selection_requests)
4646 (x_get_window_property, x_get_window_property_as_lisp_data):
4647 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4648 Remove unnecessary pointer casts.
4649 * alloc.c (record_xmalloc): New function.
4650 * lisp.h (record_xmalloc): New decl.
4651 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4652 more like a function. This is because the pointer cast is not
4653 needed. All uses changed.
4654 * print.c (print_string, print_error_message): Avoid length recalc.
4655
8834c57a
PE
4656 Improve fix for macroexp crash with debugging (Bug#12118).
4657 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4658 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4659 not supposed to be invoked from the garbage collector.
4660 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4661 (gc_aset): New function, which is like ASET but can be
4662 used in the garbage collector.
4663 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4664 (set_hash_index): Use it instead of ASET.
4665
6dad7178
EZ
46662012-08-03 Eli Zaretskii <eliz@gnu.org>
4667
4668 Support symlinks on latest versions of MS-Windows.
4669 * w32.c: Include winioctl.h and aclapi.h.
4670 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4671 (revert_to_self): Forward declarations of static functions.
4672 <static BOOL g_b_init_get_security_info>:
4673 <g_b_init_create_symbolic_link>: New static flags.
4674 (globals_of_w32): Initialize them to zero.
4675 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4676 (map_w32_filename): Improve commentary. Simplify switch.
4677 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4678 headers (most versions of MinGW w32api don't).
4679 (get_security_info, create_symbolic_link)
4680 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4681 New functions.
4682 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4683 in the argument file name.
4684 (sys_access): Call unc_volume_file_attributes only if
4685 GetFileAttributes fails with network-related error codes.
4686 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4687 have the required privileges.
14ae4239 4688 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
4689 get_file_security_desc.
4690 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
4691 with addition of handling of symlinks and support for 'lstat'.
4692 If possible, get file's attributes and security information by
6dad7178
EZ
4693 handle, not by name. Produce S_IFLNK bit for symlinks, when
4694 called from 'lstat'.
4695 (stat, lstat): New functions, call 'stat_worker'.
4696 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4697 symlinks when the underlying filesystem supports them.
4698
f162bcc3
PE
46992012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4700
79ea6c20
PE
4701 Fix macroexp crash on Windows with debugging (Bug#12118).
4702 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4703 checking subscripts; problem introduced with the recent
4704 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4705 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4706 since it's used in non-static inline functions now.
4707
c0ce93fd
PE
4708 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4709 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 4710
f162bcc3
PE
4711 Use C99-style 'extern inline' if available.
4712 * buffer.h (BUFFER_INLINE):
4713 * category.h (CATEGORY_INLINE):
4714 * character.h (CHARACTER_INLINE):
4715 * charset.h (CHARSET_INLINE):
4716 * composite.h (COMPOSITE_INLINE):
4717 * dispextern.h (DISPEXTERN_INLINE):
4718 * lisp.h (LISP_INLINE):
4719 * systime.h (SYSTIME_INLINE):
4720 New macro, replacing 'static inline' in this header.
4721 * buffer.h, category.h, character.h, charset.h, composite.h:
4722 * dispextern.h, lisp.h, systime.h:
4723 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4724 * alloc.c (LISP_INLINE):
4725 * buffer.c (BUFFER_INLINE):
4726 * category.c (CATEGORY_INLINE):
4727 * character.c (CHARACTER_INLINE):
4728 * charset.c (CHARSET_INLINE):
4729 * composite.c (COMPOSITE_INLINE):
4730 * dispnew.c (DISPEXTERN_INLINE):
4731 * sysdep.c (SYSTIME_INLINE):
4732 Define to EXTERN_INLINE, so that the corresponding functions
4733 are compiled into code.
4734 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4735 (INLINE_HEADER_END): New macros.
4736 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4737 since it's used in non-static inline functions now.
a8333d03 4738 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 4739
837b365b
GM
47402012-08-02 Glenn Morris <rgm@gnu.org>
4741
d66b744d
GM
4742 * s/: Remove empty directory.
4743
837b365b
GM
4744 * s/ms-w32.h: Move to ../nt/inc.
4745 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4746 Update for new ms-w32.h location.
4747
13294f95
PE
47482012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4749
4750 Port to Solaris 8.
4751 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4752
90df0db3
GM
47532012-08-02 Glenn Morris <rgm@gnu.org>
4754
4755 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4756 hard-coding the path separator.
4757
4939150c
PE
47582012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4759
4760 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4761 This how ASET and AREF are supposed to work, and makes
4762 it easier to think about future improvements. See
4763 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4764 * charset.h (set_charset_attr): New function.
4765 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4766 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4767 (aref_addr): New function. All uses of &AREF(...) changed.
4768 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4769 (set_hash_index): New functions. All lvalue-style uses of
4770 HASH_KEY etc. changed.
4771 * keyboard.c (set_prop): New function. All lvalue-style uses
4772 of PROP changed.
4773
947b2afd
AA
47742012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4775
4776 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4777 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 4778 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
4779 * nsfns.m (ns_set_name_as_filename): Likewise.
4780 * nsmenu.m (ns_update_menubar): Likewise.
4781 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4782
4f5d0325
EZ
47832012-08-01 Eli Zaretskii <eliz@gnu.org>
4784
2008beae
EZ
4785 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4786 Adapt to latest changes in field names of the corresponding Lisp
288479f6 4787 objects.
2008beae 4788
4f5d0325
EZ
4789 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4790
fe3cc771
GM
47912012-08-01 Glenn Morris <rgm@gnu.org>
4792
4793 * s/msdos.h: Remove file.
4794 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4795 * Makefile.in (S_FILE): Remove.
4796 (config_h): Remove S_FILE.
4797
c90acc54
JB
47982012-08-01 Juanma Barranquero <lekktu@gmail.com>
4799
4800 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4801 Remove; moved to nt/config.nt.
4802
d8a05828
DA
48032012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4804
4805 Use INTERNAL_FIELD for conses and overlays.
4806 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4807 Remove obsolete comment.
4808 (MVAR): New macro.
4809 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4810 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4811
8271d590
DA
48122012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4813
4814 Use INTERNAL_FIELD for symbols.
4815 * lisp.h (SVAR): New macro. Adjust users.
4816 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4817 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4818
3193acd2
DA
48192012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4820
4821 Use INTERNAL_FIELD for processes.
4822 * process.h (PVAR): New macro. Adjust style.
4823 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4824 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4825
3a45383a
DA
48262012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4827
4828 Use INTERNAL_FIELD for windows.
4829 * window.h (WVAR): New macro.
4830 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4831 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4832 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4833 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4834 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4835 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4836
c1dbc63c
PE
48372012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4838
4839 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4840
5c0c0e8a
GM
48412012-08-01 Glenn Morris <rgm@gnu.org>
4842
4843 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4844 Move to configure.ac.
4845
552a99b4
JB
48462012-08-01 Juanma Barranquero <lekktu@gmail.com>
4847
4848 * makefile.w32-in (CONFIG_H): Update dependencies.
4849 (CONF_POST_H): New macro.
4850
4851 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4852
8d8e2dfe
GM
48532012-07-31 Glenn Morris <rgm@gnu.org>
4854
bc96620a
GM
4855 * Makefile.in (S_FILE): No longer set by configure.
4856
476b1b2d
GM
4857 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4858 is available.
4859 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4860
b2c7a106
GM
4861 * process.h (NULL_DEVICE):
4862 * emacs.c (SEPCHAR):
4863 * editfns.c (USER_FULL_NAME): Let configure set them.
4864
d53d062a
GM
4865 * s/README, s/template.h: Remove files.
4866
4515017f
GM
4867 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4868
8d8e2dfe
GM
4869 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4870 Move to configure.ac.
4871
5b20b3cc
EZ
48722012-07-31 Eli Zaretskii <eliz@gnu.org>
4873
1e0afd9a
EZ
4874 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4875 resulting renaming of 'struct frame' members.
4876
5b20b3cc
EZ
4877 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4878
4879 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4880 after introduction of FVAR.
4881
f1310128
JD
48822012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4883
79e721e0
JD
4884 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4885
4886 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4887 instead of compositeToPoint.
4888 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4889
8d7c7eed 4890 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 4891
e34f7f79
DA
48922012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4893
4894 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4895 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 4896 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
4897 (BVAR): Change to use INTERNAL_FIELD.
4898 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4899 (KVAR): Change to use INTERNAL_FIELD.
4900 * frame.h (FVAR): New macro.
4901 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
4902 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4903 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4904 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
4905 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4906
c09bfb2f
DA
49072012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4908
4909 Miscellaneous fixes for non-default X toolkits.
4910 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4911 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4912 Move under #ifdef USE_LUCID.
4913 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4914 definition and usage to avoid warnings.
4915
14c114ae
JD
49162012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4917
4918 * nsterm.m (openFiles): Fix previous checkin.
4919
3bd21e82
PE
49202012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4921
4922 * indent.c (compute_motion): Remove unused local.
4923
c1529ded
GM
49242012-07-31 Glenn Morris <rgm@gnu.org>
4925
400d5621
GM
4926 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4927
268e2432
GM
4928 * conf_post.h [USG5_4]:
4929 Move remaining contents of s/usg5-4-common.h here.
4930 * s/usg5-4-common.h: Remove file.
4931
7552f3ee
GM
4932 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4933 * s/irix6-5.h: Remove file.
4934
6a381852
GM
4935 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4936 * s/darwin.h: Remove file.
4937
c1529ded
GM
4938 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4939 * s/hpux10-20.h: Remove file, which is now empty.
4940
b429a4ee
GM
49412012-07-30 Glenn Morris <rgm@gnu.org>
4942
4943 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4944 * Makefile.in (config_h): Add conf_post.h.
4945 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4946
adff3182
JD
49472012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4948
4949 * nsterm.m (ns_do_open_file): New variable.
b9031d69 4950 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
4951 (openFile, openTempFile, openFileWithoutUI, openFiles):
4952 Open files only if ns_do_open_file.
adff3182 4953
c32af1e4
PE
49542012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4955
7393bcbb
PE
4956 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4957 This no-op macro hasn't been needed for many years.
4958 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4959
c32af1e4
PE
4960 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4961 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4962 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4963 gdb_make_enums_visible.
4964 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4965 (DIRECTORY_SEP): Now a constant, not a macro.
4966
302fc036
EZ
49672012-07-30 Eli Zaretskii <eliz@gnu.org>
4968
4969 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4970 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4971
4972 * w32term.c <w32_keyboard_codepage>: Renamed from
4973 keyboard_codepage and now external. All users changed.
4974
4975 * w32term.h: Add declaration of w32_keyboard_codepage.
4976
4977 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4978 the codepage to translate keys to Unicode. If this argument is
4979 -1, use the value returned by GetConsoleCP. All callers changed.
4980
88fb40b4
PE
49812012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4982
0aee6912
PE
4983 Update .PHONY listings in makefiles.
4984 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4985 bootstrap-clean, distclean, maintainer-clean, versioclean,
4986 extraclean, frc.
4987
88fb40b4
PE
4988 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4989 This is a bit clearer. Fix some commentary typos.
4990
0a763bd1
GM
49912012-07-30 Glenn Morris <rgm@gnu.org>
4992
32bac6d6
GM
4993 * s/netbsd.h: Let configure include signal.h if needed.
4994 Remove file, which is now empty.
4995
b65e7c46
GM
4996 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4997 Let configure set them.
4998 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4999 No more need to undefine.
0a763bd1 5000
169304bd
AS
50012012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5002
5003 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5004 non-single-byte char when adding meta modifier. (Bug#12090)
5005
6cd7a139
DA
50062012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5007
5008 Convert safe_call to use variable number of arguments.
5009 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5010 (safe_call2): Fix comment.
5011 * lisp.h (safe_call): Adjust prototype.
5012 * coding.c (encode_coding_object): Change to use safe_call2.
5013 * xfaces.c (merge_face_heights): Change to use safe_call1.
5014
d34d6ffc
GM
50152012-07-30 Glenn Morris <rgm@gnu.org>
5016
7b8a48e4 5017 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 5018 does that unconditionally. Remove file, which is now empty.
7b8a48e4 5019
d34d6ffc
GM
5020 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5021 Remove empty files.
5022
03a660a6
PE
50232012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5024
5025 Export to GDB most of lisp.h's remaining object-like macros.
5026 * lisp.h (min, max): Move earlier, because they're used earlier now.
5027 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5028 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5029 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5030 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5031 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5032 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5033 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5034 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5035 Now constants, for GDB. They need not be macros.
5036 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5037 Now constants, for GDB, as well as macros, for static initializers.
5038 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5039 Move to after the definition of struct Lisp_Char_Table,
5040 since the former now needs that type defined.
5041 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5042 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5043 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5044 New enums, for gdb_make_enums_visible.
5045 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 5046 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
5047 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5048 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5049 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5050 enum maxargs, enum MAX_ALLOCA.
5051 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5052 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5053 no longer needed, now that they are done in lisp.h.
5054
e499d0ee
DA
50552012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5056
5057 Cleanup string bytes checking.
5058 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5059 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5060 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5061 (check_sblock, compact_small_strings): Simplify.
5062
d5040d2d
PE
50632012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5064
5065 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5066 These macros are confusing and no longer need to be defined, as
5067 the enum values now suffice. All uses replaced with definiens.
5068 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5069
7f259ae6
JB
50702012-07-29 Juanma Barranquero <lekktu@gmail.com>
5071
5072 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5073 ($(BLD)/w32console.$(O)): Update dependencies.
5074
7e63e0c3
DA
50752012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5076
5077 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5078 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5079 time. Adjust users.
5080 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5081
ffd817eb
JD
50822012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5083
5084 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5085 setting sitelisp (Bug#12010).
5086
417a7a0e
EZ
50872012-07-29 Eli Zaretskii <eliz@gnu.org>
5088
14ae4239 5089 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
5090
5091 * w32heap.c (cache_system_info):
5092 * w32.c (sys_rename):
5093 * w32proc.c (find_child_console, sys_kill): All users changed.
5094
387d4d92
PE
50952012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5096
5097 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5098
55a6cca6
EZ
50992012-07-29 Eli Zaretskii <eliz@gnu.org>
5100
5101 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5102
dbcf001c
DA
51032012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5104
5105 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
5106 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5107 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 5108
e2688e4a
DA
51092012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5110
5111 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5112 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5113 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5114 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5115 (replace_range, replace_range_2, del_range_2): Change to eassert.
5116 * marker.c (byte_char_debug_check): Adjust style.
5117
b46a6a83
PE
51182012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5119
5120 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5121 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5122 long-ago-commented-out code that talks about "WIN32".
5123 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5124 All uses changed.
5125
e32a5799
PE
51262012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5127
5128 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5129 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5130 Simplify by using alignof.
5131 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5132 * lisp.h: Include <stdalign.h>.
5133 (GCALIGNMENT): New macro and constant.
5134 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5135 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5136 (stdalign): New macro, if not already defined.
5137
df81cd29
EZ
51382012-07-28 Eli Zaretskii <eliz@gnu.org>
5139
01bd1b0d
EZ
5140 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5141 * w32inevt.c: Include w32inevt.h.
5142 (w32_read_console_input): New inline function, calls either
5143 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5144 w32_console_unicode_input.
5145 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5146 (w32_kbd_patch_key, key_event): Use the codepage returned by
5147 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5148 (key_event): use uChar.UnicodeChar only if
5149 w32_console_unicode_input is non-zero.
5150
5151 * w32console.c: Include w32heap.h.
5152 <w32_console_unicode_input>: New global variable.
5153 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5154 family of Windows, zero otherwise.
5155
5156 * w32inevt.h: Declare w32_console_unicode_input.
5157
df81cd29
EZ
5158 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5159 --without-x. (Bug#11742)
5160
c20fdd9e
PE
51612012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5162
5163 Adjust GDB to reflect pvec_type changes (Bug#12036).
5164 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
5165 2012-07-04 changes to pseudovector representation.
5166 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 5167
32770973 51682012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
5169
5170 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5171 bus address.
5172 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5173
3438fe21
EZ
51742012-07-27 Eli Zaretskii <eliz@gnu.org>
5175
bcfbc9de
EZ
5176 * alloc.c (listn): Fix the order the arguments are consed onto the
5177 list.
5178
3438fe21
EZ
5179 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5180 enumeration constants, as PURE and HEAP are too general, and clash
5181 with other headers and sources, such as gmalloc.c and the
5182 MS-Windows system headers. All users changed.
5183
eeaea515
DA
51842012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5185
5186 Revert last save_excursion_save and save_excursion_restore changes.
5187 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5188 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5189
073c88c2
DA
51902012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5191
5192 Fix recently-introduced typos in Windows port.
5193 Reported by Martin Rudalics <rudalics@gmx.at>.
5194 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 5195 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 5196
4706125e
PE
51972012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5198
5199 Improve GDB symbol export (Bug#12036).
5200 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5201 arms of an 'if', not using conditional expressions; otherwise GDB
5202 complains about the types in the unevaluated arm when the argument
5203 is an integer literal.
5204 (xgetint): Simplify expression.
5205 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5206 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5207 Zaretskii in <http://bugs.gnu.org/12036#13>.
5208 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5209 needed now that we have gdb_make_enums_visible.
5210 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5211 (enum enum_USE_LSB_TAG):
5212 New enum types, packaging up enums that need to be exported to GDB.
5213
694b6c97
DA
52142012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5215
5216 Utility function to make a list from specified amount of objects.
5217 * lisp.h (enum constype): New datatype.
5218 (listn): New prototype.
5219 * alloc.c (listn): New function.
5220 (Fmemory_use_count, syms_of_alloc): Use it.
5221 * buffer.c (syms_of_buffer): Likewise.
5222 * callint.c (syms_of_callint): Likewise.
5223 * charset.c (define_charset_internal): Likewise.
5224 * coding.c (syms_of_coding): Likewise.
5225 * keymap.c (syms_of_keymap): Likewise.
5226 * search.c (syms_of_search): Likewise.
5227 * syntax.c (syms_of_syntax): Likewise.
5228 * w32.c (init_environment): Likewise.
5229 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5230 * xdisp.c (syms_of_xdisp): Likewise.
5231 * xfns.c (syms_of_xfns): Likewise.
5232
6195f384
DA
52332012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5234
5235 Fast save_excursion_save and save_excursion_restore.
5236 * lisp.h (struct Lisp_Excursion): New data type.
5237 (PVEC_EXCURSION): New pseudovector type.
5238 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5239 to deal with it. Adjust comments.
5240 (init_marker, attach_marker): New prototype.
5241 (unchain_marker): Adjust prototype.
5242 * marker.c (attach_marker): Change to global.
5243 (init_marker): New function.
5244 * alloc.c (Fmake_marker, build_marker): Use it.
5245 (build_marker): More easserts.
5246 (mark_object): Handle struct Lisp_Excursion.
5247 * editfns.c (save_excursion_save, save_excursion_restore):
5248 Reimplement to use struct Lisp_Excursion. Add comments.
5249
5eceb8fb
PE
52502012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5251
5252 Fix export of symbols to GDB (Bug#12036).
5253 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5254 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5255 emacs.c, as this is a more-suitable home. Had this been done earlier
5256 the fix for 12036 would have avoided some of the problems noted in
5257 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5258 would have been more obvious.
562157c8
PE
5259 * emacs.c: Do not include <verify.h>; no longer needed.
5260 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
5261 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5262 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5263 Remove; now done in lisp.h.
5264 * lisp.h (PUBLISH_TO_GDB): New macro.
5265 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5266 (DATA_SEG_BITS): Use it.
5267 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5268 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5269 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5270 not be usable in #if. This simplifies things.
5271
d6749401
JB
52722012-07-26 Juanma Barranquero <lekktu@gmail.com>
5273
5274 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5275
1781b9e9
PE
52762012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5277
d89518db 5278 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
5279 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5280 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5281 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5282 Adjust to changes in lisp.h and emacs.c, by using
5283 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5284 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5285 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5286 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5287 instead of gdb_valbits.
5288 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5289 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5290 instead of gdb_array_mark_flag.
5291 (xboolvector): Get size from $->size, not $->header.size.
5292 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5293 (xreload, hook-run, hookpost-run): Remove.
5294 * emacs.c: Include <verify.h>.
5295 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5296 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5297 Remove.
5298 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5299 (gdb_USE_LSB_TAG): New enum constants.
5300 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5301 Also define these as enum constants, so they're visible to GDB.
5302 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5303 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5304 as constants, so they're visible to GDB.
5305 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5306 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5307 Now enum constants, not macros, so they're visible to GDB.
5308 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5309 more convenient now. All uses changed.
5310 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5311 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5312
3628596a
DA
53132012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5314
5315 Explicitly free restriction data that are not needed anymore.
5316 * editfns.c (save_restriction_restore): Free restriction data.
5317
7abaf5cc
SM
53182012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5319
5320 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5321 add argument, tune behavior, and adjust all callers.
5322
71f88e00
PE
53232012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5324
5325 Use typedef for EMACS_INT, EMACS_UINT.
5326 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5327 than macros. This simplifies debugging in the usual case, since
5328 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5329 and it allows expressions involving EMACS_INT casts.
5330 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5331
57ec3034
JD
53322012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5333
5334 * nsterm.m (ns_read_socket): Return early if there is a modal
5335 window (Bug#12043).
5336
8137e7b3
MR
53372012-07-25 Martin Rudalics <rudalics@gmx.at>
5338
5339 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5340 that FOCUS-FRAME can be omitted.
5341
04e9897c
DA
53422012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5343
5344 Adjust buffer text indirection counters at the end of Fkill_buffer.
5345 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5346 buffer is definitely dead. This should really fix an issue reported
5347 by Christoph Scholtes again. (Bug#12007).
5348 (init_buffer_once): Initialize indirection counters of
5349 buffer_defaults and buffer_local_symbols (for sanity and safety).
5350
8a0484e1
EZ
53512012-07-24 Eli Zaretskii <eliz@gnu.org>
5352
5353 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5354 and continuation glyphs on tooltip frames, leave them at zero.
5355 Avoids continued lines in tooltips. (Bug#11832)
5356
fa691a83
DA
53572012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5358
5359 Simplify copy_overlay.
04e9897c 5360 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
5361 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5362
436bc8e0
EZ
53632012-07-23 Eli Zaretskii <eliz@gnu.org>
5364
5365 * print.c (print_object): Don't crash when a frame's name is nil
5366 or invalid. (Bug#12025)
5367
5368 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5369 it signals an error when a tooltip frame is being created.
5370
d7a7fda3
DA
53712012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5372
5373 Cleanup miscellaneous objects allocation and initialization.
5374 * alloc.c (allocate_misc): Change to static. Add argument to
5375 specify the subtype. Adjust comment and users.
5376 (build_overlay): New function.
5377 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5378 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5379 (allocate_misc): Remove prototype.
5380 (build_overlay): Add prototype.
5381
53822012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
5383
5384 Swap buffer text indirection counters in Fbuffer_swap_text.
5385 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5386 This avoids crash reported by Christoph Scholtes at
5387 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5388
9d7fa573
JD
53892012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5390
5391 * nsmenu.m (Popdown_data): New struct.
5392 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5393 free Popdown_data.
5394 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5395 (initWithContentRect): Make imgView and contentView non-static
5396 and autorelease them. Also autorelease img and matrix (Bug#12005).
5397 (dealloc): Remove (Bug#12005).
5398
0dd6d66d
DA
53992012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5400
5401 Adjust consing_since_gc when objects are explicitly freed.
5402 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5403 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5404 (free_cons, free_misc): Subtract object size from consing_since_gc.
5405
d36d71df
DA
54062012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5407
5408 Simplify and cleanup markers positioning code.
5409 * marker.c (attach_marker): More useful eassert.
5410 (live_buffer, set_marker_internal): New function.
5411 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5412 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5413
fb9ea40f
PE
54142012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5415
5416 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5417 as it's limited by the amount of memory, not by INT_MAX.
5418
2d5c5f7d
EZ
54192012-07-21 Eli Zaretskii <eliz@gnu.org>
5420
07fb592e
EZ
5421 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5422 in special-event-map. See the discussion at
5423 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5424 for the reasons.
5425
37a9eac8 5426 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
5427 info.dwItemData. Fixes crashes on 64-bit Windows.
5428 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 5429
c4328746
JD
54302012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5431
fc0c31f8 5432 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 5433 (conversationIdentifier): Return value is NSInteger.
784051c4 5434 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 5435
6e5d1c12
CY
54362012-07-21 Chong Yidong <cyd@gnu.org>
5437
5438 * window.c (decode_any_window): Signal an error if the window is
5439 on a dead frame (Bug#11984).
5440
9928463d
DA
54412012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5442
5443 Add indirection counting to speed up Fkill_buffer.
5444 * buffer.h (struct buffer): New member.
5445 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5446 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5447 base buffer indirection counter.
5448 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5449 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5450 through buffer list if indirection counter is 0.
5451
f8643a6b
DA
54522012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5453
5454 Extend the value returned by Fgarbage_collect with heap statistics.
5455 * alloc.c (Qheap): New symbol.
5456 (syms_of_alloc): DEFSYM it.
5457 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5458 (Fmemory_free): Remove.
5459 (syms_of_alloc): Don't defsubr it.
5460 * buffer.c (Fcompact_buffer): Remove.
5461 (syms_of_buffer): Don't defsubr it.
5462
dac616ff
DA
54632012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5464
5465 Make maybe_gc inline.
5466 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5467 * lisp.h (consing_since_gc, gc_relative_threshold)
5468 (memory_full_cons_threshold): Revert declaration.
5469 (maybe_gc): Remove prototype, define as inline.
5470 * alloc.c: Remove old commented-out code.
5471 (consing_since_gc, gc_relative_threshold)
5472 (memory_full_cons_threshold): Revert to global.
5473 (maybe_gc): Remove.
5474
d7ea76b4
DA
54752012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5476
5477 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5478 * lisp.h (build_unibyte_string): New function.
5479 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5480 * sysdep.c, w32fns.c, xfns.c: Use it.
5481 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5482 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5483 Adjust users accordingly.
5484 * font.h (font_open_by_name): Adjust prototype.
5485
765e61e3
DA
54862012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5487
5488 Cleanup calls to Fgarbage_collect.
5489 * lisp.h (maybe_gc): New prototype.
5490 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5491 Remove declarations.
5492 * alloc.c (maybe_gc): New function.
5493 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5494 Make them static.
5495 * bytecode.c (MAYBE_GC): Use maybe_gc.
5496 * eval.c (eval_sub, Ffuncall): Likewise.
5497 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5498 to avoid dependency from auto-save feature.
5499
52b852c7
PE
55002012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5501
5502 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5503 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5504 'for_each_per_buffer_object_at'.
5505 All uses changed. It's better to use upper-case for macros that
5506 cannot be implemented as functions, to give the reader a clue
5507 that they're special.
5508
5db81e33
SM
55092012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5510
5511 * alloc.c (Fgarbage_collect): Tweak docstring.
5512
5b835e1d
DA
55132012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5514
5515 Tweak the value returned from Fgarbage_collect again.
5516 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5517 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5518 Adjust documentation.
5519 (total_vector_bytes): Rename to total_vector_slots, adjust
5520 accounting.
5521 (total_free_vector_bytes): Rename to total_free_vector_slots,
5522 adjust accounting.
5523 (Qstring_bytes, Qvector_slots): New symbols.
5524 (syms_of_alloc): DEFSYM them.
5525
9cd47b72
DA
55262012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5527
5528 Buffer compaction primitive which may be used from Lisp.
5529 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5530 (syms_of_buffer): Register Fcompact_buffer.
5531 * alloc.c (Fgarbage_collect): Use compact_buffer.
5532 * buffer.h (compact_buffer): New prototype.
5533 (struct buffer_text): New member.
5534
d17337e5
DA
55352012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5536
5537 New macro to iterate over all buffers, miscellaneous cleanups.
5538 * lisp.h (all_buffers): Remove declaration.
5539 * buffer.h (all_buffers): Add declaration, with comment.
5540 (for_each_buffer): New macro.
5541 * alloc.c (Fgarbage_collect, mark_object): Use it.
5542 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5543 (init_buffer): Likewise.
5544 * data.c (Fset_default): Likewise.
5545 * coding.c (code_conversion_restore): Remove redundant check
5546 for dead buffer.
5547 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5548
60cfd278
AS
55492012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5550
5551 Fix bug that created negative-length intervals.
5552 * intervals.c (merge_interval_right, merge_interval_left):
5553 Do not zero out this interval if it is absorbed by its children,
5554 as this interval's total length doesn't change in that case. See
5555 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5556
d06714cb
PE
55572012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5558
83713154
PE
5559 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5560 when invoking (make-bool-vector N t) and N is a positive
5561 multiple of 8 -- the last 8 bits were mistakenly cleared.
5562
d06714cb
PE
5563 Remove some struct layout assumptions in bool vectors.
5564 * alloc.c (bool_header_size): New constant.
5565 (header_size, word_size): Move earlier, as they're now used earlier.
5566 Use 'word_size' in a few more places, where it's appropriate.
5567 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5568 padding before the data member of a bool vector.
5569 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5570 than doing the check by hand with an abort ().
5571
464d5a5e
SM
55722012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5573
5fbc0409
SM
5574 * eval.c (Fdefvar): Don't check constants since we only set the var if
5575 it's not yet defined anyway (bug#11904).
5576
464d5a5e
SM
5577 * lisp.h (last_undo_boundary): Declare new var.
5578 * keyboard.c (command_loop_1): Set it.
5579 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5580 were auto-added by the command loop (bug#11774).
5581
8dc2e44a
AS
55822012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5583
5584 * w32font.c (Qsymbol): Remove local definition.
5585 (syms_of_w32font): Don't DEFSYM it.
5586
169925ec
DA
55872012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5588
5589 Fix sweep_vectors to handle large bool vectors correctly.
5590 * alloc.c (sweep_vectors): Account total_vector_bytes for
5591 bool vectors larger than VBLOCK_BYTES_MAX.
5592
5fbfb018
CY
55932012-07-18 Chong Yidong <cyd@gnu.org>
5594
5595 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5596 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5597
3ab6e069
DA
55982012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5599
5600 Return more descriptive data from Fgarbage_collect.
5601 Suggested by Stefan Monnier in
5602 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5603 * alloc.c (bounded_number): New function.
5604 (total_buffers, total_vectors): New variable.
5605 (total_string_size): Rename to total_string_bytes, adjust users.
5606 (total_vector_size): Rename to total_vector_bytes, adjust users.
5607 (sweep_vectors): Account total_vectors and total_vector_bytes.
5608 (Fgarbage_collect): New return value. Adjust documentation.
5609 (gc_sweep): Account total_buffers.
5610 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5611 (VECTOR_SIZE): Remove.
5612 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5613 (Qinterval, Qmisc): New symbols.
5614 (syms_of_data): Initialize them.
5615 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5616 (Qcons, Qbuffer): New declarations.
5617
6d02fe5b
PE
56182012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5619
5620 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5621 Round up, not down. Improve doc.
5622
b7ffe040
DA
56232012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5624
5625 Restore old code in allocate_string_data to avoid Faset breakage.
5626 Reported by Julien Danjou <julien@danjou.info> in
5627 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5628 * alloc.c (allocate_string_data): Restore old code with minor
5629 adjustments, fix comment to explain this subtle issue.
5630
4dc7c8d5
SM
56312012-07-17 Eli Zaretskii <eliz@gnu.org>
5632
5633 Remove FILE_SYSTEM_CASE.
5634 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5635
5636 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5637 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5638 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5639 call-process-region passes it through expand-file-name.
5640
5641 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5642
56432012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5644
5645 Fix crash when creating indirect buffer (Bug#11917)
5646 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5647 Don't handle unbound variables specially if non-zero.
5648 (Fbuffer_local_variables): Pass zero.
5649 (clone_per_buffer_values): Pass non-zero.
5650
56512012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5652
5653 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5654 to make the loop interruptible.
5655
56562012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5657
5658 * gnutls.c (emacs_gnutls_handshake): Only retry if
5659 GNUTLS_E_INTERRUPTED.
5660
cce7fefc
DA
56612012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5662
5663 Cleanup and convert miscellaneous checks to eassert.
5664 * alloc.c (mark_interval): Fix comment, partially rephrase
5665 old comment from intervals.h (see below).
5666 * intervals.c (find_interval, adjust_intervals_for_insertion)
5667 (delete_interval, adjust_intervals_for_deletion)
5668 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5669 Convert to eassert.
5670 (adjust_intervals_for_insertion, make_new_interval):
5671 Remove obsolete and unused code.
5672 * intervals.h (struct interval): Remove obsolete comment.
5673 * textprotp.c (erase_properties): Remove unused code.
5674 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5675 (Fremove_list_of_text_properties): Convert to eassert.
5676
9ea10cc3
CY
56772012-07-17 Chong Yidong <cyd@gnu.org>
5678
5679 * editfns.c (Finsert_char): Doc fix.
5680
3900d5de
DA
56812012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5682
5683 Fix previous change to make Fmemory_free always accurate.
5684 * alloc.c (make_interval): Update total_free_intervals.
5685 (make_float): Likewise for total_free_floats.
5686 (free_cons, Fcons): Likewise for total_free_conses.
5687 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5688 Likewise for total_free_vector_bytes.
5689 (Fmake_symbol): Likewise for total_free_symbols.
5690 (bytes_free): Remove.
5691
7098646f
DA
56922012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5693
5694 Simple free memory accounting feature.
5695 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5696 (sweep_vectors): Accumulate size of free vectors.
5697 (Fgarbage_collect): Setup bytes_free.
5698 (Fmemory_free): New function.
5699 (syms_of_alloc): Register it.
5700
22657b40
DA
57012012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5702
5703 Cleanup overlays checking.
5704 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5705 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5706 eassert and OVERLAYP.
5707 (sort_overlays): Change to use OVERLAYP.
5708
ddfc8813
RK
57092012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5710
5711 * editfns.c (Finsert_char): Make it interactive, and make the
5712 second arg optional. Copy interactive spec and docstring from
5713 ucs-insert.
5714
7c26cf3c
PE
57152012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5716
5717 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5718 Unlike the other wrapped functions, fabs has an unspecified
5719 effect on errno.
5720
5d127af9
JD
57212012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5722
5723 * nsterm.m (keyDown): Interpret flags without left/right bits
5724 as the left key (Bug#11670).
5725
6a0dd1d7
DA
57262012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5727
5728 Remove empty and useless init functions.
5729 * lisp.h (init_character_once, init_fns, init_image)
5730 (init_filelock, init_sound): Remove prototype.
5731 * character.c (init_character_once): Remove.
5732 * filelock.c (init_filelock): Likewise.
5733 * fns.c (init_fns): Likewise.
5734 * image.c (init_image): Likewise.
5735 * sound.c (init_sound): Likewise.
5736 * emacs.c (main): Adjust accordingly.
5737
7a6136fd
DA
57382012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5739
5740 * gtkutil.h: Tiny cleanups.
5741 (use_old_gtk_file_dialog): Remove useless declaration.
5742 (xg_uses_old_file_dialog): Add suggested const attribute.
5743
ce811ad9
EZ
57442012-07-15 Eli Zaretskii <eliz@gnu.org>
5745
5746 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5747 (bidi_paragraph_init): Use it to limit search forward for a strong
5748 directional character in abnormally large paragraphs full of
5749 neutral or weak characters. (Bug#11943)
5750
c9adfeaa
SF
57512012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5752
5753 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5754 the toolbar (Bug#9451).
5755 (xg_make_tool_item): Give the widget event box a transparent
5756 background.
5757
fff62aa9
DA
57582012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5759
5760 Cleanup basic allocation variables and functions.
5761 * alloc.c (ignore_warnings, init_intervals, init_float)
5762 (init_cons, init_symbol, init_marker): Remove.
5763 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5764 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5765 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5766 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5767 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5768 (staticidx, init_alloc_once, init_strings, free_ablock):
5769 Remove redundant initialization.
5770 * fns.c (init_weak_hash_tables): Remove.
5771 * lisp.h (init_weak_hash_tables): Remove prototype.
5772
9730daca
DA
57732012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5774
5775 Use zero_vector where appropriate.
5776 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5777 accordingly.
5778 * lisp.h (zero_vector): New declaration.
5779 * font.c (null_vector): Remove.
5780 (syms_of_font): Remove initialization and staticpro.
5781 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5782 * keymap.c (Faccessible_keymaps): Likewise.
5783
2e2d2a13
LL
57842012-07-15 Leo Liu <sdl.web@gmail.com>
5785
5786 * fringe.c: Fix typo in comments.
5787
cd276f6e
LL
57882012-07-14 Leo Liu <sdl.web@gmail.com>
5789
5790 * fringe.c: Add a new bitmap exclamation-mark.
5791
5a1131d9
EZ
57922012-07-14 Eli Zaretskii <eliz@gnu.org>
5793
5794 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5795
5796 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5797 (HAVE_MENUS): Don't define, defined by editing config.in with
5798 msdos/sed2v2.inp.
5799 (GMALLOC_INHIBIT_VALLOC): Don't define.
5800 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5801
22e983b7
JB
58022012-07-14 Juanma Barranquero <lekktu@gmail.com>
5803
5804 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5805
5b3f250f
GM
58062012-07-14 Glenn Morris <rgm@gnu.org>
5807
5808 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5809 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5810 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5811
33d63ff4
GM
58122012-07-13 Glenn Morris <rgm@gnu.org>
5813
5b633342
GM
5814 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5815
33d63ff4
GM
5816 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5817 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5818
b55b9f85
JD
58192012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5820
0dc8cf50
JD
5821 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5822 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5823 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5824 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5825 where appropriate.
5826 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5827 as boolean expression.
5828 (x_set_window_size): Remove unused variable toolbar.
5829 (ns_get_color_default, ns_mod_to_lisp): Remove.
5830 (ns_mouse_position): Remove unused variables xchar and ychar.
5831 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5832 (ns_set_vertical_scroll_bar): Remove unused variable count.
5833 (ns_delete_terminal): Remove unused variable i.
5834 (ns_term_init): Remove unused variables r, g and b.
5835 (mouseDown): Remove unused variable window.
5836 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5837 (initFrameFromEmacs): Remove unused variable vbextra.
5838 (mouseEntered): Remove unused variables p and dpyinfo.
5839 (mouseExited): Remove unused variables p and r.
5840 (ns_define_frame_cursor, ns_clear_frame_area)
5841 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5842 (menuDown): Assign [sender tag] to variable and cast the variable.
5843
5844 * nsterm.h (menuDown): Add id as type to argument sender.
5845 (ns_display_info_for_name): Add Lisp_Object argument.
5846 (ns_term_init): Add Lisp_Object argument.
5847 (ns_map_event_to_object): Add void argument.
5848 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5849 prototype with arguments and only declare if __OBJC__.
5850 (nxatoms_of_nsselect): Add void argument.
5851 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5852 (ns_alloc_autorelease_pool): Add void argument.
5853 (ns_release_autorelease_pool): Add void* argument.
5854 (ns_get_defaults_value): Add const char* argument.
5855
5856 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5857 (initFromContents): Use SSDATA where appropriate.
5858 (ns_update_menubar): Add braces to ambigous if-else.
5859 (initWithTitle): Put () around assignment in if statement.
5860 (ns_menu_show): Remove unused variables window and keymap.
5861 (update_frame_tool_bar): Remove unused variable selected_p.
5862 (initWithContentRect): Remove unused variable this_cmd_name.
5863
5864 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5865 appropriate.
5866 (setXBMColor): Remove unused variable len.
5867 (setPixmapData): Put () around assignment in loop statement.
5868
5869 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5870 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5871 where appropriate.
5872 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5873 around assignment in loop statement.
5874 (nsfont_open): Remove unused variable i.
5875 (nsfont_open): Remove unused variable len.
5876 (nsfont_draw): Remove unused variable cs.
5877
5878 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5879 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5880 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5881 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5882 (Fns_font_name, Fns_perform_service)
5883 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5884 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5885 (ns_set_name): Remove unused variable view.
5886 (x_set_menu_bar_lines): Remove unused variable olines.
5887 (x_set_tool_bar_lines): Remove unused variable root_window.
5888 (Fns_list_colors): Put () around assignment in while statement.
5889 (Fns_perform_service): Remove unused variable len.
5890 (Fns_display_usable_bounds): Remove unused variable top.
5891 (syms_of_nsfns): Remove unused variable i.
5892
b55b9f85
JD
5893 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5894 memcpy (Bug#11907).
5895
ed9265fc 58962012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
5897
5898 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5899 and free it with DestroyExceptionInfo (Bug#11558).
5900
ef099b57
JB
59012012-07-13 Juanma Barranquero <lekktu@gmail.com>
5902
5903 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5904 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5905 Set here, not in nt/config.nt.
5906
ea814a5d
EZ
59072012-07-13 Eli Zaretskii <eliz@gnu.org>
5908
5909 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5910 cursor overflow into the last glyph on display line when the right
5911 fringe is off. (Bug#11832)
5912
1a952767
PE
59132012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5914
5915 * xdisp.c (produce_special_glyphs): Now static.
5916 * dispextern.h (produce_special_glyphs): Remove decl.
5917
983188fd
GM
59182012-07-13 Glenn Morris <rgm@gnu.org>
5919
8d7c7eed 5920 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
5921 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5922
983188fd
GM
5923 * s/usg5-4-common.h (USG, USG5):
5924 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5925 * s/sol2-6.h (SOLARIS2):
5926 * s/irix6-5.h (IRIX6_5):
5927 * s/hpux10-20.h (USG, USG5, HPUX):
5928 * s/gnu-linux.h (USG, GNU_LINUX):
5929 * s/freebsd.h (BSD_SYSTEM):
5930 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5931 * s/cygwin.h (CYGWIN):
5932 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5933 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5934
d1e68667 59352012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
5936
5937 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 5938
6de0e799
GM
59392012-07-13 Glenn Morris <rgm@gnu.org>
5940
739ae010
GM
5941 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5942
dbee5793
GM
5943 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5944
6de0e799
GM
5945 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5946 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5947
b82da769
GM
59482012-07-12 Glenn Morris <rgm@gnu.org>
5949
4fae5a7a 5950 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
5951
5952 * process.c (init_process_emacs): Rename from init_process.
5953 The old name is also the name of a Mach system call.
5954 * lisp.h, emacs.c: Update for this name change.
5955 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5956 longer needed.
5957
5a979817
EZ
59582012-07-12 Eli Zaretskii <eliz@gnu.org>
5959
5960 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5961 memmove call that removes glyphs covered by the left truncation
5962 glyph. Improve commentary.
5963 (display_line): Fix display of continuation glyphs on GUI frames
5964 when the right fringe is turned off and variable-size fonts are
5965 used in the window. Move the code that appends a stretch glyph to
5966 produce_special_glyphs, so that it could be used for truncation
5967 and continuation glyphs alike.
5968 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5969 glyph of a suitably computed width, to align the special glyphs at
5970 the window margin. Code moved from display_line. (Bug#11832)
5971
3e91a053
GM
59722012-07-12 Glenn Morris <rgm@gnu.org>
5973
ba9e4b84
GM
5974 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5975
5976 * s/gnu-linux.h, s/hpux10-20.h:
5977 Do not unconditionally define HAVE_XRMSETDATABASE.
5978
3e91a053
GM
5979 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5980
b300b1f4
PE
59812012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5982
5983 Fix typos that broke OS X build.
5984 Reported by Randal L. Schwartz in
5985 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5986 * nsterm.m (ns_timeout): Add missing local decl.
5987 (ns_get_color): snprintf -> sprintf, to fix typo.
5988
6e777848
GM
59892012-07-12 Glenn Morris <rgm@gnu.org>
5990
3f922c37
GM
5991 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5992 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5993 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5994 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5995
0ab7b23a
GM
5996 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5997 Move PTY_OPEN to configure.
5998
6e777848
GM
5999 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6000 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6001 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6002
4a7edc24
DA
60032012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6004
6005 Use empty_unibyte_string where applicable.
6006 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6007 * lread.c (read1): Likewise.
6008 * xsettings.c (syms_of_xsettings): Likewise.
6009
308aab79
GM
60102012-07-12 Glenn Morris <rgm@gnu.org>
6011
42bd1719
GM
6012 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6013 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
6014 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6015 * s/hpux10-20.h (RUN_TIME_REMAP):
6016 * s/bsd-common.h (TABDLY): Move to configure.
6017
6018 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6019
6020 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6021
ea0bbd17 6022 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 6023 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
6024
6025 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 6026
308aab79
GM
6027 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6028 * s/template.h: Move NARROWPROTO to configure.
6029
ee1cf5cf
GM
60302012-07-11 Glenn Morris <rgm@gnu.org>
6031
30fe9bf4
GM
6032 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6033 unused since 2011-01-17 change to systty.h.
6034
ee1cf5cf
GM
6035 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6036 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6037 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6038
63e47e07
PE
60392012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6040
6041 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6042
c43fb4c3
GM
60432012-07-11 Glenn Morris <rgm@gnu.org>
6044
6045 * s/darwin.h, s/gnu-linux.h, s/template.h:
6046 Move INTERRUPT_INPUT to configure.
6047
e8df9267
DA
60482012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6049
6050 Minor adjustments to interning code.
6051 * lisp.h (intern, intern_c_string): Redefine as static inline
6052 wrappers for intern_1 and intern_c_string_1, respectively.
6053 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
6054 * lread.c (intern_1, intern_c_string_1, oblookup):
6055 Simplify Vobarray checking.
e8df9267
DA
6056 * font.c (font_intern_prop): Likewise. Adjust comment.
6057 * w32font.c (intern_font_name): Likewise.
6058
34348bd4
AS
60592012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6060
d96a1e0c
AS
6061 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6062
34348bd4
AS
6063 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6064 of Fcar/Fcdr if possible.
6065 * font.c (check_otf_features): Likewise.
6066 * fontset.c (Fnew_fontset): Likewise.
6067 * gnutls.c (Fgnutls_boot): Likewise.
6068 * minibuf.c (read_minibuf): Likewise.
6069 * msdos.c (IT_set_frame_parameters): Likewise.
6070 * xmenu.c (Fx_popup_dialog): Likewise.
6071 * w32menu.c (Fx_popup_dialog): Likewise.
6072
c8add24e
GM
60732012-07-11 Glenn Morris <rgm@gnu.org>
6074
4b575b3c
GM
6075 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6076 since nothing has defined it on these platforms.
6077
09f4e3b0
GM
6078 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6079 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6080
172bedef
GM
6081 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6082 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6083 Move CLASH_DETECTION to configure.
6084
249685df
GM
6085 * s/gnu.h: Remove file, which is now empty.
6086
c8add24e
GM
6087 * s/gnu.h, s/gnu-linux.h:
6088 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6089
b41253a3
JW
60902012-07-11 John Wiegley <johnw@newartisans.com>
6091
6092 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6093 function attribute, so we only use it if it exists in the
6094 compiler.
6095
d923b542
DA
60962012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6097
6098 Avoid call to strlen in fast_c_string_match_ignore_case.
6099 * search.c (fast_c_string_match_ignore_case): Change to use
6100 length argument. Adjust users accordingly.
6101 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6102
5ebbef1d
PE
61032012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6104
bb352260
PE
6105 Assume mkdir, rmdir.
6106 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6107 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6108
57054ddd
PE
6109 Assume rename.
6110 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6111
b747d3f7
PE
6112 Assume perror.
6113 * s/hpux10-20.h (HAVE_PERROR): Remove.
6114 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6115 Remove dummy definition, as this problem was obsolete long ago.
6116
5ebbef1d
PE
6117 Assume strerror.
6118 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6119
984e7f30
DA
61202012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6121
6122 Avoid calls to strlen in font processing functions.
6123 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
6124 (font_open_by_name): Change to use length argument.
6125 Adjust users accordingly.
d923b542
DA
6126 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6127 Adjust prototypes.
6128 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6129 Change to return ptrdiff_t.
984e7f30
DA
6130 (xfont_list_pattern, xfont_match): Use length returned by
6131 xfont_decode_coding_xlfd.
6132 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6133
20e94fdd
GM
61342012-07-11 Glenn Morris <rgm@gnu.org>
6135
9d596af3
GM
6136 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6137 Move DONT_REOPEN_PTY to configure.
6138
20e94fdd
GM
6139 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6140 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6141
e99a530f
PE
61422012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6143
22ffb973
PE
6144 Remove "#define unix" that is no longer needed (Bug#11905).
6145 * s/aix4-2.h (unix): Remove; no longer needed.
6146
e9a9ae03
PE
6147 EMACS_TIME simplification (Bug#11875).
6148 This replaces macros (which typically do not work in GDB)
6149 with functions, typedefs and enums, making the code easier to debug.
6150 The functional style also makes code easier to read and maintain.
6151 * systime.h: Include <sys/time.h> on all hosts, not just if
6152 WINDOWSNT, since 'struct timeval' is needed in general.
6153 (EMACS_TIME): Now a typedef, not a macro.
6154 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6155 not macros.
6156 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6157 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6158 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6159 (EMACS_TIME_LE): Now functions, not macros.
6160 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6161 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6162 which are not functions. All uses rewritten to use:
6163 (make_emacs_time): New function.
6164 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6165 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6166 not functions. All uses rewritten to use the following, respectively:
6167 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6168 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 6169 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
6170 * fileio.c (Fcopy_file):
6171 * xterm.c (XTflash): Get the current time closer to when it's used.
6172 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6173
ffacb126
PE
6174 * bytecode.c (targets): Suppress -Woverride-init warnings.
6175
e99a530f
PE
6176 Simplify by avoiding confusing use of strncpy etc.
6177 * doc.c (Fsnarf_documentation):
6178 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6179 * frame.c (Fmake_terminal_frame):
6180 * gtkutil.c (get_utf8_string):
6181 * lread.c (openp):
6182 * nsmenu.m (ns_update_menubar):
6183 * regex.c (regerror):
6184 Prefer memcpy to strncpy and strncat when either will do.
6185 * fileio.c (Fsubstitute_in_file_name):
6186 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6187 (menu_separator_name_p):
6188 * nsmenu.m (ns_update_menubar):
6189 Prefer memcmp to strncmp when either will do.
6190 * nsterm.m: Include <ftoastr.h>.
6191 (ns_get_color):
6192 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6193 Prefer snprintf to strncpy.
6194 * nsterm.m (ns_term_init):
6195 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6196 * nsterm.m (ns_term_init):
6197 Avoid the need for strncpy, by using build_string or
6198 make_unibyte_string directly. Use dtoastr, not snprintf.
6199 * process.c (Fmake_network_process): Diagnose service names that
6200 are too long, rather than silently truncating them or creating
6201 non-null-terminated names.
6202 (Fnetwork_interface_info): Likewise, for interface names.
6203 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6204 Prefer sprintf to strncat.
6205 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6206 Prefer vsnprintf to vsprintf + strncpy.
6207
c59592b3
GM
62082012-07-10 Glenn Morris <rgm@gnu.org>
6209
6210 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6211 Clarify fallback case.
6212
7d7bbefd
DA
62132012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6214
6215 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6216 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6217 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 6218 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
6219 where argument type is known to be a Lisp_Cons.
6220
3a4c8000
TT
62212012-07-10 Tom Tromey <tromey@redhat.com>
6222
6223 * bytecode.c (BYTE_CODE_THREADED): New macro.
6224 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6225 (enum byte_code_op): New type.
6226 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6227 (exec_byte_code): Use them. Use token threading when applicable.
6228
2a0213a6
DA
62292012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6230
6231 Optimize pure C strings initialization.
6232 * lisp.h (make_pure_string): Fix prototype.
6233 (build_pure_c_string): New function, defined as static inline. This
6234 provides a better opportunity to optimize away calls to strlen when
6235 the function is called with compile-time constant argument.
6236 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6237 argument, adjust users accordingly. Use build_pure_c_string where
6238 appropriate.
6239 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6240 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6241 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6242
cb1caeaf
DA
62432012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6244
6245 Avoid calls to strlen in miscellaneous functions.
6246 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6247 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6248 * lread.c (openp): Likewise.
6249
c293e30c
DA
62502012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6251
6252 Avoid calls to strlen in path processing functions.
6253 * fileio.c (file_name_as_directory): Add comment. Change to add
6254 srclen argument and return the length of result. Adjust users
6255 accordingly.
6256 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
6257 swap 1st and 2nd arguments to obey the common convention.
6258 Adjust users accordingly.
c293e30c
DA
6259 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6260
9e059e3f
GM
62612012-07-10 Glenn Morris <rgm@gnu.org>
6262
d02eb359
GM
6263 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6264 Move PENDING_OUTPUT_COUNT definition to configure.
6265
882cf227
GM
6266 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6267 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6268 * s/gnu.h (DATA_START): Move definitions to configure.
6269
af6e839f
GM
6270 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6271 We include usg5-4-common.h, which defines them both.
6272
40289a12
GM
6273 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6274 O_RDONLY already includes it).
6275
9e059e3f
GM
6276 Stop ns builds setting the EMACSLOADPATH environment variable.
6277 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6278 Now it does not set EMACSLOADPATH, just returns the load-path string.
6279 * nsterm.h: Update accordingly.
6280 * lread.c [HAVE_NS]: Include nsterm.h.
6281 (init_lread) [HAVE_NS]: Use ns_load_path.
6282 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6283
7c4e8ec0
GM
62842012-07-09 Glenn Morris <rgm@gnu.org>
6285
d4f600ff
GM
6286 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6287 since the included bsd-common.h does so.
6288
cbb31951
GM
6289 Stop ns builds setting the EMACSPATH environment variable.
6290 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6291 (ns_init_paths): Do not set EMACSPATH.
6292 * nsterm.h (ns_exec_path): Add it.
6293 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6294 Use ns_exec_path.
6295
7c4e8ec0
GM
6296 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6297
26bccfae
PE
62982012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6299
a0bee46f
PE
6300 * process.c (wait_reading_process_output): 'waitchannels' was unset
6301 when read_kbd || !NILP (wait_for_cell); fix this.
6302
5994c183
PE
6303 Add GCC-style 'const' attribute to functions that can use it.
6304 * character.h (char_resolve_modifier_mask):
6305 * keyboard.h (make_ctrl_char):
6306 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6307 (init_character_once, next_almost_prime, init_fns, init_image)
6308 (flush_pending_output, init_sound):
6309 * mem-limits.h (start_of_data):
6310 * menu.h (finish_menu_items):
6311 Add ATTRIBUTE_CONST.
6312 * emacs.c (DEFINE_DUMMY_FUNCTION):
6313 Declare the dummy function with ATTRIBUTE_CONST.
6314 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6315 Add decls with ATTRIBUTE_CONST.
6316
26bccfae
PE
6317 Minor improvements to make_formatted_string.
6318 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6319 where int is good enough, as vsprintf returns an int.
6320 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6321
a8290ec3
DA
63222012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6323
6324 Use make_formatted_string to avoid double length calculation.
6325 * lisp.h (make_formatted_string): New prototype.
6326 * alloc.c (make_formatted_string): New function.
6327 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 6328 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
6329 * editfns.c (Fcurrent_time_zone): Likewise.
6330 * filelock.c (get_boot_time): Likewise.
6331 * frame.c (make_terminal_frame, set_term_frame_name)
6332 (x_report_frame_params): Likewise.
6333 * image.c (gs_load): Likewise.
6334 * minibuf.c (get_minibuffer): Likewise.
6335 * msdos.c (dos_set_window_size): Likewise.
6336 * process.c (make_process): Likewise.
6337 * xdisp.c (ensure_echo_area_buffers): Likewise.
6338 * xsettings.c (apply_xft_settings): Likewise.
6339
d01ba2f1
GM
63402012-07-09 Glenn Morris <rgm@gnu.org>
6341
6342 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6343 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6344 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6345 * nsterm.h (ns_etc_directory): Add it.
6346 * callproc.c [HAVE_NS]: Include nsterm.h.
6347 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6348
f1f924b6
DA
63492012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6350
6351 Move marker debugging code under MARKER_DEBUG.
6352 * marker.c (MARKER_DEBUG): Move marker debugging code under
6353 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6354 for bootstrap with --enable-checking (~3x slowdown reported
6355 by Juanma Barranquero <lekktu@gmail.com>).
6356 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6357
ab531b66
PE
63582012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6359
6360 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6361 See <http://bugs.gnu.org/11825#29>.
6362
c4b3bc8a
EZ
63632012-07-08 Eli Zaretskii <eliz@gnu.org>
6364
6365 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6366 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
6367 (display_line): Add commentary about displaying truncation glyphs
6368 on GUI frames.
6369 (produce_special_glyphs): Move here from term.c.
6370
6371 * term.c (produce_special_glyphs): Move to xdisp.c.
6372
6373 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6374 section.
c4b3bc8a 6375
b676b881
AS
63762012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6377
f17c5273
AS
6378 * xdisp.c (display_line): Avoid warning about implicit declaration
6379 of FRAME_FONT.
6380
298819b9
AS
6381 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6382
b676b881
AS
6383 * lisp.h: Remove empty conditional.
6384
6045c4fd
PE
63852012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6386
b3350bf9
PE
6387 * lread.c (load_path_check): Now static.
6388
6045c4fd
PE
6389 Fix some minor --with-ns problems found by static checking.
6390 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6391 (x_set_font) [!HAVE_X_WINDOWS]:
6392 * image.c (xpm_load_image) [HAVE_NS]:
6393 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6394 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6395 Remove unused local.
6396 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6397 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6398 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6399 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6400 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6401 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6402 Fix pointer signedness problem.
6403 * xfaces.c (FRAME_X_FONT_TABLE):
6404 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6405
929e7845
GM
64062012-07-07 Glenn Morris <rgm@gnu.org>
6407
6408 * lread.c (load_path_check): New function, split from init_lread.
6409 (init_lread): Reorganize. Motivation:
6410 If EMACSLOADPATH is set, check/warn about that rather than the
6411 defaults, which we are not going to use. Hence we can remove
6412 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6413 Don't warn if site-lisp directories are missing.
6414 If not installed, start from a blank load-path, since
6415 PATH_LOADSEARCH refers to the eventual installation directories.
6416
58dd0aa4
EZ
64172012-07-07 Eli Zaretskii <eliz@gnu.org>
6418
6419 Support truncation and continuation glyphs on GUI frames, when
6420 fringes are disabled. (Bug#11832)
6421 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
6422 continuation glyphs even if on GUI frames.
6423 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
6424 or both, are absent.
6425 (start_display, move_it_in_display_line_to): Handle the case of a
6426 GUI frame without a fringe to display continuation or truncation
6427 glyphs.
6428 (insert_left_trunc_glyphs): Support GUI frames: make sure
6429 truncation glyphs overwrite enough glyphs from the current line to
6430 have sufficient space in pixels.
6431 (display_line): Support truncation and continuation glyphs on GUI
6432 frames. If some spare pixels are left on the line after inserting
6433 the truncation glyphs, fill that space with a stretch glyph of a
6434 suitably computed width.
6435
6436 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6437 produce_glyphs, to support GUI sessions.
6438
31571fd7
PE
64392012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6440
5a16b9bc
PE
6441 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6442
f3047c75
PE
6443 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6444
31571fd7
PE
6445 Do not require float-time's arg to fit in time_t (Bug#11825).
6446 This works better on hosts where time_t is unsigned, and where
6447 float-time is applied to the (negative) difference between two times.
6448 * editfns.c (decode_time_components): Last arg is now double *,
6449 not int *, and means to store all the result as a double, without
6450 worrying about whether the seconds part fits in time_t.
6451 All callers changed.
6452 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6453 All callers changed.
6454 (Ffloat_time): Do not fail merely because the specified time falls
6455 outside of time_t range.
6456
4516fbef
GM
64572012-07-07 Glenn Morris <rgm@gnu.org>
6458
6459 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6460 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6461 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6462
07adc2c6
JB
64632012-07-07 Juanma Barranquero <lekktu@gmail.com>
6464
6465 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6466 Update dependencies.
6467
6468 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6469
fd573f31
PE
64702012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6471
fee5959d
PE
6472 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6473 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6474 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6475 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6476 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6477 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6478
fd573f31
PE
6479 * xfont.c (compare_font_names): Redo to omit the need for casts.
6480
ddadbc0e
AS
64812012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6482
fca8d6b6
AS
6483 * xfns.c (Fx_change_window_property): Doc fix.
6484 * w32fns.c (Fx_change_window_property): Doc fix.
6485
ddadbc0e
AS
6486 * w32fns.c (Fx_window_property): Accept the same arguments as the
6487 X Windows version. Doc fix.
6488 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6489
ed9265fc 64902012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
6491 Eli Zaretskii <eliz@gnu.org>
6492
6493 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6494 Windows-specific code from nt/config.nt moved here.
6495 Obsolete settings removed.
6496
216ee680
PE
64972012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6498
6499 * process.c: Avoid unnecessary calls to gettime.
6500 (wait_reading_process_output): Don't get the time of day
6501 when gobbling data immediately and not waiting, as there's no need
6502 for it in that case. This removes a FIXME.
6503
bdd091e4
JD
65042012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6505
6506 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6507 is defined (Bug#11768).
6508
9d44f8ce
DA
65092012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6510
6511 Fix marker debugging code.
6512 * marker.c (byte_char_debug_check): Do not perform the check
6513 if buffer is not multibyte.
090bd7cb
JB
6514 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6515 Call byte_char_debug_check with correct arguments.
9d44f8ce 6516
90fc4786
DA
65172012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6518
6519 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
6520 * marker.c (byte_char_debug_check, count_markers):
6521 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
6522 (byte_debug_flag): Remove.
6523 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6524 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6525
7b7ae965
DA
65262012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6527
4e57b342
DA
6528 Avoid code repetition in marker-related functions.
6529 * marker.c (attach_marker): New function.
6530 (Fset_marker, set_marker_restricted, set_marker_both)
6531 (set_marker_restricted_both): Use it.
6532 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6533 Consistently rename charno to charpos.
6534 (marker_position): Add eassert.
6535 (marker_byte_position): Convert to eassert.
6536
65372012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6538
6539 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 6540 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 6541 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 6542
657924ff
DA
65432012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6544
6545 Introduce fast path for the widely used marker operation.
6546 * alloc.c (build_marker): New function.
6547 * lisp.h (build_marker): New prototype.
6548 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6549 * composite.c (autocmp_chars): Likewise.
6550 * editfns.c (buildmark): Remove.
6551 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6552 (save_restriction_save): Use build_marker.
6553 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6554 * window.c (save_window_save): Likewise.
6555
041a49a6
DA
65562012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6557
6558 Do not use Fdelete_overlay in delete_all_overlays
6559 to avoid redundant calls to unchain_overlay.
6560 * buffer.c (drop_overlay): New function.
6561 (delete_all_overlays, Fdelete_overlay): Use it.
6562 * minibuf.c (get_minibuffer): Fix comment.
6563
7dca65a4
PE
65642012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6565
6566 Port to OpenBSD 5.1 amd64.
6567 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6568 This is needed for OpenBSD, and should be harmless on all BSD systems.
6569 Also, include <sys/sysctl.h>, as it should be available on all
6570 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6571 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6572 use p_pid member, not kp_proc.pid.
6573
8eb876e2
GM
65742012-07-06 Glenn Morris <rgm@gnu.org>
6575
6576 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6577
38182d90
PE
65782012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6579
6580 More xmalloc and related cleanup.
6581 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6582 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6583 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6584 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6585 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6586 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6587 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6588 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6589 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6590 * xterm.c:
6591 Omit needless casts involving void * pointers and allocation.
6592 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6593 as the former is more robust if P's type is changed.
6594 Prefer xzalloc to xmalloc + memset 0.
6595 Simplify malloc-or-realloc to realloc.
6596 Don't worry about xmalloc returning a null pointer.
6597 Prefer xstrdup to xmalloc + strcpy.
6598 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6599 growing it.
6600 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6601 alloca of a constant.
6602
6dd5a677
EZ
66032012-07-05 Eli Zaretskii <eliz@gnu.org>
6604
6605 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6606 hscroll is larger than the line width. Fixes long and futile
6607 looping inside extend_face_to_end_of_line (on a TTY) producing
6608 glyphs that are not needed and thrown away.
6609
6b312f0f
DA
66102012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6611
6612 * marker.c (set_marker_restricted_both): Simplify by using
6613 clip_to_bounds.
6614
f520ef9b
PE
66152012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6616
6617 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6618
383b7c95
JD
66192012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6620
6621 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6622 not defined (Bug#11768).
6623 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6624 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6625 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6626 followed by gtk_box_set_homogeneous (Bug#11768).
6627 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
6628 (update_theme_scrollbar_width, xg_create_scroll_bar):
6629 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
6630 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6631 (is_box_type): New function (Bug#11768).
6632 (xg_tool_item_stale_p): Call is_box_type.
5293d758 6633 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
6634 with default display (Bug#11768).
6635
d6e7bf45
EZ
66362012-07-05 Eli Zaretskii <eliz@gnu.org>
6637
6638 * xdisp.c (window_hscroll_limited): New function.
6639 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6640 coordinates when window's hscroll is set to insanely large
6641 values. (Bug#11857)
6642
431391ec
JB
66432012-07-05 Juanma Barranquero <lekktu@gmail.com>
6644
6645 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6646 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6647
23f86fce
DA
66482012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6649
6650 Cleanup xmalloc.
6651 * lisp.h (xzalloc): New prototype. Omit needless casts.
6652 * alloc.c (xzalloc): New function. Omit needless casts.
6653 * charset.c: Omit needless casts. Convert all calls to
6654 xmalloc with following memset to xzalloc.
6655 * dispnew.c: Likewise.
6656 * fringe.c: Likewise.
6657 * image.c: Likewise.
6658 * sound.c: Likewise.
6659 * term.c: Likewise.
6660 * w32fns.c: Likewise.
6661 * w32font.c: Likewise.
6662 * w32term.c: Likewise.
6663 * xfaces.c: Likewise.
6664 * xfns.c: Likewise.
6665 * xterm.c: Likewise.
6666 * atimer.c: Omit needless casts.
6667 * buffer.c: Likewise.
6668 * callproc.c: Likewise.
6669 * ccl.c: Likewise.
6670 * coding.c: Likewise.
6671 * composite.c: Likewise.
6672 * doc.c: Likewise.
6673 * doprnt.c: Likewise.
6674 * editfns.c: Likewise.
6675 * emacs.c: Likewise.
6676 * eval.c: Likewise.
6677 * filelock.c: Likewise.
6678 * fns.c: Likewise.
6679 * gtkutil.c: Likewise.
6680 * keyboard.c: Likewise.
6681 * lisp.h: Likewise.
6682 * lread.c: Likewise.
6683 * minibuf.c: Likewise.
6684 * msdos.c: Likewise.
6685 * print.c: Likewise.
6686 * process.c: Likewise.
6687 * region-cache.c: Likewise.
6688 * search.c: Likewise.
6689 * sysdep.c: Likewise.
6690 * termcap.c: Likewise.
6691 * terminal.c: Likewise.
6692 * tparam.c: Likewise.
6693 * w16select.c: Likewise.
6694 * w32.c: Likewise.
6695 * w32reg.c: Likewise.
6696 * w32select.c: Likewise.
6697 * w32uniscribe.c: Likewise.
6698 * widget.c: Likewise.
6699 * xdisp.c: Likewise.
6700 * xmenu.c: Likewise.
6701 * xrdb.c: Likewise.
6702 * xselect.c: Likewise.
6703
0497dc44
PE
67042012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6705
6706 * fileio.c (time_error_value): Check the right error number.
6707 Problem reported by Troels Nielsen in
6708 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6709
356e7178
PE
67102012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6711
4e71fd89
PE
6712 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6713 This should be fixed in a better way; see Eli Zaretskii in
6714 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6715 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6716
f0941253
PE
6717 * fileio.c (time_error_value): Rename from special_mtime.
6718 The old name's problems were noted by Eli Zaretskii in
6719 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6720
065c9eb4
PE
6721 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6722 This variable's comment says Emacs needs at least one GDB-visible
6723 symbol of type enum pvec_type, to work around GDB problems.
6724 The symbol's value doesn't matter.
6725
356e7178
PE
6726 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6727 that causes compilation to fail on pre-C99 compilers.
6728
ed9265fc 67292012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
6730
6731 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6732 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6733
3884d954
DA
67342012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6735
d209e2fb 6736 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
6737 headers for buffer_defaults and buffer_local_symbols.
6738 Reported by Juanma Barranquero <lekktu@gmail.com>.
6739
ee28be33
SM
67402012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6741
6742 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6743 * lisp.h (enum pvec_type): Use fewer bits.
6744 (PSEUDOVECTOR_SIZE_BITS): New constant.
6745 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6746 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6747 change in pvec_type.
6748 (PSEUDOVECTOR_TYPEP): New macro.
6749 (TYPED_PSEUDOVECTORP): Use it.
6750 * fns.c (internal_equal): Adapt code to extract pvectype.
6751 * emacs.c (gdb_pvec_type): Update type.
6752 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6753 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6754 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6755 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6756 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6757 abusing vector->header.next.nbytes.
6758 (live_vector_p): Use PVEC_TYPE.
6759 (mark_object): Adapt code to extract pvectype. Use switch.
6760
c7f2cd7f
PE
67612012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6762
6763 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6764 Tighten new eassert a bit.
6765
8ce70ed2
DA
67662012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6767
6768 Fix compilation with --enable-gcc-warnings and -O1
6769 optimization level.
6770 * doprnt.c (doprnt): Change type of tem to int, initialize
6771 to avoid compiler warning. Add eassert.
6772 * search.c (simple_search): Initialize match_byte to avoid
6773 compiler warning. Add eassert.
6774
dea7f1e5
PE
67752012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6776
24a212eb
PE
6777 Avoid weird behavior with large horizontal scrolls.
6778 Without this change, for example, large hscroll values would
6779 mess up Emacs's display on Fedora 15 x86, presumably due to
6780 overflows in int calculations in the display code.
6781 Also, if buffers had long lines, Emacs would freeze.
6782 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6783 (set_window_hscroll): New function, containing the old guts of
6784 Fset_window_hscroll. Return the clipped value.
6785 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6786 This avoids the need to check against PTRDIFF_MAX.
6787
dea7f1e5
PE
6788 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6789
76046526
DA
67902012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6791
6792 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6793
39adff0d
PE
67942012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6795
63807d47
PE
6796 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6797 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6798 since GCC 4.4.6 issues a bogus warning for them.
6799
39adff0d
PE
6800 Fix bugs in file timestamp newness comparisons.
6801 * fileio.c (Ffile_newer_than_file_p):
6802 * lread.c (Fload): Use full timestamp resolution of files,
6803 not just the 1-second resolution, so that files that are only
6804 slightly newer still count as newer.
6805 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6806 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6807
dbeed9a6
PE
68082012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6809
6810 * fileio.c: Improve handling of file time marker. (Bug#11852)
6811 (special_mtime): New function.
6812 (Finsert_file_contents, Fverify_visited_file_modtime):
6813 Use it to set special mtime values consistently.
6814
636334d6
AS
68152012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6816
6817 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6818 marker for non-existing file. (Bug#11852)
6819
e2017fe2
GM
68202012-07-03 Glenn Morris <rgm@gnu.org>
6821
6822 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6823 and did not make it into globals.h).
6824
404dbd37
TT
68252012-07-03 Tom Tromey <tromey@redhat.com>
6826
6827 * window.c (Fset_window_margins, Fset_window_fringes)
6828 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6829 * textprop.c (Fprevious_property_change): No longer static.
6830 * syntax.c (Fsyntax_table_p): No longer static.
6831 * process.c (Fget_process, Fprocess_datagram_address): No longer
6832 static.
6833 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6834 * keyboard.c (Fcommand_execute): No longer static.
6835 Remove EXFUN.
6836 * insdel.c (Fcombine_after_change_execute): No longer static.
6837 * image.c (Finit_image_library): No longer static.
6838 * fileio.c (Fmake_symbolic_link): No longer static.
6839 * eval.c (Ffetch_bytecode): No longer static.
6840 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
6841 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6842 No longer static.
404dbd37
TT
6843 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6844 static.
6845 * dired.c (Ffile_attributes): No longer static.
6846 * composite.c (Fcomposition_get_gstring): No longer static.
6847 * callproc.c (Fgetenv_internal): No longer static.
6848
6849 * ccl.h: Remove EXFUNs.
6850 * buffer.h: Remove EXFUNs.
6851 * dispextern.h: Remove EXFUNs.
6852 * intervals.h: Remove EXFUNs.
6853 * fontset.h: Remove EXFUN.
6854 * font.h: Remove EXFUNs.
6855 * dosfns.c (system_process_attributes): Remove EXFUN.
6856 * keymap.h: Remove EXFUNs.
6857 * lisp.h: Remove EXFUNs.
6858 * w32term.h: Remove EXFUNs.
6859 * window.h: Remove EXFUNs.
6860 * xsettings.h: Remove EXFUN.
6861 * xterm.h: Remove EXFUN.
6862
8e4fd1e1
GM
68632012-07-03 Glenn Morris <rgm@gnu.org>
6864
6865 * lisp.h (Frandom): Make it visible to C.
6866 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6867 buffer for invisible buffers. (Bug#1229)
6868
ca95b3eb
DA
68692012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6870
6871 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6872 values which aren't power of 2.
14ae4239 6873 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 6874 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
6875 accordingly.
6876
7555c33f
SM
68772012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6878
6879 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6880
6881 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6882
d12e8f5a
DA
68832012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6884
6885 * alloc.c (allocate_vector_block): Remove redundant
6886 calls to mallopt if DOUG_LEA_MALLOC is defined.
6887 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6888 avoid calls to mallopt if zero_vector is returned.
6889
296094c3
DA
68902012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6891
6892 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6893 is enabled, avoid dereferencing NULL current_sblock if
6894 running undumped.
6895
36429c89
DA
68962012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6897
6898 Cleanup basic buffer management.
6899 * buffer.h (struct buffer): Change layout to use generic vector
6900 marking code. Fix some comments. Change type of 'clip_changed'
6901 to bitfield. Remove unused #ifndef old.
6902 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6903 (GET_OVERLAYS_AT): Fix indentation.
6904 (for_each_per_buffer_object_at): New macro.
6905 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6906 (Fbuffer_local_variables): Use it.
6907 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6908 * alloc.c (allocate_buffer): Adjust to match new layout of
6909 struct buffer. Fix comment.
6910 (mark_overlay): New function.
6911 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6912 Lisp area of struct buffer.
6913 (mark_object): Use it. Adjust marking of misc objects
6914 and related comments.
6915
3b3e4cac
PE
69162012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6917
6918 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6919 wrapper that is not needed because the wrapped code is a no-op (zero
6920 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6921 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6922
cf5c0175
DA
69232012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6924
6925 * alloc.c (mark_buffer): Simplify. Remove prototype.
6926 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 6927 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
6928 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6929 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 6930
ca26824c
GM
69312012-06-30 Glenn Morris <rgm@gnu.org>
6932
2e4c5312
GM
6933 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6934
ca26824c
GM
6935 * epaths.in (PATH_SITELOADSEARCH): New.
6936 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6937 This is rather than relying on --enable-locallisppath elements
6938 having "site-lisp" in their names. (Bug#10208#25, 11658)
6939
0d23c240
EZ
69402012-06-30 Eli Zaretskii <eliz@gnu.org>
6941
c9240d7a
EZ
6942 * w32proc.c (sys_select): Accept and ignore one more argument.
6943
6944 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6945
0d23c240 6946 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 6947 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
6948
6949 * sysdep.c: Don't include dos.h and dosfns.h.
6950
6951 * process.c (sys_select):
6952 * msdos.c (sys_select): Accept one more argument and ignore it.
6953
6954 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6955 adapt data types and code to that.
6956
6957 * dosfns.c:
6958 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6959 which clashes with the gnulib function of the same name.
6960
af5a5a98
AS
69612012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6962
c5e4379c
AS
6963 * font.c (font_style_to_value, font_style_symbolic)
6964 (font_prop_validate_style): Add type checks for values in
6965 font_style_table.
6966
af5a5a98
AS
6967 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6968 argument.
6969 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6970 uses.
6971
8d38f461
EZ
69722012-06-29 Eli Zaretskii <eliz@gnu.org>
6973
2e5a6631
EZ
6974 * xdisp.c (try_window_id): Undo last change.
6975
8d38f461
EZ
6976 * w32.c (getwd): Adjust commentary about startup_dir.
6977 (init_environment): Always call sys_access, even in non-MSVC
6978 builds. Don't chdir to the directory of the Emacs executable.
6979 This undoes code from 1997 which was justified by the need to
6980 "avoid conflicts when removing and renaming directories". But its
6981 downside was that every relative file name was being interpreted
6982 relative to the directory of the Emacs executable, which can never
6983 be TRT. In particular, it broke sys_access when called with
6984 relative file names.
6985 (sys_access): Map GetLastError to errno.
6986
2af3565e
DA
69872012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6988
6989 * window.h (struct window): Change type of 'fringes_outside_margins'
6990 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 6991 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
6992 Adjust comment.
6993 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6994 to ptrdiff_t.
6995
c8d3a25c 69962012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 6997
c8d3a25c
GM
6998 * gnutls.c (emacs_gnutls_handshake):
6999 Add QUIT to make the loop interruptible.
57570cd3 7000
c8d3a25c 70012012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 7002
c8d3a25c
GM
7003 * charset.c (init_charset): Make lack of etc/charsets fatal.
7004
3e984ee8
DA
70052012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7006
7007 * editfns.c (region_limit): Fix type mismatch.
7008
ef884f23
DA
70092012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7010
7011 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7012 undefined. Convert from xassert to eassert.
7013 * nsmenu.m: Convert from xassert to eassert.
7014 * nsterm.m: Likewise.
7015
7d7e0027
SM
70162012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7017
7018 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7019
aa754e6a
PE
70202012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7021
7022 Avoid integer overflow on scroll-left and scroll-right.
7023 * window.c (HSCROLL_MAX): New macro.
7024 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7025 overflow when requested scroll falls outside ptrdiff_t range.
7026
80b00b08
DA
70272012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7028
7029 * window.h (struct window): Change type of 'hscroll',
7030 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7031 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7032 Adjust users accordingly.
7033 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7034 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7035 from EMACS_INT to ptrdiff_t.
7036 (make_window): Omit redundant initialization.
7037
62b2bcf6
JB
70382012-06-28 Juanma Barranquero <lekktu@gmail.com>
7039
7040 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7041
45942c7d
DA
70422012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7043
7044 * window.h (struct window): Change type of 'use_time' and
7045 'sequence_number' from Lisp_Object to int.
7046 * frame.c (make_frame): Adjust users accordingly.
7047 * print.c (print_object): Likewise.
7048 * window.c (select_window, Fwindow_use_time, make_parent_window)
7049 (make_window): Likewise.
7050
e509cfa6
DA
70512012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7052
7053 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7054 enabled with --enable-checking=[all,glyphs] configure option.
7055 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7056 adjust comments accordingly.
7057 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7058 undefined, adjust comments accordingly.
7059 * image.c: Likewise.
7060 * scroll.c: Likewise.
7061 * w32fns.c: Likewise.
7062 * w32term.c: Likewise.
7063 * xdisp.c: Likewise.
7064 * xfaces.c: Likewise.
7065 * xfns.c: Likewise.
7066 * xterm.c: Likewise.
7067
a54e2c05
DA
70682012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7069
7070 Generalize run-time debugging checks.
7071 * dispextern.h (XASSERTS): Remove.
7072 * fontset.c (xassert): Remove.
7073 Convert from xassert to eassert.
7074 * alloc.c: Convert from xassert to eassert.
7075 * bidi.c: Likewise.
7076 * dispnew.c: Likewise.
7077 * fns.c: Likewise.
7078 * fringe.c: Likewise.
7079 * ftfont.c: Likewise.
7080 * gtkutil.c: Likewise.
7081 * image.c: Likewise.
7082 * keyboard.c: Likewise.
7083 * menu.c: Likewise.
7084 * process.c: Likewise.
7085 * scroll.c: Likewise.
7086 * sound.c: Likewise.
7087 * term.c: Likewise.
7088 * w32console.c: Likewise.
7089 * w32fns.c: Likewise.
7090 * w32term.c: Likewise.
7091 * window.c: Likewise.
7092 * xdisp.c: Likewise.
7093 * xfaces.c: Likewise.
7094 * xfns.c: Likewise.
7095 * xselect.c: Likewise.
7096 * xterm.c: Likewise.
7097
1ec4b7b2
SM
70982012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7099
7100 * fns.c (maybe_resize_hash_table): Output message when growing the
7101 purify-hashtable.
7102
2014308a
DA
71032012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7104
7105 * alloc.c (allocate_string_data): Remove dead code.
7106 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7107 avoid GCC warning about unused macro.
7108
246155eb
DA
71092012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7110
7111 * alloc.c (allocate_string): Omit intervals initialization.
7112 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7113 as in make_pure_string and make_pure_c_string.
7114
43184b7b
DA
71152012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7116
d209e2fb 7117 * alloc.c (allocate_string): Fix last change.
43184b7b 7118
3fe6dd74
DA
71192012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7120
d209e2fb 7121 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
7122 to memset, add explicit initialization where appropriate.
7123
1ba6038a
GM
71242012-06-27 Glenn Morris <rgm@gnu.org>
7125
7126 * lisp.mk (lisp): Remove paths.elc.
7127
c89926a5
CY
71282012-06-27 Chong Yidong <cyd@gnu.org>
7129
7130 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7131
ed6b3510
JW
71322012-06-26 John Wiegley <johnw@newartisans.com>
7133
1ec4b7b2 7134 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
7135 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7136
ed6b3510
JW
7137 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7138 when building with Clang.
7139
8edd4a2b
SM
71402012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7141
7142 * eval.c (Fapply): Allow calling it with a single argument.
7143
f6f62d1b
EZ
71442012-06-26 Eli Zaretskii <eliz@gnu.org>
7145
7146 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7147 _stricmp and _strnicmp.
7148 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7149
62efea5e
DA
71502012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7151
7152 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7153 allocated window.
7154 (allocate_process): Likewise for new process.
8edd4a2b 7155 (allocate_terminal): Change to use offsetof.
62efea5e
DA
7156 (allocate_frame): Likewise.
7157 * frame.c (make_frame): Omit redundant initialization.
7158 * window.c (make_parent_window): Use memset.
7159 (make_window): Omit redundant initialization.
7160 * process.c (make_process): Omit redundant initialization.
7161 * terminal.c (create_terminal): Likewise.
7162
42997f4d
DA
71632012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7164
7165 * term.c (delete_tty): Remove redundant call to memset.
7166
1130ecfc
DA
71672012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7168
7169 * alloc.c: Remove build_string.
7170 * lisp.h: Define build_string as static inline. This provides
7171 a better opportunity to optimize away calls to strlen when the
7172 function is called with compile-time constant argument.
7173 * image.c (imagemagick_error): Convert to build_string.
7174 * w32proc.c (sys_spawnve): Likewise.
7175 * xterm.c (x_term_init): Likewise.
7176
cf38a720
PE
71772012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7178
99027bdd
PE
7179 Use sprintf return value instead of invoking strlen on result.
7180 In the old days this wasn't portable, since some sprintf
7181 implementations returned char *. But they died out years ago and
7182 Emacs already assumes sprintf returns int.
7183 Similarly for float_to_string.
7184 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7185 * ccl.c (ccl_driver):
7186 * character.c (string_escape_byte8):
7187 * data.c (Fnumber_to_string):
7188 * doprnt.c (doprnt):
7189 * print.c (print_object):
7190 * xdisp.c (message_dolog):
7191 * xfns.c (syms_of_xfns):
7192 Use sprintf or float_to_string result to avoid need to call strlen.
7193 * data.c (Fnumber_to_string):
7194 Use make_unibyte_string, since the string must be ASCII.
7195 * lisp.h, print.c (float_to_string): Now returns int length.
7196 * term.c (produce_glyphless_glyph):
7197 Use sprintf result rather than recomputing it.
7198
cf38a720
PE
7199 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7200 * Makefile.in (ALL_CFLAGS):
7201 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7202 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7203
3511c784
DA
72042012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7205
0a08eb21 7206 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
7207 strcasecmp if available.
7208 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7209
fb7da12e
AS
72102012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7211
7212 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7213 Avoid comma operator.
7214 * menu.c (push_submenu_start, push_submenu_end)
7215 (push_left_right_boundary, push_menu_pane): Likewise.
7216 * msdos.c (dos_rawgetc): Likewise.
7217
afa2ffd8
DA
72182012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7219
7220 * xfns.c (xic_create_fontsetname): Remove redundant calls
7221 to memset.
7222
b3b4476b
PE
72232012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7224
4495ff38
PE
7225 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7226 sprintf already null-terminates its output.
7227
b3b4476b
PE
7228 * xfns.c (x_window): Remove redundant cast.
7229
b00876c9
DA
72302012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7231
7232 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7233 `const char *' to `char *' to avoid compiler warning.
7234
d188e26b
PE
72352012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7236
885d1d74
PE
7237 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7238 instead of truncating it to 63 (admittedly a generous limit).
7239
d188e26b
PE
7240 * process.c: Fix spelling and caps in comments.
7241
e2f560b1
DN
72422012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7243
e86db54b 7244 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
7245 * sysdep.c (setpgrp): Remove definition, not used in this file.
7246
7583a3a1
JB
72472012-06-24 Juanma Barranquero <lekktu@gmail.com>
7248
7249 * makefile.w32-in: Update dependencies.
7250
696056c2
EZ
72512012-06-24 Eli Zaretskii <eliz@gnu.org>
7252
7253 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7254 (SYSTIME_H): Add nt/inc/sys/time.h.
7255
7256 * systime.h [WINDOWSNT]: Include sys/time.h.
7257
7258 * s/ms-w32.h (struct timespec): Definition moved from
7259 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7260
845ca893
PE
72612012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7262
7263 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7264 * buffer.h (buffer_slot_type_mismatch):
7265 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7266 * eval.c (unwind_to_catch):
7267 * image.c (my_png_error, my_error_exit):
7268 * keyboard.c (quit_throw_to_read_char, user_error)
7269 (Fexit_recursive_edit, Fabort_recursive_edit):
7270 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7271 (wrong_type_argument, buffer_overflow, __executable_start)
7272 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7273 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7274 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7275 (fatal):
7276 (child_setup) [!DOS_NT]:
7277 * lread.c (end_of_file_error, invalid_syntax):
7278 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7279 * puresize.h (pure_write_error):
7280 * search.c (matcher_overflow):
7281 * sound.c (sound_perror, alsa_sound_perror):
7282 * sysdep.c, syssignal.h (croak):
7283 * term.c (maybe_fatal, vfatal):
7284 * textprop.c (text_read_only):
7285 * undo.c (user_error):
7286 * unexmacosx.c (unexec_error):
7287 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7288 Use _Noreturn rather than NO_RETURN.
7289 No need for separate decl merely because of _Noreturn.
7290 * sound.c (sound_warning, parse_sound):
7291 Remove unnecessary forward decls.
7292
f1dd8073
PE
72932012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7294
7295 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7296 * lisp.h (WAIT_READING_MAX): New macro.
7297 * dispnew.c (Fsleep_for, sit_for):
7298 * keyboard.c (kbd_buffer_get_event):
7299 * process.c (Faccept_process_output):
7300 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7301 This improves on the previous patch, which introduced a bug
7302 when time_t is unsigned and as wide as intmax_t.
7303 See <http://bugs.gnu.org/9000#51>.
7304
b82c1755
EZ
73052012-06-23 Eli Zaretskii <eliz@gnu.org>
7306
7307 * dispnew.c (sit_for, Fsleep_for):
7308 * keyboard.c (kbd_buffer_get_event):
7309 * process.c (Faccept_process_output): Avoid compiler warnings when
7310 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7311
ca300656
JB
73122012-06-23 Juanma Barranquero <lekktu@gmail.com>
7313
049ec95b
JB
7314 * makefile.w32-in: Update dependencies.
7315
ca300656
JB
7316 * w32.c (ltime): Add return type and declare static.
7317 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7318
db7b8d06
PE
73192012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7320
7321 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7322 Privately reported by Herbert J. Skuhra.
7323 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7324 All uses changed.
7325 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7326 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7327
0bd8297f
EZ
73282012-06-23 Eli Zaretskii <eliz@gnu.org>
7329
96512555
EZ
7330 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7331 last argument of make_unibyte_string.
7332
0bd8297f
EZ
7333 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7334 language ID in the event parameters.
7335
7336 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7337 event.code, not the obscure "character set ID".
7338
63def6b6
CY
73392012-06-23 Chong Yidong <cyd@gnu.org>
7340
7341 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7342
e8a02204
EZ
73432012-06-23 Eli Zaretskii <eliz@gnu.org>
7344
388cdec0
EZ
7345 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7346 * w32.c (fdutimens): New function.
7347
7348 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7349
7350 * s/ms-w32.h (pselect): Redirect to sys_select.
7351
7352 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7353
e8a02204
EZ
7354 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7355 in the logic of incrementing and decrementing the value of
7356 use_relocatable_buffers.
7357
d054f3fb
PE
73582012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7359
7360 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7361 Privately reported by Herbert J. Skuhra.
7362 [__FreeBSD__]: Remove "*/" typo after "#include".
7363 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7364 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7365 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7366 Don't assume EMACS_TIME and struct timeval are the same type.
7367
d35af63c
PE
73682012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7369
7370 Support higher-resolution time stamps (Bug#9000).
7371 The time stamps are only nanosecond-resolution at the C level,
7372 since that's the best that any real-world system supports now.
7373 But they are picosecond-resolution at the Lisp level, as that's
7374 easy, and leaves room for future OS improvements.
7375
7376 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7377 (LIBES): Use it.
7378
7379 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7380 Don't get current time unless it's needed.
7381
7382 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7383 now provides it if it's absent.
7384 (start_atimer): Port to higher-res time stamps.
7385 Check for time stamp overflow. Don't get current time more
7386 often than is needed.
7387
7388 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7389 Include systime.h, not time.h.
7390 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7391
7392 * dired.c: Include stat-time.h.
7393 (Ffile-attributes): File times now have higher resolution.
7394
7395 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7396 (struct image): Timestamp now has higher resolution.
7397
7398 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7399 has at least microseconds now. All uses removed.
7400 (update_frame, update_single_window, update_window, update_frame_1)
7401 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 7402 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
7403
7404 * editfns.c (time_overflow): Now extern.
7405 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7406 (float-time, Fformat_time_string, Fcurrent_time_string)
7407 (Fcurrent_time_zone): Accept and generate higher-resolution
7408 time stamps.
7409 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7410 (decode_time_components, lisp_seconds_argument): New functions.
7411 (make_time): Now static.
7412 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7413 Report an error if the time is invalid, rather than having the caller
7414 do that.
7415
7416 * fileio.c: Include <stat-time.h>
7417 (Fcopy_file): Copy higher-resolution time stamps.
7418 Prefer to set the time stamp via a file descriptor if that works.
7419 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7420 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7421 (Fvisited_file_modtime, Fset_visited_file_modtime):
7422 Support higher-resolution time stamps.
7423
7424 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7425
7426 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7427
7428 * image.c (prepare_image_for_display, clear_image_cache)
7429 (lookup_image): Port to higer-resolution time stamps.
7430
7431 * keyboard.c (start_polling, bind_polling_period):
7432 Check for time stamp overflow.
7433 (read_char, kbd_buffer_get_event, timer_start_idle)
7434 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7435 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7436 Port to higher-resolution time stamps. Do not assume time_t is signed.
7437 (decode_timer): New function. Timers are now vectors of length 9,
7438 not 8, to accommodate the picosecond component.
7439 (timer_check_2): Use it.
7440
7441 * nsterm.m (select_timeout, timeval_subtract): Remove.
7442 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7443 as they're a bit more accurate and handle overflow better.
7444 (ns_select): Change prototype to be compatible with pselect.
7445 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7446 * nsterm.h (ns_select): Adjust prototype.
7447
7448 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7449 us-resolution time stamps.
7450 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7451
7452 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7453
7454 * lisp.h (time_overflow): New decl.
7455 (wait_reading_process_output): First arg is now intmax_t, not int,
7456 to accommodate larger waits.
7457
7458 * process.h (struct Lisp_Process.read_output_delay):
7459 Now counts nanoseconds, not microseconds.
7460 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7461 EMACS_HAS_USECS.
7462 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7463 (wait_reading_process_output):
7464 Port to ns-resolution time stamps.
7465 (Faccept_process_output, wait_reading_process_output):
7466 Check for time stamp overflow. Do not assume time_t is signed.
7467 (select_wrapper): Remove; we now use pselect.
7468 (Fprocess_attributes): Now generates ns-resolution time stamps.
7469
7470 * sysdep.c: Include utimens.h. Don't include utime.h
7471 or worry about struct utimbuf; gnulib does that for us now.
7472 (gettimeofday): Remove; gnulib provides a substitute.
7473 (make_timeval): New function.
7474 (set_file_times): Now sets ns-resolution time stamps.
7475 New arg FD; all uses changed.
7476 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7477 (system_process_attributes):
7478 Now returns ns-resolution time stamp. All uses changed.
7479 Check for time stamp overflow.
7480
7481 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7482 provides a substitute now.
7483
7484 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7485 since it guarantees struct timespec.
7486 (EMACS_TIME): Now struct timespec, so that we can support
7487 ns-resolution time stamps.
7488 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7489 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7490 (EMACS_USECS): Remove.
7491 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7492 so multiply the arg by 1000 before storing it.
7493 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7494 New macros.
7495 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7496 Port to ns-resolution time stamps.
7497 (EMACS_TIME_NEG_P): Remove; replaced by....
7498 (EMACS_TIME_SIGN): New macro.
7499 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7500 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7501 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7502 (make_timeval, make_lisp_time, decode_time_components): New decls.
7503 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7504 that it mishandled time_t overflow. You can't compare by subtracting!
7505 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7506 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7507
7508 * term.c: Include <sys/time.h>.
7509 (timeval_to_Time): New function, for proper overflow wraparound.
7510 (term_mouse_position, term_mouse_click): Use it.
7511
7512 * undo.c (record_first_change): Support higher-resolution time stamps
7513 in the undo buffer.
7514 (Fprimitive_undo): Use them when restoring time stamps.
7515
7516 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7517 (w32_get_internal_run_time):
7518 Port to higher-resolution Emacs time stamps.
7519 (ltime): Now accepts single 64-bit integer, as that's more convenient
7520 for callers.
7521
7522 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7523
7524 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7525 for compatibility with pselect. Support ns-resolution time stamps.
7526
7527 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7528
7529 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7530 Check for time stamp overflow, and support ns-resolution time stamps.
7531
7532 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7533 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7534 (timeval_subtract): Remove; no longer needed.
7535 (XTflash, XTring_bell, x_wait_for_event):
7536 Port to ns-resolution time stamps. Don't assume time_t is signed.
7537
b6a92dfe
CY
75382012-06-22 Chong Yidong <cyd@gnu.org>
7539
7540 * xdisp.c (x_consider_frame_title): Revert last change.
7541
d251c37c
EZ
75422012-06-22 Eli Zaretskii <eliz@gnu.org>
7543
7544 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7545 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7546 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7547 staticidx goes up to 1597 out of 1600 = 0x640.)
7548
f10deafb
PE
75492012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7550
7551 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7552 Otherwise, the umask might be mistakenly 0 while handling input signals.
7553
ec6de1e2
SM
75542012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7555
7556 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7557
28be1ada
DA
75582012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7559
7560 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7561 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7562 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7563 access to `contents' member of Lisp_Vector objects with AREF and ASET
7564 where appropriate.
7565
c6bf3022
CY
75662012-06-19 Chong Yidong <cyd@gnu.org>
7567
7568 * frame.c (delete_frame): When selecting a frame on a different
7569 text terminal, do not alter the terminal's top-frame.
7570
7571 * xdisp.c (format_mode_line_unwind_data): Record the target
7572 frame's selected window and its terminal's top-frame.
7573 (unwind_format_mode_line): Restore them.
7574 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7575 Callers changed.
7576 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7577 since tty frames can be explicitly named.
7578 (prepare_menu_bars): Likewise.
7579
7580 * term.c (Ftty_top_frame): New function.
7581
defd4196
PE
75822012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7583
7584 Port byte-code-meter to modern targets.
7585 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7586 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 7587 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
7588 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7589 (METER_1, METER_2): Simplify.
7590
1053a871
SM
75912012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7592
7593 * data.c (Fdefalias): Return `symbol' (bug#11686).
7594
b7e8d081
MR
75952012-06-18 Martin Rudalics <rudalics@gmx.at>
7596
7597 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
7598 gets killed during executing of this function (Bug#11665).
7599 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
7600 (Vkill_buffer_query_functions): In doc-string say that functions
7601 run by this hook should not change the current buffer.
7602
7ea2b339
PE
76032012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7604
7605 Fix recently-introduced process.c problems found by static checking.
7606 * process.c (write_queue_push, write_queue_pop, send_process):
7607 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7608 (write_queue_pop): Fix pointer signedness problem.
7609 (send_process): Remove unused local.
7610
96a313a1
CY
76112012-06-17 Chong Yidong <cyd@gnu.org>
7612
7613 * xdisp.c (redisplay_internal): No need to redisplay terminal
7614 frames that are not on top.
7615
20ca2e94
TN
76162012-06-17 Troels Nielsen <bn.troels@gmail.com>
7617
7618 * process.c (make_process): Initialize write_queue.
7619 (write_queue_push, write_queue_pop): New functions.
7620 (send_process): Use them to maintain correct ordering of process
7621 writes (Bug#10815).
7622
9a900ca9
PE
76232012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7624
310fbfa8
PE
7625 * lisp.h (eassert): Assume C89 or later.
7626 This removes the need for CHECK.
7627 (CHECK): Remove. Its comments about always evaluating its
7628 argument were confusing, as 'eassert' typically does not evaluate
7629 its argument.
7630
27bb1ca4
PE
7631 * coding.c (produce_chars): Use ptrdiff_t, not int.
7632
9a900ca9
PE
7633 * xterm.c (x_draw_underwave): Check for integer overflow.
7634 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7635
41b7f8bc 76362012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
7637
7638 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7639 referenced (Bug#11583).
7640
9b0e3eba
AA
76412012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7642
7643 Implement wave-style variant of underlining.
7644 * dispextern.h (face_underline_type): New enum.
7645 (face): Add field for underline type.
7646 * nsterm.m (ns_draw_underwave): New function.
7647 (ns_draw_text_decoration): Use it.
7648 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7649 New functions.
7650 (x_draw_glyph_string): Use them.
7651 * xfaces.c (Qline, Qwave): New Lisp objects.
7652 (check_lface_attrs, merge_face_ref)
1053a871
SM
7653 (Finternal_set_lisp_face_attribute, realize_x_face):
7654 Handle wave-style underline face attributes.
9b0e3eba
AA
7655 * xterm.c (x_draw_underwave): New function.
7656 (x_draw_glyph_string): Use it.
7657
0fb52f11
JB
76582012-06-16 Juanma Barranquero <lekktu@gmail.com>
7659
7660 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7661 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7662 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7663 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7664 ($(BLD)/w32select.$(O)): Update dependencies.
7665
e5560ff7
AS
76662012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7667
7668 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7669 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7670 * character.c (_fetch_multibyte_char_p): Remove.
7671 * alloc.c: Include "character.h" before "buffer.h".
7672 * bidi.c: Likewise.
7673 * buffer.c: Likewise.
7674 * bytecode.c: Likewise.
7675 * callint.c: Likewise.
7676 * callproc.c: Likewise.
7677 * casefiddle.c: Likewise.
7678 * casetab.c: Likewise.
7679 * category.c: Likewise.
7680 * cmds.c: Likewise.
7681 * coding.c: Likewise.
7682 * composite.c: Likewise.
7683 * dired.c: Likewise.
7684 * dispnew.c: Likewise.
7685 * doc.c: Likewise.
7686 * dosfns.c: Likewise.
7687 * editfns.c: Likewise.
7688 * emacs.c: Likewise.
7689 * fileio.c: Likewise.
7690 * filelock.c: Likewise.
7691 * font.c: Likewise.
7692 * fontset.c: Likewise.
7693 * fringe.c: Likewise.
7694 * indent.c: Likewise.
7695 * insdel.c: Likewise.
7696 * intervals.c: Likewise.
7697 * keyboard.c: Likewise.
7698 * keymap.c: Likewise.
7699 * lread.c: Likewise.
7700 * macros.c: Likewise.
7701 * marker.c: Likewise.
7702 * minibuf.c: Likewise.
7703 * nsfns.m: Likewise.
7704 * nsmenu.m: Likewise.
7705 * print.c: Likewise.
7706 * process.c: Likewise.
7707 * regex.c: Likewise.
7708 * region-cache.c: Likewise.
7709 * search.c: Likewise.
7710 * syntax.c: Likewise.
7711 * term.c: Likewise.
7712 * textprop.c: Likewise.
7713 * undo.c: Likewise.
7714 * unexsol.c: Likewise.
7715 * w16select.c: Likewise.
7716 * w32fns.c: Likewise.
7717 * w32menu.c: Likewise.
7718 * window.c: Likewise.
7719 * xdisp.c: Likewise.
7720 * xfns.c: Likewise.
7721 * xmenu.c: Likewise.
7722 * xml.c: Likewise.
7723 * xselect.c: Likewise.
7724
2f07e6af
EZ
77252012-06-16 Eli Zaretskii <eliz@gnu.org>
7726
1053a871
SM
7727 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7728 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 7729 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
7730 row.
7731 (handle_face_prop): Use chunk-relative overlay string index when
7732 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
7733 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7734 the rightmost. (Bug#11720)
2f07e6af 7735
29b83cec
AS
77362012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7737
7738 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7739 (CATEGORY_MEMBER): Enforce 1/0 value.
7740 * category.c (_temp_category_set): Remove.
7741
4c5501e9
EZ
77422012-06-16 Eli Zaretskii <eliz@gnu.org>
7743
7744 * window.c (Fdelete_other_windows_internal)
7745 (Fdelete_window_internal): Don't access frame's mouse highlight
7746 info of the initial frame. (Bug#11677)
7747
2b570124
PE
77482012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7749
e93864f9
PE
7750 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7751 Assume USE_2_TAGS_FOR_INTS.
7752 (xreload): Adjust $tagmask width to match recent lisp.h change.
7753
2b570124
PE
7754 Simplify lisp.h in minor ways that should not affect code.
7755 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7756 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7757 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7758 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7759 (INTTYPEBITS): New macro, for clarity.
7760 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
7761 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7762 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
7763 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7764 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7765
81755f69
JB
77662012-06-13 Juanma Barranquero <lekktu@gmail.com>
7767
7768 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7769
16192a57
GM
77702012-06-13 Glenn Morris <rgm@gnu.org>
7771
7772 * s/bsd-common.h (BSD4_3):
7773 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7774
646b5f55
AS
77752012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7776
7777 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7778 instead of union.
7779 (XLI, XIL): Define.
1053a871
SM
7780 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7781 Use them.
7782 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 7783 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 7784 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
7785 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7786 * frame.c (delete_frame): Remove outdated comment.
7787 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7788 USE_LISP_UNION_TYPE.
7789 (Fw32_unregister_hot_key): Likewise.
7790 (Fw32_toggle_lock_key): Likewise.
7791 * w32menu.c (add_menu_item): Likewise.
7792 (w32_menu_display_help): Use XIL instead of checking
7793 USE_LISP_UNION_TYPE.
7794 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7795 (init_heap): Likewise.
7796 * w32term.c (w32_read_socket): Update comment.
7797
1d3823c9
GM
77982012-06-13 Glenn Morris <rgm@gnu.org>
7799
c62ff706
GM
7800 * s/usg5-4-common.h, src/s/unixware.h:
7801 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7802
1d3823c9
GM
7803 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7804
bfe3e0a2
PE
78052012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7806
7807 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7808 * alloc.c (make_number) [!defined make_number]:
7809 Remove, as lisp.h always defines this now.
7810 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7811 (roundup_size): Verify that it is a power of 2.
7812 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7813 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7814 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7815 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7816 USE_LSB_TAG now is always defined to be either 0 or 1.
7817 All uses changed.
7818 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7819 code works fine either way, and efficiency is not a concern here,
7820 as the union type is for debugging, not for production.
7821 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7822 Use an inline function on all platforms when using the union type,
7823 since this is simpler and 'static inline' can be used portably
7824 within Emacs now.
7825 (LISP_INITIALLY_ZERO): New macro.
7826 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7827 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7828
45fa9c0f
GM
78292012-06-12 Glenn Morris <rgm@gnu.org>
7830
b4492cba
GM
7831 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7832
7833 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 7834
45fa9c0f
GM
7835 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7836 Move BROKEN_SIGIO to configure.
7837
7838 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7839 Move NO_TERMIO to configure.
7840
0e25d334
CY
78412012-06-12 Chong Yidong <cyd@gnu.org>
7842
7843 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7844 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7845 MagickExportImagePixels is undefined.
7846
43682bb6
PE
78472012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7848
7849 * image.c (imagemagick_load_image): Remove unused label.
7850
a9be7d2b
GM
78512012-06-11 Glenn Morris <rgm@gnu.org>
7852
7853 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7854 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7855 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7856 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7857
3017f87f
SM
78582012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7859
7860 * alloc.c (make_byte_code): New function.
7861 (Fmake_byte_code): Use it. Don't purify here.
7862 * lread.c (read1): Use it as well to avoid extra allocation.
7863
1b9b4cf4
CY
78642012-06-11 Chong Yidong <cyd@gnu.org>
7865
7866 * image.c (imagemagick_load_image): Implement transparency.
7867
95988fcf
AS
78682012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7869
7870 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7871 account for preceding backslashes. (Bug#11663)
7872
cd4eb164
CY
78732012-06-09 Chong Yidong <cyd@gnu.org>
7874
7875 * term.c: Support italics in capable terminals (Bug#9652).
7876 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7877 (turn_on_face): Output using TS_enter_italic_mode if available.
7878 Don't handle unused blinking and alt-charset cases.
7879 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7880 and tty_alt_charset_p cases.
7881 (tty_capable_p, init_tty): Support italics.
7882
7883 * termchar.h (struct tty_display_info): Add field for italics.
7884 Remove unused blink field.
7885
7886 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7887 Handle slant.
7888
7889 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7890 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7891 tty_alt_charset_p. Add tty_italic_p.
7892
ff88beb8
MA
78932012-06-09 Michael Albinus <michael.albinus@gmx.de>
7894
7895 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7896 dbus_type_is_basic if available.
7897 (xd_extract_signed, xd_extract_unsigned): Rename from
7898 extract_signed and extract_unsigned, respectively. Adapt callers.
7899
44286096
CY
79002012-06-09 Chong Yidong <cyd@gnu.org>
7901
1682701f
CY
7902 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7903
44286096
CY
7904 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7905 case (Bug#9752).
7906
d86feb17
PE
79072012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7908
7909 * xdisp.c (vmessage): Treat frame message as multibyte.
7910 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7911 would generate the diagnostic "Making \302\247 buffer-local while
7912 let-bound!".
7913
d5c20fe8
EZ
79142012-06-08 Eli Zaretskii <eliz@gnu.org>
7915
7916 * dispnew.c (showing_window_margins_p): Undo last change, which
7917 was done due to an inadvertent commit.
7918 (adjust_frame_glyphs_for_frame_redisplay): Do call
7919 showing_window_margins_p.
7920
513749ee
SM
79212012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7922
7923 * eval.c (Fmake_var_non_special): New primitive.
7924 (syms_of_eval): Defsubr it.
7925 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7926
d4a8f5c1
JB
79272012-06-08 Juanma Barranquero <lekktu@gmail.com>
7928
7929 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7930 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7931
8bbbc977
EZ
79322012-06-08 Eli Zaretskii <eliz@gnu.org>
7933
7934 * alloc.c (allocate_vectorlike): Fix last change.
7935
f3372c87
DA
79362012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7937
7938 Block-based vector allocation of small vectors.
7939 * lisp.h (struct vectorlike_header): New field `nbytes',
7940 adjust comment accordingly.
7941 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 7942 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
7943 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7944 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7945 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7946 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7947 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7948 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7949 (roundup_size): New constant.
7950 (struct vector_block): New data type.
7951 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 7952 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
7953 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7954 (sweep_vectors): New functions.
7955 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 7956 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
7957 or equal to VBLOCK_BYTES_MAX.
7958 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7959 (init_alloc_once): Add call to init_vectors.
7960
4f18a4ed
SM
79612012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7962
7963 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7964
86f158bc
PE
79652012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7966
7967 * doprnt.c (doprnt): Truncate multibyte char correctly.
7968 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7969 would mishandle a string argument "Xc" if X was a multibyte
7970 character of length 2: it would truncate after X's first byte
7971 rather than including all of X.
7972
c5cfcbe0
CY
79732012-06-06 Chong Yidong <cyd@gnu.org>
7974
7975 * buffer.c (word_wrap): Doc fix.
7976
c05cf390
PE
79772012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7980
0c3461de
GM
79812012-06-03 Glenn Morris <rgm@gnu.org>
7982
7983 * xdisp.c (tool-bar-style): Doc fix.
7984
c71232db
UM
79852012-06-03 Ulrich Müller <ulm@gentoo.org>
7986
7987 * Makefile.in (PAXCTL): Define.
7988 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7989 binary via PaX flags if the paxctl utility is available.
7990 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7991 Restore PaX flags to their default. (Bug#11398)
7992
383f7350
CY
79932012-06-03 Chong Yidong <cyd@gnu.org>
7994
7995 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7996 buffer (Bug#11226).
7997
5f2c76c6
CY
79982012-06-03 Chong Yidong <cyd@gnu.org>
7999
8000 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8001 (note_mode_line_or_margin_highlight): If there is no help echo,
8002 use mode-line-default-help-echo. Handle the case where the mouse
8003 position is past the end of the mode line string.
8004
8005 * buffer.c (buffer_local_value_1): New function, split from
8006 Fbuffer_local_value; can return Qunbound.
8007 (Fbuffer_local_value): Use it.
8008 (Vmode_line_format): Docstring tweaks.
8009
773d47f6
PE
80102012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8011
8012 * sysdep.c (system_process_attributes): Improve comment.
8013
f2d6a3df
SM
80142012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8015
8016 * keyboard.c: Export real-this-command to Elisp.
8017 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8018 and DEFVAR it. Update all users.
8019
63810350
PE
80202012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8021
7bd5c1f4
PE
8022 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8023
63810350
PE
8024 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8025 Convert pctcpu and pctmem to Lisp float properly.
8026 Let the compiler fold better, as 100.0/0x8000 is exact.
8027
a2821611
AS
80282012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8029
8030 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8031 cons_block.
8032
5fceba1d
PE
80332012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8034
8035 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8036
c98ff5dd
DA
80372012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8038
8039 For a 'struct window', replace some Lisp_Object fields to
8040 bitfields where appropriate, remove unused fields.
8041 * window.h (struct window): Remove unused 'last_mark_x' and
8042 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 8043 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
8044 Change type of 'force_start', 'optional_new_start',
8045 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 8046 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 8047
ca34e0be
PE
80482012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8049
8050 Pacify gcc -Wdouble-precision when using Xaw.
8051 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8052 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8053 Use 'float' consistently, rather than 'float' in most places
8054 and 'double' in a couple of places.
8055
efc00ab1 80562012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
8057
8058 * xdisp.c (handle_stop): Detect whether we have overlay strings
8059 loaded by testing it->current.overlay_string_index to be
8060 non-negative, instead of checking whether n_overlay_strings is
8061 positive. (Bug#11587)
8062
efc00ab1 80632012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
8064
8065 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8066
8067 * doc.c (Fsubstitute_command_keys): Doc fix.
8068
efc00ab1 80692012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
8070
8071 * search.c (search_buffer): Remove calls to
8072 r_alloc_inhibit_buffer_relocation, as it is now called by
8073 maybe_unify_char, which was the cause of relocation of buffer text
8074 in bug#11519.
8075
efc00ab1 80762012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
8077
8078 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8079 for the duration of call to load_charset, to avoid problems with
8080 callers of maybe_unify_char that access buffer text through C
8081 pointers.
8082
8083 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8084 decrement the inhibition flag, instead of just setting or
8085 resetting it.
8086
ba93a187
PE
80872012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8088
8089 Remove obsolete '#define static' cruft.
8090 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8091 This #undef was "temporary" in 2000; it is no longer needed
8092 now that '#define static' has gone away.
8093 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8094 (gray_bitmap_bits): Remove; no longer needed.
8095 All uses replaced with definiens.
8096 * xterm.c: Include "bitmaps/gray.xbm".
8097
9e4bf381
PE
80982012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8099
8100 Clean up __executable_start, monstartup when --enable-profiling.
8101 The following changes affect the code only when profiling.
8102 * dispnew.c (__executable_start): Rename from safe_bcopy.
8103 Define only on platforms that need it.
8104 * emacs.c: Include <sys/gmon.h> when profiling.
8105 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8106 (__executable_start): Remove decl, since lisp.h does it now.
8107 (safe_bcopy): Remove decl; no longer has that name.
8108 (main): Coalesce #if into single bit of code, for simplicity.
8109 Cast pointers to uintptr_t, since standard libraries want integers
8110 and not pointers.
8111 * lisp.h (__executable_start): New decl.
8112
32d72c2f
GM
81132012-05-31 Glenn Morris <rgm@gnu.org>
8114
8115 * image.c (Fimagemagick_types): Doc fix.
8116
baac5bc7
JM
81172012-05-30 Jim Meyering <meyering@redhat.com>
8118
8119 * callproc.c (Fcall_process_region): Include directory component
8120 in mkstemp error message (Bug#11586).
8121
72cb32cf
PE
81222012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8123
8124 * alloc.c, lisp.h (make_pure_vector): Now static.
8125
61b108cc
SM
81262012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8127
8128 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8129 Move to byte-run.el.
8130 (Fautoload): Do the hash-doc more carefully.
8131 * data.c (Fdefalias): Purify definition, except for keymaps.
8132 (Qdefun): Move from eval.c.
8133 * lisp.h (Qdefun): Remove.
8134 * lread.c (read1): Tiny simplification.
8135
471fe23d
TN
81362012-05-29 Troels Nielsen <bn.troels@gmail.com>
8137
934f3f58 8138 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
8139 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8140 Bug#9642, but explicitly check that the buffer the overlay would
8141 be moved to is live and rearrange lines to make sure that errors
8142 will not put the overlay in an inconsistent state.
8143 (Fdelete_overlay): Cosmetics.
8144
85d0efd1
EZ
81452012-05-28 Eli Zaretskii <eliz@gnu.org>
8146
8147 * w32term.c (my_bring_window_to_top): New function.
8148 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
8149 could be different from the original one.
8150 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
8151 (Bug#11513)
8152
8153 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8154 by calling BringWindowToTop.
8155
8156 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8157 (WM_EMACS_END): Increase by one.
8158
da92a98c
PE
81592012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8160
8161 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8162 This avoids undefined behavior that might cause the eassert
8163 to not catch an out-of-range value.
8164
74d1f848
JB
81652012-05-28 Juanma Barranquero <lekktu@gmail.com>
8166
8167 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8168 Update dependencies.
8169
9e1a06fc
EZ
81702012-05-27 Eli Zaretskii <eliz@gnu.org>
8171
8172 * bidi.c (bidi_mirror_char): Fix last change.
8173
f3dd7312
AS
81742012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8175
8176 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8177 when referring to sectname field in printf format.
8178
81899c91
PE
81792012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8180
57b81a9f
PE
8181 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8182 Only r_alloc_inhibit_buffer_relocation needed to be added;
8183 the others were already declared.
8184
81899c91
PE
8185 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8186 before checking whether it's out of range. Put the check inside
8187 eassert. See
8188 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8189
33017faf 81902012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
8191
8192 * callproc.c (Fcall_process): Restore a line that was accidentally
8193 commented out in the 2011-02-13 change (bug#11547).
8194
33017faf 81952012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
8196
8197 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8198 defined on ralloc.c.
8199
8200 * buffer.c [REL_ALLOC]: Remove prototypes of
8201 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8202 they are now on lisp.h.
8203
8204 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8205
8206 * search.c (search_buffer): Use it to inhibit relocation of buffer
8207 text while re_search_2 is doing its job, because re_search_2 is
8208 passed C pointers to buffer text. (Bug#11519)
8209
23415acf
EZ
8210 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8211 Update value to 24.
8212
44e27368
EZ
8213 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8214 state after an additional call to move_it_in_display_line_to, keep
8215 the values of it->max_ascent and it->max_descent found for the
8216 entire line.
8217 (pos_visible_p): Revert the comparison against bottom_y to what it
8218 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8219 (Bug#11464)
8220
c1892f11
PE
82212012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8222
8223 Fix coding-related core dumps with gcc -ftrapv.
8224 The code was computing A - B, where A and B are pointers, and B is
8225 random garbage. This can lead to core dumps on platforms that
8226 have special pointer registers, and it also leads to core dumps on
8227 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8228 A - B only when B is initialized properly.
8229 * coding.c (coding_set_source, coding_set_destination): Return void.
8230 (coding_change_source, coding_change_destinations): New functions,
8231 with the old behaviors of coding_set_source and coding_set_destination.
8232 All callers that need an offset changed to use these new functions.
8233
eb7afdad
GM
82342012-05-26 Glenn Morris <rgm@gnu.org>
8235
8236 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8237
f12fdf02
EZ
82382012-05-26 Eli Zaretskii <eliz@gnu.org>
8239
53a63be6 8240 Extend mouse support on W32 text-mode console.
61b108cc
SM
8241 * xdisp.c (draw_row_with_mouse_face):
8242 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 8243
eb3f6f01 8244 * w32console.c: Include window.h.
61b108cc
SM
8245 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8246 New functions.
eb3f6f01
EZ
8247 (initialize_w32_display): Initialize mouse-highlight data.
8248
53a63be6
EZ
8249 * w32inevt.c: Include termchar.h and window.h.
8250 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8251 moves, call note_mouse_highlight. If help_echo changed, call
8252 gen_help_event to produce help-echo message in the echo area.
8253 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8254 highlight info.
8255
4cfd81f6
PE
82562012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8257
8258 * lread.c (read1): Simplify slightly to avoid an overflow warning
8259 with GCC 4.7.0 on x86-64.
8260
4446092a
EZ
82612012-05-26 Eli Zaretskii <eliz@gnu.org>
8262
8263 * bidi.c (bidi_mirror_char): Revert last change: an int is
8264 definitely wide enough here.
8265
42b2a986 82662012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 8267
42b2a986 8268 Fix integer width and related bugs (Bug#9874).
eb106a49 8269 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
8270 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8271 (string_bytes, check_sblock, allocate_string_data):
8272 (compact_small_strings, Fmake_bool_vector, make_string)
8273 (make_unibyte_string, make_multibyte_string)
8274 (make_string_from_bytes, make_specified_string)
8275 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8276 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8277 (mark_vectorlike):
8278 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8279 (allocate_pseudovector):
8280 Use int, not EMACS_INT, where int is wide enough.
8281 (inhibit_garbage_collection, Fgarbage_collect):
8282 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8283 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8284 int might not be wide enough.
8285 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8286 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8287 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8288 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8289 (bidi_level_of_next_char, bidi_move_to_visually_next):
8290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8291 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8292 (Fkill_buffer, Fset_buffer_major_mode)
8293 (advance_to_char_boundary, Fbuffer_swap_text)
8294 (Fset_buffer_multibyte, overlays_at, overlays_in)
8295 (overlay_touches_p, struct sortvec, record_overlay_string)
8296 (overlay_strings, recenter_overlay_lists)
8297 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8298 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8299 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8300 (Foverlay_recenter, last_overlay_modification_hooks_used)
8301 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8302 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
8303 (validate_region): Omit unnecessary test for b <= e,
8304 since that's guaranteed by the previous test.
d311d28c
PE
8305 (adjust_overlays_for_delete): Avoid pos + length overflow.
8306 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8307 (report_overlay_modification):
8308 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8309 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8310 Omit pointer cast, which isn't needed anyway, and doesn't work
8311 after the EMACS_INT -> ptrdiff_t change.
02481186 8312 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
8313 * buffer.h: Adjust decls to match defn changes elsewhere.
8314 (struct buffer_text, struct buffer):
8315 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8316 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
8317 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8318 not int, to avoid needless 32-bit limit on 64-bit hosts.
8319 (exec_byte_code): Use tighter memory-full test, one that checks
8320 for alloca overflow. Don't compute the address of the object just
8321 before an array, as that's not portable. Use EMACS_INT, not
8322 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
8323 * callint.c (Fcall_interactively):
8324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8325 * callproc.c (call_process_kill, Fcall_process):
8326 Don't assume pid_t fits into an Emacs fixnum.
8327 (call_process_cleanup, Fcall_process, child_setup):
8328 Don't assume pid_t fits into int.
8329 (call_process_cleanup, Fcall_process, delete_temp_file)
8330 (Fcall_process_region):
8331 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8332 (Fcall_process): Simplify handling of volatile integers.
8333 Use int, not EMACS_INT, where int will do.
8334 * casefiddle.c (casify_object, casify_region, operate_on_word)
8335 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8336 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8337 (casify_object): Avoid integer overflow when overallocating buffer.
8338 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 8339 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
8340 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8341 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8342 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8343 integers are now checked earlier. All uses replaced with XINT.
8344 (ccl_driver):
8345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8346 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
8347 (ccl_driver, Fregister_code_conversion_map):
8348 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
8349 (resolve_symbol_ccl_program): Check that vector header is in range.
8350 Always copy the vector, so that we can check its contents reliably
8351 now rather than having to recheck each instruction as it's being
8352 executed. Check that vector words fit in 'int'.
8353 (ccl_get_compiled_code, Fregister_ccl_program)
8354 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8355 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8356 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8357 contents are in range.
8358 (Fccl_execute_on_string): Check that status is in range.
8359 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8360 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8361 Accept and return EMACS_INT, not int, because callers can pass values
8362 out of 'int' range.
8363 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8364 (multibyte_chars_in_text, parse_str_as_multibyte)
8365 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8366 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8367 (string_escape_byte8, Fget_byte):
8368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 8369 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
8370 avoid mishandling large integers.
8371 * character.h: Adjust decls to match defn changes elsewhere.
8372 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8373 (Ffind_charset_region):
8374 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8375 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8376 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 8377 Don't assume fixnum fits in int.
d311d28c
PE
8378 (load_charset_map_from_vector, Fmap_charset_chars):
8379 Remove now-unnecessary CHECK_NATNUMs.
8380 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
8381 Don't rely on undefined behavior with signed left shift overflow.
8382 Don't assume unsigned int fits into fixnum, or that fixnum fits
8383 into unsigned int. Don't require max_code to be a valid fixnum;
8384 that's not true for gb10830 4-byte on a 32-bit host. Allow
8385 invalid_code to be a cons, for the same reason. Require code_offset
8386 to be a character. Avoid int overflow if max_char is close
8387 to INT_MAX.
8388 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8389 this is intended anyway and avoids some undefined behavior.
8390 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8391 INDEX_TO_CODE_POINT, as that's what it expects.
8392 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
8393 * charset.h (DECODE_CHAR): Return int, not unsigned;
8394 this is what was intended anyway, and it avoids undefined behavior.
8395 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8396 integer-overflow issues.
8397 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8398 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8399 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
8400 * chartab.c (Fmake_char_table, Fset_char_table_range)
8401 (uniprop_get_decoder, uniprop_get_encoder):
8402 Don't assume fixnum fits in int.
8403 * cmds.c (move_point): New function, that does the gist of
8404 Fforward_char and Fbackward_char, but does so while checking
8405 for integer overflow more accurately.
c96e5d6a 8406 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
8407 (Fforward_line, Fend_of_line, internal_self_insert)
8408 (internal_self_insert):
8409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8410 Fix a FIXME, by checking for integer overflow when calculating
8411 target_clm and actual_clm.
8412 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 8413 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
8414 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8415 (coding_alloc_by_making_gap, alloc_destination)
8416 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8417 (encode_coding_utf_16, detect_coding_emacs_mule)
8418 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8419 (detect_coding_iso_2022, decode_coding_iso_2022)
8420 (encode_invocation_designation, encode_designation_at_bol)
8421 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8422 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8423 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8424 (encode_coding_ccl, encode_coding_raw_text)
8425 (detect_coding_charset, decode_coding_charset)
8426 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8427 (produce_composition, produce_charset, produce_annotation)
8428 (decode_coding, handle_composition_annotation)
8429 (handle_charset_annotation, consume_chars, decode_coding_gap)
8430 (decode_coding_object, encode_coding_object, detect_coding_system)
8431 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8432 (code_convert_region, code_convert_string)
8f50130c
PE
8433 (Fdefine_coding_system_internal)
8434 (coding_set_source, coding_set_destination):
d311d28c
PE
8435 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8436 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8437 (Fdefine_coding_system_internal):
8438 Don't assume fixnums fit in int.
8439 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 8440 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
8441 (Funencodable_char_position, Fcheck_coding_systems_region)
8442 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 8443 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 8444 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 8445 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 8446 Don't access memory outside of the args array.
d311d28c 8447 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
8448 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8449 result of ENCODE_CHAR.
d311d28c
PE
8450 * coding.h: Adjust decls to match defn changes elsewhere.
8451 (struct coding_system):
8452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8453 * composite.c (get_composition_id, find_composition)
8454 (run_composition_function, update_compositions)
8455 (compose_text, composition_gstring_put_cache)
8456 (composition_gstring_p, composition_gstring_width)
8457 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8458 (composition_compute_stop_pos, composition_reseat_it)
8459 (composition_update_it, struct position_record)
8460 (find_automatic_composition, composition_adjust_point)
8461 (Fcomposition_get_gstring, Ffind_composition_internal):
8462 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8463 (update_compositions):
8464 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8465 * composite.h: Adjust decls to match defn changes elsewhere.
8466 (struct composition):
8467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8468 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8469 Do not attempt to compute the address of the object just before a
8470 buffer; this is not portable.
8471 (Faref, Faset):
8472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8473 (Faset): Use int, not EMACS_INT, where int is wide enough.
8474 (Fstring_to_number): Don't assume fixnums fit in int.
8475 (Frem): Don't assume arg is nonnegative.
8476 * dbusbind.c (xd_append_arg): Check for integers out of range.
8477 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 8478 (extract_signed, extract_unsigned): New functions.
243e0530
PE
8479 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8480 (xd_get_connection_references): Return ptrdiff_t, not int.
8481 All uses changed.
8482 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8483 (xd_read_message_1):
8484 Use int, not unsigned, where the dbus API uses int.
8485 (Fdbus_message_internal): Don't overflow mtype.
8486 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
8487 * dired.c (directory_files_internal, file_name_completion, scmp)
8488 (file_name_completion_stat):
8489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8490 (file_name_completion): Don't overflow matchcount.
8491 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8492 * dispextern.h: Adjust decls to match defn changes elsewhere.
8493 (struct text_pos, struct glyph, struct bidi_saved_info)
8494 (struct bidi_string_data, struct bidi_it, struct composition_it)
8495 (struct it):
8496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8497 (struct display_pos, struct composition_it, struct it):
8498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8499 * dispnew.c (increment_matrix_positions)
8500 (increment_row_positions, mode_line_string)
8501 (marginal_area_string):
8502 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 8503 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
8504 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8505 (duration_to_sec_usec): New function, to check for overflow better.
8506 (Fsleep_for, sit_for): Use it.
8507 * doc.c (get_doc_string, store_function_docstring):
8508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8509 (get_doc_string, Fsnarf_documentation):
8510 Use int, not EMACS_INT, where int is wide enough.
8511 (get_doc_string):
8512 Use SAFE_ALLOCA, not alloca.
8513 Check for overflow when converting EMACS_INT to off_t.
8514 * doprnt.c (doprnt):
8515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8516 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8517 Don't assume uid_t fits into fixnum.
8518 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8519 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8520 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8521 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8522 (general_insert_function)
8523 (Finsert_char, make_buffer_string, make_buffer_string_both)
8524 (update_buffer_properties, Fbuffer_substring)
8525 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8526 (Fsubst_char_in_region, check_translation)
8527 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8528 (transpose_markers, Ftranspose_regions):
8529 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8530 (clip_to_bounds): Move to lisp.h as an inline function).
8531 (Fconstrain_to_field): Don't assume integers are nonnegative.
8532 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8533 (Fsubst_char_in_region, Fsave_restriction):
8534 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8535 (Femacs_pid): Don't assume pid_t fits into fixnum.
8536 (lo_time): Use int, not EMACS_INT, when int suffices.
8537 (lisp_time_argument): Check for usec out of range.
8538 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
8539 (Fuser_login_name, Fuser_full_name): Signal an error
8540 if a uid argument is out of range, rather than relying on
8541 undefined behavior.
c8d5c857
PE
8542 (Fformat_time_string): Remove now-unnecessary check.
8543 lisp_time_argument checks for out-of-range usec now.
243e0530 8544 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
8545 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8546 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8547 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8548 (init_cmdargs, Fdump_emacs):
8549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8550 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8551 the bottom (typically) 32 bits of the fixnum.
8552 * eval.c (specpdl_size, call_debugger):
8553 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8554 (when_entered_debugger, Fbacktrace_debug):
8555 Don't assume fixnum can fit in int.
8556 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8557 the object just before a buffer; this is not portable.
8558 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8559 (grow_specpdl, unbind_to):
8560 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8561 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8562 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 8563 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
8564 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8565 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8566 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8567 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8568 (a_write, e_write):
8569 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8570 (Fcopy_file, non_regular_nbytes, read_non_regular)
8571 (Finsert_file_contents):
8572 Use int, not EMACS_INT, where int is wide enough.
8573 (READ_BUF_SIZE): Verify that it fits in int.
8574 (Finsert_file_contents): Check that counts are in proper range,
8575 rather than assuming fixnums fit into ptrdiff_t etc.
8576 Don't assume fixnums fit into int.
125b3835 8577 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
8578 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8579 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
8580 (string_char_to_byte, string_byte_to_char)
8581 (string_make_multibyte, string_to_multibyte)
8582 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8583 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8584 (substring_both, Fdelete, internal_equal, Ffillarray)
8585 (Fclear_string, mapcar1)
8586 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8587 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8588 (larger_vector, make_hash_table, maybe_resize_hash_table)
8589 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8590 (Fmaphash, secure_hash):
8591 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8592 (concat): Check for string index and length overflow.
8593 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8594 (Frequire):
8595 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8596 (larger_vector): New API (vec, incr_min, size_max) replaces old
8597 one (vec, new_size, init). This catches size overflow.
8598 INIT was removed because it was always Qnil.
8599 All callers changed.
8600 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8601 the upper bound on a hash table index size.
8602 (make_hash_table, maybe_resize_hash_table): Use it.
8603 (secure_hash): Computer start_byte and end_byte only after
8604 they're known to be in ptrdiff_t range.
8605 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8606 (Ffont_get_glyphs, Ffont_at):
8607 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8608 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8609 (Flist_fonts, Fopen_font):
8610 Don't assume fixnum can fit in int.
8611 (check_gstring): Don't assume index can fit in int.
8612 (font_match_p): Check that fixnum is a character, not a nonnegative
8613 fixnum, since the later code needs to stuff it into an int.
8614 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8615 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8616 conversion overflow issues.
8617 (Fopen_font): Check for integer out of range.
8618 (Ffont_get_glyphs): Don't assume index can fit in int.
8619 * font.h: Adjust decls to match defn changes elsewhere.
8620 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8621 integer overflow.
8622 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8623 printmax_t, where ptrdiff_t is wide enough.
8624 (Finternal_char_font):
8625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8626 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8627 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8628 (Fset_frame_position, x_set_frame_parameters)
8629 (x_set_line_spacing, x_set_border_width)
8630 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8631 Check that fixnums are in proper range for system types.
8632 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8633 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8634 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8635 Use SAFE_ALLOCA_LISP, not alloca.
8636 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8637 intptr_t is wide enough.
8638 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8639 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8640 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8641 Check for fixnum out of range.
8642 * ftfont.c (ftfont_list): Don't assume index fits in int.
8643 Check that fixnums are in proper range for system types.
8644 (ftfont_shape_by_flt):
8645 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
8646 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8647 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8648 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8649 Check that fixnums are in proper range for system types.
8650 * gnutls.h: Adjust decls to match defn changes elsewhere.
8651 * gtkutil.c (xg_dialog_run):
8652 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8653 (update_frame_tool_bar):
8654 Check that fixnums are in proper range for system types.
8655 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 8656 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
8657 * indent.c (last_known_column, last_known_column_point):
8658 (current_column_bol_cache):
8659 (skip_invisible, current_column, check_display_width):
8660 (check_display_width, scan_for_column, current_column_1)
8661 (Findent_to, Fcurrent_indentation, position_indentation)
8662 (indented_beyond_p, Fmove_to_column, compute_motion):
8663 (Fcompute_motion, Fvertical_motion):
8664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8665 (last_known_column_modified): Use EMACS_INT, not int.
8666 (check_display_width):
8667 (Fcompute_motion):
8668 Check that fixnums and floats are in proper range for system types.
8669 (compute_motion): Don't assume index or fixnum fits in int.
8670 (compute_motion, Fcompute_motion):
8671 Use int, not EMACS_INT, when it is wide enough.
8672 (vmotion): Omit local var start_hpos that is always 0; that way
8673 we don't need to worry about overflow in expressions involving it.
8674 * indent.h: Adjust decls to match defn changes elsewhere.
8675 (struct position):
8676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8677 Use int, not EMACS_INT, where int is wide enough.
8678 Remove unused members ovstring_chars_done and tab_offset;
8679 all uses removed.
8680 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8681 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8682 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8683 (make_gap, copy_text, insert, insert_and_inherit)
8684 (insert_before_markers, insert_before_markers_and_inherit)
8685 (insert_1, count_combining_before, count_combining_after)
8686 (insert_1_both, insert_from_string)
8687 (insert_from_string_before_markers, insert_from_string_1)
8688 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8689 (adjust_after_replace, adjust_after_insert, replace_range)
8690 (replace_range_2, del_range, del_range_1, del_range_byte)
8691 (del_range_both, del_range_2, modify_region)
8692 (prepare_to_modify_buffer, signal_before_change)
8693 (signal_after_change, Fcombine_after_change_execute):
8694 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8695 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8696 (balance_an_interval, split_interval_right, split_interval_left)
8697 (find_interval, next_interval, update_interval)
8698 (adjust_intervals_for_insertion, delete_node, delete_interval)
8699 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8700 (static_offset_intervals, offset_intervals)
8701 (merge_interval_right, merge_interval_left, make_new_interval)
8702 (graft_intervals_into_buffer, temp_set_point_both)
8703 (temp_set_point, set_point, adjust_for_invis_intang)
8704 (set_point_both, move_if_not_intangible, get_property_and_range)
8705 (get_local_map, copy_intervals, copy_intervals_to_string)
8706 (compare_string_intervals, set_intervals_multibyte_1):
8707 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8708 * intervals.h: Adjust decls to match defn changes elsewhere.
8709 (struct interval):
8710 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8711 * keyboard.c (this_command_key_count, this_single_command_key_start)
8712 (before_command_key_count, before_command_echo_length, echo_now)
8713 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8714 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8715 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8716 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8717 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8718 (last_non_minibuf_size, last_point_position, echo_truncate)
8719 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8720 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8721 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8722 (stuff_buffered_input):
8723 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8724 (last_auto_save, command_loop_1, read_char):
8725 Use EMACS_INT, not int, to avoid integer overflow.
8726 (record_char): Avoid overflow in total_keys computation.
8727 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8728 * keyboard.h: Adjust decls to match defn changes elsewhere.
8729 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8730 (Fkey_description, Fdescribe_vector, Flookup_key):
8731 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8732 (click_position): New function, to check that positions are in range.
8733 (Fcurrent_active_maps):
8734 (describe_command):
8735 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8736 (Faccessible_keymaps, Fkey_description):
8737 (preferred_sequence_p):
8738 Don't assume fixnum can fit into int.
8739 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8740 Check for integer overflow in size calculations.
8741 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8742 avoid mishandling large integers.
8743 * lisp.h: Adjust decls to match defn changes elsewhere.
8744 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8745 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8746 (struct Lisp_Marker):
8747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8748 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
8749 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8750 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8751 All callers changed.
8752 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8753 Assume the arg has valid form, since it always does.
8754 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8755 unsigned integer system type.
8756 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8757 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8759 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8760 (duration_to_sec_usec): New decl.
8761 * lread.c (read_from_string_index, read_from_string_index_byte)
8762 (read_from_string_limit, readchar, unreadchar, openp)
8763 (read_internal_start, read1, oblookup):
8764 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8765 (Fload, readevalloop, Feval_buffer, Feval_region):
8766 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8767 (openp): Check for out-of-range argument to 'access'.
8768 (read1): Use int, not EMACS_INT, where int is wide enough.
8769 Don't assume fixnum fits into int.
6efdadfd 8770 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
8771 (read_filtered_event): Use duration_to_sec_usec
8772 to do proper overflow checking on durations.
d311d28c
PE
8773 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8774 in size calculation.
8775 (Fexecute_kbd_macro):
8776 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8777 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8778 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8779 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8780 (set_marker_both, set_marker_restricted_both, marker_position)
8781 (marker_byte_position, Fbuffer_has_markers_at):
8782 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8783 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 8784 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
8785 It now merely ensures that the menu is large enough, without
8786 necessarily growing it, as this avoids some integer overflow issues.
8787 All callers changed.
8788 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8789 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8790 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8791 Use SAFE_ALLOCA_LISP, not alloca.
8792 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8793 to EMACS_INT. Check that fixnums are in proper range for system types.
8794 * minibuf.c (minibuf_prompt_width, string_to_object)
8795 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8796 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8797 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8798 (get_minibuffer, read_minibuf_unwind):
8799 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8800 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8801 this simplifies overflow checking. All callers changed.
8802 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8803 (Ftest_completion):
8804 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8805 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8806 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8807 Check that fixnums are in proper range for system types.
8808 (Fx_create_frame, Fx_show_tip):
8809 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8810 * nsfont.m (ns_findfonts, nsfont_list_family):
8811 Don't assume fixnum fits in long.
8812 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8813 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8814 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8815 wide enough.
17fdb222 8816 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
8817 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8818 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8819 (PRINTDECLARE, PRINTPREPARE):
8820 (strout, print_string):
8821 (print, print_preprocess, print_check_string_charset_prop)
8822 (print_object):
8823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8824 (PRINTDECLARE):
8825 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8826 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8827 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 8828 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 8829 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
8830 (print_error_message): Use SAFE_ALLOCA, not alloca.
8831 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
8832 (print_depth, new_backquote_output, print_number_index):
8833 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
8834 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8835 (Fset_process_window_size, Fformat_network_address)
8836 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 8837 (sigchld_handler):
d311d28c 8838 Check that fixnums are in proper range for system types.
d44287d4 8839 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
8840 Check for process-ids out of pid_t range rather than relying on
8841 undefined behavior.
e4d81efc 8842 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
8843 (Fformat_network_address, read_process_output, send_process)
8844 (Fprocess_send_region, status_notify):
8845 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8846 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8847 (wait_reading_process_output, read_process_output, exec_sentinel):
8848 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8849 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8850 (Faccept_process_output): Use duration_to_sec_usec to do proper
8851 overflow checking on durations.
dde14581
PE
8852 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8853 Don't assume pid_t fits in int.
02481186
PE
8854 * process.h (struct Lisp_Process): Members tick and update_tick
8855 are now of type EMACS_INT, not int.
b62b53e8
PE
8856 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8857 configured --with-wide-int.
d311d28c
PE
8858 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8859 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8860 * search.c (looking_at_1, string_match_1):
8861 (fast_string_match, fast_c_string_match_ignore_case)
8862 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8863 (scan_newline, find_before_next_newline, search_command)
8864 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8865 (set_search_regs, wordify):
8866 (Freplace_match):
8867 (Fmatch_data):
8868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8869 (string_match_1, search_buffer, set_search_regs):
8870 (Fmatch_data):
8871 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8872 (wordify): Check for overflow in size calculation.
8873 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8874 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8875 Check that fixnums are in proper range for system types.
8876 * sound.c (struct sound_device)
8877 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8878 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8879 (Fplay_sound_internal):
8880 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 8881 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
8882 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8883 (Fparse_partial_sexp):
8884 Don't assume fixnums can fit in int.
8885 (struct lisp_parse_state, find_start_pos, find_start_value)
8886 (find_start_value_byte, find_start_begv)
8887 (update_syntax_table, char_quoted, dec_bytepos)
8888 (find_defun_start, prev_char_comend_first, back_comment):
8889 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8890 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8891 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8892 (Finternal_describe_syntax_value): Check that match_lisp is a
8893 character, not an integer, since the code stuffs it into int.
8894 (scan_words, scan_sexps_forward):
8895 Check that fixnums are in proper range for system types.
8896 (Fforward_word):
8897 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8898 (scan_sexps_forward):
8899 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8900 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8901 * syntax.h: Adjust decls to match defn changes elsewhere.
8902 (struct gl_state_s):
8903 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
8904 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8905 MOST_POSITIVE_FIXNUM.
d311d28c
PE
8906 * sysdep.c (wait_for_termination_1, wait_for_termination)
8907 (interruptible_wait_for_termination, mkdir):
8908 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8909 (emacs_read, emacs_write):
8910 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
8911 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8912 and double all fit in int.
d311d28c
PE
8913 * term.c (set_tty_color_mode):
8914 Check that fixnums are in proper range for system types.
8915 * termhooks.h (struct input_event):
8916 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8917 * textprop.c (validate_interval_range, interval_of)
8918 (Fadd_text_properties, set_text_properties_1)
8919 (Fremove_text_properties, Fremove_list_of_text_properties)
8920 (Ftext_property_any, Ftext_property_not_all)
8921 (copy_text_properties, text_property_list, extend_property_ranges)
8922 (verify_interval_modification):
8923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8924 (Fnext_single_char_property_change)
8925 (Fprevious_single_char_property_change):
8926 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
8927 (copy_text_properties):
8928 Check for integer overflow in index calculation.
d311d28c
PE
8929 * undo.c (last_boundary_position, record_point, record_insert)
8930 (record_delete, record_marker_adjustment, record_change)
8931 (record_property_change):
8932 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8933 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8934 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8935 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8936 (Fx_hide_tip, Fx_file_dialog):
8937 * w32menu.c (set_frame_menubar):
8938 Use ptrdiff_t, not int, for consistency with rest of code.
8939 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8940 (select_window, Fdelete_other_windows_internal)
8941 (window_scroll_pixel_based, window_scroll_line_based)
8942 (Frecenter, Fset_window_configuration):
8943 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8944 (Fset_window_hscroll, run_window_configuration_change_hook)
8945 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 8946 (Fscroll_other_window, Frecenter):
d311d28c
PE
8947 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8948 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8949 Don't assume fixnum fits in int.
8950 (Fset_window_scroll_bars):
8951 Check that fixnums are in proper range for system types.
8952 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8953 (string_pos, c_string_pos, number_of_chars, init_iterator)
8954 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8955 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8956 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
8957 (face_before_or_after_it_pos, handle_invisible_prop)
8958 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
8959 (display_prop_intangible_p, string_buffer_position_lim)
8960 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8961 (get_overlay_strings_1, get_overlay_strings)
8962 (iterate_out_of_display_property, forward_to_next_line_start)
8963 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8964 (get_next_display_element, set_iterator_to_next)
8965 (get_visually_first_element, compute_stop_pos_backwards)
8966 (handle_stop_backwards, next_element_from_buffer)
8967 (move_it_in_display_line_to, move_it_in_display_line)
8968 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8969 (add_to_log, message_dolog, message_log_check_duplicate)
8970 (message2, message2_nolog, message3, message3_nolog
8971 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8972 (current_message_1, truncate_echo_area, truncate_message_1)
8973 (set_message, set_message_1, store_mode_line_noprop)
8974 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8975 (text_outside_line_unchanged_p, check_point_in_composition)
8976 (reconsider_clip_changes)
8977 (redisplay_internal, set_cursor_from_row, try_scrolling)
8978 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8979 (redisplay_window, find_last_unchanged_at_beg_row)
8980 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8981 (trailing_whitespace_p, find_row_edges, display_line)
8982 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8983 (display_mode_element, store_mode_line_string)
8984 (pint2str, pint2hrstr, decode_mode_spec)
8985 (display_count_lines, display_string, draw_glyphs)
8986 (x_produce_glyphs, x_insert_glyphs)
8987 (rows_from_pos_range, mouse_face_from_buffer_pos)
8988 (fast_find_string_pos, mouse_face_from_string_pos)
8989 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8990 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8991 (safe_call, init_from_display_pos, handle_fontified_prop)
8992 (handle_single_display_spec, load_overlay_strings)
8993 (with_echo_area_buffer, setup_echo_area_for_printing)
8994 (display_echo_area, echo_area_display)
8995 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8996 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
8997 (redisplay_window, dump_glyph_row, display_mode_line)
8998 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 8999 (handle_display_spec, display_prop_string_p):
d311d28c
PE
9000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9001 (handle_single_display_spec, build_desired_tool_bar_string)
9002 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9003 (get_specified_cursor_type):
9004 Check that fixnums are in proper range for system types.
9005 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9006 (Flookup_image_map):
9007 Don't assume fixnums fit in int.
9008 (compare_overlay_entries):
9009 Avoid mishandling comparisons due to subtraction overflow.
9010 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9011 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9012 (handle_tool_bar_click):
9013 Use int, not unsigned, since we prefer signed and the signedness
9014 doesn't matter here.
9015 (get_next_display_element, next_element_from_display_vector):
9016 Use int, not EMACS_INT, when int is wide enough.
9017 (start_hourglass): Use duration_to_sec_usec to do proper
9018 overflow checking on durations.
9019 * xfaces.c (Fbitmap_spec_p):
9020 Check that fixnums are in proper range for system types.
9021 (compare_fonts_by_sort_order):
9022 Avoid mishandling comparisons due to subtraction overflow.
9023 (Fx_family_fonts, realize_basic_faces):
9024 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9025 (Fx_family_fonts):
9026 Don't assume fixnum fits in int.
9027 Use SAFE_ALLOCA_LISP, not alloca.
9028 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9029 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9030 (face_at_buffer_position, face_for_overlay_string)
9031 (face_at_string_position):
9032 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9033 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9034 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9035 (Fx_show_tip):
9036 Check that fixnums are in proper range for system types.
9037 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9038 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9039 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9040 (Fx_change_window_property): Don't assume fixnums fit in int.
9041 * xfont.c (xfont_chars_supported):
9042 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9043 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9044 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9045 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9046 * xml.c (parse_region):
9047 * xrdb.c (magic_file_p):
9048 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9049 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9050 (x_get_local_selection, x_reply_selection_request)
9051 (x_handle_selection_request, wait_for_property_change):
9052 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9053 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9054 short is wide enough.
9055 (x_send_client_event): Don't assume fixnum fits in int.
9056 * xterm.c (x_x_to_emacs_modifiers):
9057 Don't assume EMACS_INT overflows nicely into int.
9058 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9059 may come from Lisp.
9060 (handle_one_xevent): NATNUMP can eval its arg twice.
9061 (x_connection_closed):
9062 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9063 * xterm.h: Adjust decls to match defn changes elsewhere.
9064 (struct scroll_bar): Use struct vectorlike_header
9065 rather than rolling our own approximation.
9066 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9067
c6574eb5
GM
90682012-05-25 Glenn Morris <rgm@gnu.org>
9069
9070 * lisp.mk (lisp): Update for more files being compiled now.
9071
e8d32c7e
SM
90722012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9073
48def666
SM
9074 * lread.c: Remove `read_pure' which makes no difference.
9075 (read_pure): Remove var.
9076 (unreadpure): Remove function.
9077 (readevalloop): Don't call read_list with -1 flag.
9078 (read1, read_vector): Don't test read_pure any more.
9079 (read_list): Simplify.
9080
e8d32c7e
SM
9081 * fileio.c, character.h: Minor style tweaks.
9082
4b2addb7
DA
90832012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9084
9085 * window.h (clip_changed): Remove useless declaration.
9086
584461b2
JB
90872012-05-22 Juanma Barranquero <lekktu@gmail.com>
9088
9089 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9090 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9091
34374650
PE
90922012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9093
9094 Remove src/m/*.
9095 This directory predates autoconf and is no longer needed nowadays.
9096 Move its few remaining bits of functionality to where they're needed.
9097 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9098 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9099 * m/template.h: Remove.
9100 * Makefile.in (M_FILE): Remove. All uses removed.
9101 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9102 * lisp.h (USE_LSB_TAG):
9103 * mem-limits.h (EXCEEDS_LISP_PTR):
9104 Use VAL_MAX, not VALBITS, in #if.
9105 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9106 (EMACS_UINT): Define unconditionally now.
9107 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9108 (BITS_PER_EMACS_INT): New constants, replacing
9109 what used to be in config.h, but not useful in #if.
9110 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9111 define them any more.
9112 (VAL_MAX): New macro.
9113 (VALMASK): Use it.
9114 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9115 BITS_PER_EMACS_INT, in #if.
9116 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9117 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9118 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9119 * s/ms-w32.h (DATA_START):
9120 Move here from removed file m/intel386.h.
9121 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9122 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9123
261cb4bb
PE
91242012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9125
9126 Assume C89 or later.
9127 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9128 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9129 (xrealloc):
9130 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9131 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9132 * textprop.c, tparam.c (NULL): Remove.
9133 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9134 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9135 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9136 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9137 * xterm.c (input_signal_count): Assume volatile works.
9138
ff23cd9f
KB
91392012-05-21 Ken Brown <kbrown@cornell.edu>
9140
9141 * xgselect.c (xg_select): Fix first argument in call to 'select'
9142 (bug#11508).
9143
1b170bc6
KB
91442012-05-20 Ken Brown <kbrown@cornell.edu>
9145
9146 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 9147 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 9148
b2f4d39f
KB
91492012-05-19 Ken Brown <kbrown@cornell.edu>
9150
9151 * xfns.c (x_in_use): Remove `static' qualifier.
9152 * xterm.h (x_in_use): Declare.
9153 * xgselect.c: Include xterm.h.
9154 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9155 and `display_arg' (bug#9754).
9156
003fdae2
PE
91572012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9158
9232a6d9
PE
9159 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9160
003fdae2
PE
9161 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9162 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9163
784b56e2
EZ
91642012-05-18 Eli Zaretskii <eliz@gnu.org>
9165
9166 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9167
9168 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 9169 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
9170
9171 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9172 reference to image_cache->refcount.
9173 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9174
a0a79cde
JL
91752012-05-17 Juri Linkov <juri@jurta.org>
9176
9177 * search.c (Fword_search_regexp, Fword_search_backward)
9178 (Fword_search_forward, Fword_search_backward_lax)
9179 (Fword_search_forward_lax): Move functions to isearch.el
9180 (bug#10145, bug#11381).
9181
b0572523
PE
91822012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9183
9184 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9185
9660f5fc
SM
91862012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9187
9188 * lread.c (init_obarray): Declare Qt and Qnil as special.
9189
4374de83
GM
91902012-05-14 Glenn Morris <rgm@gnu.org>
9191
9192 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 9193 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 9194
dc44c39a
PE
91952012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9196
078c97cb
PE
9197 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9198
dc44c39a
PE
9199 * unexaix.c: Port to more-recent AIX compilers.
9200 (report_error, report_error_1, make_hdr, copy_sym)
9201 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9202 Make arguments const char *, not char *, to avoid violations of C
9203 standard and to fix some AIX warnings reported by Gilles Pion.
9204
e18afed7 92052012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
9206
9207 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9208 already have overlays loaded.
9209 (handle_single_display_spec): Before returning without displaying
9210 fringe bitmap, synchronize the bidi iterator with the main display
9211 iterator, by calling iterate_out_of_display_property.
9212 (iterate_out_of_display_property): Detect buffer iteration by
9213 testing that it->string is a Lisp string.
9214 (get_next_display_element): When the current object is exhausted,
9215 and there's something on it->stack, call set_iterator_to_next to
9216 proceed with what's on the stack, instead of returning zero.
9217 (set_iterator_to_next): If called at the end of a Lisp string,
9218 proceed to consider_string_end without incrementing string
9219 position. Don't increment display vector index past the end of
9220 the display vector. (Bug#11417)
c8fb9dc6
EZ
9221 (pos_visible_p): Don't report a position visible when move_it_to
9222 stopped at the last line of window, which happens to be scanned
9223 backwards by the bidi iteration. (Bug#11464)
ac268e67 9224
e18afed7 92252012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
9226
9227 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9228 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
9229 are on a TTY, and thus unable to display on the fringes.
9230 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
9231 so we need to signal to the caller that this is a "replacing"
9232 display spec. This fixes display when the spec is invalid or we
9233 are on a TTY.
9234
e18afed7 92352012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
9236
9237 * unexaix.c (make_hdr): Fix typo in prototype.
9238 This bug broke the build on AIX. Problem reported by Gilles Pion.
9239
9d0a235a
MA
92402012-05-14 Michael Albinus <michael.albinus@gmx.de>
9241
9242 * keyboard.c (kbd_buffer_get_event): Read special events also in
9243 batch mode. (Bug#11415)
9244
9e6b06ed
GM
92452012-05-12 Glenn Morris <rgm@gnu.org>
9246
9247 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9248
c1a1d7a3
EZ
92492012-05-12 Eli Zaretskii <eliz@gnu.org>
9250
9251 * lisp.mk (lisp): Add newcomment.elc.
9252
3fe7cdc8
GM
92532012-05-12 Glenn Morris <rgm@gnu.org>
9254
9255 * Makefile.in (MKDIR_P): New, set by configure.
9256 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9257
53f7d2c0
PE
92582012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9259
9260 Remove unused function hourglass_started.
9261 * dispextern.h (hourglass_started):
9262 * w32fns.c (hourglass_started):
9263 * xdisp.c (hourglass_started): Remove.
9264
75aafb17
JB
92652012-05-10 Juanma Barranquero <lekktu@gmail.com>
9266
9267 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9268 Update dependencies.
9269
12959e8e
PE
92702012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9271
97107e2e
PE
9272 * xgselect.c (xg_select): Put maxfds+1 into a var.
9273 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9274
12959e8e
PE
9275 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9276
836d29b3
DA
92772012-05-10 Dave Abrahams <dave@boostpro.com>
9278
9279 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9280 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9281
5cb67954
MA
92822012-05-09 Michael Albinus <michael.albinus@gmx.de>
9283
9284 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9285 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9286 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9287 Initialize xd_registered_buses.
9288
3478ec45
PE
92892012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9290
b263a6b0
PE
9291 Untag more efficiently if USE_LSB_TAG.
9292 This is based on a proposal by YAMAMOTO Mitsuharu in
9293 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9294 For an admittedly artificial (nth 8000 longlist) benchmark on
9295 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9296 Emacs's overall text size by 1%.
9297 * lisp.h (XUNTAG): New macro.
9298 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9299 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9300 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9301 * eval.c (Fautoload):
9302 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9303 * frame.h (XFRAME): Use XUNTAG.
9304
3478ec45
PE
9305 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9306 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9307 Remove unportable assumptions about print widths of types like
9308 dbus_uint32_t.
9309 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9310 intptr_t when converting between pointer and integer, to avoid GCC
9311 warnings about wrong width.
9312
666b903b 93132012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
9314
9315 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9316 stack for each reader_thread, instead of defaulting to 8MB
9317 determined by the linker. This avoids failures in creating
9318 subprocesses on Windows 7, see the discussion in this thread:
9319 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9320
b120cc17
JC
93212012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9322
9323 Fix up display of the *Minibuf-0* buffer in the mini window.
9324 * keyboard.c (read_char): Don't clear the echo area if there's no
9325 message to clear.
9326 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 9327 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 9328
9a4b36f8
MA
93292012-05-07 Michael Albinus <michael.albinus@gmx.de>
9330
9331 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9332 batch mode.
9333
e5f9458f
CY
93342012-05-06 Chong Yidong <cyd@gnu.org>
9335
9336 * lisp.mk (lisp): Update.
9337
eceeb5fc 93382012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
9339
9340 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9341
71873e2b
SM
93422012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9343
9344 * data.c (PUT_ERROR): New macro.
9345 (syms_of_data): Use it. Add new error type `user-error'.
9346 * undo.c (user_error): New function.
9347 (Fprimitive_undo): Use it.
9348 * print.c (print_error_message): Adjust print style for `user-error'.
9349 * keyboard.c (user_error): New function.
9350 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9351
ab0fa4e4
PE
93522012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9353
9354 Do not limit current-time-string to years 1000..9999.
9355 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9356 (Fcurrent_time_string): Support any year that is supported by the
9357 underlying localtime representation. Don't use asctime, as it
9358 has undefined behavior for years outside the range -999..9999.
9359
7ed806a7
PE
93602012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9361
9362 Fix race conditions involving setenv, gmtime, localtime, asctime.
9363 Without this fix, interrupts could mess up code that uses these
9364 nonreentrant functions, since setting TZ invalidates existing
9365 tm_zone or tzname values, and since most of these functions return
9366 pointers to static storage.
9367 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9368 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9369 Grow the critical sections to include not just invoking
9370 localtime/gmtime, but also accessing these functions' results
9371 including their tm_zone values if any, and any related TZ setting.
9372 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
9373 so that the struct tm is saved in the critical section.
9374 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
9375 motivated by the fact that memory allocation needs to be outside
9376 the critical section.
9377
0c16dfed
DA
93782012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9379
9380 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9381 with RESET_INTERVAL.
9382
9383 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9384 Remove duplicated buffer name initialization.
9385
3f83ace8
JM
93862012-05-02 Jim Meyering <jim@meyering.net>
9387
9388 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9389
c7b8541e
JM
9390 * xfns.c (x_window): Use xstrdup (Bug#11375).
9391
90207a15 93922012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
9393
9394 * xdisp.c (pos_visible_p): If already at a newline from the
9395 display string before the 'while' loop, don't walk back the glyphs
9396 from it3.glyph_row. Solves assertion violation when the display
9397 string begins with a newline (egg.el). (Bug#11367)
9398
b593d6a9
AH
93992012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9400
9401 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9402 Move to simple.el.
9403
4737362e
GM
94042012-05-01 Glenn Morris <rgm@gnu.org>
9405
99cf43f9
GM
9406 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9407 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9408 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9409 All were removed before 23.1.
9410
9311dcff
GM
9411 * dispnew.c: Remove HAVE_LIBNCURSES test;
9412 it is always true on relevant platforms.
9413
4d5c6349
GM
9414 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9415 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9416
4737362e
GM
9417 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9418
74dd3a6b
AS
94192012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9420
9421 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9422 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9423 Remove.
9424
13c379ee
PE
94252012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9426
9427 Do not avoid creating empty evaporating overlays (Bug#9642).
9428 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9429 That is, do not delete an evaporating overlay if it becomes
9430 empty after its bounds are adjusted to fit within its buffer.
9431 This fix caused other problems, and I'm reverting it until we get
9432 to the bottom of them.
9433
a8e7d6d7 94342012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
9435
9436 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9437
a8e7d6d7 94382012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
9439
9440 * xdisp.c (pos_visible_p): If the window start position is beyond
9441 ZV, start the display from buffer beginning. Prevents assertion
9442 violation in init_iterator when the minibuffer window is scrolled
9443 via the scroll bar.
9444
9445 * window.c (window_scroll_pixel_based): Likewise.
9446
a8e7d6d7 94472012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
9448
9449 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9450
a8e7d6d7 94512012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
9452
9453 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9454 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9455
a8e7d6d7 94562012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 9457
b593d6a9
AH
9458 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9459 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 9460
1c6900d9
EZ
94612012-04-26 Eli Zaretskii <eliz@gnu.org>
9462
4c3fa1d9
EZ
9463 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9464 display element, check also the underlying string or buffer
9465 character. (Bug#11341)
9466
1c6900d9
EZ
9467 * w32menu.c: Include w32heap.h.
9468 (add_menu_item): If the call to AppendMenuW (via
9469 unicode_append_menu) fails, disable Unicode menus only if we are
9470 running on Windows 9X/Me.
9471
42bf8205
AS
94722012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9473
9474 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9475 (xgetint): Add missing shift for LSB tags.
9476
b1bac16e
MR
94772012-04-24 Martin Rudalics <rudalics@gmx.at>
9478
9479 * keyboard.c (read_char): Don't wipe echo area for select window
9480 events: These might get delayed via `mouse-autoselect-window'
9481 (Bug#11304).
9482
d69621cc
JB
94832012-04-24 Juanma Barranquero <lekktu@gmail.com>
9484
9485 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9486 manipulation of :loaded-from data.
9487
02fd101b
JB
94882012-04-23 Juanma Barranquero <lekktu@gmail.com>
9489
9490 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9491 now a cons (bug#11311).
9492
888bec30
PE
94932012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9494
89a438bd
PE
9495 Do not create empty overlays with the evaporate property (Bug#9642).
9496 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9497 if it becomes empty after its bounds are adjusted to fit within
9498 its buffer. Without this fix, in a nonempty buffer (let ((o
9499 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9500 yields an empty overlay that has the evaporate property, which is
9501 not supposed to happen.
9502
1068fe4d
PE
9503 Fix minor GTK3 problems found by static checking.
9504 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9505 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9506 (struct _EmacsFixedClass, emacs_fixed_get_type):
9507 Move decls here from emacsgtkfixed.h, since they needn't be public.
9508 (emacs_fixed_get_type): Now static.
9509 (emacs_fixed_class_init): Omit unused local.
9510 (emacs_fixed_child_type): Remove; unused.
9511 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9512 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9513 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9514 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9515 (EMACS_FIXED_GET_CLASS): Remove; unused.
9516 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9517
888bec30
PE
9518 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9519 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9520
de85e130
PE
95212012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9522
d0baac98 9523 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 9524 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
9525 (__malloc_size_t, __malloc_ptrdiff_t):
9526 Remove. All uses removed, replaced by the definiens if needed,
9527 since we can assume C89 or better now.
9528 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9529 (protect_malloc_state, align, get_contiguous_space)
9530 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9531 (malloc_atfork_handler_child, malloc_enable_thread)
9532 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9533 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9534 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9535 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9536 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9537 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9538 Define using prototypes, not old style.
9539 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9540 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9541 (align): Don't assume that signed integer overflow wraps around.
9542 Omit unused local var.
9543 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9544 (_free_internal_nolock, memalign, mallochook, reallochook):
9545 Omit no-longer-needed casts.
9546 (valloc): Use getpagesize, not __getpagesize.
9547 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9548 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9549
de85e130
PE
9550 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9551
dcbf5805
MA
95522012-04-22 Michael Albinus <michael.albinus@gmx.de>
9553
9554 Move functions from C to Lisp. Make non-blocking method calls
9555 the default. Implement further D-Bus standard interfaces.
9556
9557 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9558 (QCdbus_request_name_allow_replacement)
9559 (QCdbus_request_name_replace_existing)
9560 (QCdbus_request_name_do_not_queue)
9561 (QCdbus_request_name_reply_primary_owner)
9562 (QCdbus_request_name_reply_in_queue)
9563 (QCdbus_request_name_reply_exists)
9564 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9565 (QCdbus_registered_serial, QCdbus_registered_method)
9566 (QCdbus_registered_signal): New Lisp objects.
9567 (XD_DEBUG_MESSAGE): Use sizeof.
9568 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9569 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9570 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9571 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9572 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9573 (xd_signature, xd_append_arg): Allow float for integer types.
9574 (xd_get_connection_references): New function.
b593d6a9
AH
9575 (xd_get_connection_address): Rename from xd_initialize.
9576 Return cached address.
dcbf5805
MA
9577 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9578 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9579 level.
9580 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 9581 Return number of refcounts.
dcbf5805
MA
9582 (Fdbus_get_unique_name): Make stronger parameter check.
9583 (Fdbus_message_internal): New defun.
9584 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9585 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9586 (Fdbus_send_signal, Fdbus_register_service)
9587 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9588 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9589 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9590 (Vdbus_compiled_version, Vdbus_runtime_version)
9591 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9592 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9593 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
9594 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9595 Adapt docstring.
dcbf5805 9596
52828e02
PE
95972012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9598
da05bc4c
PE
9599 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9600 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9601 Do not assume ptrdiff_t is the same width as 'int'.
9602
52828e02
PE
9603 * alloc.c: Handle unusual debugging option combinations.
9604 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9605 since the two debugging options are incompatible.
9606 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9607 is defined.
9608 (mem_init, mem_insert, mem_insert_fixup):
9609 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9610 (NEED_MEM_INSERT): Remove; no longer needed.
9611
f01769f9
LL
96122012-04-22 Leo Liu <sdl.web@gmail.com>
9613
9614 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9615
5790543d
PE
96162012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9617
9618 * sysdep.c [__FreeBSD__]: Minor cleanups.
9619 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9620 Use Emacs indenting style more consistently. Avoid some casts.
9621 Use 'double' consistently rather than mixing 'float' and 'double'.
9622
b91b7e4d
EW
96232012-04-21 Eduard Wiebe <usenet@pusto.de>
9624
b593d6a9
AH
9625 * sysdep.c (list_system_processes, system_process_attributes):
9626 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 9627
6114eb15
AS
96282012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9629
9630 * lisp.mk (lisp): Update.
9631
2f38dff7
PE
96322012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9633
9634 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9635 It is never used otherwise.
9636
4ae29f89
SM
96372012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9638
9639 * print.c (print_preprocess): Only check print_depth if print-circle
9640 is nil.
9641 (print_object): Check for cycles even when print-circle is nil and
9642 print-gensym is t, but only check print_depth if print-circle is nil.
9643
f30d612a
CY
96442012-04-20 Chong Yidong <cyd@gnu.org>
9645
9646 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9647 set the status to "failed" and ensure that sentinel is run.
9648
c07a4c0b 96492012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
9650
9651 * process.c (Fset_process_inherit_coding_system_flag)
9652 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 9653 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 9654
c07a4c0b 96552012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
9656
9657 * xdisp.c (string_buffer_position_lim): Limit starting position to
9658 BEGV.
9659 (set_cursor_from_row): If called for a mode-line or header-line
9660 row, return zero immediately.
9661 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
9662 farther than the first row after the header line, if any.
9663 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
9664 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9665
c07a4c0b 96662012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9667
4ae29f89
SM
9668 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9669 (bug#11238).
ad3a2b41 9670
c07a4c0b 96712012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 96722012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
9673
9674 configure: new option --enable-gcc-warnings (Bug#11207)
9675 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9676 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9677 (ALL_CFLAGS): Use new macros rather than old.
9678 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9679 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9680 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9681 -Wunused-result, -Wunused-variable. This should go away once
9682 the Emacs and Gnulib regex code is merged.
9683 (xmalloc, xrealloc): Now static.
9684
aba027e8
PE
96852012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9686
9687 * dired.c (Fsystem_groups): Remove unused local.
9688
e5a36063
GM
96892012-04-17 Glenn Morris <rgm@gnu.org>
9690
9691 * dired.c (Fsystem_users): Doc fix.
9692
316411f0
DA
96932012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9694
9695 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9696 (syms_of_dired): Add them.
9697
9426aba4
PE
96982012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9699
b62a57be
PE
9700 Fix minor alloc.c problems found by static checking.
9701 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9702 New extern decls, to avoid calling undeclared functions.
9703 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9704 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9705 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9706 (NEED_MEM_INSERT): New macro.
9707 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 9708 Remove one incorrect comment and fix another.
b62a57be 9709
3539f31f
PE
9710 Fix minor ralloc.c problems found by static checking.
9711 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9712 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9713 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9714 (r_alloc_sbrk): Now static.
9715
a041960a
PE
9716 Improve ralloc.c interface checking.
9717 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9718 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9719 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9720 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9721 [REL_ALLOC]: ... to here, to check interface.
9722 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9723 Remove decls. This fixes an "It stinks!".
9724
9426aba4
PE
9725 * alloc.c (which_symbols): Fix alignment issue / type clash.
9726
d55c12ed
AS
97272012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9728
9729 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9730 (struct Lisp_Misc_Any): Likewise.
9731 (struct Lisp_Free): Likewise.
9732 * alloc.c (union aligned_Lisp_Symbol): Define.
9733 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9734 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9735 (union aligned_Lisp_Misc): Define.
9736 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9737 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 9738 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 9739
b948ce8b
PE
97402012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9741
9742 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9743 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9744 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9745 * s/netbsd.h, s/sol2-6.h:
9746 Remove definition of GC_MARK_STACK, since the default now works.
9747 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9748 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9749 no longer the default.
9750 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9751
35dc09a1 97522012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9753
35dc09a1
GM
9754 * lread.c (lisp_file_lexically_bound_p):
9755 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 9756
35dc09a1
GM
97572012-04-14 Eli Zaretskii <eliz@gnu.org>
9758
9759 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9760 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9761
97622012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9763
9764 * nsterm.m (constrainFrameRect): Always constrain when there is only
9765 one screen (Bug#10962).
9766
bcd86815
KB
97672012-04-13 Ken Brown <kbrown@cornell.edu>
9768
9769 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9770
c25df26e
RT
97712012-04-13 Reuben Thomas <rrt@sc3d.org>
9772
9773 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9774
0fc59f1e
DC
97752012-04-11 Daniel Colascione <dancol@dancol.org>
9776
9777 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9778 against is gone. It's better to use vfork now so that when Cygwin
9779 gains a new, working vfork, we use it automatically (bug#10398).
9780
de8c03dc
SM
97812012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9782
9783 * window.c (save_window_save): Obey window-point-insertion-type.
9784
2f097256
GM
97852012-04-11 Glenn Morris <rgm@gnu.org>
9786
9787 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9788
453b951e
SM
97892012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9790
9791 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9792
75f1671a 97932012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
9794
9795 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9796 (force_quit_count): New var.
9797 (handle_interrupt): Use it.
9798
2a8ce227
JB
97992012-04-10 Juanma Barranquero <lekktu@gmail.com>
9800
9801 * w32.c (w32_delayed_load): Record the full path of the library
9802 being loaded (bug#10424).
9803
935396c0
GM
98042012-04-09 Glenn Morris <rgm@gnu.org>
9805
05920a43
GM
9806 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9807 not just in the obarray, before snarfing them. (Bug#11036)
9808
935396c0
GM
9809 * Makefile.in ($(leimdir)/leim-list.el):
9810 Pass EMACS rather than BUILT_EMACS.
9811
a18ecafa
TZ
98122012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9813
9814 * process.c (make_process):
9815 * process.h: Add integer `gnutls_handshakes_tried' member to
9816 process struct.
9817
6bbef4e5
JC
9818 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9819 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
9820
9821 * gnutls.c (gnutls_log_function2i): Convenience log function.
9822 (emacs_gnutls_read): Use new log functions,
9823 `gnutls_handshakes_tried' process member, and
9824 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9825 attempts per process (connection).
9826
b4d3bc10
CY
98272012-04-09 Chong Yidong <cyd@gnu.org>
9828
9829 * eval.c (Fuser_variable_p, user_variable_p_eh)
9830 (lisp_indirect_variable): Functions deleted.
9831 (Fdefvar): Caller changed.
9832
9833 * callint.c (Finteractive, Fcall_interactively):
9834 * minibuf.c (Fread_variable): Callers changed.
9835
70f4d973
EZ
98362012-04-09 Eli Zaretskii <eliz@gnu.org>
9837
9838 * xdisp.c (set_cursor_from_row): If the display string appears in
9839 the buffer at position that is closer to point than the position
9840 after the display string, display the cursor on the first glyph of
9841 the display string. Fixes cursor display when a 'display' text
9842 property immediately follows invisible text. (Bug#11094)
9843
cb3c2e3e
PE
98442012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9845
9846 composite.c: use 'double' consistently
9847 * composite.c (get_composition_id): Use 'double' consistently
9848 instead of converting 'float' to 'double' and vice versa; this is
9849 easier to understand and avoids a GCC warning.
9850
fd06db5d
GM
98512012-04-09 Glenn Morris <rgm@gnu.org>
9852
50fe702a
GM
9853 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9854 preparation for dumping it with emacs. (Bug#4789)
9855 (leimdir): New variable.
9856 ($(leimdir)/leim-list.el): New rule.
9857 (emacs$(EXEEXT)): Depend on leim-list.el.
9858
fd06db5d
GM
9859 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9860 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9861 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9862
55c131ee
AS
98632012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9864
9865 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9866 proper alignment.
9867
9209588f
JB
98682012-04-07 Juanma Barranquero <lekktu@gmail.com>
9869
9870 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9871 Remove unused local variable.
9872
e3fb2efb
PE
98732012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9874
9875 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9876 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9877 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9878 objects, as mark_maybe_pointer will catch them otherwise.
9879 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9880 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9881
b5385551
PE
98822012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9883
9884 Fix typo that broke non-Windows builds.
9885 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9886
9078ead6
EZ
98872012-04-07 Eli Zaretskii <eliz@gnu.org>
9888
9889 Support building on MS-Windows with libxml2.
9890
9891 * makefile.w32-in (OBJ2): Add xml.$(O).
9892 (GLOBAL_SOURCES): Add xml.c.
9893 ($(BLD)/xml.$(O)): New dependency list.
9894
9895 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9896 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9897 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9898 [!WINDOWSNT]: New macros.
9899 (init_libxml2_functions, libxml2_loaded_p): New functions.
9900 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9901 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9902 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9903 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9904 linked in).
6bbef4e5
JC
9905 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9906 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
9907 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9908
9909 * emacs.c: Don't include libxml/parser.h.
9910 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9911 xmlCleanupParser directly.
9912
9913 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9914
3811fdf3
EZ
99152012-04-07 Eli Zaretskii <eliz@gnu.org>
9916
9917 * indent.c (Fvertical_motion): If there is a display string at
9918 point, use it.vpos to compute how many lines to backtrack after
9919 move_it_to point. (Bug#11133)
9920
2f8e16b2
EZ
99212012-04-06 Eli Zaretskii <eliz@gnu.org>
9922
9923 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9924 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9925 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9926 macros related to unification of CJK characters. For the details,
9927 see the discussion following the message here:
9928 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9929
3d439cd1
CY
99302012-04-04 Chong Yidong <cyd@gnu.org>
9931
9932 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9933
8bc53d00
EZ
99342012-04-01 Eli Zaretskii <eliz@gnu.org>
9935
9936 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9937 instead of alloca. (Bug#11138)
9938
3b0512a3
AS
99392012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9940
9941 * w32menu.c (is_simple_dialog): Properly check lisp types.
9942 (Bug#11141)
9943
8427ddd2
EZ
99442012-03-31 Eli Zaretskii <eliz@gnu.org>
9945
979022ef
EZ
9946 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9947 position we get to after a call to move_it_to fails the
9948 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9949 only if we wind up in a string from display property. (Bug#11063)
9950
a6b1c7cc
EZ
9951 * window.c (Fdelete_other_windows_internal): Invalidate the row
9952 and column information about mouse highlight, so that redisplay
9953 restores it after reallocating the glyph matrices. (Bug#7464)
9954
8427ddd2
EZ
9955 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9956 string comes from a `display' text property, use the buffer
9957 position of that property as if we actually saw that position in
9958 the row's glyphs.
697ba24b
EZ
9959 (move_it_by_lines): Remove the assertion that
9960 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9961 violated when there's a before-string at the beginning of a line.
9962 (Bug#11063)
8427ddd2 9963
65a0a738
EZ
99642012-03-30 Eli Zaretskii <eliz@gnu.org>
9965
9966 * xdisp.c (append_space_for_newline): If the default face was
9967 remapped, use the remapped face for the appended newline.
9968 (extend_face_to_end_of_line): Use the remapped default face for
9969 extending the face to the end of the line.
9970 (display_line): Call extend_face_to_end_of_line when the default
9971 face was remapped. (Bug#11068)
9972
581355cc
EZ
99732012-03-29 Eli Zaretskii <eliz@gnu.org>
9974
9975 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9976
e8fc049f
SM
99772012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9978
9979 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9980
4fb9a543
GM
99812012-03-27 Glenn Morris <rgm@gnu.org>
9982
9983 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9984 Doc fixes.
9985
679910f1
KH
99862012-03-26 Kenichi Handa <handa@m17n.org>
9987
9988 * dispextern.h (struct glyph): Fix previous change. Change the
9989 bit length of glyphless.ch to 25 (Bug#11082).
9990
90d49b7f
CY
99912012-03-26 Chong Yidong <cyd@gnu.org>
9992
9993 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9994 (command_loop_1): Use it; inhibit selection update for
9995 handle-select-window too (Bug#8996).
9996
f514f6f0
FP
99972012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9998
e8fc049f 9999 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 10000
bf43fa51
KH
100012012-03-25 Kenichi Handa <handa@m17n.org>
10002
10003 * dispextern.h (struct glyph): Change the bit length of
10004 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10005
8a0c01dd
EZ
100062012-03-24 Eli Zaretskii <eliz@gnu.org>
10007
10008 * s/ms-w32.h (tzname): Include time.h before redirecting to
10009 _tzname. Fixes the MSVC build. (Bug#9960)
10010
7d1c3a76
AS
100112012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10012
8ed79523
AS
10013 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10014 characters.
10015
7d1c3a76
AS
10016 * xterm.c (XTread_socket): Only modify handling_signal if
10017 !SYNC_INPUT. (Bug#11080)
10018
e99a9b8b
EZ
100192012-03-23 Eli Zaretskii <eliz@gnu.org>
10020
10021 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10022 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10023 when fetching a multibyte character consumes more bytes than
10024 CHAR_BYTES returns, due to unification of CJK characters in
10025 string_char. (Bug#11073)
10026
5063c0e1
TN
100272012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10028
10029 * process.c (wait_reading_process_output): Handle pty disconnect
10030 by refraining from sending oneself a SIGCHLD (bug#10933).
10031
9f851fbd
CY
100322012-03-22 Chong Yidong <cyd@gnu.org>
10033
10034 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10035
5063c0e1 10036 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
10037 Mark string as coming from a prefix property.
10038 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10039 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10040
fb5b8aca
CY
100412012-03-21 Chong Yidong <cyd@gnu.org>
10042
10043 * xfaces.c (Vface_remapping_alist): Doc fix.
10044
62356a1b
EZ
100452012-03-20 Eli Zaretskii <eliz@gnu.org>
10046
10047 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
10048 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10049 Doc fixes.
62356a1b 10050
025de85b
CY
100512012-03-20 Chong Yidong <cyd@gnu.org>
10052
10053 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10054 to reflect default non-nil value of redisplay-dont-pause.
10055
4827f94e
KH
100562012-03-19 Kenichi Handa <handa@m17n.org>
10057
10058 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10059 it fit in a valid range (Bug#11003).
10060
e50a24a2
EZ
100612012-03-18 Eli Zaretskii <eliz@gnu.org>
10062
10063 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10064 that is not from display property, accept the row as a "cursor
10065 row" if one of the string's character has a non-nil `cursor'
10066 property. Fixes cursor positioning when there are newlines in
10067 overlay strings, e.g. in icomplete.el. (Bug#11035)
10068
9af5ed87
PE
100692012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10070
10071 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10072
d1f55f16
CY
100732012-03-12 Chong Yidong <cyd@gnu.org>
10074
10075 * eval.c (inhibit_lisp_code): Rename from
10076 inhibit_window_configuration_change_hook; move from window.c.
10077
10078 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10079 * window.c (run_window_configuration_change_hook)
10080 (syms_of_window): Callers changed.
10081
66c5eebd
CY
100822012-03-11 Chong Yidong <cyd@gnu.org>
10083
413df973
CY
10084 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10085
66c5eebd
CY
10086 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10087
1de11f56
CY
100882012-03-10 Chong Yidong <cyd@gnu.org>
10089
10090 * frame.c (other_visible_frames): Don't assume the selected frame
10091 is visible (Bug#10955).
10092
cae07000
SM
100932012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10094
10095 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10096
89c94350
JD
100972012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10098
10099 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10100 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10101 zero (Bug#10954).
10102
999dd333
GM
101032012-03-03 Glenn Morris <rgm@gnu.org>
10104
01a6dcc8 10105 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 10106
de0100f2
EZ
101072012-03-02 Eli Zaretskii <eliz@gnu.org>
10108
10109 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10110 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
10111 (redisplay_window, next_element_from_string): Fix typos in
10112 comments.
3e441275
EZ
10113 (redisplay_window): Pass to move_it_vertically the margin in
10114 pixels, not in screen lines.
de0100f2 10115
96a72ee9
GM
101162012-03-02 Glenn Morris <rgm@gnu.org>
10117
10118 * buffer.c (buffer-list-update-hook): Doc fix.
10119
312508d7
EZ
101202012-02-29 Eli Zaretskii <eliz@gnu.org>
10121
10122 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10123 push_it before setting up the iterator for the first overlay
10124 string, even if we have an empty string loaded.
10125 (next_overlay_string): If there's an empty string on the iterator
10126 stack, pop the stack. (Bug#10903)
10127
27f3c637
PE
101282012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10129
10130 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10131 Suggested by Stefan Monnier in
10132 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10133 * alloc.c (widen_to_Lisp_Object): New static function.
10134 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10135 and widening them to Lisp_Objects. This would work even if
10136 USE_LSB_TAG is defined and wide integers are used, which might
10137 happen in a future version of Emacs.
10138
3c9dfce6
CY
101392012-02-25 Chong Yidong <cyd@gnu.org>
10140
fa74b241
CY
10141 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10142 Doc fix.
10143
3c9dfce6
CY
10144 * xselect.c (Fx_selection_exists_p): Doc fix.
10145 (x_clipboard_manager_save_all): Print an informative message
10146 before saving to clipboard manager.
10147
9486df08
CY
101482012-02-24 Chong Yidong <cyd@gnu.org>
10149
10150 * keyboard.c (process_special_events): Handle all X selection
10151 requests in kbd_buffer, not just the next one (Bug#8869).
10152
f01d3321
CY
101532012-02-23 Chong Yidong <cyd@gnu.org>
10154
10155 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10156 call when setting menu-bar-lines and tool-bar-lines parameters.
10157 (unwind_create_frame_1): New helper function.
10158
10159 * window.c (inhibit_window_configuration_change_hook): New var.
10160 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 10161 (syms_of_window): Initialize it.
f01d3321 10162
86b847b6
CY
101632012-02-22 Chong Yidong <cyd@gnu.org>
10164
10165 * xterm.c (x_draw_image_relief): Add missing type check for
10166 Vtool_bar_button_margin (Bug#10743).
10167
a59225b1
CY
101682012-02-21 Chong Yidong <cyd@gnu.org>
10169
10170 * fileio.c (Vfile_name_handler_alist): Doc fix.
10171
10172 * buffer.c (Fget_file_buffer): Protect against invalid file
10173 handler return value.
10174
310f5bd4
PE
101752012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10176
cb3a28cc
PE
10177 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10178 when computing $valmask.
10179
310f5bd4
PE
10180 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10181 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10182 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10183 It's useless in that case, and it can cause problems on hosts
10184 that allocate halves of EMACS_INT values separately.
10185 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10186 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10187 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10188 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10189 it avoids undefined behavior on hosts where shifting right by more
10190 than the word width has undefined behavior.
10191
2375c96a
CY
101922012-02-19 Chong Yidong <cyd@gnu.org>
10193
10194 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10195 (Funhandled_file_name_directory, Ffile_name_as_directory)
10196 (Fdirectory_file_name, Fexpand_file_name)
10197 (Fsubstitute_in_file_name): Protect against invalid file handler
10198 return values (Bug#10845).
10199
3eb49e71
EZ
102002012-02-18 Eli Zaretskii <eliz@gnu.org>
10201
10202 * .gdbinit (pitx): Fix incorrect references to fields of the
10203 iterator stack.
10204
7b926f3f
CY
102052012-02-17 Chong Yidong <cyd@gnu.org>
10206
10207 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10208
11273115
PE
102092012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10210
10211 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10212 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10213
c3a70e2b
CY
102142012-02-15 Chong Yidong <cyd@gnu.org>
10215
10216 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10217 marked as special. Also, starting docstrings with * is obsolete.
10218
0ca43699
AS
102192012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10220
10221 * gnutls.c (emacs_gnutls_write): Fix last change.
10222
2e8f3c56
LI
102232012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10224
10225 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10226 send_process.
10227
af70074f
SM
102282012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10229
10230 * keymap.c (Fsingle_key_description): Handle char ranges.
10231
95986d52
CY
102322012-02-12 Chong Yidong <cyd@gnu.org>
10233
afd83bd1
CY
10234 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10235 as that creates a dangerous corner case.
10236
95986d52
CY
10237 * window.c (Fdelete_window_internal): Invalidate the mouse
10238 highlight (Bug#9904).
10239
bd7da63e
GM
102402012-02-12 Glenn Morris <rgm@gnu.org>
10241
10242 * xselect.c (Fx_own_selection_internal)
10243 (Fx_get_selection_internal, Fx_disown_selection_internal)
10244 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10245 * nsselect.m (Fx_own_selection_internal)
10246 (Fx_disown_selection_internal, Fx_selection_exists_p)
10247 (Fx_selection_owner_p, Fx_get_selection_internal):
10248 Sync docs and argument specs with the xselect.c versions.
10249
77abcbc2
LI
102502012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10251
10252 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10253
90b671e2
EZ
102542012-02-11 Eli Zaretskii <eliz@gnu.org>
10255
1c0ca0b7
EZ
10256 * w32select.c (Fx_selection_exists_p): Sync doc string and
10257 argument list with xselect.c. (Bug#10783)
10258
10259 * w16select.c (Fx_selection_exists_p): Sync doc string and
10260 argument list with xselect.c. (Bug#10783)
90b671e2 10261
49241268
GM
102622012-02-10 Glenn Morris <rgm@gnu.org>
10263
10264 * fns.c (Fsecure_hash): Doc fix.
10265
f998bbe7 102662012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
10267
10268 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10269
0992bd9c
CY
102702012-02-07 Chong Yidong <cyd@gnu.org>
10271
10272 * buffer.c (Fbuffer_local_variables)
10273 (buffer_lisp_local_variables): Handle unbound vars correctly;
10274 don't let Qunbound leak into Lisp.
10275
af008560
GM
102762012-02-07 Glenn Morris <rgm@gnu.org>
10277
dd605cc4
GM
10278 * image.c (Fimagemagick_types): Doc fix.
10279
af008560
GM
10280 * image.c (imagemagick-render-type): Change it from a lisp object
10281 to an integer. Move the doc here from the lisp manual.
10282 Treat all values not equal to 0 the same.
10283
1449fa1d
CY
102842012-02-06 Chong Yidong <cyd@gnu.org>
10285
10286 * doc.c (store_function_docstring): Avoid applying docstring of
10287 alias to base function (Bug#2603).
10288
3723ec07
AS
102892012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10290
10291 * .gdbinit (pp1, pv1): Remove redundant defines.
10292 (pr): Use pp.
10293
79c1cc1e
CY
102942012-02-04 Chong Yidong <cyd@gnu.org>
10295
10296 * nsterm.m: Declare a global (Bug#10694).
10297
d7f29f8e
EZ
102982012-02-04 Eli Zaretskii <eliz@gnu.org>
10299
cae07000
SM
10300 * w32.c (get_emacs_configuration_options):
10301 Include --enable-checking, if specified, in the return value.
d7f29f8e 10302
3b95a6f9
MR
103032012-02-04 Martin Rudalics <rudalics@gmx.at>
10304
10305 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10306 after rounding frame sizes. (Bug#9723)
10307
d6fa96a6
EZ
103082012-02-04 Eli Zaretskii <eliz@gnu.org>
10309
10310 * keyboard.c (adjust_point_for_property): Don't position point
10311 before BEGV. (Bug#10696)
10312
df0b2940
PE
103132012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10314
10315 Handle overflow when computing char display width (Bug#9496).
10316 * character.c (char_width): Return EMACS_INT, not int.
10317 (char_width, c_string_width): Check for overflow when
10318 computing the width; this is possible now that individual
10319 characters can have unbounded width. Problem introduced
10320 by merge from Emacs 23 on 2012-01-19.
10321
6bee44d6
MA
103222012-02-02 Michael Albinus <michael.albinus@gmx.de>
10323
10324 * dbusbind.c (Fdbus_register_method): Mention the return value
10325 :ignore in the docstring.
10326
44f92739
GM
103272012-02-02 Glenn Morris <rgm@gnu.org>
10328
1b9f60cc
GM
10329 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10330
44f92739
GM
10331 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10332 Unconditionally set to t. (Bug#10673)
10333 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10334 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10335 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10336
c5d3843c
KH
103372012-02-02 Kenichi Handa <handa@m17n.org>
10338
10339 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10340 0, do not call append_composite_glyph.
10341
159462d4 103422012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
10343
10344 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10345 NULL (Bug#6988).
10346 (x_produce_glyphs): If the component of a composition is a null
10347 string, set it->pixel_width to 1 to avoid zero-width glyph.
10348
78cef877
EZ
103492012-02-01 Eli Zaretskii <eliz@gnu.org>
10350
10351 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10352 first 2 arguments are identical. This makes inserting large
10353 output from a subprocess an order of magnitude faster on
10354 MS-Windows, where all sbrk'ed memory is always contiguous.
10355
97897668
GM
103562012-01-31 Glenn Morris <rgm@gnu.org>
10357
10358 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 10359 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
10360 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10361
31fd3586
GM
103622012-01-29 Glenn Morris <rgm@gnu.org>
10363
10364 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10365
0e24a8b2
CY
103662012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10367
10368 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10369
cc0adcb0
CY
103702012-01-28 Chong Yidong <cyd@gnu.org>
10371
10372 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10373
acc28cb9
CY
103742012-01-26 Chong Yidong <cyd@gnu.org>
10375
9c69cfb7
CY
10376 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10377
acc28cb9
CY
10378 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10379 repeat counts (Bug#10507).
10380
48da7392
GM
103812012-01-26 Glenn Morris <rgm@gnu.org>
10382
10383 * lread.c (syms_of_lread): Doc fix.
10384
14af5f7f
CY
103852012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10386
10387 * coding.c (encode_designation_at_bol): Change return value to
10388 EMACS_INT.
10389
0b21c100
CY
103902012-01-25 Chong Yidong <cyd@gnu.org>
10391
10392 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10393
3c2907f7
CY
103942012-01-21 Chong Yidong <cyd@gnu.org>
10395
10396 * floatfns.c (Fcopysign): Make the second argument non-optional,
10397 since nil is not allowed anyway.
10398
959ad23f
AS
103992012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10400
10401 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10402 (send_process): Likewise.
10403
34a02f46
MR
104042012-01-19 Martin Rudalics <rudalics@gmx.at>
10405
10406 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
10407 (Vwindow_persistent_parameters): Do not use Qstate.
10408 Rewrite doc-strings.
34a02f46 10409
1259009a 104102012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
10411
10412 * character.c (char_width): New function.
70d4fdf6
GM
10413 (Fchar_width, c_string_width, lisp_string_width):
10414 Use char_width (Bug#9496).
25ed9e61 10415
6a6ee00d
MR
104162012-01-16 Martin Rudalics <rudalics@gmx.at>
10417
10418 * window.c (Vwindow_persistent_parameters): New variable.
10419 (Fset_window_configuration, save_window_save): Handle persistent
10420 window parameters.
10421
c85efaf7
EZ
104222012-01-14 Eli Zaretskii <eliz@gnu.org>
10423
10424 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10425 thrashing the stack of the thread. (Bug#9087)
10426
5944709e
PE
104272012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10428
10429 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10430
e71f5d99
EZ
104312012-01-11 Eli Zaretskii <eliz@gnu.org>
10432
10433 * xdisp.c (rows_from_pos_range): Handle the case where the
10434 highlight ends on a newline. (Bug#10464)
10435 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10436 he end column for display of highlight that ends on a newline
10437 before a R2L line.
10438
ce316182
GM
104392012-01-11 Glenn Morris <rgm@gnu.org>
10440
10441 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10442 from load-path also when installation-directory is nil. (Bug#10208)
10443
5b43da69
GM
104442012-01-10 Glenn Morris <rgm@gnu.org>
10445
74cc8ff9
GM
10446 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10447
7d8d6e4e
GM
10448 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10449 Update template values to be closer to their typical values these days.
5b43da69 10450
a0db8d43
EZ
104512012-01-09 Eli Zaretskii <eliz@gnu.org>
10452
10453 * xdisp.c (rows_from_pos_range): Accept additional argument
10454 DISP_STRING, and accept any glyph in a row whose object is that
10455 string as eligible for mouse highlight. Fixes mouse highlight of
10456 display strings from overlays. (Bug#10464)
10457
9a0115ab 104582012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 10459
b9110d6a 10460 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
10461 * fileio.c (auto_saving_dir_umask): New static var.
10462 (Fmake_directory_internal): Use it.
10463 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10464 creating the directory. The old code temporarily assigns
10465 too-generous permissions to the directory.
10466 (do_auto_save_eh): Clear it.
b9110d6a 10467 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
10468 that the var is always cleared.
10469
6c1bd3f3
EZ
104702012-01-07 Eli Zaretskii <eliz@gnu.org>
10471
10472 * search.c (scan_buffer): Pass character positions to
10473 know_region_cache, not byte positions. (Bug#6540)
10474
069d2b50
L
104752012-01-07 LynX <_LynX@bk.ru> (tiny change)
10476
10477 * w32.c (sys_rename): Report EXDEV when rename of a directory
10478 fails because the target is on another logical disk. (Bug#10284)
10479
75bf0d33
DB
104802012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10481
10482 * xterm.c (x_embed_request_focus): New function.
10483
10484 * xterm.h: Add prototype.
10485
10486 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10487
1c6e5a32
GM
104882012-01-05 Glenn Morris <rgm@gnu.org>
10489
10490 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10491
651e947e
EZ
104922012-01-01 Eli Zaretskii <eliz@gnu.org>
10493
10494 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10495 Load gnutls_transport_set_lowat only if GnuTLS version is below
10496 2.11.1.
10497 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10498 GnuTLS versions below 2.11.1.
10499
3778cdd8
AL
105002011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10501
10502 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10503 to the doc string advising against its use for altering the way
10504 windows are scrolled.
10505
0e5317f7
KH
105062011-12-28 Kenichi Handa <handa@m17n.org>
10507
10508 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10509 coding-system ASCII compatible only when it does not produce BOM
10510 on encoding (Bug#10383).
10511
93d5ca1f
JD
105122011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10513
10514 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10515 can scroll.
10516 (create_and_show_popup_menu): Always use menu_position_func for
10517 Gtk3 (Bug#10361).
10518
ca22b785
AS
105192011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10520
10521 * callint.c (Fcall_interactively): Don't truncate prompt string.
10522
d048e1e6
EZ
105232011-12-23 Eli Zaretskii <eliz@gnu.org>
10524
10525 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10526 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 10527 resumed from there (after widening). (Bug#10360)
d048e1e6 10528
5ccaba1f
JD
105292011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10530
10531 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10532
204ee57f
JD
105332011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10534
b81d40f0
JB
10535 * nsterm.m (x_free_frame_resources):
10536 Release f->output_data.ns->miniimage.
204ee57f
JD
10537 (ns_index_color): Fix indentation. Do not retain
10538 color_table->colors[i].
10539
10540 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10541 before returning.
10542
10543 * nsfns.m (x_set_background_color): Assign return value from
10544 ns_index_color to face-background instead of NSColor*.
10545 (ns_implicitly_set_icon_type): Fix indentation.
10546 Change assignment in for loop to comparison.
10547
10548 * emacs.c (ns_pool): New variable.
10549 (main): Assign ns_pool.
10550 (Fkill_emacs): Call ns_release_autorelease_pool.
10551
10552 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10553 autorelease fdesc, release fdAttrs and tdict.
10554 (ns_get_covering_families): Release charset.
10555 (ns_findfonts): Release NSFontDescriptor created with new.
10556 (ns_uni_to_glyphs): Fix indentation.
10557 (setString): Release attrStr before assigning new value.
10558
c803b2b7
JD
105592011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10560
678f4426
JD
10561 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10562 and NS_IMPL_COCOA.
10563 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10564 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10565
cd394be1 105662011-12-18 David Reitter <reitter@cmu.edu>
678f4426 10567
5fecd5fc
JD
10568 * nsterm.m (ns_term_init): Subscribe for notifications
10569 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10570 to method trackingNotification in EmacsMenu.
10571
10572 * nsmenu.m (trackingMenu): New variable.
3771cb17 10573 (trackingNotification): New method (from Aquamacs).
5fecd5fc 10574 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 10575 from Aquamacs (Bug#7030).
678f4426
JD
10576
105772011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 10578
c803b2b7
JD
10579 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10580 (symbol_to_nsstring): Fix indentation.
10581 (ns_symbol_to_pb): New function.
cae07000
SM
10582 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10583 (Fns_rotate_cut_buffers_internal): Remove.
10584 (Fns_store_selection_internal): Rename from
c803b2b7
JD
10585 Fns_store_cut_buffer_internal.
10586 (ns_get_foreign_selection, Fx_own_selection_internal)
10587 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
10588 (Fns_get_selection_internal, Fns_store_selection_internal):
10589 Use ns_symbol_to_pb and check if return value is nil.
10590 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10591 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
10592 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10593 renamed to Sns_store_selection_internal.
10594 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10595 and remove this function.
10596 (ns_handle_selection_clear): Remove, never used.
10597 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10598 here.
10599
e1b01a3a
KB
106002011-12-17 Ken Brown <kbrown@cornell.edu>
10601
10602 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10603 GID is unknown (Bug#10257).
10604
2adb6e85
PE
106052011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10606
10607 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10608 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10609 which caused a build failure on GNU/Linux IA-64. This problem was
10610 introduced by my 2011-10-07 patch.
10611
d1d7b339
JL
106122011-12-15 Juri Linkov <juri@jurta.org>
10613
10614 * image.c (imagemagick_error): New function. (Bug#10112)
10615 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10616 Use `imagemagick_error' where ImageMagick functions return
10617 `MagickFalse'.
10618 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10619 proper order.
10620
100d5755
KH
106212011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10622
10623 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10624 fill background (Bug#8992).
10625
454592a6
MR
106262011-12-13 Martin Rudalics <rudalics@gmx.at>
10627
10628 * window.c (Vwindow_combination_resize)
10629 (Vwindow_combination_limit): Use t instead of non-nil in
10630 doc-strings.
61d4b438
MR
10631 (Vrecenter_redisplay): Add first sentence of doc-string on
10632 separate line.
53524d93 10633 (Frecenter): Fix doc-string typo.
454592a6 10634
3633e3aa
KH
106352011-12-11 Kenichi Handa <handa@m17n.org>
10636
10637 * coding.c (Funencodable_char_position): Pay attention to the
10638 buffer text relocation (Bug#9389).
10639
7b9d523a 106402011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 10641
7b9d523a
JD
10642 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10643 gtk_init (Bug#10100).
10644
b73189c6
EZ
106452011-12-10 Eli Zaretskii <eliz@gnu.org>
10646
10647 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10648 IT->string is nil. (Bug#10263)
10649
f7dfe5d6
JD
106502011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10651
83faebb4
JD
10652 * nsterm.h (x_free_frame_resources): Declare.
10653
f7dfe5d6
JD
10654 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10655 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10656
10657 * nsterm.h (ns_get_defaults_value): Declare.
10658
10659 * nsterm.m (ns_default): Call ns_get_defaults_value.
10660
7cd4e72c
EZ
106612011-12-09 Eli Zaretskii <eliz@gnu.org>
10662
10663 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10664 (Bug#10170)
10665
b34d7317
YM
106662011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10667
10668 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10669 that where the value of an _OBJC_* symbol points to is in the .bss
10670 section (Bug#10240).
10671
76470ad1
KH
106722011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10673
10674 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 10675 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 10676
745fff94
KH
106772011-12-08 Kenichi Handa <handa@m17n.org>
10678
10679 * ftfont.c (get_adstyle_property): Fix previous change
10680 (Bug#10233).
10681
6e44397c
JB
106822011-12-07 Juanma Barranquero <lekktu@gmail.com>
10683
10684 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10685 dirs from the default value of EMACSLOADPATH (bug#10208).
10686
7efa6272
GM
106872011-12-07 Glenn Morris <rgm@gnu.org>
10688
10689 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10690 installation and source directories as well. (Bug#10208)
10691
f6fc4d87
CY
106922011-12-06 Chong Yidong <cyd@gnu.org>
10693
10694 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10695
2bf26180
GM
106962011-12-06 Glenn Morris <rgm@gnu.org>
10697
10698 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10699 as an error, not just -1. (Bug#10217)
10700
3a6ad4f0
CY
107012011-12-05 Chong Yidong <cyd@gnu.org>
10702
10703 * keyboard.c (process_special_events): New function.
10704 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10705
75a3b399
PE
107062011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10707
10708 * coding.c (encode_designation_at_bol): Don't use uninitialized
10709 local variable (Bug#9318).
10710
c3c9e25e
KH
107112011-12-05 Kenichi Handa <handa@m17n.org>
10712
10713 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10714 return Qnil (Bug#8046, Bug#10193).
10715
5eb05ea3
KH
107162011-12-05 Kenichi Handa <handa@m17n.org>
10717
10718 * coding.c (encode_designation_at_bol): New args charbuf_end and
10719 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
10720 (coding_set_source): Return how many bytes coding->source was
10721 relocated.
10722 (coding_set_destination): Return how many bytes
10723 coding->destination was relocated.
10724 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 10725 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
10726
107272011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10728
10729 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10730 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10731 macro (Bug#9318).
10732
107332011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10734
10735 The following changes are to fix Bug#9318.
10736
a79703f5 10737 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
10738 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10739 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 10740 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 10741
7dbda6df
JB
107422011-12-05 Juanma Barranquero <lekktu@gmail.com>
10743
10744 * lisp.h (process_quit_flag): Fix external declaration.
10745
6d5eb5b0
SM
107462011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10747
10748 Don't macro-inline non-performance-critical code.
10749 * eval.c (process_quit_flag): New function.
10750 * lisp.h (QUIT): Use it.
10751
a0c3fad0
JD
107522011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10753
10754 * nsfns.m (get_geometry_from_preferences): New function.
10755 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10756
6c07aac2
AS
107572011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10758
10759 * emacs.c (Qkill_emacs): Define.
10760 (syms_of_emacs): Initialize it.
10761 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10762 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
10763 (quit_throw_to_read_char): Add parameter `from_signal'.
10764 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
10765 * lisp.h (QUIT): Call Fkill_emacs if requested.
10766
c052ead4
JD
107672011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10768
10769 * widget.c (update_wm_hints): Return if wmshell is null.
10770 (widget_update_wm_size_hints): New function.
10771
10772 * widget.h (widget_update_wm_size_hints): Declare.
10773
10774 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10775 widget_update_wm_size_hints (Bug#10104).
10776
9e49252b
EZ
107772011-12-03 Eli Zaretskii <eliz@gnu.org>
10778
10779 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10780 before a newline, prepare the bidi iterator for consuming the
10781 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 10782 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 10783
02b16839
JL
107842011-12-02 Juri Linkov <juri@jurta.org>
10785
10786 * search.c (Fword_search_regexp): New Lisp function created from
10787 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10788 (Fword_search_backward, Fword_search_forward)
10789 (Fword_search_backward_lax, Fword_search_forward_lax):
10790 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10791 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10792
0068070e
SM
107932011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10794
10795 * fileio.c (Finsert_file_contents): Move after-change-function call
10796 to before the "handled:" label, since all "goto handled" appear in
10797 cases where the *-change-functions have already been properly called
10798 (bug#10117).
10799
3360a3fc
AS
108002011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10801
10802 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10803 waiting for input. (Bug#10169)
10804
73d6c093
EZ
108052011-11-30 Eli Zaretskii <eliz@gnu.org>
10806
10807 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10808 verifies glyph row's hash code--we have just reallocated the
10809 glyphs, so their contents can be complete garbage. (Bug#10164)
10810
febe6bea
JB
108112011-11-30 Juanma Barranquero <lekktu@gmail.com>
10812
10813 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10814
801a4313
EZ
108152011-11-30 Eli Zaretskii <eliz@gnu.org>
10816
10817 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10818 attributes are tested _before_ calling verify_row_hash, to protect
10819 against GCC re-ordering of the tests. (Bug#10164)
10820
2b56b87e
JD
108212011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10822
10823 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10824
10825 * xterm.c (handle_one_xevent): Only set async_visible and friends
10826 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 10827 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
10828 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10829
dbf31225
PE
108302011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10831
10832 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10833 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10834 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10835 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10836 All uses changed to use GCPRO1 etc.
10837 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10838 Revert to old implementation (i.e., before 2011-03-11).
10839
1305621b
YM
108402011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10841
10842 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10843 of scroll runs so as to avoid assigning disabled bogus rows and
10844 unnecessary graphics copy operations.
10845
8c9afb46
EZ
108462011-11-27 Eli Zaretskii <eliz@gnu.org>
10847
10848 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10849 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10850 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10851 (malloc, free, realloc, calloc): Redirect to e_* only when
10852 compiling Emacs.
10853
10854 * lisp.h (GCTYPEBITS): Move before first use.
10855 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10856 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10857 this macro definition.
10858
10859 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10860 _MSC_VER.
10861
54e9e3bf
JD
108622011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10863
6d5eb5b0
SM
10864 * gtkutil.c (xg_create_frame_widgets):
10865 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
10866 present with Gtk+ 2.0.
10867
83aca1cb
PE
108682011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10869
10870 * fileio.c (Finsert_file_contents): Undo previous change; see
10871 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10872
5b76caa4
PE
108732011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10874
10875 Rename locals to avoid shadowing.
10876 * fileio.c (Finsert_file_contents):
10877 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10878 * process.c (wait_reading_process_output):
10879 Rename inner 'proc' to 'p' to avoid shadowing.
10880 Indent for consistency with usual Emacs style.
10881
8c535114
EZ
108822011-11-25 Eli Zaretskii <eliz@gnu.org>
10883
10884 * xdisp.c (redisplay_window): If cursor row is not fully visible
10885 after recentering, and scroll-conservatively is set to a large
10886 number, scroll window by a few more lines to make the cursor fully
10887 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
10888 (start_display): Don't move to the next line if the display should
10889 start at a newline that is part of a display vector or an overlay
10890 string. (Bug#10119)
8c535114 10891
fa4fdb5c
JL
108922011-11-24 Juri Linkov <juri@jurta.org>
10893
10894 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10895 after the `MagickPingImage' call. (Bug#10112)
10896
90ec88df
CY
108972011-11-23 Chong Yidong <cyd@gnu.org>
10898
10899 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10900
56e2e794
MR
109012011-11-23 Martin Rudalics <rudalics@gmx.at>
10902
10903 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10904 making another buffer current. (Bug#10114)
10905
b6e64c41
GM
109062011-11-23 Glenn Morris <rgm@gnu.org>
10907
10908 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10909
6b21de18
CY
109102011-11-23 Chong Yidong <cyd@gnu.org>
10911
10912 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10913 using it (Bug#5984).
10914
b12cd789
EZ
109152011-11-22 Eli Zaretskii <eliz@gnu.org>
10916
10917 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10918 and header-lines, as they don't have one computed for them.
10919 (Bug#10098)
10920
10921 * .gdbinit (prow): Make displayed values more self-explaining.
10922 Add row's hash code.
10923
261b6fd4
LMI
109242011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10925
10926 * process.c (wait_reading_process_output): Fix asynchrounous
10927 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 10928 (wait_reading_process_output): Add comment and URL.
261b6fd4 10929
e7cfd277
JD
109302011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10931
10932 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10933
a9b9b7f5
CY
109342011-11-21 Chong Yidong <cyd@gnu.org>
10935
10936 * window.c (Fnext_window, Fprevious_window): Doc fix.
10937
b0d15b4f
SM
109382011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10939
10940 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10941
fe7a3057
JB
109422011-11-20 Juanma Barranquero <lekktu@gmail.com>
10943
10944 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10945
d2999b1a
MR
109462011-11-20 Martin Rudalics <rudalics@gmx.at>
10947
10948 * window.c (Fset_window_combination_limit): Rename argument
10949 STATUS to LIMIT.
10950 (Vwindow_combination_limit): Remove "status" from doc-string.
10951
d5ff9cd0
AS
109522011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10953
10954 * m/ibms390.h: Remove.
10955 * m/ibms390x.h: Don't include "ibms390.h".
10956
a5bb9bd3
SM
109572011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10958
10959 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10960 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10961
cd1181db
JB
109622011-11-20 Juanma Barranquero <lekktu@gmail.com>
10963
10964 * casetab.c (Fset_case_table):
10965 * charset.c (Fcharset_after): Fix typos.
10966
615a3b8d 109672011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 10968
17e845af
PE
10969 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10970 Otherwise, valgrind does not work on some platforms.
10971 Problem reported by Andreas Schwab in
6a0bf43d
PE
10972 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10973 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10974 is set, removing the need for VIRT_ADDRESS_VARIES.
10975 (PURE_P): Use a more-efficient implementation that needs just one
10976 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10977 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10978 to 4 (xorl, subq, cmpq, setbe).
10979 * alloc.c (pure): Always extern now, since that's the
10980 VIRT_ADDR_VARIES behavior.
10981 (PURE_POINTER_P): Use a single comparison, not two, for
10982 consistency with the new puresize.h.
10983 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10984 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10985 Remove VIRT_ADDR_VARIES no longer needed.
10986
f8fe6f96
EZ
109872011-11-19 Eli Zaretskii <eliz@gnu.org>
10988
10989 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10990 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10991 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10992 behave as if the cursor position were at the window margin.
10993
10994 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10995 and the cursor position is out of bounds, behave as if the cursor
10996 position were at the window margin. (Bug#10075)
10997
df05a53c
CY
109982011-11-18 Chong Yidong <cyd@gnu.org>
10999
11000 * window.c (Fwindow_combination_limit): Make first argument
11001 non-optional, since it is meaningless for live windows like the
11002 selected window.
61ccba97 11003
2071918e
DA
110042011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11005
11006 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11007
b50a28de
SM
110082011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11009
11010 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11011 (graft_intervals_into_buffer): Simplify.
11012
015137db
EZ
110132011-11-18 Eli Zaretskii <eliz@gnu.org>
11014
11015 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11016 hash values of the two rows.
11017 (copy_row_except_pointers): Preserve the used[] arrays and the
11018 hash values of the two rows. (Bug#10035)
68c95424 11019 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
11020
11021 * xdisp.c (row_hash): New function, body extracted from
11022 compute_line_metrics.
11023 (compute_line_metrics): Call row_hash, instead of computing the
11024 hash code inline.
11025
11026 * dispnew.c (verify_row_hash): Call row_hash for computing the
11027 hash code of a row, instead of duplicating code from xdisp.c.
11028
11029 * dispextern.h (row_hash): Add prototype.
11030
a2addb04
TH
110312011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11032
11033 * frame.c (delete_frame): Don't delete the terminal when the last
11034 X frame is closed if emacs is built with GTK toolkit.
11035
df85d315
JB
110362011-11-17 Juanma Barranquero <lekktu@gmail.com>
11037
11038 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11039
a0c2d0ae
MR
110402011-11-17 Martin Rudalics <rudalics@gmx.at>
11041
11042 * window.c (Vwindow_splits): Rename to
11043 Vwindow_combination_resize. Suggested by Juri Linkov.
11044 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11045 of Vwindow_splits.
11046
58179cce
JB
110472011-11-16 Juanma Barranquero <lekktu@gmail.com>
11048
7877f373
JB
11049 * nsfns.m (Fns_font_name):
11050 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 11051
b6f67890
MR
110522011-11-16 Martin Rudalics <rudalics@gmx.at>
11053
11054 * window.h (window): Rename slot "nest" to "combination_limit".
11055 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11056 (Fset_window_nest): Rename to Fset_window_combination_limit.
11057 (Vwindow_nest): Rename to Vwindow_combination_limit.
11058 (recombine_windows, make_parent_window, make_window)
11059 (Fsplit_window_internal, saved_window)
11060 (Fset_window_configuration, save_window_save): Rename all
11061 occurrences of window_nest to window_combination_limit.
11062
c7015153
JB
110632011-11-15 Juanma Barranquero <lekktu@gmail.com>
11064
11065 * image.c (imagemagick_load_image): Fix typo.
11066
322ad6ec
EZ
110672011-11-14 Eli Zaretskii <eliz@gnu.org>
11068
11069 * xdisp.c (display_line): Move the call to
11070 highlight_trailing_whitespace before the call to
11071 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
11072 faces of all the glyphs to compute ROW's hash value.
11073 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 11074
f067b8ec
JB
110752011-11-14 Juanma Barranquero <lekktu@gmail.com>
11076
11077 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11078 just return (bug#10044).
11079
1e5b2111
EZ
110802011-11-12 Eli Zaretskii <eliz@gnu.org>
11081
7ef3cbd5
EZ
11082 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11083 with user-defined heap size. Bump the default size of the temacs
11084 heap to 27MB, to avoid memory warning when running temacs.
11085 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11086
1e5b2111
EZ
11087 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11088 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
11089 (verify_row_hash) [XASSERTS]: New function.
11090 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11091 that the hash value of glyph rows is correct.
1e5b2111 11092
89d61221
MR
110932011-11-12 Martin Rudalics <rudalics@gmx.at>
11094
11095 * window.h (window): Remove splits slot.
11096 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11097 (Fdelete_other_windows_internal, make_parent_window)
11098 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11099 (Fset_window_configuration, save_window_save): Don't deal with
11100 split status of windows.
11101 (saved_window): Remove splits slot.
11102 (Vwindow_splits): Rewrite doc-string.
11103
97f18cc8
JD
111042011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11105
11106 * xfns.c (unwind_create_frame):
11107 * nsfns.m (unwind_create_frame):
11108 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11109 Vframe_list (Bug#9999).
11110
22a648b4
DA
111112011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11112
0b381c7e 11113 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 11114
659afede
KH
111152011-11-11 Kenichi Handa <handa@m17n.org>
11116
11117 * callproc.c (Fcall_process): Set the member dst_multibyte of
11118 process_coding.
11119
9ac0394b
KH
111202011-11-11 Johan Bockgård <bojohan@gnu.org>
11121
11122 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11123 avoid a crash (bug#9496).
11124
2fbdc249
CY
111252011-11-09 Chong Yidong <cyd@gnu.org>
11126
11127 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11128 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11129
ac6b1f81
PE
111302011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11131
11132 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11133
09db192c
PE
111342011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11135
11136 Avoid some portability problems by eschewing 'extern inline' functions.
11137 The trivial performance wins aren't worth the portability hassles; see
11138 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11139 et seq.
11140 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11141 (window_box_width, window_box_left, window_box_left_offset)
11142 (window_box_right, window_box_right_offset): Undo previous change,
11143 by removing the "extern"s.
11144 * intervals.c (adjust_intervals_for_insertion)
11145 (adjust_intervals_for_deletion): Undo previous change,
11146 making these static again.
11147 (offset_intervals, temp_set_point_both, temp_set_point)
11148 (copy_intervals_to_string): No longer inline.
11149 * xdisp.c (window_text_bottom_y, window_box_width)
11150 (window_box_height, window_box_left_offset)
11151 (window_box_right_offset, window_box_left, window_box_right)
11152 (window_box): No longer inline.
11153
105216ed
CY
111542011-11-08 Chong Yidong <cyd@gnu.org>
11155
11156 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
11157 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11158 Signal an error if not a live window.
105216ed
CY
11159 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11160 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11161
ae9e237f
JB
111622011-11-07 Juanma Barranquero <lekktu@gmail.com>
11163
11164 * lisp.h (syms_of_abbrev): Remove declaration.
11165 Reported by CHENG Gao <chenggao@royau.me>.
11166
c7aa8333
EZ
111672011-11-07 Eli Zaretskii <eliz@gnu.org>
11168
11169 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11170 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11171 of temacs in GUI mode.
11172
be7f5545
MR
111732011-11-07 Martin Rudalics <rudalics@gmx.at>
11174
11175 * window.h: Declare delete_all_child_windows instead of
11176 delete_all_subwindows.
11177 * window.c (Fwindow_nest, Fset_window_nest)
11178 (Fset_window_new_total, Fset_window_new_normal)
11179 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11180 (delete_all_subwindows): Rename to delete_all_child_windows.
11181 (Fdelete_other_windows_internal, Fset_window_configuration):
11182 Call delete_all_child_windows instead of delete_all_subwindows.
11183 * frame.c (delete_frame): Call delete_all_child_windows instead
11184 of delete_all_subwindows.
11185
ca78dc43
PE
111862011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11187
11188 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11189 This is also needed for porting to any host where GC_MARK_STACK is
11190 not GC_MAKE_GCPROS_NOOPS.
11191 (which_symbols): Use it.
11192
a0241d01
KH
111932011-11-07 Kenichi Handa <handa@m17n.org>
11194
11195 * coding.c (coding_set_destination): Check coding->src_pos only
11196 when coding->src_object is a buffer (bug#9910).
11197
11198 * process.c (send_process): Set the member src_multibyte of coding
11199 to 0 (bug#9911) when sending a unibyte text.
11200
11201 * callproc.c (Fcall_process): Set the member src_multibyte of
11202 process_coding to 0 (bug#9912).
11203
a64bfdfa 112042011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
11205
11206 * xmenu.c (cleanup_widget_value_tree): New function.
11207 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11208 calling free_menubar_widget_value_tree directly (Bug#9830).
11209
cb41b32a
PE
112102011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11211
11212 Fix some portability problems with 'inline'.
11213 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11214 (window_box_width, window_box_left, window_box_left_offset)
11215 (window_box_right, window_box_right_offset): Declare extern.
11216 Otherwise, these inline functions do not conform to C99 and
11217 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11218 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11219 * intervals.c (adjust_intervals_for_insertion)
11220 (adjust_intervals_for_deletion): Now extern, because otherwise the
11221 extern inline functions 'offset_intervals' couldn't refer to it.
11222 (static_offset_intervals): Remove.
11223 (offset_intervals): Rewrite using the old contents of
11224 static_offset_intervals. The old version didn't conform to C99
11225 because an extern inline function contained a reference to an
11226 identifier with static linkage.
11227
b7041366
AS
112282011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11229
11230 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11231 GC.
11232
88a37c4d
EZ
112332011-11-06 Eli Zaretskii <eliz@gnu.org>
11234
11235 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11236 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11237 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11238 return Qleft_to_right.
11239
49745b39
CY
112402011-11-06 Chong Yidong <cyd@gnu.org>
11241
11242 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11243 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11244 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11245 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11246 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11247 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11248 (Fwindow_vscroll): Doc fix.
11249 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11250 argument, since it makes no sense to pass a live window and for
11251 consistency with window-child.
11252
1f05cd82
CS
112532011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11254
11255 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11256 support MSVC.
11257
22610910
JR
112582011-11-05 Jason Rumney <jasonr@gnu.org>
11259
11260 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11261 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11262 fonts (Bug#6029).
11263 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11264 bitwise arithmetic preventing use of unicode-sip and non-truetype
11265 opentype fonts.
11266
a06776b2
EZ
112672011-11-05 Eli Zaretskii <eliz@gnu.org>
11268
3ad924ba
EZ
11269 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11270 "emacs"-only part.
11271
a06776b2
EZ
11272 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11273 initialization code to keep similarity to xfns.c after changes
11274 from 2011-11-05.
11275
c9e7db78
JD
112762011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11277
a97f8f3f
JD
11278 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11279 (unwind_create_frame): New function (Bug#9943).
11280 (Fx_create_frame): Restructure code to be more similar to the one in
11281 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11282 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11283 Move terminal->reference_count++ just before making the frame official
11284 (Bug#9943).
11285
11286 * nsterm.m (x_free_frame_resources): New function.
11287 (x_destroy_window): Move code to x_free_frame_resources.
11288
c9e7db78 11289 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
11290 (Fx_create_frame, x_create_tip_frame):
11291 Move terminal->reference_count++ just before making the frame
75f1671a 11292 official. Move initialization of image_cache_refcount and
c9e7db78
JD
11293 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11294
a6fc3b5c
EZ
112952011-11-05 Eli Zaretskii <eliz@gnu.org>
11296
11297 Support MSVC build with newer versions of Visual Studio.
11298 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11299 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11300 nt/gmake.defs.
11301
11302 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11303 which are not supported by MSVC.
11304 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11305 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11306 bitfields.
11307 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11308 types in bitfields.
11309 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11310
11311 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11312
58179cce 113132011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
11314
11315 Support MSVC build with newer versions of Visual Studio.
11316 * w32.c: Don't include w32api.h for MSVC.
11317 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11318
11319 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11320 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11321 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11322 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11323 e_* cousins.
11324 (alloca) [_MSC_VER]: Define to _alloca.
11325
11326 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11327
11328 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11329
a58c13ed
EZ
113302011-11-04 Eli Zaretskii <eliz@gnu.org>
11331
11332 * xdisp.c (note_mouse_highlight): If either of
11333 previous/next-single-property-change returns nil, treat that as
11334 the beginning or the end of the buffer. (Bug#9955)
11335
fe0b6370
JD
113362011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11337
a58c13ed 11338 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
11339 label is not null (Bug#9951).
11340 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11341 may be NULL.
11342
89bd5ee1
EZ
113432011-11-04 Eli Zaretskii <eliz@gnu.org>
11344
11345 * window.c (Fwindow_body_size): Mention in the doc string that the
11346 return value is in frame's canonical units. (Bug#9949)
11347
84c3edb9
EZ
113482011-11-03 Eli Zaretskii <eliz@gnu.org>
11349
4e2fb5c7
EZ
11350 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11351
84c3edb9 11352 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 11353 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 11354 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 11355
bc17a887
EZ
113562011-11-01 Eli Zaretskii <eliz@gnu.org>
11357
11358 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11359 Don't stop backward scan on the continuation glyph, even though
11360 its CHARPOS is positive.
6d5eb5b0
SM
11361 (mouse_face_from_buffer_pos, note_mouse_highlight):
11362 Rename cover_string to disp_string.
bc17a887 11363
4ee88440
MR
113642011-11-01 Martin Rudalics <rudalics@gmx.at>
11365
11366 * window.c (temp_output_buffer_show): Don't use
11367 Vtemp_buffer_show_specifiers.
11368 (Vtemp_buffer_show_specifiers): Remove unused variable.
11369
c2ff3c02
EZ
113702011-10-30 Eli Zaretskii <eliz@gnu.org>
11371
11372 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11373 past the beginning of the current glyph matrix.
11374
58179cce 113752011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
11376
11377 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11378 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11379 HAVE_GTK3 (Bug#9869).
b77a6a7f 11380
3b574623
JD
11381 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11382 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11383
b77a6a7f
JD
11384 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11385
11386 * xterm.c: Declare x_handle_net_wm_state to return int.
11387 (handle_one_xevent): Check if we are iconified but don't have
11388 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11389 (get_current_wm_state): Return non-zero if not hidden,
11390 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11391 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11392 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11393 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11394
196e41e4
PE
113952011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11396
11397 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11398 so that this new function doesn't get optimized away by a
11399 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11400
021f2e1a
AS
114012011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11402
11403 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11404
8b058d44
EZ
114052011-10-29 Eli Zaretskii <eliz@gnu.org>
11406
11407 Fix the `xbytecode' command.
11408 * .gdbinit (xprintbytestr): New command.
b50a28de 11409 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
11410 (xbytecode): Print the byte-code string as well.
11411
4452fb80
EZ
114122011-10-29 Kim Storm <storm@cua.dk>
11413
8b058d44
EZ
11414 * alloc.c (which_symbols): New function.
11415
21b72067
AS
114162011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11417
11418 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11419 line. (Bug#9903)
11420
83ed7b5c
GM
114212011-10-29 Glenn Morris <rgm@gnu.org>
11422
11423 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11424 Not clear what it was for, and it causes various bugs. (Bug#9839)
11425
5a7a728b
EZ
114262011-10-28 Eli Zaretskii <eliz@gnu.org>
11427
11428 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11429 possible random value that matches one of those tested as
11430 condition to clear the mouse face.
11431
d3d0842f
CY
114322011-10-28 Chong Yidong <cyd@gnu.org>
11433
11434 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11435
31b39d13
DN
114362011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11437
11438 * window.c (make_window): Initialize phys_cursor_on_p.
11439
9aba6043
SM
114402011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11441
11442 * lisp.h (struct Lisp_Symbol): Update comments.
11443
c20992f4
JB
114442011-10-28 Juanma Barranquero <lekktu@gmail.com>
11445
11446 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11447
db4f02f2
EZ
114482011-10-28 Eli Zaretskii <eliz@gnu.org>
11449
11450 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11451 <oslsachem@gmail.com> for helping to debug this.
11452
11453 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11454 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11455 (g_b_init_get_glyph_outline_w): New static variables.
11456 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11457 (GetGlyphOutlineW_Proc): New typedefs.
11458 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
11459 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11460 New functions.
11461 (w32font_open_internal, compute_metrics):
11462 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
11463 instead of calling the "wide" APIs directly.
11464
11465 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11466
11467 * w32.h (syms_of_w32font): Add prototype.
11468
87e68db4
JB
114692011-10-27 Juanma Barranquero <lekktu@gmail.com>
11470
11471 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11472 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11473 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11474 (Fmove_to_window_line): Doc fix.
11475
435c1d67
CY
114762011-10-27 Chong Yidong <cyd@gnu.org>
11477
11478 * process.c (make_process): Set gnutls_state to NULL.
11479
11480 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11481 non-NULL, regardless of GNUTLS_INITSTAGE.
11482 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11483 an error. Set process slots as soon as we allocate them.
11484
11485 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11486
9c6c6f49
CY
114872011-10-27 Chong Yidong <cyd@gnu.org>
11488
9aba6043
SM
11489 * gnutls.c (emacs_gnutls_deinit): New function.
11490 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
11491 (Fgnutls_deinit, Fgnutls_boot): Use it.
11492
11493 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11494 (deactivate_process): Call emacs_gnutls_deinit.
11495
657d08d3
JB
114962011-10-27 Juanma Barranquero <lekktu@gmail.com>
11497
11498 * image.c (x_create_x_image_and_pixmap):
11499 * w32.c (sys_rename, w32_delayed_load):
11500 * w32font.c (fill_in_logfont):
11501 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11502
5430d399
JB
115032011-10-26 Juanma Barranquero <lekktu@gmail.com>
11504
11505 * w32fns.c (w32_default_color_map): New function,
11506 extracted from Fw32_default_color_map.
a7ef684b 11507 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 11508
fe0055fa
PE
115092011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11510
11511 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11512
e6346438
SM
115132011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11514
11515 * keyboard.c (test_undefined): New function (bug#9751).
11516 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11517
e112cc37
ET
115182011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11519
11520 * sysdep.c (init_sys_modes): Fix the check for the controlling
11521 terminal (Bug#6649).
11522
7b5d6677
EZ
115232011-10-20 Eli Zaretskii <eliz@gnu.org>
11524
11525 * dispextern.h (struct bidi_it): New member next_en_type.
11526
11527 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11528 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11529 current character, check also for next_en_type being WEAK_EN.
11530 (bidi_resolve_weak): Don't enter the expensive loop if the current
11531 position is before next_en_pos. Record the bidi type of the first
11532 non-ET, non-BN character we find, in addition to its position.
11533 (bidi_level_of_next_char): Invalidate next_en_type when
11534 next_en_pos is over-stepped.
11535
7da0b018
PE
115362011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11537
11538 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11539 * editfns.c: Rewrite current-time-zone so that it invokes
11540 the equivalent of (format-time-string "%Z") to get the time zone name.
11541 This fixes a bug when the time zone name contains characters that
11542 need converting from the system time locale to Emacs internal format.
11543 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11544 that patch fixed format-time-string to do the conversion, but
11545 I forgot to fix current-time-zone.
11546 (format_time_string): New function, containing most of
11547 what Fformat_time_string used to contain.
11548 (Fformat_time_string): Rewrite in terms of format_time_string.
11549 This doesn't change this function's behavior.
11550 (current-time-zone): Rewrite to use format_time_string.
11551 This fixes the bug reported by Michael Schierl in
11552 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11553 Jason Rumney's 2007-06-07 change worked around this bug, but
11554 didn't fix it.
11555 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11556
8547b010
EZ
115572011-10-19 Eli Zaretskii <eliz@gnu.org>
11558
11559 * xdisp.c (start_display): If the character at POS is displayed
11560 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
11561 (try_window_reusing_current_matrix): If a line ends in a display
11562 vector or the next line starts in a display vector, continue
11563 redrawing the window even though the character position of
11564 start_row was reached.
8547b010
EZ
11565 (Bug#9771, part 2)
11566
4e948d15
CY
115672011-10-18 Chong Yidong <cyd@gnu.org>
11568
11569 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11570 with nobreak-char-display too.
11571
4787455f
EZ
115722011-10-18 Eli Zaretskii <eliz@gnu.org>
11573
11574 Fix part 3 of bug#9771.
11575 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11576 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11577 non-neutral characters if the current character is a paragraph
11578 separator (a.k.a. Newline). This avoids running the same
11579 expensive loop twice, once when we consume the preceding newline
11580 and the other time when the line actually needs to be displayed.
11581 Avoid the loop when we see neutrals on the base embedding level
11582 following a character whose directionality is the same as the
11583 paragraph's. This avoids running the expensive loop when a line
11584 ends in a long sequence of neutrals, like control characters.
11585 Add assertion against STRONG_AL type. Slightly rearrange code
11586 that determines the type of a neutral given the first non-neutral
11587 that follows it.
11588 (bidi_level_of_next_char): Set next_en_pos to zero when
11589 invalidating its info.
11590
2c91f553
EZ
115912011-10-17 Eli Zaretskii <eliz@gnu.org>
11592
11593 * xdisp.c (push_display_prop): Determine whether to record string
11594 or buffer position by IT->string, not by IT->method. Allow
11595 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
11596 (move_it_vertically_backward): Don't look for character position
11597 immediately after the newline when in a continuation line.
11598 (Bug#9771, part 1)
2c91f553 11599
c7b08b0d
MR
116002011-10-15 Martin Rudalics <rudalics@gmx.at>
11601
11602 * window.c (coordinates_in_window): Rewrite and delabelize
11603 vertical border check. (Bug#5357) (Bug#9618)
11604
6b02f655
SM
116052011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11606
11607 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11608 errors in XSetWindowBorder (bug#9310).
11609
81d40c92
DA
116102011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11611
11612 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11613 avoid crash when xmalloc overrun checking is enabled.
11614
d4172c3b
EZ
116152011-10-13 Eli Zaretskii <eliz@gnu.org>
11616
11617 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11618 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11619 cursor motion with <left> and <right> arrow keys.
11620
11621 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11622 some callers set that themselves.
11623
b00eea75
EZ
116242011-10-12 Eli Zaretskii <eliz@gnu.org>
11625
11626 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11627 display string and the previous row comes from the same string and
11628 is empty. (Bug#9739) (Bug#9738)
11629
8fe012c4
SM
116302011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11631
11632 * doc.c (get_doc_string): Encode file name (bug#9735).
11633
0074aef2
EZ
116342011-10-12 Eli Zaretskii <eliz@gnu.org>
11635
79beb178
EZ
11636 * bidi.c (bidi_level_of_next_char):
11637 * xdisp.c (get_visually_first_element): Remove old incorrect
11638 comments regarding the Unicode Line Separator character.
11639
0074aef2
EZ
11640 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11641
6e4b3fbe
DA
116422011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11643
11644 * alloc.c (Fgc_status): Do not access beyond zombies array
11645 boundary if nzombies > MAX_ZOMBIES.
11646 * alloc.c (dump_zombies): Add missing format specifier.
11647
0324f3af
PE
116482011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11649
b5525cac
PE
11650 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11651 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11652
0324f3af
PE
11653 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11654 Some packages use them to denote characters with modifiers.
11655
e9b5f888
AS
116562011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11657
11658 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11659 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11660 matching a pp-number. Rename parameter var to var1.
11661
127827c0
SM
116622011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11663
11664 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11665
c8fd3bd0
GM
116662011-10-08 Glenn Morris <rgm@gnu.org>
11667
11668 * callint.c (Fcall_interactively): Give a more explicit error for the
11669 'c' case with a non-character input. (Bug#8479)
11670
352ec8ff
EZ
116712011-10-08 Eli Zaretskii <eliz@gnu.org>
11672
03669ccb
EZ
11673 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11674 lines.
7061c986
EZ
11675 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11676 lines that are hscrolled on the left.
03669ccb 11677
352ec8ff
EZ
11678 * dispnew.c (buffer_posn_from_coords): Account for a possible
11679 presence of header-line. (Bug#4426)
11680
a66cfb1c
SM
116812011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11682
6b02f655
SM
11683 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11684 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 11685
7c5ee88e
PE
116862011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11687
11688 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11689 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11690 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11691 this makes Emacs dump core during garbage collection on rare
11692 occasions. sizeof is obviously inferior to offsetof here, so
11693 stick with offsetof.
11694 (GC_POINTER_ALIGNMENT): New macro.
11695 (mark_memory): Omit 3rd (offset) arg; caller changed.
11696 Don't assume EMACS_INT alignment is the same as pointer alignment.
11697
df1bbe5b
SM
116982011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11699
11700 * keyboard.c (read_key_sequence_remapped): New var.
11701 (read_key_sequence): Compute remapping in the right buffer.
11702 (command_loop_1): Use read_key_sequence's remapping directly.
11703
51553db6
SM
117042011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11705
32c1fffd
SM
11706 * dired.c (file_name_completion): Don't expand file name.
11707 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11708 before checking file name handler.
11709
51553db6
SM
11710 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11711 they've been requested explicitly (bug#9591).
11712
b6bd1599 117132011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
11714
11715 * keymap.c (Fsingle_key_description): Use make_specified_string
11716 instead of build_string to build string from push_key_description.
11717 (Bug#5193)
11718
f701dc2a
PE
117192011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11720
4222c55d
PE
11721 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11722 This fixes a Y2038 bug on 64-bit hosts.
11723 * buffer.c (reset_buffer):
11724 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11725 (Fclear_buffer_auto_save_failure):
11726 Use 0, not -1, to represent an unset failure time, since time_t
11727 might not be signed.
11728
f701dc2a
PE
11729 Remove dependency on glibc malloc internals.
11730 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11731 Move back here from lisp.h, but with their new implementations.
11732 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11733 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11734 * charset.c (charset_table_init): New static var.
11735 (syms_of_charset): Use it instead of xmalloc. This removes a
11736 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11737 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11738 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11739 Move back to alloc.c.
11740 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11741 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11742
9ceebf39
JD
117432011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11744
11745 * nsterm.m (windowDidResize): Call x_set_window_size only when
11746 ns_in_resize is true. Otherwise set pixelwidth/height and
11747 call change_frame_size (Bug#9628).
11748
cb993c58
PE
117492011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11750
3930c88b
PE
11751 Port --enable-checking=all to Fedora 14 x86-64.
11752 * charset.c (syms_of_charset): Also account for glibc malloc's
11753 internal overhead when calculating the initial malloc maximum.
11754
cb993c58
PE
11755 Port --enable-checking=all to Fedora 14 x86.
11756 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11757 Move to lisp.h.
11758 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11759 (overrun_check_realloc, overrun_check_free):
11760 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11761 That way, xmalloc returns a properly-aligned pointer even if
11762 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11763 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11764 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11765 into account when calculating the initial malloc maximum.
11766 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11767 Move here from alloc.c, so that charset.c can use it too.
11768 Properly align; the old code wasn't right for common 32-bit hosts
11769 when configured with --enable-checking=all.
11770 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11771 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11772
31bed486
EZ
117732011-09-29 Eli Zaretskii <eliz@gnu.org>
11774
04c70788 11775 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
11776 use EDOM.
11777
fbcaa2f3
EZ
117782011-09-28 Eli Zaretskii <eliz@gnu.org>
11779
11780 * xdisp.c (compute_display_string_end): If there's no display
11781 string at CHARPOS, return -1.
11782
11783 * bidi.c (bidi_fetch_char): When compute_display_string_end
11784 returns a negative value, treat the character as a normal
11785 character not covered by a display string. (Bug#9624)
11786
a239d4e9
JB
117872011-09-28 Juanma Barranquero <lekktu@gmail.com>
11788
11789 * lread.c (Fread_from_string): Fix typo in docstring.
11790
88652fd5
EZ
117912011-09-27 Eli Zaretskii <eliz@gnu.org>
11792
11793 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11794 newline, reseat the iterator instead of bidi-iterating there one
11795 character at a time. (Bug#9610)
32c1fffd
SM
11796 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11797 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 11798
ed497dd4
AS
117992011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11800
11801 * lread.c (readevalloop): Use correct code for NBSP.
11802 (read1): Likewise. (Bug#9608)
11803
b2bf61aa
MA
118042011-09-25 Michael Albinus <michael.albinus@gmx.de>
11805
11806 * dbusbind.c (Fdbus_register_signal): When service is not
11807 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11808
32bbb17c
GM
118092011-09-25 Glenn Morris <rgm@gnu.org>
11810
11811 * buffer.c (truncate-lines): Doc fix.
11812
94e0933e
CY
118132011-09-24 Chong Yidong <cyd@stupidchicken.com>
11814
11815 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11816 (Fset_window_next_buffers): Doc fix.
11817
cddde921
GM
118182011-09-24 Glenn Morris <rgm@gnu.org>
11819
11820 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11821
1260aef1
PE
118222011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11823
25b4bfa0
PE
11824 Fix minor problems found by static checking.
11825 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
11826 * indent.c (Fvertical_motion): Fix == vs = typo.
11827
e3cbd34b
EZ
118282011-09-24 Eli Zaretskii <eliz@gnu.org>
11829
a66cfb1c
SM
11830 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11831 Default value is now t. Doc fix.
6bf7006f 11832
e3cbd34b 11833 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 11834 logic when moving up, not only when moving down. Fix the
e3cbd34b 11835 confusing name and values of the it_overshoot_expected variable;
32c1fffd 11836 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
11837
11838 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11839 CHARPOS is covered by a display string which includes newlines.
11840 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11841 is covered by a display string with embedded newlines.
11842
a3de0cbd
MA
118432011-09-24 Michael Albinus <michael.albinus@gmx.de>
11844
11845 * dbusbind.c (Fdbus_register_signal): Add match rule to
11846 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
11847 (Fdbus_register_method, Vdbus_registered_objects_table):
11848 Fix docstring.
a3de0cbd 11849
b260039d
JM
118502011-09-24 Jim Meyering <meyering@redhat.com>
11851
32c1fffd 11852 do not ignore write error for any output size
b260039d
JM
11853 The previous change was incomplete.
11854 While it makes emacs --batch detect the vast majority of stdout
11855 write failures, errors were still ignored whenever the output size is
11856 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11857 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11858 && echo FAIL: ignored write error
11859 FAIL: ignored write error
11860 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11861 && echo FAIL: ignored write error
11862 FAIL: ignored write error
11863 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11864
8eca8a7c
AS
118652011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11866
11867 * emacs.c (Fkill_emacs): In noninteractive mode exit
11868 non-successfully if a write error occurred on stdout. (Bug#9574)
11869
3341db62
EZ
118702011-09-21 Eli Zaretskii <eliz@gnu.org>
11871
11872 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11873 the xassert test.
11874
11875 * dispextern.h (struct it): Update the comment documenting what
11876 can it->OBJECT be.
11877
8c203dbf
EZ
118782011-09-20 Eli Zaretskii <eliz@gnu.org>
11879
11880 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11881 a display string, extend search for cursor position to end of row.
11882 (find_row_edges): If the row ends in a newline from a display
11883 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11884 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
11885 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11886 non-empty line. Fixes confusing cursor motion with arrow keys at
11887 the beginning of a line that starts with whitespace.
8c203dbf 11888
a4824228
LMI
118892011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11890
11891 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11892 (bug#9493).
11893
33ed493b
CY
118942011-09-18 Chong Yidong <cyd@stupidchicken.com>
11895
11896 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11897 boolean (Bug#9154).
11898
56cd55c8
EZ
118992011-09-18 Eli Zaretskii <eliz@gnu.org>
11900
11901 * xdisp.c (display_line): Record maximum and minimum buffer
11902 positions even if no glyphs were produced (e.g., by a zero-width
11903 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11904 buffer positions that will be removed from the glyph row because
11905 they don't fit.
c02dcedf
EZ
11906 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11907 column is beyond frame width: don't subtract 1 "pixel" when
11908 computing width of the stretch.
3e62b7e0
EZ
11909 (reseat_at_next_visible_line_start): Undo the change made on
11910 2011-09-17 that saved paragraph information and restored it after
11911 the call to `reseat'. (Bug#9545)
56cd55c8 11912
5ed99d36 119132011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
11914
11915 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11916 and turn window cursor on if cleared (Bug#9415).
11917
5ed99d36 119182011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
11919
11920 * search.c (boyer_moore): Take unibyte characters from pattern
11921 literally. (Bug#9458)
11922
9bade7b2
EZ
119232011-09-18 Eli Zaretskii <eliz@gnu.org>
11924
11925 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11926
e5e9d610
PE
119272011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11928
87e4427a
PE
11929 Fix minor problem found by static checking.
11930 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11931 initialized, to pacify gcc -Wuninitialized.
11932
e5e9d610
PE
11933 * fileio.c: Report proper errno when syscall falls.
11934 (Finsert_file_contents): Save and restore errno,
11935 so that report_file_error outputs the correct diagnostic.
11936 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11937
a1674f0b
EZ
119382011-09-18 Eli Zaretskii <eliz@gnu.org>
11939
11940 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11941
fbfb6dd4
EZ
119422011-09-17 Eli Zaretskii <eliz@gnu.org>
11943
11944 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11945 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11946
bb187662
EZ
119472011-09-17 Eli Zaretskii <eliz@gnu.org>
11948
1137e8b8 11949 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 11950 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
11951
11952 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11953 (bidi_find_paragraph_start): Search back for paragraph beginning
11954 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11955 (bidi_move_to_visually_next): Only trigger paragraph-related
11956 computations when the last character is a newline or at EOB, not
11957 just any NEUTRAL_B. (Bug#9470)
11958
bb187662
EZ
11959 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11960 truncated lines if point is covered by a display string. (Bug#9524)
11961
2e621251
PE
119622011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11963
11964 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11965 (cons_to_x_long): New function.
11966 (lisp_data_to_selection_data): Use it. Correct the test for
11967 short-versus-long data; it was negated. Break out of vector
11968 loop, for efficiency, when a long datum is discovered.
11969
91a15bc6
SM
119702011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11971
11972 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11973
b41c3a35
EZ
119742011-09-16 Eli Zaretskii <eliz@gnu.org>
11975
11976 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11977 GCC PR/17406) by declaring this function with external scope.
11978
7812ba2d
PE
119792011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11980
11981 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11982 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11983
cf7edc2a
AS
119842011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11985
11986 * editfns.c (Fformat): Correctly handle text properties on "%%".
11987
bd01620e
EZ
119882011-09-15 Eli Zaretskii <eliz@gnu.org>
11989
11990 * xterm.c (x_draw_composite_glyph_string_foreground):
11991 * w32term.c (x_draw_composite_glyph_string_foreground):
11992 * term.c (encode_terminal_code):
11993 * composite.c (composition_update_it, get_composition_id):
11994 * xdisp.c (get_next_display_element)
11995 (fill_composite_glyph_string): Add comments about special meaning
11996 of TAB characters in a composition.
11997
a02719a3
PE
119982011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11999
12000 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
12001 This occurs when processing a multibyte format.
12002 Problem reported by Wolfgang Jenker.
a02719a3 12003
72589a3c
JB
120042011-09-15 Johan Bockgård <bojohan@gnu.org>
12005
12006 * xdisp.c (try_cursor_movement): Only check for exact match if
12007 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12008
1c14176c
PE
120092011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12010
12011 Remove unused external symbols.
12012 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12013 * xdisp.c (calc_pixel_width_or_height): Now static.
12014 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12015 * indent.c (check_display_width):
12016 * w32term.c: Fix comment to match code.
12017 * xterm.c, xterm.h (x_catching_errors): Remove.
12018
d2eea5b5
PE
120192011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12020
12021 * xselect.c: Use signed conversions more consistently (Bug#9498).
12022 (selection_data_to_lisp_data): Assume incoming selection data are
12023 signed integers, not unsigned. This is to be consistent with
12024 outgoing selection data, which was modified to use signed integers
12025 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12026 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12027 expects long, not unsigned long.
12028
46888499
EZ
120292011-09-14 Eli Zaretskii <eliz@gnu.org>
12030
12031 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12032 computation of loop end. Reported by Johan Bockgård
12033 <bojohan@gnu.org>.
12034
ef8ef9fb
CY
120352011-09-13 Chong Yidong <cyd@stupidchicken.com>
12036
12037 * frame.c (Fother_visible_frames_p): Function deleted.
12038
fa819fed
EZ
120392011-09-12 Eli Zaretskii <eliz@gnu.org>
12040
12041 * indent.c (compute_motion): Process display vector front to back
12042 rather than the other way around. (Bug#2496)
12043
2ba8e008
SM
120442011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12045
12046 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12047
20f53c69
CY
120482011-09-11 Chong Yidong <cyd@stupidchicken.com>
12049
12050 * minibuf.c (Fread_from_minibuffer): Doc fix.
12051
d562d7a4
EZ
120522011-09-11 Eli Zaretskii <eliz@gnu.org>
12053
12054 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12055 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12056
1c4d7f3d
LMI
120572011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12058
12059 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12060 value for non-existent files.
12061
b885bf36
EZ
120622011-09-11 Eli Zaretskii <eliz@gnu.org>
12063
12064 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12065 set its "size" to -1. This will set the modtime_size field of
12066 the corresponding buffer to -1, which is what
12067 verify-visited-file-modtime expects for files that do not exist.
12068 (Bug#9139)
12069
6612f0bf
PE
120702011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12071
12072 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12073 here ...
12074 * lisp.h: ... from here. push_key_description is no longer
12075 defined in keyboard.c, so its declaration should not be in
12076 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12077 logically belongs with push_key_description.
12078
dfb3f755
PE
120792011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12080
12081 * buffer.h: Include <sys/types.h> instead of <time.h>.
12082 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12083 Problem reported by Herbert J. Skuhra.
12084
3134906c
LMI
120852011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12086
12087 * xml.c (parse_region): Make the parsing work for
12088 non-comment-starting XML files again (bug#9144).
12089
8d903f4e
AS
120902011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12091
12092 * image.c (gif_load): Fix calculation of bottom and right corner.
12093 (Bug#9468)
12094
80ad64f4
EZ
120952011-09-10 Eli Zaretskii <eliz@gnu.org>
12096
12097 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12098 redisplay in small windows.
12099
208a048d
EZ
121002011-09-09 Eli Zaretskii <eliz@gnu.org>
12101
12102 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12103
9b1c252e
MR
121042011-09-08 Martin Rudalics <rudalics@gmx.at>
12105
12106 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12107 Operate on live windows only.
12108
2949f33b
JB
121092011-09-08 Juanma Barranquero <lekktu@gmail.com>
12110
12111 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12112
e08dcafd
EZ
121132011-09-07 Eli Zaretskii <eliz@gnu.org>
12114
12115 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12116 only under bidi iteration.
12117
115b96bd
JD
121182011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12119
12120 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12121
c8199d0f
PE
121222011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12123
12124 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12125 Without this fix, the command to link temacs failed due to an
12126 undefined symbol __builtin_isnan. This is because
12127 /usr/include/iso/math_c99.h #defines isnan(x) to
12128 __builtin_isnan(x), but the bundled gcc, which identifies itself
12129 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12130 a __builtin_isnan.
12131 * floatfns.c (isnan): #undef, and then #define to a clone of
12132 what's in data.c.
12133 (Fisnan): Always define, since it's always available now.
12134 (syms_of_floatfns): Always define isnan at the Lisp level.
12135
e39b275c 121362011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
12137
12138 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12139
b2db44d9 121402011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 12141
f4af5137 12142 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
12143 The previous code assumed that file offsets (off_t values) fit in
12144 EMACS_INT variables, which is not true on typical 32-bit hosts.
12145 The code messed up by falsely reporting buffer overflow in cases
12146 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12147 when "big" contains more than 2**29 bytes, even though this
12148 inserts just one byte and does not overflow the buffer.
12149 (Finsert_file_contents): Store file offsets as off_t
12150 values, not as EMACS_INT values. Check for overflow when
12151 converting between EMACS_INT and off_t. When checking for
12152 buffer overflow or for overlap, take the offsets into account.
12153 Don't use EMACS_INT for small values where int suffices.
12154 When checking for overlap, fix a typo: ZV was used where
12155 ZV_BYTE was intended.
12156 (Fwrite_region): Don't assume off_t fits into 'long'.
12157 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12158
ecfc0a49
MA
121592011-09-05 Michael Albinus <michael.albinus@gmx.de>
12160
12161 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12162
6511acf2 121632011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 12164
0999621a 12165 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
12166
12167 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 12168 (esprintf, exprintf, evxprintf): New functions.
62f19c19 12169 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 12170 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
12171 (modify_event_symbol): Do not assume that the length of
12172 name_alist_or_stem is safe to alloca and fits in int.
12173 (Fexecute_extended_command): Likewise for function name and binding.
12174 (Frecursion_depth): Wrap around reliably on integer overflow.
12175 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12176 since some callers pass EMACS_INT values.
12177 (Fsingle_key_description): Don't crash if symbol name contains more
12178 than MAX_ALLOCA bytes.
12179 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12180 (get_minibuffer): Arg is now EMACS_INT, not int.
12181 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 12182 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
12183 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12184
2be7d702
PE
12185 * dbusbind.c (signature_cat): New function.
12186 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
12187 Do not overrun buffer; instead, report string overflow.
12188
9d1df220
PE
12189 * dispnew.c (add_window_display_history): Don't overrun buffer.
12190 Truncate instead; this is OK since it's just a log.
12191
33ef5c64
PE
12192 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12193 even if the time zone offset is outlandishly large.
12194 Don't mishandle offset == INT_MIN.
12195
66c6fdd5
PE
12196 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12197 when creating daemon; the previous buffer-overflow check was incorrect.
12198
d749b01b
PE
12199 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12200 which has the guts of the old verror function.
12201
b5cd1905
PE
12202 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12203 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12204
6e1a67fb
PE
12205 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12206 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 12207 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 12208 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
12209 length of string rather than counting it via multiple sprintfs;
12210 that's simpler and more reliable.
c21721cc
PE
12211 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12212 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12213 sprintf, in case result does not fit in int.
12214
c57b67fc
PE
12215 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12216 (fontset_from_font): Print it.
12217
8a401434
PE
12218 * frame.c (tty_frame_count): Now printmax_t, not int.
12219 (make_terminal_frame, set_term_frame_name): Print it.
12220 (x_report_frame_params): In X, window IDs are unsigned long,
12221 not signed long, so print them as unsigned.
12222 (validate_x_resource_name): Check for implausibly long names,
12223 and don't assume name length fits in 'int'.
12224 (x_get_resource_string): Don't blindly alloca invocation name;
12225 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12226 not fit in int.
12227
6e1a67fb
PE
12228 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12229 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
12230 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12231
0df02bf3
PE
12232 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12233 Use esprintf, not sprintf, in case result does not fit in int.
12234
48e30793
PE
12235 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12236 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12237 it as a large positive number.
12238 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12239 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12240
a66ff6d8
PE
12241 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12242 in case result does not fit in int.
12243
aca216ff
PE
12244 * print.c (float_to_string): Detect width overflow more reliably.
12245 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12246 buffer overrun. Don't assume list length fits in 'int'. Treat
12247 print length of 0 as 0, not as infinity; to be consistent with other
12248 uses of print length in this function. Don't overflow print length
12249 index. Don't assume hash table size fits in 'long', or that
12250 vectorlike size fits in 'unsigned long'.
12251
31c286f7
PE
12252 * process.c (make_process): Use printmax_t, not int, to format
12253 process-name gensyms.
12254
55e5faa1
PE
12255 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12256
80f2e268
PE
12257 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12258 to avoid potential buffer overrun.
12259
670741ab
PE
12260 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12261 if X resource line is longer than 512 bytes.
12262
b7163a50
PE
12263 * xfns.c (x_window): Make sprintf buffer a bit bigger
12264 to avoid potential buffer overrun.
12265
ae58ff1f
PE
12266 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12267
c43c8a6a
PE
12268 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12269
3f8236f4
PE
122702011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12271
53e9fe90 12272 Integer overflow fixes for scrolling, etc.
6511acf2
PE
12273 Without these, Emacs silently mishandles large integers sometimes.
12274 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
12275 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12276
6511acf2
PE
12277 * xdisp.c (try_window_id): Check Emacs fixnum range before
12278 converting to 'int'.
806add1d 12279
6511acf2 12280 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
12281 Check that an Emacs fixnum is in range before assigning it to 'int'.
12282 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12283 values converted from Emacs fixnums.
12284 (Frecenter): Don't wrap around a line count if it is out of 'int'
12285 range; instead, treat it as an extreme value.
12286 (Fset_window_configuration, compare_window_configurations):
12287 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12288
6511acf2
PE
12289 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12290 that can exceed INT_MAX. Check that EMACS_INT value is in range
12291 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
12292 (match_limit): Don't assume that a fixnum can fit in 'int'.
12293
6511acf2 12294 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
12295 exceed INT_MAX.
12296
6511acf2 12297 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
12298 (Fvertical_motion): Don't wrap around LINES values that don't fit
12299 in 'int'. Instead, treat them as extreme values. This is good
12300 enough for windows, which can't have more than INT_MAX lines anyway.
12301
fcb901a7
LMI
123022011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12303
0f2f6b6d
LMI
12304 * Require libxml/parser.h to avoid compilation warning.
12305
fcb901a7
LMI
12306 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12307
12308 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12309 since this reportedly can destroy thread storage.
12310
6e20a0d4
CY
123112011-08-30 Chong Yidong <cyd@stupidchicken.com>
12312
12313 * syntax.c (find_defun_start): Update all cache variables if
12314 exiting early (Bug#9401).
12315
148ae00e
EZ
123162011-08-30 Eli Zaretskii <eliz@gnu.org>
12317
f6cfbd8f
EZ
12318 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12319
148ae00e
EZ
12320 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12321 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12322 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12323
12324 * term.c (tty_append_glyph): New function.
12325 (produce_stretch_glyph): Static function and its prototype deleted.
12326
a66cfb1c
SM
12327 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12328 Add prototypes.
148ae00e 12329
c4a07a4c
PE
123302011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12331
12332 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12333 when checking :margin (Bug#9390).
12334 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 12335 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
12336 so that the name doesn't mislead. All uses changed.
12337
6bc8cd65
JB
123382011-08-28 Johan Bockgård <bojohan@gnu.org>
12339
12340 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12341 set_tty_hooks.
12342
dca4927e
EZ
123432011-08-27 Eli Zaretskii <eliz@gnu.org>
12344
12345 * xdisp.c (move_it_to): Don't bail out early when reaching
12346 position beyond to_charpos, if we are scanning backwards.
12347 (move_it_vertically_backward): When DY == 0, make sure we get to
12348 the first character in the line after the newline.
12349
f2cad773
PE
123502011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12351
12352 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12353 (ccl_driver): Do not generate an out-of-range pointer.
12354 (Fccl_execute_on_string): Remove unnecessary check for
12355 integer overflow, noted by Stefan Monnier in
12356 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12357 Remove a FIXME that didn't need fixing.
12358 Simplify the newly-introduced buffer reallocation code.
12359
0cae2cdb
JB
123602011-08-27 Juanma Barranquero <lekktu@gmail.com>
12361
12362 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12363
5fc295a4 123642011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 12365
70c60eb2 12366 Integer and memory overflow issues (Bug#9196).
726e0ab1 12367
d31850da
PE
12368 * doc.c (get_doc_string): Rework so that
12369 get_doc_string_buffer_size is the actual buffer size, rather than
12370 being 1 less than the actual buffer size; this makes xpalloc more
12371 convenient.
12372
a69fbedb
PE
12373 * image.c (x_allocate_bitmap_record, cache_image):
12374 * xselect.c (Fx_register_dnd_atom):
12375 Simplify previous changes by using xpalloc.
12376
fe5c5d37
PE
12377 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12378 since either will do and ptrdiff_t is convenient with xpalloc.
12379
0065d054
PE
12380 * charset.c (charset_table_size)
12381 (struct charset_sort_data.priority): Now ptrdiff_t.
12382 (charset_compare): Don't overflow if priorities differ greatly.
12383 (Fsort_charsets): Don't assume list length fits in int.
12384 Check for size-calculation overflow when allocating sort data.
12385 (syms_of_charset): Allocate an initial charset table that is
12386 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12387
12388 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12389
12390 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12391 The actual value is always <= INT_MAX, and leaving it unsigned made
12392 overflow checking harder.
12393
12394 * dispextern.h (struct glyph_matrix.rows_allocated)
12395 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12396 with xpalloc. The values are still always <= INT_MAX.
12397
12398 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12399
12400 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12401 (SAFE_NALLOCA): New macro.
12402
12403 * region-cache.c (struct boundary.pos, find_cache_boundary)
12404 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12405 (set_cache_region, invalidate_region_cache)
12406 (revalidate_region_cache, know_region_cache, region_cache_forward)
12407 (region_cache_backward, pp_cache):
12408 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12409 so that ptrdiff_t * can be passed to xpalloc.
12410 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12411 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12412 (pp_cache): Don't assume cache_len fits in int.
12413 * region-cache.h: Adjust extern decls to match.
12414
12415 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12416 EMACS_INT, since either will do, for xpalloc.
12417
12418 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12419 (xnmalloc, xnrealloc, xpalloc): New functions.
12420
726e0ab1
PE
12421 * bidi.c (bidi_shelve_header_size): New constant.
12422 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12423 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12424
51f30bc5 12425 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
12426 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12427 (overlay_strings):
12428 Don't update size of array until after memory allocation succeeds,
12429 because xmalloc/xrealloc may not return.
0065d054
PE
12430 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12431 now that we have proper integer overflow checking.
12432 (record_overlay_string, overlay_strings): Catch overflows when
12433 calculating size of overlay_str_buf.
726e0ab1 12434
0065d054
PE
12435 * callproc.c (Fcall_process): Check for size overflow when
12436 calculating size of args2.
12437 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12438 Normally we prefer signed values, but sticking with ptrdiff_t would
12439 require adding more-complicated checks.
726e0ab1
PE
12440
12441 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12442 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12443 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 12444 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
12445
12446 * character.c (Fstring): Check for size-calculation overflow.
12447
12448 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12449 unnecessary integer overflow. Check for size overflow.
12450 (encode_coding_object): Don't update size until xmalloc succeeds.
12451
12452 * composite.c (get_composition_id): Check for overflow in glyph
12453 length calculations.
12454
12455 Integer and memory overflow fixes for display code.
12456 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12457 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12458 (scrolling_window): Check for overflow in size calculations.
12459 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12460 Don't assume glyph table len fits in int.
12461 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12462 (row_table_size): Now ptrdiff_t, not int.
12463 (scrolling_window): Avoid overflow in size calculations.
12464 Don't update size until allocation succeeds.
12465 * fns.c (concat): Check for overflow in size calculations.
12466 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12467 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12468 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12469
12470 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12471 (get_doc_string): Check for size calculation overflow.
12472 Don't update size until allocation succeeds.
12473 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12474 EMACS_INT, where ptrdiff_t will do.
12475 (Fsubstitute_command_keys): Check for string overflow.
12476
12477 * editfns.c (set_time_zone_rule): Don't assume environment length
12478 fits in int.
12479 (message_length): Now ptrdiff_t, not int.
12480 (Fmessage_box): Don't update size until allocation succeeds.
12481 Don't assume message length fits in int.
12482 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12483
0065d054
PE
12484 * emacs.c (main): Do not reallocate argv, since there is a null at
12485 the end that can be overwritten, and this way there's no need to
12486 worry about size-calculation overflow.
12487 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
12488
12489 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12490 alloc succeeds.
12491 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12492
12493 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12494 (x_set_scroll_bar_width, x_figure_window_size):
12495 Check for integer overflow.
12496 (x_set_alpha): Do not assume XINT fits in int.
12497
12498 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12499 This is for the members text_lines, text_cols, total_lines, total_cols,
12500 where the system imposes an 'int' limit.
12501
12502 * fringe.c (Fdefine_fringe_bitmap):
12503 Don't update size until alloc works.
12504
12505 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12506 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12507
12508 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12509 Check for size-calculation overflow.
12510 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12511 do, as we prefer signed integers.
12512 (id_to_widget.max_size, id_to_widget.used)
12513 (xg_store_widget_in_map, xg_remove_widget_from_map)
12514 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12515 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12516 Use and return ptrdiff_t, not int.
12517 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12518 * gtkutil.h: Change prototypes to match the above.
12519
12520 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12521 are duplicate now that they've been promoted to lisp.h.
12522 (x_allocate_bitmap_record, x_alloc_image_color)
12523 (make_image_cache, cache_image, xpm_load):
12524 Don't update size until alloc is done.
12525 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12526 (x_detect_edges):
3256efce 12527 Check for size calculation overflow.
726e0ab1
PE
12528 (ct_colors_allocated_max): New constant.
12529 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12530 overflow.
3256efce 12531
726e0ab1
PE
12532 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12533 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12534 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12535 Use ptrdiff_t, not int, to count maps.
12536 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
12537 calculations. Don't update size until allocation succeeds.
12538 Redo calculations to avoid overflow.
726e0ab1
PE
12539 * keyboard.h: Change prototypes to match the above.
12540
12541 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12542 to count maps.
12543 (current_minor_maps): Check for size calculation overflow.
12544 * keymap.h: Change prototypes to match the above.
12545
12546 * lread.c (read1, init_obarray): Don't update size until alloc done.
12547
12548 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12549 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12550
726e0ab1
PE
12551 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12552 Now ptrdiff_t, not int.
12553 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12554 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12555
12556 * process.c (Fnetwork_interface_list): Check for overflow
12557 in size calculation.
12558
12559 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12560
12561 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12562 overflow. Don't bother calling xmalloc when xrealloc will do.
12563
12564 * search.c (Freplace_match): Check for size calculation overflow.
12565 (Fset_match_data): Don't assume list lengths fit in 'int'.
12566
12567 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12568 for command line length. Do not attempt to address one before the
12569 beginning of an array, as that's not portable.
12570
12571 * term.c (max_frame_lines): Remove; unused.
12572 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12573 not int.
12574 (encode_terminal_code, calculate_costs): Check for size
12575 calculation overflow.
12576 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12577 table lengths and related sizes. Don't update size until alloc
12578 done. Redo calculations to avoid overflow.
12579 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12580
12581 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12582 subtracting pointers.
12583 (gobble_line): Check for overflow more carefully. Don't update size
12584 until alloc done.
12585
12586 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12587 Don't update size until alloc done.
12588 Redo size calculations to avoid overflow.
12589 Check for size calculation overflow.
0065d054 12590 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
12591
12592 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12593 Use ptrdiff_t, not int, for sizes.
12594 (store_mode_line_noprop_char): Don't update size until alloc done.
12595
0065d054
PE
12596 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12597 Use ptrdiff_t, not int, for sizes.
12598 (Finternal_make_lisp_face, cache_face):
12599 Check for size calculation overflow.
12600 (cache_face): Treat size calculation overflows as if they were
12601 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
12602
12603 * xfns.c (x_encode_text, x_set_name_internal)
12604 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12605 sizes, since they can exceed INT_MAX in size. Check for size
12606 calculation overflow.
12607
0065d054
PE
12608 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12609 (xg_select): Check for size calculation overflow.
726e0ab1
PE
12610 Don't update size until alloc done.
12611
0065d054 12612 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 12613 as sprintf is limited to int lengths.
1d526e2f 12614
252c5ee1
PE
12615 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12616 (X_LONG_MIN): New macros.
864d7ce7
PE
12617 Use them to make the following changes clearer.
12618 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12619 This change doesn't affect the value now, but it may help remind
12620 future maintainers not to raise the value too much later.
12621 (SELECTION_QUANTUM): Remove, replacing with ...
12622 (selection_quantum): ... new function, which avoids overflow.
12623 All uses changed.
12624 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12625 assumption that selection length fits in 'int'.
12626 (x_reply_selection_request, x_handle_selection_request)
12627 (x_get_window_property, receive_incremental_selection)
12628 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12629 (lisp_data_to_selection_data, clean_local_selection_data):
12630 Use ptrdiff_t, not int, to record length of selection.
12631 (x_reply_selection_request, x_get_window_property)
12632 (receive_incremental_selection, x_property_data_to_lisp):
12633 Redo calculations to avoid overflow.
12634 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 12635 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
12636 something.
12637 (x_get_window_property, receive_incremental_selection)
12638 (lisp_data_to_selection_data, x_property_data_to_lisp):
12639 Check for size-calculation overflow.
12640 (x_get_window_property, receive_incremental_selection)
12641 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12642 Don't store size until memory allocation succeeds.
12643 (x_get_window_property): Plug memory leak on memory exhaustion.
12644 Don't double-block input; malloc is safe here. Don't assume 2**34
12645 - 4 fits in unsigned long. Add an xassert to check
12646 XGetWindowProperty overflow. Be more careful about overflow
12647 calculations, and distinguish size from memory overflow better.
12648 (receive_incremental_selection): When tracing, don't assume
12649 unsigned int is less than INT_MAX.
12650 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12651 harmful) conversions of unsigned short to int.
12652 (lisp_data_to_selection_data): Don't assume that integers
12653 in the range -65535 through -1 fit in an X unsigned short.
12654 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12655 result parameters unless successful. Rely on cons_to_unsigned
12656 to report problems with elements; the old code wasn't right anyway.
12657 (x_check_property_data): Check for int overflow; we cannot use
12658 a wider type due to X limits.
12659 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12660
726e0ab1 12661 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 12662
0065d054
PE
12663 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12664 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
12665 (x_color_cells): Don't store size until memory allocation succeeds.
12666 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 12667 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
12668 (x_term_init): Don't assume length fits in int (sprintf is limited
12669 to int size).
bc18e09d 12670
ebfa62c0
PE
12671 Use ptrdiff_t for composition IDs.
12672 * character.c (lisp_string_width):
12673 * composite.c (composition_table_size, n_compositions)
12674 (get_composition_id, composition_gstring_from_id):
12675 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12676 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12677 * window.c (Frecenter):
12678 Use ptrdiff_t, not int, for composition IDs.
12679 * composite.c (get_composition_id): Check for integer overflow.
12680 * composite.h: Adjust prototypes to match the above changes.
12681
d3411f89
PE
12682 Use ptrdiff_t for hash table indexes.
12683 * category.c (hash_get_category_set):
12684 * ccl.c (ccl_driver):
12685 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12686 * coding.c (coding_system_charset_list, detect_coding_system):
12687 * coding.h (struct coding_system.id):
12688 * composite.c (get_composition_id, gstring_lookup_cache):
12689 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12690 * image.c (xpm_get_color_table_h):
12691 * lisp.h (hash_lookup, hash_put):
12692 * minibuf.c (Ftest_completion):
12693 Use ptrdiff_t for hash table indexes, not int (which is too
12694 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12695 32-bit --with-wide-int hosts).
12696
e097a6fa
PE
12697 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12698 Add a FIXME comment about memory leaks.
12699 (syms_of_charset): Don't assume xmalloc returns.
12700
5637687f
PE
12701 Don't assume that stated character widths fit in int.
12702 * character.c (Fchar_width, c_string_width, lisp_string_width):
12703 * character.h (CHAR_WIDTH):
12704 * indent.c (MULTIBYTE_BYTES_WIDTH):
12705 Use sanitize_char_width to avoid undefined and/or bad behavior
12706 with outlandish widths.
a66cfb1c 12707 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
12708 now that we have two such functions. All uses changed.
12709 (sanitize_char_width): New inline function.
12710
a2271ba2
PE
12711 Don't assume that tab-width fits in int.
12712 * character.h (sanitize_width): New inline function.
12713 (SANE_TAB_WIDTH): New macro.
12714 (ASCII_CHAR_WIDTH): Use it.
12715 * indent.c (sane_tab_width): Remove. All uses replaced by
12716 SANE_TAB_WIDTH (current_buffer).
12717 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12718
18c52557
PE
12719 * fileio.c: Integer overflow issues with file modes.
12720 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12721
caeeedc1
PE
12722 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12723 Remove unreachable code.
12724 (read_hex, load_charset_map_from_file): Check for integer overflow.
12725
6df6ae42 12726 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
12727 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12728 (x_send_scroll_bar_event): Likewise. Check that the size does not
12729 exceed limits imposed by XClientMessageEvent, as well as the usual
12730 ptrdiff_t and size_t limits.
12731
b13995db
PE
12732 * keyboard.c: Overflow, signedness and related fixes.
12733 (make_lispy_movement): Use same integer type in forward decl
12734 that is used in the definition.
12735 (read_key_sequence, keyremap_step):
12736 Change bufsize argument back to int, undoing my 2011-03-30 change.
12737 We prefer signed types, and int is wide enough here.
12738 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12739 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12740 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12741 length, not size_t. Use ptrdiff_t for index, not int.
12742 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12743 possibility of integer overflow.
12744
13464394
PE
12745 Overflow, signedness and related fixes for images.
12746
12747 * dispextern.h (struct it.stack[0].u.image.image_id)
12748 (struct_it.image_id, struct image.id, struct image_cache.size)
12749 (struct image_cache.used, struct image_cache.ref_count):
12750 * gtkutil.c (update_frame_tool_bar):
12751 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12752 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12753 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12754 * nsmenu.m (update_frame_tool_bar):
12755 * xdisp.c (calc_pixel_width_or_height):
12756 * xfns.c (image_cache_refcount):
12757 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12758 on typical 64-bit hosts.
12759
12760 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12761 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12762 Omit unnecessary casts to int.
12763 (parse_image_spec): Check that integers fall into 'int' range
12764 when the callers expect that.
12765 (image_ascent): Redo ascent calculation to avoid int overflow.
12766 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12767 (lookup_image): Remove unnecessary tests.
12768 (xbm_image_p): Locals are now of int, not EMACS_INT,
12769 since parse_image_check makes sure they fit into int.
12770 (png_load, gif_load, svg_load_image):
12771 Prefer int to unsigned where either will do.
12772 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
12773 old tiff_error_handler and tiff_warning_handler.
12774 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
12775 stack buffer overflows. It uses only the features of vsnprintf
12776 that are common to both POSIX and native Microsoft.
12777 (tiff_error_handler, tiff_warning_handler): Use it.
12778 (tiff_load, gif_load, imagemagick_load_image):
12779 Don't assume :index value fits in 'int'.
12780 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12781 (imagemagick_load_image): Check that crop parameters fit into
12782 the integer types that MagickCropImage accepts. Don't assume
12783 Vimagemagick_render_type has a nonnegative value. Don't assume
12784 size_t fits in 'long'.
12785 (gs_load): Use printmax_t to print the widest integers possible.
12786 Check for integer overflow when computing image height and width.
12787
c11821d4
EZ
127882011-08-26 Eli Zaretskii <eliz@gnu.org>
12789
12790 * xdisp.c (redisplay_window): Don't force window start if point
12791 will be invisible in the resulting window. (Bug#9324)
12792
0c95fcf7
EZ
127932011-08-25 Eli Zaretskii <eliz@gnu.org>
12794
12795 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12796 the display spec is of the form `(space ...)'.
12797 (handle_display_spec): Return the value returned by
12798 handle_single_display_spec, not just 1 or zero.
12799 (handle_single_display_spec): If the display spec is of the form
12800 `(space ...)', and specifies display in the text area, return 2
12801 rather than 1.
fee65a97 12802 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
12803 accurately, and prefer exact match for point under bidi.
12804 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
12805
12806 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12807 into disp_prop; all users changed.
12808
12809 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12810 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12811 for the text covered by the display property.
12812
e4ed06f1
CY
128132011-08-25 Chong Yidong <cyd@stupidchicken.com>
12814
12815 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12816 Change return value to nil.
12817 (Frecord_buffer): Delete unused function.
12818
f67cdd7f
EZ
128192011-08-24 Eli Zaretskii <eliz@gnu.org>
12820
5980d4c6
EZ
12821 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12822 buffers, return left-to-right.
8610fe8b
EZ
12823 (set_cursor_from_row): Consider candidate row a win if its glyph
12824 represents a newline and point is on that newline. Fixes cursor
12825 positioning on the newline at EOL of R2L text within L2R
12826 paragraph, and vice versa.
12827 (try_cursor_movement): Check continued rows, in addition to
12828 continuation rows. Fixes unwarranted scroll when point enters a
12829 continued line of R2L text within an L2R paragraph, or vice versa.
12830 (cursor_row_p): Consider the case of point being equal to
12831 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12832 from the end of a short line to the beginning of a continued line
12833 of R2L text within L2R paragraph.
12834 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12835 composed characters.
5980d4c6 12836
f67cdd7f
EZ
12837 * bidi.c (bidi_check_type): Use xassert.
12838 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12839 members.
12840
bca633fb
EZ
128412011-08-23 Eli Zaretskii <eliz@gnu.org>
12842
12843 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12844 a character.
12845
4a5885a7
CY
128462011-08-23 Chong Yidong <cyd@stupidchicken.com>
12847
12848 * nsfont.m (ns_otf_to_script): Fix typo.
12849
0902a04e
KH
128502011-08-22 Kenichi Handa <handa@m17n.org>
12851
12852 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12853 extra slot even if the purpose is char-code-property-table.
12854
1a2e6670
EZ
128552011-08-23 Eli Zaretskii <eliz@gnu.org>
12856
8ddde651
EZ
12857 * xdisp.c (redisplay_window): When computing centering_position,
12858 account for the height of the header line. (Bug#8874)
12859
425cc014
EZ
12860 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12861 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12862 candidate is selected by the mouse, and that candidate has a
12863 composed character under the mouse.
12864
1a2e6670
EZ
12865 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12866 coordinates reported by pos-visible-in-window-p for a composed
12867 character in column zero.
12868
8b76d6f8
SM
128692011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12870
12871 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12872
dac347dd
EZ
128732011-08-22 Eli Zaretskii <eliz@gnu.org>
12874
12875 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12876 consider it a hit if to_charpos is anywhere in the range of the
12877 composed buffer positions.
12878
e013fb34
CY
128792011-08-22 Chong Yidong <cyd@stupidchicken.com>
12880
12881 * image.c (gif_load): Don't assume that each subimage has the same
12882 dimensions as the base image. Handle disposal method that is
12883 "undefined" by the gif spec (Bug#9335).
12884
bd1ba3e8
CY
128852011-08-20 Chong Yidong <cyd@stupidchicken.com>
12886
12887 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 12888 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 12889
54a1215b
EZ
128902011-08-19 Eli Zaretskii <eliz@gnu.org>
12891
823564e5
EZ
12892 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12893 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12894 from an Org mode buffer to a Speedbar frame.
12895
54a1215b
EZ
12896 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12897 a composition, take its buffer position from IT->cmp_it.charpos.
12898 Fixes cursor positioning at the beginning of a line that begins
12899 with a composed character.
12900
9778ebcc
EZ
129012011-08-18 Eli Zaretskii <eliz@gnu.org>
12902
0be6ee06
EZ
12903 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12904 character bidirectional type, use STRONG_L instead. Fixes crashes
12905 in a buffer produced by `describe-categories'.
12906
9778ebcc
EZ
12907 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12908 members before the level stack, so they would be saved and
12909 restored when copying iterator state. Fixes incorrect reordering
12910 around TABs covered by display properties.
12911
156bffbe
AS
129122011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12913
6b02f655 12914 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 12915
72ad093b
CY
129162011-08-17 Chong Yidong <cyd@stupidchicken.com>
12917
12918 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
12919 (internal_condition_case_2, internal_condition_case_n):
12920 Remove unnecessary aborts (Bug#9081).
72ad093b 12921
35774242
EZ
129222011-08-17 Eli Zaretskii <eliz@gnu.org>
12923
12924 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12925 has no `load' handler, try opening the file locally. (Bug#9311)
12926
db76dd85
KB
129272011-08-16 Ken Brown <kbrown@cornell.edu>
12928
12929 * gmalloc.c: Expand comment.
12930
b215eee5
EZ
129312011-08-16 Eli Zaretskii <eliz@gnu.org>
12932
12933 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12934 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12935
a4579d33
KB
129362011-08-16 Ken Brown <kbrown@cornell.edu>
12937
12938 Fix memory allocation problems in Cygwin build (Bug#9273).
12939
12940 * unexcw.c ( __malloc_initialized): Declare external variable.
12941 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12942
8b76d6f8
SM
12943 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12944 New variables.
a4579d33
KB
12945 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12946 dumped emacs.
12947 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12948 in the static heap.
12949 [CYGWIN] (special_realloc): New function.
12950 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12951 requests to realloc storage in the static heap.
12952
3ebec551
PE
129532011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12954
12955 * bidi.c (bidi_initialize): Remove unused local.
12956
9fd8be00
EZ
129572011-08-15 Eli Zaretskii <eliz@gnu.org>
12958
6b02f655
SM
12959 * bidimirror.h:
12960 * biditype.h: Remove file.
12961 * makefile.w32-in ($(BLD)/bidi.$(O)):
12962 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
12963
12964 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12965
12966 * chartab.c: Improve commentary for the uniprop_table API.
12967
32413314
EZ
12968 * bidi.c (bidi_paragraph_init): Support zero value of
12969 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
12970 (bidi_initialize): Use uniprop_table instead of including
12971 biditype.h and bidimirror.h.
32413314 12972
9fd8be00
EZ
12973 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12974 coordinates of the iterator when restoring from ppos_it.
12975 (Bug#9296)
12976
5cf2b69b
KH
129772011-08-14 Kenichi Handa <handa@m17n.org>
12978
12979 * process.c (create_process): Call setup_process_coding_systems
72ad093b 12980 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 12981
daf17d00
EZ
129822011-08-14 Eli Zaretskii <eliz@gnu.org>
12983
12984 * xdisp.c (move_it_in_display_line_to): Don't invoke
12985 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12986 ppos_it. Fixes vertical cursor motion when line beginning is
12987 covered by an image. (Bug#9296)
12988
08e3161a
JD
129892011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12990
12991 * nsterm.h (ns_run_ascript): Declare.
12992 (NSAPP_DATA2_RUNASSCRIPT): Define.
12993
12994 * nsfns.m (as_script, as_result, as_status): New static variables.
12995 (ns_run_ascript): New function.
5e617bc2 12996 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
12997 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12998 the event loop. Get status from as_status (Bug#7276).
12999
13000 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13001 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13002 the event loop (Bug#7276).
13003
a3720aa2
AS
130042011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13005
13006 * gnutls.c (QCgnutls_bootprop_priority)
13007 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13008 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13009 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13010 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13011 (QCgnutls_bootprop_verify_hostname_error)
13012 (QCgnutls_bootprop_callbacks_verify): Rename from
13013 Qgnutls_bootprop_..., all uses changed.
13014
13015 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13016 uses changed.
13017
0a0d27fb
PE
130182011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13019
19d5c50c
PE
13020 * xfaces.c (Qframe_set_background_mode): Now static.
13021 * dispextern.h (Qframe_set_background_mode): Remove decl.
13022
0a0d27fb
PE
13023 * process.c (Fnetwork_interface_info): Declare local only if needed.
13024
377538cb
JD
130252011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13026
13027 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13028 (Fnetwork_interface_list): Allocate in increments of bytes instead
13029 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13030 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13031 sockaddr.
13032 (struct ifflag_def): notrailers is smart on OSX.
13033 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13034 Get hardware address with getifaddrs if available.
13035
08fff70c
EZ
130362011-08-12 Eli Zaretskii <eliz@gnu.org>
13037
13038 * xdisp.c (iterate_out_of_display_property): xassert that
13039 IT->position is set to within IT->object's boundaries. Break from
13040 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
13041 when IT->position is set up wrongly due to some bug.
13042 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
13043 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13044 entry. Force push_it to save on the stack the current
13045 buffer/string position, to be restored by pop_it. Fix flags in
13046 the iterator structure wrt the object coming from a display
13047 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13048 properties. (Bug#9284)
13049
7be1c708 130502011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 13051
7be1c708
CY
13052 * fontset.c (fontset_get_font_group): Add proper type checks.
13053 (Bug#9172)
aac0c6e3 13054
7be1c708 130552011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 13056
7be1c708
CY
13057 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13058 and LC_VERSION_MIN_MACOSX.
13059 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13060 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 13061
97bb72a6
EZ
130622011-08-08 Eli Zaretskii <eliz@gnu.org>
13063
13064 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
13065 no-display-properties-and-no-overlays under bidi display.
13066 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 13067 properties and overlays.
97bb72a6 13068
d5617611
CY
130692011-08-08 Chong Yidong <cyd@stupidchicken.com>
13070
37e11a63
CY
13071 * editfns.c (Fset_time_zone_rule): Document relationship with the
13072 setenv function.
13073
d5617611
CY
13074 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13075 the font entity extracted from the cache (Bug#8109).
13076
58872834
CY
130772011-08-07 Chong Yidong <cyd@stupidchicken.com>
13078
13079 * composite.c (autocmp_chars): Don't reset point. That is done by
13080 restore_point_unwind (Bug#5984).
13081
75bfc667
JL
130822011-08-07 Juri Linkov <juri@jurta.org>
13083
13084 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13085 to show the arg `TIME' instead of `TIMEVAL'.
13086
d1410150
EZ
130872011-08-06 Eli Zaretskii <eliz@gnu.org>
13088
13089 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13090 display property strides EOL and includes a newline, as in
13091 longlines-mode. (Bug#9254)
75b771e4
EZ
13092 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13093 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
13094
13095 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13096 is non-zero, even if the data buffer is NULL. Fixes a crash in
13097 vertical-motion with longlines-mode. (Bug#9254)
13098
35928349
EZ
130992011-08-05 Eli Zaretskii <eliz@gnu.org>
13100
ec7cc85b
EZ
13101 * bidi.c <bidi_cache_total_alloc>: Now static.
13102 (bidi_initialize): Initialize bidi_cache_total_alloc.
13103
8b76d6f8 13104 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
13105 cache. (Bug#9221)
13106
13107 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13108 amount allocated this far in `bidi_cache_total_alloc'.
13109 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13110 non-zero, only free the data buffer without restoring the cache
13111 contents. All callers changed.
13112
13113 * dispextern.h (bidi_unshelve_cache): Update prototype.
13114
13115 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13116 (move_it_in_display_line, move_it_to)
13117 (move_it_vertically_backward, move_it_by_lines): Replace the call
13118 to xfree to an equivalent call to bidi_unshelve_cache.
13119 (move_it_in_display_line_to): Fix logic of returning
412b6358 13120 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 13121
e2e2423b
EZ
131222011-08-05 Eli Zaretskii <eliz@gnu.org>
13123
13124 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13125 came from a string character with a `cursor' property. (Bug#9229)
13126
ae9e757a
JD
131272011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13128
13129 * Makefile.in (LIB_PTHREAD): New variable.
13130 (LIBES): Add LIB_PTHREAD (Bug#9216).
13131
13132 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13133 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13134
213bd7f2
AS
131352011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13136
6b02f655 13137 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 13138
99aaf75f
JD
131392011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13140
13141 * xterm.c (x_find_topmost_parent): New function.
13142 (x_set_frame_alpha): Find topmost parent window with
13143 x_find_topmost_parent and set the property there also (bug#9181).
13144 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13145
c74e9d86
PE
131462011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13147
13148 * callproc.c (Fcall_process): Avoid vfork clobbering
13149 the local vars buffer, coding_systems, current_dir.
13150
640c8776
SM
131512011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13152
13153 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13154
f26d0e4c
PE
131552011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13156
8a10d76c
PE
13157 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13158 so that it is not optimized away.
13159
f26d0e4c
PE
13160 * xdisp.c (compute_display_string_pos): Remove unused local.
13161
55439c61
EZ
131622011-08-02 Eli Zaretskii <eliz@gnu.org>
13163
13164 Fix slow cursor motion and scrolling in large buffers with
13165 selective display, like Org Mode buffers. (Bug#9218)
13166
13167 * dispextern.h (struct bidi_it): New member disp_prop_p.
13168
13169 * xdisp.c: Remove one-slot cache of display string positions.
13170 (compute_display_string_pos): Accept an additional argument
5e617bc2 13171 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
13172 for a display string or property. If found, set DISP_PROP_P
13173 non-zero.
13174
13175 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
13176 DISP_PROP_P, and pass it to compute_display_string_pos.
13177 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
13178 non-zero. All callers of bidi_fetch_char changed.
13179
fb33fa43
SM
131802011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13181
13182 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13183
b099e063
DM
131842010-12-03 Don March <don@ohspite.net>
13185
13186 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13187 last character M-[char] is translated to ESC [char] (bug#7541).
13188
5cc7f7af
KH
131892011-08-02 Kenichi Handa <handa@m17n.org>
13190
d0fffa3f 13191 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
13192
13193 * chartab.c (uniprop_table): Make it non-static.
13194
525d5e6e
EZ
131952011-08-01 Eli Zaretskii <eliz@gnu.org>
13196
13197 * xdisp.c (forward_to_next_line_start): Accept additional argument
13198 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13199 on the newline.
13200 (reseat_at_next_visible_line_start): Use the bidi iterator state
13201 returned by forward_to_next_line_start to restore the state of
13202 it->bidi_it after backing up to previous newline. (Bug#9212)
13203
31011111
AS
132042011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13205
13206 * regex.c (re_comp): Protoize.
13207 (re_exec): Fix return type.
13208 (regexec): Fix type of `ret'. (Bug#9203)
13209
476371c4
PE
132102011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13211
e5d76069
PE
13212 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13213 This is needed if max-image-size is a floating-point number.
13214
9a79b20c
AS
132152011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13216
13217 * print.c (print_object): Print empty symbol as ##.
13218
13219 * lread.c (read1): Read ## as empty symbol.
13220
d8c2fa78
AA
132212011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13222
13223 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13224 setting frame foreground color (Bug#9175).
13225 (x_set_background_color): Likewise.
13226
ffe57a7a
AA
13227 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13228 contents (Bug#9176).
13229 (EmacsTooltip -init): Remove bezels and add shadows to
13230 tooltip windows.
13231
bf3492a5
AA
13232 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13233 or scroll bar (Bug#8470).
13234
d55e9c53
AA
13235 * nsfont.m (nsfont_open): Remove assignment to voffset and
13236 unnecessary vars hshink, expand, hd, full_height, min_height.
13237 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13238
13239 * nsterm.h (nsfont_info): Remove voffset field.
13240
d8c2fa78 132412011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
13242
13243 Implement strike-through and overline on NextStep (Bug#8863).
13244
13245 * nsfont.m (nsfont_open): Use underline position provided by font,
13246 instead of hard-coded value of 2.
13247 (nsfont_draw): Call ns_draw_text_decoration instead.
13248
13249 * nsterm.h: Add declaration for ns_draw_text_decoration.
13250
13251 * nsterm.m (ns_draw_text_decoration): New function for drawing
13252 underline, overline, and strike-through.
13253 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13254 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 13255 accommodate underlining, etc.
4843aac3 13256
4cc60b9b
EZ
132572011-07-28 Eli Zaretskii <eliz@gnu.org>
13258
bc7ece87
EZ
13259 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13260 default.
4cc60b9b 13261
476371c4
PE
132622011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13263
66606eea
PE
13264 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13265 Without this fix, if a signal arrives just after memory fills up,
13266 'malloc' might be invoked reentrantly.
13267
476371c4
PE
13268 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13269 In other words, assume that every image size is allowed, on non-X
13270 hosts. This assumption is probably wrong, but it lets Emacs compile.
13271
f3fcc40d
AS
132722011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13273
13274 * regex.c (re_iswctype): Convert return values to boolean.
13275
350c992f
EZ
132762011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13277
13278 * xdisp.c (compute_display_string_pos): Don't use cached display
13279 string position if the buffer had its restriction changed.
13280 (Bug#9184)
13281
5266b4bb
PE
132822011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13283
13284 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13285
2573a837 132862011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 13287
41f55ccd 13288 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 13289
39e378da
PE
13290 * bidi.c: Integer size and overflow fixes.
13291 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13292 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13293 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13294 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13295 (bidi_find_other_level_edge):
13296 Use ptrdiff_t instead of EMACS_INT where either will do.
13297 This works better on 32-bit hosts configured --with-wide-int.
13298 (bidi_cache_ensure_space): Check for size-calculation overflow.
13299 Use % rather than repeated addition, for better worst-case speed.
13300 Don't set bidi_cache_size until after xrealloc returns, because it
13301 might not return.
13302 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
13303 (bidi_cache_ensure_space): Also check that the bidi cache size
13304 does not exceed that of the largest Lisp string or buffer. See Eli
13305 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 13306
5e927815
PE
13307 * alloc.c (__malloc_size_t): Remove.
13308 All uses replaced by size_t. See Andreas Schwab's note
13309 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13310
ca4aa935
PE
13311 * image.c: Improve checking for integer overflow.
13312 (check_image_size): Assume that f is nonnull, since
13313 it is always nonnull in practice. This is one less thing to
13314 worry about when checking for integer overflow later.
13315 (x_check_image_size): New function, which checks for integer
13316 overflow issues inside X.
13317 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13318 This removes the need for a memory_full check.
13319 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13320 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13321 (xbm_read_bitmap_data): Change locals back to 'int', since
13322 their values must fit in 'int'.
13323 (xpm_load_image, png_load, tiff_load):
13324 Invoke x_create_x_image_and_pixmap earlier,
13325 to avoid much needless work if the image is too large.
13326 (tiff_load): Treat overly large images as if
13327 x_create_x_image_and_pixmap failed, not as malloc failures.
13328 (gs_load): Use x_check_image_size.
13329
5f8f9cc2
PE
13330 * gtkutil.c: Omit integer casts.
13331 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13332 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13333
5adf60bc
PE
13334 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13335
c8907a93
PE
13336 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13337 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13338 would wrongly return t on a 64-bit host.
13339
e3c25c68
PE
13340 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13341 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13342 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13343 and therefore cause GCC to emit a bogus diagnostic in some cases.
13344
3f791afe
PE
13345 * image.c: Integer signedness and overflow and related fixes.
13346 This is not an exhaustive set of fixes, but it's time to
13347 record what I've got.
13348 (lookup_pixel_color, check_image_size): Remove redundant decls.
13349 (check_image_size): Don't assume that arbitrary EMACS_INT values
13350 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13351 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13352 (tiff_load, imagemagick_load_image):
13353 Check for overflow in size calculations.
13354 (x_create_x_image_and_pixmap): Remove unnecessary test for
13355 xmalloc returning NULL; that can't happen.
13356 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13357 (xpm_color_bucket): Use better integer hashing function.
13358 (xpm_cache_color): Don't possibly over-allocate memory.
13359 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13360 (gif_memory_source):
13361 Use ptrdiff_t, not int or size_t, to record sizes.
13362 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13363 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13364 either works, as we prefer signed integers.
13365 (tiff_read_from_memory, tiff_write_from_memory):
13366 Return tsize_t, not size_t, since that's what the TIFF API wants.
13367 (tiff_read_from_memory): Don't fail simply because the read would
13368 go past EOF; instead, return a short read.
13369 (tiff_load): Omit no-longer-needed casts.
13370 (Fimagemagick_types): Don't assume size fits into 'int'.
13371
3cc5a532
PE
13372 Improve hashing quality when configured --with-wide-int.
13373 * fns.c (hash_string): New function, taken from sxhash_string.
13374 Do not discard information about ASCII character case; this
13375 discarding is no longer needed.
13376 (sxhash-string): Use it. Change sig to match it. Caller changed.
13377 * lisp.h: Declare it.
13378 * lread.c (hash_string): Remove, since we now use fns.c's version.
13379 The fns.c version returns a wider integer if --with-wide-int is
13380 specified, so this should help the quality of the hashing a bit.
13381
b312a492
PE
13382 * emacs.c: Integer overflow minor fix.
13383 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13384 Define only if GNU_LINUX.
13385 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13386
dfd153ae
PE
13387 * dispnew.c: Integer signedness and overflow fixes.
13388 Remove unnecessary forward decls, that were a maintenance hassle.
13389 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13390 All uses changed.
13391 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13392 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13393 (prepare_desired_row, line_draw_cost):
13394 Use int, not unsigned, where either works.
13395 (save_current_matrix, restore_current_matrix):
13396 Use ptrdiff_t, not size_t, where either works.
13397 (init_display): Check for overflow more accurately, and without
13398 relying on undefined behavior.
13399
a81d11a3
PE
13400 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13401 Remove, replacing with the new symbols in lisp.h. All uses changed.
13402 * fileio.c (make_temp_name):
13403 * filelock.c (lock_file_1, lock_file):
13404 * xdisp.c (message_dolog):
13405 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13406 Use pMd etc. instead.
13407 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13408 replacing the pWIDE etc. symbols removed from editfns.c.
13409
3300e6fd
PE
13410 * keyboard.h (num_input_events): Now uintmax_t.
13411 This is (very slightly) less likely to mess up due to wraparound.
13412 All uses changed.
13413
fd05c7e9
PE
13414 * buffer.c: Integer signedness fixes.
13415 (alloc_buffer_text, enlarge_buffer_text):
13416 Use ptrdiff_t rather than size_t when either will do, as we prefer
13417 signed integers.
13418
903fe15d
PE
13419 * alloc.c: Integer signedness and overflow fixes.
13420 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13421 (__malloc_size_t): Default to size_t, not to int.
13422 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13423 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13424 Prefer ptrdiff_t to size_t when either would do, as we prefer
13425 signed integers.
13426 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13427 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13428 Now const. Initialize with values that are in range even if char
13429 is signed.
13430 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13431 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13432 These functions do the right thing with sizes > 2**32.
13433 (check_depth): Now ptrdiff_t, not int.
13434 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13435 Adjust to new way of storing sizes. Check for size overflow bugs
13436 in rest of code.
13437 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13438 slightly wrong anyway, as it missed one instance of
13439 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13440 (refill_memory_reserve): Omit needless cast to size_t.
13441 (mark_object_loop_halt): Mark as externally visible.
13442
ac82cc6a
PE
13443 * xselect.c: Integer signedness and overflow fixes.
13444 (Fx_register_dnd_atom, x_handle_dnd_message):
13445 Use ptrdiff_t, not size_t, since we prefer signed.
13446 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13447 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13448 x_dnd_atoms_size and x_dnd_atoms_length.
13449
c2d1e36d
PE
13450 * doprnt.c: Prefer signed to unsigned when either works.
13451 * eval.c (verror):
13452 * doprnt.c (doprnt):
13453 * lisp.h (doprnt):
13454 * xdisp.c (vmessage):
13455 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13456 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13457 prefer signed arithmetic to avoid comparison confusion.
13458 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13459 but is a bit tricky.
13460
0e926e56
PE
13461 Assume freestanding C89 headers, string.h, stdlib.h.
13462 * data.c, doprnt.c, floatfns.c, print.c:
13463 Include float.h unconditionally.
13464 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13465 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13466 * regex.c: Likewise for stddef.h, string.h.
13467 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13468 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13469 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13470 (STDC_HEADERS): Remove obsolete defines.
13471 * sysdep.c: Include limits.h unconditionally.
13472
9cfdb3ec
PE
13473 Assume support for memcmp, memcpy, memmove, memset.
13474 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13475 * regex.c (memcmp, memcpy):
13476 Remove; we assume C89 now.
13477
13478 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13479 (__malloc_safe_bcopy): Remove; no longer needed.
13480
cf950e6b 13481 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
13482 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13483 well either way, and we prefer signed to unsigned.
13484
dbf38e02
LMI
134852011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13486
13487 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13488 closes the connection while we're reading (bug#9182).
13489
d6f0886c 134902011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 13491
d6f0886c
JD
13492 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13493 are specified (Bug#9168).
24e0f6b1 13494
2eb1f9e6
PE
134952011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13496
13497 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13498 Found by GCC static checking and --with-wide-int on a 32-bit host.
13499
22381272 135002011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
13501
13502 * xdisp.c (compute_display_string_pos): Fix logic of caching
13503 previous display string position. Initialize cached_prev_pos to
13504 -1. Fixes slow-down at the beginning of a buffer.
13505
f25e39b4
EZ
135062011-07-24 Eli Zaretskii <eliz@gnu.org>
13507
13508 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13509 for attrs[LFACE_FONTSET_INDEX].
13510
04c4b52e
PE
135112011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13512
13513 * xml.c (parse_region): Remove unused local
13514 that was recently introduced.
13515
c1734fbd
EZ
135162011-07-23 Eli Zaretskii <eliz@gnu.org>
13517
be18c5a5
EZ
13518 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13519 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13520
c1734fbd
EZ
13521 * xdisp.c (move_it_in_display_line_to): Record the best matching
13522 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
13523 exit if none of the characters scanned was an exact match.
13524 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
13525 when exact match is impossible due to invisible text, and the
13526 lines are truncated.
13527
a258d627
JD
135282011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13529
13530 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13531 for OSX >= 10.7.
13532
b6d5a689
EZ
135332011-07-22 Eli Zaretskii <eliz@gnu.org>
13534
0f74f785
EZ
13535 Fix a significant slow-down of cursor motion with C-n, C-p,
13536 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13537 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 13538 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
13539 (next_element_from_buffer): Call compute_stop_pos_backwards to
13540 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
13541 base_level_stop.
13542 (reseat): Don't look for prev_stop, as that could mean a very long
13543 run.
13544 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13545 <cached_disp_overlay_modiff>: Cache for last found display string
13546 position.
551918c1 13547 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
13548 about the same buffer in the same area of character positions, and
13549 the buffer wasn't changed since the time the display string
13550 position was cached.
551918c1 13551
b2d0c91a
EZ
135522011-07-22 Eli Zaretskii <eliz@gnu.org>
13553
13554 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13555 is an integer, which is important for empty lines. (Bug#9149)
13556
043604ee
CY
135572011-07-22 Chong Yidong <cyd@stupidchicken.com>
13558
13559 * frame.c (Fmodify_frame_parameters): In tty case, update the
13560 default face if necessary (Bug#4238).
13561
da4adb04
CY
135622011-07-21 Chong Yidong <cyd@stupidchicken.com>
13563
13564 * editfns.c (Fstring_to_char): No need to explain what a character
13565 is in the docstring (Bug#6576).
13566
9abd0532
LMI
135672011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13568
13569 * xml.c (parse_region): Make sure we always return a tree.
13570
36881d16
HK
135712011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13572
13573 * xml.c (parse_region): If a document contains only comments,
13574 return that, too.
13575
1e98674d
LMI
135762011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13577
13578 * xml.c (make_dom): Return comments, too.
13579
590bd467
PE
135802011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13581
13582 Port to OpenBSD.
13583 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13584 and the surrounding thread.
13585 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13586 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13587 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13588 timer goes off.
13589 * s/openbsd.h (BROKEN_SIGIO): Define.
13590 * unexelf.c (unexec) [__OpenBSD__]:
13591 Don't update the .mdebug section of the Alpha COFF symbol table.
13592
f41628b2
LMI
135932011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13594
13595 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13596 (bug#8460).
13597
b59b67c5
PE
135982011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13599
15e3a074
PE
13600 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13601 This fixes some race conditions on the permissions of any newly
13602 created file.
13603
41bed37d
PE
13604 * alloc.c (valid_pointer_p): Use pipe, not open.
13605 This fixes some permissions issues when debugging.
13606
b59b67c5
PE
13607 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13608 If fchown fails to set both uid and gid, try to set just gid,
13609 as that is sometimes allowed. Adjust the file's mode to eliminate
13610 setuid or setgid bits that are inappropriate if fchown fails.
13611
925a6be7
SM
136122011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13613
13614 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13615 to compare Lisp_Objects.
13616 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13617 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13618 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13619
52968808
AS
136202011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13621
0a6a104b
AS
13622 * lread.c (read_integer): Unread even EOF character.
13623 (read1): Likewise. Properly record start position of symbol.
13624
52968808
AS
13625 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13626 symbol character follows.
13627
9e381cdd
PE
136282011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13629
13630 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13631 This works around a problem with the previous change to Fcopy_file.
13632 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13633 and without this change, GCC might complain about discarding
13634 fchown's return value.
13635
b5641435
JB
136362011-07-16 Juanma Barranquero <lekktu@gmail.com>
13637
13638 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13639
a8031457
PE
136402011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13641
13642 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13643
dd889327
LMI
136442011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13645
750c33f7
LMI
13646 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13647 it's used from the C level.
13648
dd889327
LMI
13649 * process.c: Use the same condition for POLL_FOR_INPUT in both
13650 keyboard.c and process.c (bug#1858).
13651
87e86684
LM
136522011-07-09 Lawrence Mitchell <wence@gmx.li>
13653
13654 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13655 (Fgnutls_boot): Use it.
13656
64348f40
AS
136572011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13658
13659 * doc.c (Fsubstitute_command_keys): Revert last change.
13660
1d698799
LMI
136612011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13662
f863868c
LMI
13663 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13664 quotes the next character, and doesn't affect other longer
13665 sequences (bug#8935).
13666
1d698799
LMI
13667 * lread.c (syms_of_lread): Clarify that is isn't only
13668 `eval-buffer' and `eval-defun' that's affected by
13669 `lexical-binding' (bug#8460).
13670
aa4b6df6
EZ
136712011-07-15 Eli Zaretskii <eliz@gnu.org>
13672
13673 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 13674 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 13675
5d856da6
PE
136762011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13677
ad6042bb
PE
13678 Fix minor problems found by static checking.
13679 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13680 (elsz): Now a signed constant, not a size_t var. We prefer signed
13681 types to unsigned, to avoid integer comparison confusion. Without
13682 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13683 "cannot optimize loop, the loop counter may overflow", a symptom
13684 of the confusion.
f00bbb22 13685 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
13686 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13687
6468f31c
LMI
136882011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13689
49080b10
LMI
13690 * search.c (Fre_search_backward): Mention `case-fold-search' in
13691 all the re_search_* functions (bug#8138).
13692
6468f31c
LMI
13693 * keyboard.c (Fopen_dribble_file): Document when the file is
13694 closed (bug#8056).
13695
c965adc5
EZ
136962011-07-14 Eli Zaretskii <eliz@gnu.org>
13697
df9733bf
EZ
13698 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13699 bidi_cache_idx.
13700
0bb23927
EZ
13701 Support bidi reordering of display and overlay strings.
13702 * xdisp.c (compute_display_string_pos)
13703 (compute_display_string_end): Accept additional argument STRING.
13704 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13705 (reseat_to_string): Initialize bidi_it->string.s and
13706 bidi_it->string.schars.
13707 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
13708 NULL (avoids a crash in bidi_paragraph_init).
13709 Initialize itb.string.lstring.
0bb23927
EZ
13710 (init_iterator): Call bidi_init_it only of a valid
13711 buffer position was specified. Initialize paragraph_embedding to
13712 L2R.
13713 (reseat_to_string): Initialize the bidi iterator.
13714 (display_string): If we need to ignore text properties of
13715 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13716 original value of -1 will not work with bidi.)
13717 (compute_display_string_pos): First arg is now struct
13718 `text_pos *'; all callers changed. Support display properties on
13719 Lisp strings.
13720 (compute_display_string_end): Support display properties on Lisp
13721 strings.
13722 (init_iterator, reseat_1, reseat_to_string): Initialize the
13723 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13724 when iterating on a string not from display properties).
640c8776
SM
13725 (compute_display_string_pos, compute_display_string_end):
13726 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
13727 arrow keys.
13728 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
13729 base_level_stop; instead, set base_level_stop to BEGV.
13730 Fixes crashes in vertical-motion.
0bb23927
EZ
13731 (next_element_from_buffer): Improve commentary for when
13732 the iterator is before prev_stop.
13733 (init_iterator): Initialize bidi_p from the default value of
13734 bidi-display-reordering, not from buffer-local value. Use the
13735 buffer-local value only if initializing for buffer iteration.
13736 (handle_invisible_prop): Support invisible properties on strings
13737 that are being bidi-reordered.
13738 (set_iterator_to_next): Support bidi reordering of C strings and
13739 Lisp strings.
13740 (next_element_from_string): Support bidi reordering of Lisp
13741 strings.
13742 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
13743 (display_string): Support display of R2L glyph rows.
13744 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
13745 (init_iterator): Don't initialize it->bidi_p for strings
13746 here.
13747 (reseat_to_string): Initialize it->bidi_p for strings here.
13748 (next_element_from_string, next_element_from_c_string)
13749 (next_element_from_buffer): Add xassert's for correspondence
13750 between IT's object being iterated and it->bidi_it.string
13751 structure.
13752 (face_before_or_after_it_pos): Support bidi iteration.
13753 (next_element_from_c_string): Handle the case of the first string
13754 character that is not the first one in the visual order.
13755 (get_visually_first_element): New function, refactored from common
13756 parts of next_element_from_buffer, next_element_from_string, and
13757 next_element_from_c_string.
13758 (tool_bar_lines_needed, redisplay_tool_bar)
13759 (display_menu_bar): Force left-to-right direction. Add a FIXME
13760 comment for making that be controlled by a user option.
13761 (push_it, pop_it): Save and restore the state of the
13762 bidi iterator. Save and restore the bidi_p flag.
13763 (pop_it): Iterate out of display property for string iteration as
13764 well.
13765 (iterate_out_of_display_property): Support iteration over strings.
13766 (handle_single_display_spec): Set up it->bidi_it for iteration
13767 over a display string, and call bidi_init_it.
13768 (handle_single_display_spec, next_overlay_string)
13769 (get_overlay_strings_1, push_display_prop): Set up the bidi
13770 iterator for displaying display or overlay strings.
13771 (forward_to_next_line_start): Don't use the shortcut if
13772 bidi-iterating.
13773 (back_to_previous_visible_line_start): If handle_display_prop
13774 pushed the iterator stack, restore the internal state of the bidi
13775 iterator by calling bidi_pop_it same number of times.
13776 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13777 and we are bidi-iterating, don't decrement the iterator position;
13778 instead, set the first_elt flag in the bidi iterator, to produce
13779 the same effect.
13780 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13781 (push_display_prop): xassert that we are iterating a buffer.
13782 (push_it, pop_it): Save and restore paragraph_embedding member.
13783 (handle_single_display_spec, next_overlay_string)
13784 (get_overlay_strings_1, reseat_1, reseat_to_string)
13785 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13786 correctly. Don't assume unibyte strings are not bidi-reordered.
13787 (compute_display_string_pos)
13788 (compute_display_string_end): Fix handling the case of C string.
13789 (push_it, pop_it): Save and restore from_disp_prop_p.
13790 (handle_single_display_spec, push_display_prop): Set the
13791 from_disp_prop_p flag.
13792 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13793 (pop_it): Call iterate_out_of_display_property only if we are
13794 popping after iteration over a string that came from a display
13795 property. Fix a typo in popping stretch info. Add an assertion
13796 for verifying that the iterator position is in sync with the bidi
13797 iterator.
13798 (handle_single_display_spec, get_overlay_strings_1)
13799 (push_display_prop): Fix initialization of paragraph direction for
13800 string when that of the parent object is not yet determined.
13801 (reseat_1): Call bidi_init_it to resync the bidi
13802 iterator with IT's position. (Bug#7616)
13803 (find_row_edges): If ROW->start.pos gives position
13804 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13805 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13806 Reset the from_disp_prop_p flag.
13807 (SAVE_IT, RESTORE_IT): New macros.
13808 (pos_visible_p, face_before_or_after_it_pos)
13809 (back_to_previous_visible_line_start)
13810 (move_it_in_display_line_to, move_it_in_display_line)
13811 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13812 (try_scrolling, redisplay_window, display_line): Use them when
13813 saving a temporary copy of the iterator and restoring it back.
13814 (back_to_previous_visible_line_start, reseat_1)
13815 (init_iterator): Empty the bidi cache "stack".
13816 (move_it_in_display_line_to): If iterator ended up at
13817 EOL, but we never saw any buffer positions smaller than
13818 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13819 motion in bidi-reordered lines.
13820 (move_it_in_display_line_to): Record prev_method and prev_pos
13821 immediately before the call to set_iterator_to_next. Fixes cursor
13822 motion in bidi-reordered lines with stretch glyphs and strings
13823 displayed in margins. (Bug#8133) (Bug#8867)
13824 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13825 TO_CHARPOS.
640c8776
SM
13826 (pos_visible_p): Support positions in bidi-reordered lines.
13827 Save and restore bidi cache.
0bb23927
EZ
13828
13829 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13830 (bidi_paragraph_info): Delete unused struct.
13831 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13832 (bidi_cache_start): New variable.
13833 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13834 to zero.
13835 (bidi_cache_fetch_state, bidi_cache_search)
13836 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13837 (bidi_cache_find, bidi_peek_at_next_level)
13838 (bidi_level_of_next_char, bidi_find_other_level_edge)
13839 (bidi_move_to_visually_next): Compare cache index with
13840 bidi_cache_start rather than with zero.
13841 (bidi_fetch_char): Accept new argument STRING; all callers
13842 changed. Support iteration over a string. Support strings with
13843 display properties. Support unibyte strings. Fix the type of
13844 `len' according to what STRING_CHAR_AND_LENGTH expects.
13845 (bidi_paragraph_init, bidi_resolve_explicit_1)
13846 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
13847 (bidi_level_of_next_char, bidi_move_to_visually_next):
13848 Support iteration over a string.
0bb23927
EZ
13849 (bidi_set_sor_type, bidi_resolve_explicit_1)
13850 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13851 can now be zero (for strings); special values 0 and -1 were
13852 changed to -1 and -2, respectively.
13853 (bidi_char_at_pos): New function.
13854 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13855 Call it instead of FETCH_MULTIBYTE_CHAR.
13856 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13857 initialized to valid values.
13858 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13859 values.
13860 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13861 the test for valid cached positions. Fix the logic for looking up
13862 the sentinel state in the cache. GCPRO the Lisp string we are
13863 iterating.
13864 (bidi_push_it, bidi_pop_it): New functions.
13865 (bidi_initialize): Initialize the bidi cache start stack pointer.
13866 (bidi_cache_ensure_space): New function, refactored from part of
13867 bidi_cache_iterator_state. Don't assume the required size is just
13868 one BIDI_CACHE_CHUNK away.
13869 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13870 (bidi_count_bytes, bidi_char_at_pos): New functions.
13871 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13872 always valid if bidi_cache_idx is valid.
13873 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13874 is valid if it's going to be used.
13875 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13876 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
13877 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13878 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
13879 (bidi_find_other_level_edge, bidi_cache_start_stack):
13880 All variables related to cache indices are now EMACS_INT.
c965adc5 13881
0bb23927
EZ
13882 * dispextern.h (struct bidi_string_data): New structure.
13883 (struct bidi_it): New member `string'. Make flag members be 1-bit
13884 fields, and put them last in the struct.
640c8776
SM
13885 (compute_display_string_pos, compute_display_string_end):
13886 Update prototypes.
0bb23927
EZ
13887 (bidi_push_it, bidi_pop_it): Add prototypes.
13888 (struct iterator_stack_entry): New members bidi_p,
13889 paragraph_embedding, and from_disp_prop_p.
13890 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
13891 (bidi_shelve_cache, bidi_unshelve_cache):
13892 Declare prototypes.
0bb23927
EZ
13893
13894 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13895 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13896 and vector-like objects.
13897
13898 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13899 cache around display iteration.
13900
13901 * window.c (Fwindow_end, window_scroll_pixel_based)
13902 (displayed_window_lines, Frecenter): Save and restore the bidi
13903 cache around display iteration.
13904
3bbd2265
LMI
139052011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13906
13907 * editfns.c (Fdelete_region): Clarify the use of the named
13908 parameters (bug#6788).
13909
adc47434
MR
139102011-07-14 Martin Rudalics <rudalics@gmx.at>
13911
13912 * indent.c (Fvertical_motion): Set and restore w->pointm when
13913 saving and restoring the window's buffer (Bug#9006).
13914
837c31f8
LMI
139152011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13916
13917 * editfns.c (Fstring_to_char): Clarify just what is returned
13918 (bug#6576). Text by Eli Zaretskii.
13919
ac389d0c
JB
139202011-07-13 Juanma Barranquero <lekktu@gmail.com>
13921
13922 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13923
0be0ce47
EZ
139242011-07-13 Eli Zaretskii <eliz@gnu.org>
13925
13926 * buffer.c (mmap_find): Fix a typo.
13927
cd18e7e3
JB
139282011-07-13 Johan Bockgård <bojohan@gnu.org>
13929
13930 Fix execution of x selection hooks.
13931 * xselect.c (Qx_lost_selection_functions)
13932 (Qx_sent_selection_functions): New vars.
13933 (syms_of_xselect): DEFSYM them.
13934 (x_handle_selection_request): Pass Qx_sent_selection_functions
13935 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13936 (x_handle_selection_clear,x_clear_frame_selections):
13937 Pass Qx_lost_selection_functions rather than
13938 Vx_lost_selection_functions to Frun_hook_with_args.
13939
47ea7f44
PE
139402011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13941
ac389d0c 13942 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
13943 The old code sometimes used this field without initializing it.
13944
47ea7f44
PE
13945 * alloc.c (gc_sweep): Don't read past end of array.
13946 In theory, the old code could also have corrupted Emacs internals,
13947 though it'd be very unlikely.
13948
bc985c87
AS
139492011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13950
13951 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 13952 argument. (Bug#4026)
bc985c87 13953
0cf34688
LMI
139542011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13955
b3dadd76
LMI
13956 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13957 key" (bug#4257).
13958
0cf34688
LMI
13959 * window.c (Fset_window_start): Doc fix (bug#4199).
13960 (Fset_window_hscroll): Ditto.
13961
270768cd
PE
139622011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13963
077e3dda 13964 Fix minor new problems caught by GCC 4.6.1.
270768cd 13965 * term.c (init_tty): Remove unused local.
490011a6 13966 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 13967 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 13968 not used otherwise.
270768cd 13969
b1f58454
CY
139702011-07-12 Chong Yidong <cyd@stupidchicken.com>
13971
13972 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13973
22b9578d
LMI
139742011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13975
6e70ab07
LMI
13976 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13977 are the mini-buffer and the echo area (bug#3320).
13978
22b9578d
LMI
13979 * term.c (init_tty): Remove support for supdup, c10 and perq
13980 terminals, which are no longer supported (bug#1482).
13981
8974cc9f
JB
139822011-07-10 Johan Bockgård <bojohan@gnu.org>
13983
13984 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13985
a560d974
JD
139862011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13987
13988 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13989 for non-popups (Bug#3642).
13990
1dae0f0a
AS
139912011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13992
268c2c36 13993 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 13994 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
13995 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13996 * cm.c (losecursor): Likewise.
1dae0f0a
AS
13997 * data.c (fmod): Likewise.
13998 * dispnew.c (swap_glyphs_in_rows): Likewise.
13999 * emacs.c (memory_warning_signal): Likewise.
14000 * floatfns.c (float_error): Likewise.
14001 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14002 (otf_open, font_otf_capability, generate_otf_features)
14003 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14004 Likewise.
14005 * image.c (pbm_read_file): Likewise.
14006 * indent.c (string_display_width): Likewise.
14007 * intervals.c (check_for_interval, search_for_interval)
14008 (inc_interval_count, count_intervals, root_interval)
14009 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14010 * lread.c (defalias): Likewise.
268c2c36 14011 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
14012 * regex.c (set_image_of_range_1, set_image_of_range)
14013 (regex_grow_registers): Likewise.
14014 * sysdep.c (strerror): Likewise.
14015 * termcap.c (valid_filename_p, tprint, main): Likewise.
14016 * tparam.c (main): Likewise.
14017 * unexhp9k800.c (run_time_remap, save_data_space)
14018 (update_file_ptrs, read_header, write_header, calculate_checksum)
14019 (copy_file, copy_rest, display_header): Likewise.
14020 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14021 Likewise.
14022 * xdisp.c (check_it): Likewise.
14023 * xfaces.c (register_color, unregister_color, unregister_colors):
14024 Likewise.
14025 * xfns.c (print_fontset_result): Likewise.
14026 * xrdb.c (member, fatal, main): Likewise.
14027
99033785
PE
140282011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14029
14030 Fix minor problems found by static checking (Bug#9031).
14031 * chartab.c (char_table_set_range, map_sub_char_table):
14032 Remove unused locals.
14033 (uniprop_table): Now static.
14034 * composite.c (_work_char): Remove unused static var.
14035
9cb2ac56
JB
140362011-07-09 Juanma Barranquero <lekktu@gmail.com>
14037
14038 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14039
f25661f0
JD
140402011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14041
14042 * gtkutil.c (qttip_cb): Remove code without function.
14043
8278c4fe
EZ
140442011-07-09 Eli Zaretskii <eliz@gnu.org>
14045
14046 * w32.c (pthread_sigmask): New stub.
14047
1692ae2d 140482011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 14049
8a6ebd58 14050 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
14051 sigprocmask is portable only for single-threaded applications, and
14052 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
14053 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14054 (LIBES): Use it.
14055 * callproc.c (Fcall_process):
14056 * process.c (create_process):
14057 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14058 Use pthread_sigmask, not sigprocmask.
123403e4 14059
1b854618
JD
140602011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14061
14062 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14063 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14064 wrong (Bug#8591).
14065
3fe4b549
JD
140662011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14067
0ce7e563
JD
14068 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14069 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14070 (xg_hide_tooltip): Fix comment.
14071
3fe4b549
JD
14072 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14073 in registerServicesMenuSendTypes.
14074 (validRequestorForSendType): Don't check ns_return_types.
14075
14076 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14077 ns_return_type.
14078
5df75e47
JR
140792011-07-08 Jason Rumney <jasonr@gnu.org>
14080
22610910
JR
14081 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14082 SH_SHOW for hidden windows (Bug#5482).
14083
5df75e47
JR
14084 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14085 frame struct members of non-existent frames (Bug#6284).
14086
699c10bd
JD
140872011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14088
4393663b
JD
14089 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14090 variable firstTime not needed on OSX >= 10.6.
14091 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14092 >= 10.5. Use setKnobProportion, setDoubleValue.
14093
14094 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14095 (MAC_OS_X_VERSION_10_5): Define if not defined.
14096 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14097 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14098 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14099
14100 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 14101 cString and lossyCString on OSX >= 10.4.
4393663b 14102
58179cce 14103 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
14104 sizeToFit on OSX >= 10.2.
14105
14106 * nsimage.m (allocInitFromFile): Don't use deprecated method
14107 bestRepresentationForDevice on OSX >= 10.6.
14108
14109 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14110 to avoid warning.
14111
14112 * emacs.c: Declare unexec_init_emacs_zone.
14113
a63e0781
JD
14114 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14115
699c10bd
JD
14116 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14117
14118 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14119 on svcsMenu (Bug#8842).
14120
14121 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14122 ns_return_types.
14123 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14124
14125 * nsterm.m (QUTF8_STRING): Declare.
14126 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14127 (validRequestorForSendType): Return type is (id).
14128 Change indexOfObjectIdenticalTo to indexOfObject.
14129 Check if we have local selection before returning self (Bug#8842).
14130 (writeSelectionToPasteboard): Put local selection into paste board
14131 if we have a local selection (Bug#8842).
14132 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14133
14134 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14135 (ns_get_local_selection): Declare.
14136
54e10184
LMI
141372011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14138
9888ff71
LMI
14139 * keymap.c (describe_map_tree): Don't insert a double newline at
14140 the end of the buffer (bug#1169) and return whether we inserted
14141 something.
14142
54e10184
LMI
14143 * callint.c (Fcall_interactively): Change "reading args" to
14144 "providing args" to try to clarify what it does (bug#1010).
14145
15fa4783
KH
141462011-07-07 Kenichi Handa <handa@m17n.org>
14147
14148 * composite.c (composition_compute_stop_pos): Ignore a static
14149 composition starting before CHARPOS (Bug#8915).
14150
14151 * xdisp.c (handle_composition_prop): Likewise.
14152
a8815b00
EZ
141532011-07-07 Eli Zaretskii <eliz@gnu.org>
14154
14155 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14156 (Bug#9015)
14157
ef7b981d 141582011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
14159
14160 * character.h (unicode_category_t): New enum type.
14161
14162 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14163 (Qchar_code_property_table): New variable.
14164 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14165 (UNIPROP_COMPRESSED_FORM_P): New macros.
14166 (char_table_ascii): Uncompress the compressed values.
14167 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14168 Uncompress the compressed values.
ac389d0c 14169 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
14170 (char_table_ref_and_range): Uncompress the compressed values.
14171 (sub_char_table_set): New arg is_uniprop. Callers changed.
14172 Uncompress the compressed values.
14173 (sub_char_table_set_range): Args changed. Callers changed.
14174 (char_table_set_range): Adjuted for the above change.
14175 (map_sub_char_table): Delete args default_val and parent. Add arg
14176 top. Give decoded values to a Lisp function.
640c8776 14177 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
14178 values to a Lisp function. Gcpro more variables.
14179 (uniprop_table_uncompress)
14180 (uniprop_decode_value_run_length): New functions.
14181 (uniprop_decoder, uniprop_decoder_count): New variables.
14182 (uniprop_get_decoder, uniprop_encode_value_character)
14183 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14184 New functions.
14185 (uniprop_encoder, uniprop_encoder_count): New variables.
14186 (uniprop_get_encoder, uniprop_table)
14187 (Funicode_property_table_internal, Fget_unicode_property_internal)
14188 (Fput_unicode_property_internal): New functions.
14189 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14190 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 14191 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
14192 char-code-property-alist.
14193
640c8776 14194 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
14195 Vunicode_category_table.
14196
640c8776 14197 * font.c (font_range): Adjust for the change of
c805dec0
KH
14198 Vunicode_category_table.
14199
76b397fb
DN
142002011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14201
14202 * m/iris4d.h: Remove file, move contents ...
14203 * s/irix6-5.h: ... here.
14204
22b4128e
PE
142052011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14206
14207 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
14208 * alloc.c (mark_buffer):
14209 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14210 (clone_per_buffer_values): Don't assume that
22b4128e
PE
14211 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14212 This isn't true in general, and it's particularly not true
14213 if Emacs is configured with --with-wide-int.
14214 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14215 New macros, used in the buffer.c change.
14216
869795d6
JD
142172011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14218
14219 * xsettings.c: Use both GConf and GSettings if both are available.
14220 (store_config_changed_event): Add comment.
14221 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14222 (store_tool_bar_style_changed): New functions.
5e617bc2 14223 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
14224 (struct xsettings): Move font inside HAVE_XFT.
14225 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 14226 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 14227 Move inside HAVE_XFT.
640c8776 14228 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
14229 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14230 also.
14231 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 14232 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 14233 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
14234 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14235 (parse_settings): Move check for font inside HAVE_XFT.
14236 (read_settings, apply_xft_settings): Add comment.
14237 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14238 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14239 call store_font_name_changed.
14240 (xft_settings_event): Add comment.
14241 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14242 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14243 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14244 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14245 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
14246 (xsettings_get_system_font, xsettings_get_system_normal_font):
14247 Add comment.
869795d6 14248
d8ed26bd
PE
142492011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14250
14251 Random fixes. E.g., (random) never returned negative values.
14252 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14253 subseconds part to the entropy, as that's a bit more random.
14254 Prefer signed to unsigned, since the signedness doesn't matter and
14255 in general we prefer signed. When given a limit, use a
14256 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14257 latter isn't right if USE_2_TAGS_FOR_INTS.
14258 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14259 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14260
cabf1cac
SM
142612011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14262
14263 * textprop.c (text_property_stickiness):
14264 Obey Vtext_property_default_nonsticky.
14265 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14266 * w32fns.c (syms_of_w32fns):
14267 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14268
6e9b2be9
PE
142692011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14270
14271 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14272 This is more efficient than Ffile_directory_p and avoids a minor race.
14273
90186c68
LMI
142742011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14275
7c301272
LMI
14276 * buffer.c (Foverlay_put): Say what the return value is
14277 (bug#7835).
14278
c4f2d8d4
LMI
14279 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14280 is a directory before asking whether to use the file name
14281 (bug#7564).
ad637907
LMI
14282 (barf_or_query_if_file_exists): Make the "File is a directory"
14283 error be more correct.
c4f2d8d4 14284
90186c68
LMI
14285 * fns.c (Frequire): Remove the mention of the .gz files, since
14286 that's installation-specific, but keep the mention of
14287 `get-load-suffixes'.
14288
da64016e
PE
142892011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14290
14291 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14292 Report string overflow if the output is too long.
14293
7d47b580
JB
142942011-07-04 Juanma Barranquero <lekktu@gmail.com>
14295
a555cb87
JB
14296 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14297 (syms_of_gnutls): Remove duplicate DEFSYM for
14298 Qgnutls_bootprop_verify_hostname_error, an error for
14299 Qgnutls_bootprop_verify_error (which is no longer used).
14300
7d47b580
JB
14301 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14302 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14303 Also (re)move comments that are misplaced or no longer relevant.
14304
1e49bfab
LMI
143052011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14306
14307 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14308
1485f4c0
CY
143092011-07-03 Chong Yidong <cyd@stupidchicken.com>
14310
14311 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14312 and background color parameters if they have been changed.
14313
a9ab721e
LMI
143142011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14315
14316 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14317
cf7cff57
PE
143182011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14319
2e13213d
PE
14320 * xsettings.c (SYSTEM_FONT): Define only when used.
14321 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14322
cf7cff57
PE
14323 * keymap.c (access_keymap_1): Now static.
14324
7a8e04f7
CY
143252011-07-02 Chong Yidong <cyd@stupidchicken.com>
14326
14327 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14328 leave any prefix arg for the up event (Bug#1586).
14329
61352f62
LMI
143302011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14331
69bb1ef7
LMI
14332 * lread.c (syms_of_lread): Mention single symbols defined by
14333 `defvar' or `defconst' (bug#7154).
14334
61352f62 14335 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 14336 (Frequire): Mention get-load-suffixes.
61352f62 14337
28545e04
MR
143382011-07-02 Martin Rudalics <rudalics@gmx.at>
14339
14340 * window.h (window): Remove clone_number slot.
14341 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14342 Remove.
14343 (make_parent_window, make_window, saved_window)
14344 (Fset_window_configuration, save_window_save): Don't deal with
14345 clone numbers.
14346 * buffer.c (Qclone_number): Remove declaration.
14347 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14348
3349e122
SM
143492011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14350
14351 Add multiple inheritance to keymaps.
14352 * keymap.c (Fmake_composed_keymap): New function.
14353 (Fset_keymap_parent): Simplify.
14354 (fix_submap_inheritance): Remove.
14355 (access_keymap_1): New function extracted from access_keymap to handle
14356 embedded parents and handle lists of maps.
14357 (access_keymap): Use it.
14358 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14359 (Fcopy_keymap): Handle embedded parents.
14360 (Fcommand_remapping, define_as_prefix): Simplify.
14361 (Fkey_binding): Simplify.
14362 (syms_of_keymap): Move minibuffer-local-completion-map,
14363 minibuffer-local-filename-completion-map,
14364 minibuffer-local-must-match-map, and
14365 minibuffer-local-filename-must-match-map to Elisp.
14366 (syms_of_keymap): Defsubr make-composed-keymap.
14367 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14368 (parse_menu_item): Trivial simplification.
14369
3279eb87
GM
143702011-07-01 Glenn Morris <rgm@gnu.org>
14371
14372 * Makefile.in (SETTINGS_LIBS): Fix typo.
14373
39cb9e56 143742011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
14375
14376 * coding.c (Fencode_coding_string): Record the last coding system
14377 used, as the function doc string says (bug#8738).
14378
0949d2b6
JD
143792011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14380
14381 * xsettings.c (store_monospaced_changed): Take new font as arg and
14382 check for change against current_mono_font.
14383 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14384 (emacs_settings_constructor, emacs_settings_get_property)
14385 (emacs_settings_set_property, emacs_settings_class_init)
14386 (emacs_settings_init, gsettings_obj): Remove.
14387 (something_changedCB): New function for HAVE_GSETTINGS.
14388 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14389 with value as argument.
14390 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14391 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 14392 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
14393 "changed".
14394
14395 * xgselect.c: Add defined (HAVE_GSETTINGS).
14396 (xgselect_initialize): Ditto.
14397
14398 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14399 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14400 xg_select.
14401
bbc6b304
PE
144022011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14403
14404 * eval.c (struct backtrace): Simplify and port the data structure.
14405 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14406 signed bit field, as this assumption is not portable and it makes
14407 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14408 "char debug_on_exit : 1" as this is not portable either; instead,
14409 use the portable "unsigned int debug_on_exit : 1". Remove unused
14410 member evalargs. Remove obsolete comments about cc bombing out.
14411
9851bfc5
JD
144122011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14413
51bb811f 14414 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
14415 Let HAVE_GSETTINGS override HAVE_GCONF.
14416 (store_monospaced_changed): New function.
14417 (EMACS_SETTINGS): A new type derived from GObject to handle
14418 GSettings notifications.
14419 (emacs_settings_constructor, emacs_settings_get_property)
14420 (emacs_settings_set_property, emacs_settings_class_init):
14421 New functions.
14422 (gsettings_client, gsettings_obj): New variables.
14423 (GSETTINGS_SCHEMA): New define.
14424 (something_changedCB): Call store_monospaced_changed.
14425 (init_gsettings): New function.
14426 (xsettings_initialize): Call init_gsettings.
14427 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14428 to NULL.
14429
640c8776 14430 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
14431 GCONF_CFLAGS/LIBS.
14432
5386012d
MR
144332011-06-29 Martin Rudalics <rudalics@gmx.at>
14434
14435 * window.c (resize_root_window, grow_mini_window)
14436 (shrink_mini_window): Rename Qresize_root_window to
14437 Qwindow_resize_root_window and Qresize_root_window_vertically to
14438 Qwindow_resize_root_window_vertically.
14439
f13e0b08
PE
144402011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14441
14442 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14443
94515237
JB
144442011-06-27 Juanma Barranquero <lekktu@gmail.com>
14445
14446 * makefile.w32-in: Redesign dependencies so they reflect more
14447 clearly which files are directly included by each source file,
14448 and not through other includes.
14449
e43b6e43
MR
144502011-06-27 Martin Rudalics <rudalics@gmx.at>
14451
14452 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14453 (sort_overlays, overlay_strings): When an overlay's clone number
14454 matches the window's clone number process the overlay even if
14455 the overlay's window property doesn't match the current window.
14456
d68443dc
MR
14457 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14458 (Fwindow_hchild): Rename to Fwindow_left_child.
14459 (Fwindow_next): Rename to Fwindow_next_sibling.
14460 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
14461 (resize_window_check): Rename to window_resize_check.
14462 (resize_window_apply): Rename to window_resize_apply.
14463 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14464 (Fdelete_other_windows_internal, resize_frame_windows)
14465 (Fsplit_window_internal, Fdelete_window_internal)
14466 (grow_mini_window, shrink_mini_window)
14467 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 14468
c7e73be5
JD
144692011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14470
14471 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14472 (emacs_fixed_set_min_size): Remove.
14473 (emacs_fixed_new): Take frame as argument.
14474
14475 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14476 (_EmacsFixedPrivate): Remove minwidth/height.
14477 Add struct frame *f.
14478 (emacs_fixed_init): Initialize priv->f.
14479 (get_parent_class, emacs_fixed_set_min_size): Remove.
14480 (emacs_fixed_new): Set priv->f to argument.
14481 (emacs_fixed_get_preferred_width)
14482 (emacs_fixed_get_preferred_height): Use min_width/height from
14483 frames size_hint to set minimum and natural (Bug#8919).
14484 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14485 and use min_width/height from frames size_hint to set
14486 min_width/height (Bug#8919).
14487
14488 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
14489 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14490 Fix indentation.
c7e73be5 14491
cf99dcf8
EZ
144922011-06-26 Eli Zaretskii <eliz@gnu.org>
14493
14494 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14495 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14496 called at ZV.
14497
029529ac
CY
144982011-06-26 Chong Yidong <cyd@stupidchicken.com>
14499
14500 * process.c (wait_reading_process_output): Bypass select if
14501 waiting for a cell while ignoring keyboard input, and input is
14502 pending. Suggested by Jan Djärv (Bug#8869).
14503
7a7ef429
PE
145042011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14505
14506 Use gnulib's dup2 module instead of rolling our own.
14507 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14508
11fdef7d 145092011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
14510
14511 * dispnew.c (scrolling_window): Before scrolling, turn off a
14512 mouse-highlight in the window being scrolled.
14513
cd3520a4
JB
145142011-06-24 Juanma Barranquero <lekktu@gmail.com>
14515
14516 Move DEFSYM to lisp.h and use everywhere.
14517
14518 * character.h (DEFSYM): Move declaration...
14519 * lisp.h (DEFSYM): ...here.
14520
14521 * gnutls.c:
14522 * minibuf.c:
14523 * w32menu.c:
14524 * w32proc.c:
14525 * w32select.c: Don't include character.h.
14526
14527 * alloc.c (syms_of_alloc):
14528 * buffer.c (syms_of_buffer):
14529 * bytecode.c (syms_of_bytecode):
14530 * callint.c (syms_of_callint):
14531 * casefiddle.c (syms_of_casefiddle):
14532 * casetab.c (init_casetab_once):
14533 * category.c (init_category_once, syms_of_category):
14534 * ccl.c (syms_of_ccl):
14535 * cmds.c (syms_of_cmds):
14536 * composite.c (syms_of_composite):
14537 * dbusbind.c (syms_of_dbusbind):
14538 * dired.c (syms_of_dired):
14539 * dispnew.c (syms_of_display):
14540 * doc.c (syms_of_doc):
14541 * editfns.c (syms_of_editfns):
14542 * emacs.c (syms_of_emacs):
14543 * eval.c (syms_of_eval):
14544 * fileio.c (syms_of_fileio):
14545 * fns.c (syms_of_fns):
14546 * frame.c (syms_of_frame):
14547 * fringe.c (syms_of_fringe):
14548 * insdel.c (syms_of_insdel):
14549 * keymap.c (syms_of_keymap):
14550 * lread.c (init_obarray, syms_of_lread):
14551 * macros.c (syms_of_macros):
14552 * msdos.c (syms_of_msdos):
14553 * print.c (syms_of_print):
14554 * process.c (syms_of_process):
14555 * search.c (syms_of_search):
14556 * sound.c (syms_of_sound):
14557 * syntax.c (init_syntax_once, syms_of_syntax):
14558 * terminal.c (syms_of_terminal):
14559 * textprop.c (syms_of_textprop):
14560 * undo.c (syms_of_undo):
14561 * w32.c (globals_of_w32):
14562 * window.c (syms_of_window):
14563 * xdisp.c (syms_of_xdisp):
14564 * xfaces.c (syms_of_xfaces):
14565 * xfns.c (syms_of_xfns):
14566 * xmenu.c (syms_of_xmenu):
14567 * xsettings.c (syms_of_xsettings):
14568 * xterm.c (syms_of_xterm): Use DEFSYM.
14569
4228cf16
TZ
145702011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14571
cd3520a4 14572 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 14573
7fcccf1e
PE
145742011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14575
7efb4e0e
PE
14576 Integer and buffer overflow fixes (Bug#8873).
14577
ff5844ad
PE
14578 * print.c (printchar, strout): Check for string overflow.
14579 (PRINTPREPARE, printchar, strout):
14580 Don't set size unless allocation succeeds.
14581
90532f02
PE
14582 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14583 for sizes. Check for string overflow more accurately.
14584 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14585
6d84508d
PE
14586 * macros.c: Integer and buffer overflow fixes.
14587 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14588 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14589 Use ptrdiff_t, not int, for sizes.
14590 Don't increment bufsize until after realloc succeeds.
14591 Check for size-calculation overflow.
14592 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14593
437b2cb4
PE
14594 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14595
8b9ac8b4
PE
14596 * lread.c: Integer overflow fixes.
14597 (read_integer): Radix is now EMACS_INT, not int,
14598 to improve quality of diagnostics for out-of-range radices.
14599 Calculate buffer size correctly for out-of-range radices.
14600 (read1): Check for integer overflow in radices, and in
14601 read-circle numbers.
82cb60d3
PE
14602 (read_escape): Avoid int overflow.
14603 (Fload, openp, read_buffer_size, read1)
14604 (substitute_object_recurse, read_vector, read_list, map_obarray):
14605 Use ptrdiff_t, not int, for sizes.
14606 (read1): Use EMACS_INT, not int, for sizes.
20270765 14607 Check for size overflow.
8b9ac8b4 14608
7fcccf1e
PE
14609 * image.c (cache_image): Check for size arithmetic overflow.
14610
bfbbd7e7
PE
14611 * lread.c: Integer overflow issues.
14612 (saved_doc_string_size, saved_doc_string_length)
14613 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14614 Now ptrdiff_t, not int.
14615 (read1): Don't assume doc string length fits in int. Check for
14616 out-of-range doc string lengths.
14617 (read_list): Don't assume file position fits in int.
39019e54 14618 (read_escape): Check for hex character overflow.
bfbbd7e7 14619
4e323265
LL
146202011-06-22 Leo Liu <sdl.web@gmail.com>
14621
14622 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14623 Move to minibuffer.el.
14624
85fece3e
PE
146252011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14626
20b84ce9 14627 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
14628 The following patches are for when GLYPH_DEBUG && !XASSERT.
14629 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14630 * dispnew.c (flush_stdout):
14631 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14632 Mark as externally visible.
14633 * dispnew.c (check_window_matrix_pointers): Now static.
14634 * dispnew.c (window_to_frame_vpos):
14635 * xfns.c (unwind_create_frame):
14636 * xterm.c (x_check_font): Remove unused local.
14637 * scroll.c (CHECK_BOUNDS):
14638 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14639 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14640 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14641 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14642 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14643 Now static.
14644 (debug_method_add): Use va_list and vsprintf rather than relying
14645 on undefined behavior with wrong number of arguments.
14646 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14647 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14648 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14649 since we're not interested in debugging glyphs with old libraries.
14650 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14651 GCC 4.6.0's static checking.
14652
0766b489
PE
146532011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14654
31fd4b32
PE
14655 Integer overflow and signedness fixes (Bug#8873).
14656 A few related buffer overrun fixes, too.
14657
b79e8648
PE
14658 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14659
0766b489
PE
14660 * dispextern.h (struct face.stipple):
14661 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14662 (x_bitmap_mask, x_allocate_bitmap_record)
14663 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14664 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14665 (x_create_bitmap_from_xpm_data):
14666 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14667 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14668 (.bitmaps_last):
14669 * xfaces.c (load_pixmap):
14670 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14671 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14672 (.bitmaps_last, struct x_output.icon_bitmap):
14673 Use ptrdiff_t, not int, for bitmap indexes.
14674 (x_allocate_bitmap_record): Check for size overflow.
14675 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14676
b081724f
PE
14677 Use ptrdiff_t, not int, for overlay counts.
14678 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14679 * editfns.c (overlays_around, get_pos_property):
14680 * textprop.c (get_char_property_and_overlay):
14681 * xdisp.c (next_overlay_change, note_mouse_highlight):
14682 * xfaces.c (face_at_buffer_position):
21514da7
PE
14683 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14684 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14685 (Fnext_overlay_change, Fprevious_overlay_change)
14686 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 14687 Use ptrdiff_t, not int, for sizes.
21514da7 14688 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 14689
3de73e5e
PE
14690 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14691
2606c57b
PE
14692 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14693 (x_session_initialize): Do not assume string length fits in int.
14694
aaafe47a
PE
14695 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14696 This is unlikely, but can occur if DPI is outlandish.
14697
2674ddc8 14698 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
14699 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14700
28154962
PE
14701 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14702 * xrdb.c (magic_file_p, search_magic_path):
14703 Omit last arg SUFFIX; it was always 0. All callers changed.
14704 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14705
7de51af5
PE
14706 * xfont.c (xfont_match): Avoid need for strlen.
14707
25ed6cc3
PE
14708 * xfns.c: Don't assume strlen fits in int.
14709 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14710
4eab31dd
PE
14711 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14712 not unsigned long, as we prefer signed integers. All callers changed.
14713 Detect integer overflow in repeat count.
14714 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 14715 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 14716
171e2a58
PE
14717 * termcap.c: Don't assume sizes fit in int and never overflow.
14718 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14719 (gobble_line): Check for size-calculation overflow.
14720
ad39faca 14721 * minibuf.c (Fread_buffer):
6e5bb2dc 14722 * lread.c (intern, intern_c_string):
74ca2eb3
PE
14723 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14724 Don't assume string length fits in int.
14725
52c61c22 14726 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
14727 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14728
b5b8c9e5
PE
14729 * font.c: Don't assume string length fits in int.
14730 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14731 Use ptrdiff_t, not int.
ccd6111c
PE
14732 (font_intern_prop): Don't assume string length fits in int.
14733 Don't assume integer property fits in fixnum.
14734 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 14735
882f0d81 14736 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 14737 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
14738 Reformulate so as not to need the command string.
14739 Invoke gzip -cd rather than gunzip, as it's more portable.
14740 (lock_info_type, lock_file_1, lock_file):
14741 Don't assume pid_t and time_t fit in unsigned long.
14742 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14743 (current_lock_owner): Prefer signed type for sizes.
14744 Use memcpy, not strncpy, where memcpy is what is really wanted.
14745 Don't assume (via atoi) that time_t and pid_t fit in int.
14746 Check for time_t and/or pid_t out of range, e.g., via a network share.
14747 Don't alloca where an auto var works fine.
14748
93f4cf88
PE
14749 * fileio.c: Fix some integer overflow issues.
14750 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14751 Don't assume string length fits in int.
14752 (directory_file_name): Don't assume string length fits in long.
14753 (make_temp_name): Don't assume pid fits in int, or that its print
14754 length is less than 20.
14755
f3e92b69
PE
14756 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14757
1bfdaf10
PE
14758 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14759
35016e9a
PE
14760 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14761
3d1e65a1
PE
14762 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14763 We prefer signed integers, even for size calculations.
14764
0b963a93
PE
14765 * emacs.c: Don't assume string length fits in 'int'.
14766 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14767 (main): Don't invoke strlen when not needed.
14768
573f4b54
PE
14769 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14770 (XD_DEBUG_MESSAGE): Don't waste a byte.
14771
989f33ba
PE
14772 * callproc.c (getenv_internal_1, getenv_internal)
14773 (Fgetenv_internal):
965d34eb
PE
14774 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14775
e4d29b33
PE
14776 * lread.c (invalid_syntax): Omit length argument.
14777 All uses changed. This doesn't fix a bug, but it simplifies the
14778 code away from its former Hollerith-constant appearance, and it's
14779 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 14780 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 14781
eb49b136
PE
14782 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14783 This didn't break anything, but it didn't help either.
14784 It's confusing to put a bogus integer in a place where the actual
14785 value does not matter.
9f62aeb1 14786 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 14787 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 14788
15375a22
PE
14789 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14790 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14791 implementation.
b61cc01c
PE
14792 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14793 We prefer signed types, and the value cannot exceed the EMACS_INT
14794 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
14795 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14796 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14797 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 14798
53b2623d
PE
14799 * indent.c (sane_tab_width): New function.
14800 (current_column, scan_for_column, Findent_to, position_indentation)
14801 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 14802 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 14803
51cab52b 14804 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 14805
f2ed8a70
PE
14806 * lisp.h (lint_assume): New macro.
14807 * composite.c (composition_gstring_put_cache):
14808 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14809
abe80cc6
PE
14810 * editfns.c, insdel.c:
14811 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 14812
b02c740e
PE
14813 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14814
ebc96716
PE
14815 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14816
b4e50fa0 14817 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 14818 Use much-faster test for byte-length change.
311d5d7c 14819 Don't assume string byte-length fits in 'int'.
a4cf38e4 14820 Check that character arg fits in 'int'.
85461888 14821 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 14822
c0c1ee9f
PE
14823 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14824
a498d7f4
PE
14825 * fns.c (concat): Catch string overflow earlier.
14826 Do not rely on integer wraparound.
14827
51cab52b
PE
14828 * dispextern.h (struct it.overlay_strings_charpos)
14829 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
14830 * xdisp.c (forward_to_next_line_start)
14831 (back_to_previous_visible_line_start)
14832 (reseat_at_next_visible_line_start, next_element_from_buffer):
14833 Don't arbitrarily truncate the value of 'selective' to int.
14834
76031fad
PE
14835 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14836
5eb55db9
PE
14837 * composite.c: Don't truncate sizes to 'int'.
14838 (composition_gstring_p, composition_reseat_it)
14839 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
14840 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14841 not EMACS_UINT, for indexes.
5eb55db9 14842
0703a717
PE
14843 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14844
d6202519
PE
14845 * buffer.c: Include <verify.h>.
14846 (struct sortvec.priority, struct sortstr.priority):
8961a454 14847 Now EMACS_INT, not int.
c20998a7 14848 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
14849 (struct sortstr.size, record_overlay_string)
14850 (struct sortstrlist.size, struct sortlist.used):
14851 Don't truncate size to int.
14852 (record_overlay_string): Check for size-calculation overflow.
d6202519 14853 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 14854
d5a19415
JM
148552011-06-22 Jim Meyering <meyering@redhat.com>
14856
029529ac 14857 Don't leak an XBM-image-sized buffer
d5a19415
JM
14858 * image.c (xbm_load): Free the image buffer after using it.
14859
a9041e6c
PE
148602011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14861
14862 Port to Sun C.
14863 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14864 that Sun C diagnosed.
14865 * fns.c (secure_hash): Fix pointer signedness issue.
14866 * intervals.c (static_offset_intervals): New function.
14867 (offset_intervals): Use it.
14868
7f3f739f
LL
148692011-06-21 Leo Liu <sdl.web@gmail.com>
14870
14871 * deps.mk (fns.o):
14872 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14873 sha512.h.
14874
14875 * fns.c (secure_hash): Rename from crypto_hash_function and change
14876 the first arg to accept symbols.
5b66d427 14877 (Fsecure_hash): New primitive.
7f3f739f
LL
14878 (syms_of_fns): New symbols.
14879
76147d94
DD
148802011-06-20 Deniz Dogan <deniz@dogan.se>
14881
14882 * process.c (Fset_process_buffer): Clarify return value in
14883 docstring.
14884
7d7d0045
CY
148852011-06-18 Chong Yidong <cyd@stupidchicken.com>
14886
14887 * dispnew.c (add_window_display_history): Use BVAR.
14888
14889 * xdisp.c (debug_method_add): Use BVAR.
14890 (check_window_end, dump_glyph_matrix, dump_glyph)
14891 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14892
14893 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14894 Likewise.
14895
14896 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14897 check till after the cache is created in init_frame_faces.
14898
ff2bc410
SM
148992011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14900
14901 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14902
28177add
PE
149032011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14904
dd3482fe
PE
14905 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14906 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14907 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14908
393d71f3 14909 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
14910 * fileio.c (Finsert_file_contents):
14911 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14912 Remove the old (too-loose) buffer overflow checks.
14913 They weren't needed, since make_gap checks for buffer overflow.
14914 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14915 The old code merely checked for Emacs fixnum overflow, and relied
14916 on undefined (wraparound) behavior. The new code avoids undefined
14917 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14918
2e6813b0 14919 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
14920 Tune. Don't use wider integers than needed. Don't use alloca.
14921 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 14922
599a9e4f
PE
14923 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14924
99561444
PE
14925 * insdel.c, lisp.h (buffer_overflow): New function.
14926 (insert_from_buffer_1, replace_range, replace_range_2):
14927 * insdel.c (make_gap_larger):
14928 * editfns.c (Finsert_char):
14929 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14930
28177add
PE
14931 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14932
e69dafad
PE
149332011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14934
4baa020d 14935 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 14936
b1c46f02
PE
14937 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14938 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14939
e69dafad
PE
14940 * fileio.c: Don't assume EMACS_INT fits in off_t.
14941 (emacs_lseek): New static function.
14942 (Finsert_file_contents, Fwrite_region): Use it.
14943 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14944
566684ea
PE
14945 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14946
e6966cd6
PE
14947 * fns.c: Don't overflow int when computing a list length.
14948 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14949 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14950 truncation on 64-bit hosts. Check for QUIT every
14951 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14952 faster and is responsive enough.
14953 (Flength): Report an error instead of overflowing an integer.
14954 (Fsafe_length): Return a float if the value is not representable
14955 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 14956 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 14957 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 14958
dd0b0efb
PE
14959 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14960 (header_size, word_size): New constants.
14961 (allocate_vectorlike): Don't check size overflow here.
14962 (allocate_vector): Check it here instead, since this is the only
14963 caller of allocate_vectorlike that could cause overflow.
14964 Check that the new vector's length is representable as a fixnum.
14965
86fe5cfe
PE
14966 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14967 The previous code was bogus. For example, next_almost_prime (32)
14968 returned 39, which is undesirable as it is a multiple of 3; and
14969 next_almost_prime (24) returned 25, which is a multiple of 5 so
14970 why was the code bothering to check for multiples of 7?
14971
80e88859
PE
14972 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14973
4a2f0ad6
PE
14974 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14975
f66c7cf8
PE
14976 Variadic C functions now count arguments with ptrdiff_t.
14977 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14978 Back then I didn't know that the Emacs coding style prefers signed int.
14979 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
14980 were being counted with int, which may truncate counts on 64-bit
14981 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
14982 * lisp.h (struct Lisp_Subr.function.aMANY)
14983 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14984 Arg counts are now ptrdiff_t, not size_t.
14985 All variadic functions and their callers changed accordingly.
14986 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14987 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14988 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14989 * callint.c (Fcall_interactively): Check arg count for overflow,
14990 to avoid potential buffer overrun. Use signed char, not 'int',
14991 for 'varies' array, so that we needn't bother to check its size
14992 calculation for overflow.
14993 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14994 * eval.c (apply_lambda):
14995 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14996 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14997 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14998
a1759b76
PE
14999 * callint.c (Fcall_interactively): Don't use index var as event count.
15000
d96be9fc
PE
15001 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15002 * mem-limits.h (SIZE): Remove; no longer used.
15003
a690a978 15004 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 15005
578c21e6
PE
15006 Remove unnecessary casts.
15007 * xterm.c (x_term_init):
15008 * xfns.c (x_set_border_pixel):
15009 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15010 These aren't needed now that we assume ANSI C.
15011
96f53c6c
PE
15012 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15013 It's more likely to cause problems (due to unsigned overflow)
15014 than to cure them.
15015
83c77d31
PE
15016 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15017
ee2079f1
PE
15018 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15019
6da65536
PE
15020 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15021
7147c4a4
PE
15022 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15023
193e32d9
PE
15024 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15025
e5533da6
PE
15026 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15027
9910e595
PE
15028 GLYPH_CODE_FACE returns EMACS_INT, not int.
15029 * dispextern.h (merge_faces):
15030 * xfaces.c (merge_faces):
01103c44
PE
15031 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15032 Don't assume EMACS_INT fits in int.
9910e595 15033
2638320e
PE
15034 * character.h (CHAR_VALID_P): Remove unused parameter.
15035 * fontset.c, lisp.h, xdisp.c: All uses changed.
15036
045eb8d9
PE
15037 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15038
c1f134b5
PE
15039 * fns.c (concat): Minor tuning based on overflow analysis.
15040 This doesn't fix any bugs. Use int to hold character, instead
15041 of constantly refetching from Emacs object. Use XFASTINT, not
15042 XINT, for value known to be a character. Don't bother comparing
15043 a single byte to 0400, as it's always less.
15044
395fcb93 15045 * floatfns.c (Fexpt):
327eeec8
PE
15046 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15047
abbd3d23
PE
15048 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15049 for characters.
15050
684a03ef
PE
15051 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15052
0fed43f3
PE
15053 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15054 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15055 incorrectly succeed when S was a string, because 4294967386 was
15056 truncated before it was used.
15057
8fd02eb7
PE
15058 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15059 Otherwise, an out-of-range integer could cause undefined behavior
15060 on a 64-bit host.
15061
f8c86b69
PE
15062 * composite.c: Use int, not EMACS_INT, for characters.
15063 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15064 EMACS_INT, for values that are known to be in character range.
15065 This doesn't fix any bugs but is the usual style inside Emacs and
15066 may generate better code on 32-bit machines.
15067
34206dd2
PE
15068 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15069 This is for reasons similar to the recent CHAR_STRING fix.
15070 * charset.c (Fencode_char): Check that character arg is actually
15071 a character. Pass an int to ENCODE_CHAR.
15072 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15073 wider than 'int', as a compile-time check to prevent future regressions
15074 in this area.
15075
c5958d4c 15076 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
15077
15078 Make sure a 64-bit char is never passed to CHAR_STRING.
15079 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15080 by silently ignoring the top 32 bits, allowing some values
15081 that were far too large to be valid characters.
15082 * character.h: Include <verify.h>.
15083 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15084 arguments are no wider than unsigned, as a compile-time check
15085 to prevent future regressions in this area.
15086 * data.c (Faset):
01103c44 15087 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
15088 (Fsubst_char_in_region):
15089 * fns.c (concat):
15090 * xdisp.c (decode_mode_spec_coding):
15091 Adjust to CHAR_STRING's new requirement.
15092 * editfns.c (Finsert_char, Fsubst_char_in_region):
15093 * fns.c (concat): Check that character args are actually
15094 characters. Without this test, these functions did the wrong
15095 thing with wildly out-of-range values on 64-bit hosts.
15096
d37ca623
PE
15097 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15098 These casts should not be needed on 32-bit hosts, either.
15099 * keyboard.c (read_char):
15100 * lread.c (Fload): Remove casts to unsigned.
15101
ea204efb
PE
15102 * lisp.h (UNSIGNED_CMP): New macro.
15103 This fixes comparison bugs on 64-bit hosts.
15104 (ASCII_CHAR_P): Use it.
15105 * casefiddle.c (casify_object):
01103c44 15106 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
15107 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15108 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15109 * dispextern.h (FACE_FROM_ID):
15110 * keyboard.c (read_char): Use UNSIGNED_CMP.
15111
41cb286c
PE
15112 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15113 not to EMACS_INT, to avoid GCC warning.
15114
4a1b9832
PE
15115 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15116
55daad71
PE
15117 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15118 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15119 isn't needed on 32-bit machines.
8f95c75c 15120
01103c44
PE
15121 * buffer.c (Fgenerate_new_buffer_name):
15122 Use EMACS_INT for count, not int.
0ceccced 15123 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
15124
15125 * data.c (Qcompiled_function): Now static.
15126
c6f072e7
PE
15127 * window.c (window_body_lines): Now static.
15128
20ce5912
PE
15129 * image.c (gif_load): Rename local to avoid shadowing.
15130
9c4c5f81
PE
15131 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15132 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15133 * alloc.c (make_save_value): Integer argument is now of type
15134 ptrdiff_t, not int.
15135 (mark_object): Use ptrdiff_t, not int.
15136 * lisp.h (pD): New macro.
15137 * print.c (print_object): Use it.
15138
c0c5c8ae
PE
15139 * alloc.c: Use EMACS_INT, not int, to count objects.
15140 (total_conses, total_markers, total_symbols, total_vector_size)
15141 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
15142 (total_free_floats, total_floats, total_free_intervals)
15143 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
15144 Now EMACS_INT, not int. All uses changed.
15145 (Fgarbage_collect): Compute overall total using a double, so that
15146 integer overflow is less likely to be a problem. Check for overflow
15147 when converting back to an integer.
5a25e253
PE
15148 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15149 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15150 These were 'int' variables that could overflow on 64-bit hosts;
15151 they were never used, so remove them instead of repairing them.
211a0b2a 15152 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
15153 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15154 Previously, this ceilinged at INT_MAX, but that doesn't work on
15155 64-bit machines.
e46bb31a 15156 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 15157
c78baabf 15158 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 15159 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
15160 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15161 when a (possibly-narrower) signed value would do just as well.
15162 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 15163
c9d624c6
PE
15164 * alloc.c: Catch some string size overflows that we were missing.
15165 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15166 for convenience in STRING_BYTES_MAX.
15167 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15168 The definition here is exact; the one in lisp.h was approximate.
15169 (allocate_string_data): Check for string overflow. This catches
15170 some instances we weren't catching before. Also, it catches
15171 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15172 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15173 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 15174
c9d624c6
PE
15175 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15176 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 15177 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 15178
353032ce
PE
15179 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15180
2bccce07
PE
15181 * alloc.c (Fmake_string): Check for out-of-range init.
15182
0ac30604
SM
151832011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15184
15185 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15186
c195f2de
JD
151872011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15188
15189 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15190 xg_get_default_scrollbar_width.
15191
15192 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15193 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15194 (style_changed_cb): Call update_theme_scrollbar_width and call
15195 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15196 all frames (Bug#8505).
15197 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15198 Call gtk_window_set_resizable if HAVE_GTK3.
15199 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15200 and height if HAVE_GTK3 (Bug#8505).
15201 (scroll_bar_width_for_theme): New variable.
15202 (update_theme_scrollbar_width): New function.
15203 (xg_get_default_scrollbar_width): Move code to
15204 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15205 (xg_initialize): Call update_theme_scrollbar_width.
15206
15207 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15208
15209 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15210
e10ac9f1
MR
152112011-06-12 Martin Rudalics <rudalics@gmx.at>
15212
15213 * frame.c (make_frame): Call other_buffer_safely instead of
15214 other_buffer.
15215
15216 * window.c (temp_output_buffer_show): Call display_buffer with
15217 second argument Vtemp_buffer_show_specifiers and reset latter
15218 immediately after the call.
15219 (Vtemp_buffer_show_specifiers): New variable.
15220 (auto_window_vscroll_p, next_screen_context_lines)
15221 (Vscroll_preserve_screen_position): Remove leading asterisks from
15222 doc-strings.
15223
2d3c217e 152242011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 15225
7b7f97e8 15226 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
15227 * buffer.c (Qclone_number): Remove for now, as it's unused.
15228 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15229 (record_buffer): Remove unused local.
15230 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15231 (set_frame_buffer_list): Remove; unused.
15232 * frame.h (other_visible_frames): Remove decl.
15233 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15234 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15235 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15236 if HAVE_GPM.
15237 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15238 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15239 Define only if HAVE_GPM.
15240 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15241 (update_hints_inhibit): Remove; never set. All uses removed.
15242 * widgetprv.h (emacsFrameClassRec): Remove decl.
15243 * window.c (delete_deletable_window): Now returns void, since it
15244 wasn't returning anything.
15245 (compare_window_configurations): Remove unused locals.
15246 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15247 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
15248 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15249 the same widths as pointers. This follows up on the 2011-05-06 patch.
15250 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15251 * xterm.h: Likewise.
15252 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15253
1384b89e
JB
152542011-06-12 Juanma Barranquero <lekktu@gmail.com>
15255
15256 * makefile.w32-in: Update dependencies.
15257 (LISP_H): Add lib/intprops.h.
15258
1100a63c
CY
152592011-06-11 Chong Yidong <cyd@stupidchicken.com>
15260
15261 * image.c (gif_load): Add animation frame delay to the metadata.
15262 (syms_of_image): Use DEFSYM. New symbol `delay'.
15263
6198ccd0
MR
152642011-06-11 Martin Rudalics <rudalics@gmx.at>
15265
15266 * window.c (delete_deletable_window): Re-add.
15267 (Fset_window_configuration): Rewrite to handle dead buffers and
15268 consequently deletable windows.
15269 (window_tree, Fwindow_tree): Remove. Supply functionality in
15270 window.el.
15271 (compare_window_configurations): Simplify code.
15272
b6e3633c
AS
152732011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15274
1ab0dee5
AS
15275 * image.c (imagemagick_load_image): Fix type mismatch.
15276 (Fimagemagick_types): Likewise.
15277
b6e3633c
AS
15278 * window.h (replace_buffer_in_windows): Declare.
15279
9397e56f
MR
152802011-06-11 Martin Rudalics <rudalics@gmx.at>
15281
15282 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15283 Qclone_number. Remove external declaration of Qdelete_window.
15284 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15285 code.
640c8776
SM
15286 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15287 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
15288 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15289 buffer list implementation.
15290 (other_buffer_safely): New function.
15291 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15292 calls to replace_buffer_in_windows and
15293 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15294 if allowed.
15295 (record_buffer): Inhibit quitting and rewrite using quittable
15296 functions. Run Qbuffer_list_update_hook if allowed.
15297 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
15298 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15299 Move switch-to-buffer to window.el.
9397e56f
MR
15300 (bury-buffer): Move to window.el.
15301 (Vbuffer_list_update_hook): New variable.
15302
15303 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15304 section.
15305
15306 * window.h (resize_frame_windows): Move up in code.
15307 (Fwindow_frame): Remove EXFUN.
15308 (replace_buffer_in_all_windows): Remove prototype.
15309 (replace_buffer_in_windows_safely): Add prototype.
15310
15311 * window.c: Declare Qdelete_window static again. Move down
15312 declaration of select_count.
15313 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15314 (Fother_window): Move to window.el.
15315 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15316 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15317 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15318 window.el.
15319 (replace_buffer_in_windows): Implement by calling
15320 Qreplace_buffer_in_windows.
15321 (replace_buffer_in_all_windows): Remove with some functionality
15322 moved into replace_buffer_in_windows_safely.
15323 (replace_buffer_in_windows_safely): New function.
15324 (select_window_norecord, select_frame_norecord): Move in front
15325 of run_window_configuration_change_hook. Remove now obsolete
15326 declarations.
640c8776
SM
15327 (Fset_window_buffer): Rewrite doc-string.
15328 Call Qrecord_window_buffer.
9397e56f
MR
15329 (keys_of_window): Move binding for other-window to window.el.
15330
b50691aa
CY
153312011-06-11 Chong Yidong <cyd@stupidchicken.com>
15332
15333 * dispextern.h (struct image): Replace data member, whose int_val
15334 and ptr_val fields were not used by anything, with a single
15335 lisp_val object.
15336
15337 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15338 (gif_clear_image, gif_load, imagemagick_load_image)
15339 (gs_clear_image, gs_load): Callers changed.
15340
3f754b86
PE
153412011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15342
cca69397
PE
15343 * buffer.h: Include <time.h>, for time_t.
15344 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15345
109e28d0
PE
15346 Fix minor problems found by static checking.
15347
60737f02
PE
15348 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15349
4b66faf3
PE
15350 Make identifiers static if they are not used in other modules.
15351 * data.c (Qcompiled_function, Qframe, Qvector):
15352 * image.c (QimageMagick, Qsvg):
15353 * minibuf.c (Qmetadata):
15354 * window.c (resize_window_check, resize_root_window): Now static.
15355 * window.h (resize_window_check, resize_root_window): Remove decls.
15356
109e28d0
PE
15357 * window.c (window_deletion_count, delete_deletable_window):
15358 Remove; unused.
46a4ce9e
PE
15359 (window_body_lines): Now static.
15360 (Fdelete_other_windows_internal): Mark vars as initialized.
15361 Make sure 'resize_failed' is initialized.
15362 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15363 (resize_window_apply): Remove unused local.
15364 * window.h (delete_deletable_window): Remove decl.
15365
109e28d0 15366 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
15367 (imagemagick_load_image): Fix pointer signedness problem by changing
15368 last arg from unsigned char * to char *. All uses changed.
15369 Also, fix a local for similar reasons.
15370 Remove unused locals. Remove locals to avoid shadowing.
15371 (fn_rsvg_handle_free): Remove; unused.
15372 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 15373 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 15374
3f754b86
PE
15375 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15376
2547adb1
CY
153772011-06-10 Chong Yidong <cyd@stupidchicken.com>
15378
15379 * image.c (gif_load): Fix omitted cast error introduced by
15380 2011-06-06 change.
15381
2c8e37d4
MR
153822011-06-10 Martin Rudalics <rudalics@gmx.at>
15383
15384 * window.h (resize_proportionally, orig_total_lines)
15385 (orig_top_line): Remove from window structure.
15386 (set_window_height, set_window_width, change_window_heights)
15387 (Fdelete_window): Remove prototypes.
15388 (resize_frame_windows): Remove duplicate declaration.
15389
440a42e3
EZ
153902011-06-10 Eli Zaretskii <eliz@gnu.org>
15391
15392 * window.h (resize_frame_windows, resize_window_check)
15393 (delete_deletable_window, resize_root_window)
15394 (resize_frame_windows): Declare prototypes.
15395
15396 * window.c (resize_window_apply): Make definition be "static" to
15397 match the prototype.
15398
562dd5e9
MR
153992011-06-10 Martin Rudalics <rudalics@gmx.at>
15400
15401 * window.c: Remove declarations of Qwindow_size_fixed,
15402 window_min_size_1, window_min_size_2, window_min_size,
15403 size_window, window_fixed_size_p, enlarge_window, delete_window.
15404 Remove static from declaration of Qdelete_window, it's
15405 temporarily needed by Fbury_buffer.
15406 (replace_window): Don't assign orig_top_line and
15407 orig_total_lines.
15408 (Fdelete_window, delete_window): Remove. Window deletion is
15409 handled by window.el.
640c8776
SM
15410 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15411 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
15412 (Fdelete_other_windows): Remove. Deleting other windows is
15413 handled by window.el.
15414 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15415 handled in window.el.
15416 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15417 Window minimum sizes are handled in window.el.
15418 (shrink_windows, size_window, set_window_height)
15419 (set_window_width, change_window_heights, window_height)
15420 (window_width, CURBEG, CURSIZE, enlarge_window)
15421 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15422 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15423 handled in window.el.
15424 (make_dummy_parent): Rename to make_parent_window and give it a
15425 second argument horflag.
15426 (make_window): Don't set resize_proportionally any more.
15427 (Fsplit_window): Remove. Windows are split in window.el.
15428 (save_restore_action, save_restore_orig_size)
15429 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15430 Resize mini windows in window.el.
15431 (grow_mini_window, shrink_mini_window): Implement by calling
15432 Qresize_root_window_vertically, resize_window_check and
15433 resize_window_apply.
640c8776
SM
15434 (saved_window, Fset_window_configuration, save_window_save):
15435 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
15436 resize_proportionally.
15437 (window_min_height, window_min_width): Move to window.el.
15438 (keys_of_window): Move bindings for delete-other-windows,
15439 split-window, delete-window and enlarge-window to window.el.
15440
15441 * buffer.c: Temporarily extern Qdelete_window.
15442 (Fbury_buffer): Temporarily call Qdelete_window instead of
15443 Fdelete_window (Fbury_buffer will move to window.el soon).
15444
15445 * frame.c (set_menu_bar_lines_1): Remove code handling
15446 orig_top_line and orig_total_lines.
15447
15448 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15449 set_window_height but set heights directly.
15450 (change_frame_size_1): Use resize_frame_windows.
15451
15452 * xdisp.c (init_xdisp): Don't use set_window_height but set
15453 heights directly.
15454
640c8776
SM
15455 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15456 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
15457 run_window_configuration_change_hook.
15458
15459 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15460 instead of change_window_heights and run
15461 run_window_configuration_change_hook.
15462
1a13852e
MR
154632011-06-09 Martin Rudalics <rudalics@gmx.at>
15464
15465 * window.c (replace_window): Rename second argument REPLACEMENT to
15466 NEW. New third argument SETFLAG. Rewrite.
15467 (delete_window, make_dummy_parent): Call replace_window with
15468 third argument 1.
15469 (window_list_1): Move down in code.
15470 (run_window_configuration_change_hook): Move set_buffer part
15471 before select_frame_norecord part in order to unwind correctly.
15472 Rename count1 to count.
15473 (recombine_windows, delete_deletable_window, resize_root_window)
15474 (Fdelete_other_windows_internal)
15475 (Frun_window_configuration_change_hook, make_parent_window)
15476 (resize_window_check, resize_window_apply, Fresize_window_apply)
15477 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
15478 (Fdelete_window_internal, Fresize_mini_window_internal):
15479 New functions.
1a13852e
MR
15480 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15481
f3d1777e
MR
154822011-06-08 Martin Rudalics <rudalics@gmx.at>
15483
496e208e
MR
15484 * window.h (window): Add some new members to window structure -
15485 normal_lines, normal_cols, new_total, new_normal, clone_number,
15486 splits, nest, prev_buffers, next_buffers.
15487 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 15488 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 15489
f3d1777e
MR
15490 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15491 Remove.
496e208e
MR
15492 (make_dummy_parent): Set new members of windows structure.
15493 (make_window): Move down in code. Handle new members of window
15494 structure.
15495 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15496 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15497 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15498 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
15499 (Fset_window_next_buffers, Fset_window_clone_number):
15500 New functions.
496e208e
MR
15501 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15502 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15503 Doc-string fixes.
15504 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15505 Argument WINDOW can be now internal window too.
15506 (Fwindow_use_time): Move up in code.
15507 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15508 Rewrite doc-string.
15509 (Fset_window_configuration, saved_window)
15510 (Fcurrent_window_configuration, save_window_save): Handle new
15511 members of window structure.
b9e809c2
MR
15512 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15513 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15514 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15515 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15516 Qget_mru_window, Qresize_root_window,
15517 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15518 Qauto_buffer_name; staticpro them.
f3d1777e 15519
abde8f8c
MR
155202011-06-07 Martin Rudalics <rudalics@gmx.at>
15521
15522 * window.c (Fwindow_total_size, Fwindow_left_column)
15523 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15524 (Fwindow_list_1): New functions.
15525 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
15526 (Fwindow_width, Fscroll_left, Fscroll_right):
15527 Use window_body_cols instead of window_box_text_cols.
15528 (delete_window, Fset_window_configuration):
15529 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
15530 (delete_all_subwindows): Take a window as argument and not a
15531 structure. Rewrite.
190b47e6
MR
15532 (window_loop): Remove handling of GET_LRU_WINDOW and
15533 GET_LARGEST_WINDOW.
15534 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
15535
15536 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
15537 window_box_text_cols. delete_all_subwindows now takes a
15538 Lisp_Object as argument.
abde8f8c 15539
640c8776
SM
15540 * indent.c (compute_motion, Fcompute_motion):
15541 Use window_body_cols instead of window_box_text_cols.
abde8f8c 15542
fa8a67e6
MR
15543 * frame.c (delete_frame): Call delete_all_subwindows with root
15544 window as argument.
15545
a54e3482
DC
155462011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15547
15548 * fns.c (Fputhash): Document return value.
15549
60002bf5
CY
155502011-06-06 Chong Yidong <cyd@stupidchicken.com>
15551
15552 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15553
0c671da6 155542011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 15555
b862a52a 15556 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 15557
be44ca6c
PE
15558 Check for overflow when converting integer to cons and back.
15559 * charset.c (Fdefine_charset_internal, Fdecode_char):
15560 Use cons_to_unsigned to catch overflow.
15561 (Fencode_char): Use INTEGER_TO_CONS.
15562 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15563 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15564 * data.c (long_to_cons, cons_to_long): Remove.
15565 (cons_to_unsigned, cons_to_signed): New functions.
15566 These signal an error for invalid or out-of-range values.
15567 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15568 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15569 * font.c (Ffont_variation_glyphs):
15570 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15571 * lisp.h: Include <intprops.h>.
15572 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15573 (cons_to_signed, cons_to_unsigned): New decls.
15574 (long_to_cons, cons_to_long): Remove decls.
15575 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15576 (Fprimitive_undo): Use CONS_TO_INTEGER.
15577 * xfns.c (Fx_window_property): Likewise.
15578 * xselect.c: Include <limits.h>.
15579 (x_own_selection, selection_data_to_lisp_data):
15580 Use INTEGER_TO_CONS.
15581 (x_handle_selection_request, x_handle_selection_clear)
15582 (x_get_foreign_selection, Fx_disown_selection_internal)
15583 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15584 (lisp_data_to_selection_data): Use cons_to_unsigned.
15585 (x_fill_property_data): Use cons_to_signed.
15586 Report values out of range.
15587
d1f3d2af
PE
15588 Check for buffer and string overflow more precisely.
15589 * buffer.h (BUF_BYTES_MAX): New macro.
15590 * lisp.h (STRING_BYTES_MAX): New macro.
15591 * alloc.c (Fmake_string):
15592 * character.c (string_escape_byte8):
15593 * coding.c (coding_alloc_by_realloc):
15594 * doprnt.c (doprnt):
15595 * editfns.c (Fformat):
15596 * eval.c (verror):
15597 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15598 since they may not be the same number.
15599 * editfns.c (Finsert_char):
15600 * fileio.c (Finsert_file_contents):
15601 Likewise for BUF_BYTES_MAX.
15602
dd52fcea
PE
15603 * image.c: Use ptrdiff_t, not int, for sizes.
15604 (slurp_file): Switch from int to ptrdiff_t.
15605 All uses changed.
15606 (slurp_file): Check that file size fits in both size_t (for
15607 malloc) and ptrdiff_t (for sanity and safety).
15608
7f9bbdbb
PE
15609 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15610 if b->modtime has its maximal value.
15611
dfe18f82
PE
15612 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15613
84acfcf0
PE
15614 Don't assume time_t can fit into int.
15615 * buffer.h (struct buffer.modtime): Now time_t, not int.
15616 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15617 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15618
ccd9a01a
PE
15619 Minor fixes for signed vs unsigned integers.
15620 * character.h (MAYBE_UNIFY_CHAR):
15621 * charset.c (maybe_unify_char):
15622 * keyboard.c (read_char, reorder_modifiers):
15623 XINT -> XFASTINT, since the integer must be nonnegative.
15624 * ftfont.c (ftfont_spec_pattern):
15625 * keymap.c (access_keymap, silly_event_symbol_error):
15626 XUINT -> XFASTINT, since the integer must be nonnegative.
15627 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15628 since it makes no difference and we prefer signed.
15629 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15630 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15631 nonnegative.
15632
d6d100dd
SM
156332011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15634
15635 * window.h (Fwindow_frame): Declare.
15636
2b6148e4
PE
156372011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15638
15639 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15640 (SPARE_MEMORY): Always define.
15641 (LARGE_REQUEST): Remove.
15642 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15643
f230ecc9
MR
156442011-06-06 Martin Rudalics <rudalics@gmx.at>
15645
727e958e
MR
15646 * lisp.h: Move EXFUNS for Fframe_root_window,
15647 Fframe_first_window and Fset_frame_selected_window to window.h.
15648
15649 * window.h: Move EXFUNS for Fframe_root_window,
15650 Fframe_first_window and Fset_frame_selected_window here from
15651 lisp.h.
15652
15653 * frame.c (Fwindow_frame, Fframe_first_window)
15654 (Fframe_root_window, Fframe_selected_window)
15655 (Fset_frame_selected_window): Move to window.c.
15656 (Factive_minibuffer_window): Move to minibuf.c.
15657 (Fother_visible_frames_p): New function.
15658
15659 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15660
f230ecc9
MR
15661 * window.c (decode_window, decode_any_window): Move up in code.
15662 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15663 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
15664 (Fwindow_buffer): Move up and rewrite doc-string.
15665 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15666 (Fwindow_prev): New functions.
727e958e
MR
15667 (Fwindow_frame): Move here from frame.c. Accept any window as
15668 argument.
15669 (Fframe_root_window, Fframe_first_window)
15670 (Fframe_selected_window): Move here from frame.c. Accept frame
15671 or arbitrary window as argument. Update doc-strings.
15672 (Fminibuffer_window): Move up in code.
15673 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
15674 (Fset_frame_selected_window): Move here from frame.c.
15675 Marginal rewrite.
727e958e
MR
15676 (Fselected_window, select_window, Fselect_window): Move up in
15677 code. Minor doc-string fixes.
f230ecc9 15678
4d09bcf6
PE
156792011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15680
15681 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15682 Do not assume that spare memory exists; that assumption is valid
15683 only if SYSTEM_MALLOC.
15684 (LARGE_REQUEST): New macro, so that the issue of large requests
15685 is separated from the issue of spare memory.
15686
810928a2
AS
156872011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15688
172418ad
AS
15689 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15690 format. (Bug#8806)
15691
43f862f7
AS
15692 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15693
810928a2
AS
15694 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15695 before statements.
15696
a059fe24
JD
156972011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15698
15699 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15700
15701 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15702
15703 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15704 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15705
989bf368
JB
157062011-06-05 Juanma Barranquero <lekktu@gmail.com>
15707
15708 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15709
4b80f674
CY
157102011-06-04 Chong Yidong <cyd@stupidchicken.com>
15711
15712 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15713 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
15714 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15715 New error handlers.
4b80f674
CY
15716 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15717 Obey Vx_select_enable_clipboard_manager. Catch errors in
15718 x_clipboard_manager_save (Bug#8779).
15719 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 15720 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 15721
99a33b77 157222011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
15723
15724 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15725
99a33b77 157262011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
15727
15728 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15729 in the current matrix if keep_current_p is non-zero.
15730
8264569d
EZ
157312011-06-04 Eli Zaretskii <eliz@gnu.org>
15732
15733 * bidi.c (bidi_level_of_next_char): Fix last change.
15734
57f97249
EZ
157352011-06-03 Eli Zaretskii <eliz@gnu.org>
15736
fec2107c 15737 Support bidi reordering of text covered by display properties.
57f97249 15738
fec2107c
EZ
15739 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15740 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15741 (bidi_cache_search, bidi_cache_iterator_state)
15742 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
15743 (bidi_level_of_next_char, bidi_move_to_visually_next):
15744 Support character positions inside a run of characters covered by a
fec2107c
EZ
15745 display string.
15746 (bidi_paragraph_init, bidi_resolve_explicit_1)
15747 (bidi_level_of_next_char): Call bidi_fetch_char and
15748 bidi_fetch_char_advance instead of FETCH_CHAR and
15749 FETCH_CHAR_ADVANCE.
15750 (bidi_init_it): Initialize new members.
15751 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15752 definitions.
15753 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15754 instead of using explicit *_CHAR codes.
d6d100dd
SM
15755 (bidi_resolve_explicit, bidi_resolve_weak):
15756 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
15757 bidirectional text is supported only in multibyte buffers.
15758 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15759 it to initialize the frame_window_p member of struct bidi_it.
15760 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15761 (bidi_resolve_explicit, bidi_resolve_weak)
15762 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15763 bidi_it->nchars is non-positive.
15764 (bidi_level_of_next_char): Don't try to lookup the cache for the
15765 next/previous character if nothing is cached there yet, or if we
15766 were just reseat()'ed to a new position.
c40e2fb2 15767
0e14fe90
EZ
15768 * xdisp.c (set_cursor_from_row): Set start and stop points
15769 according to the row's direction when priming the loop that looks
15770 for the glyph on which to display cursor.
15771 (single_display_spec_intangible_p): Function deleted.
15772 (display_prop_intangible_p): Reimplement to call
15773 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
15774 Accept 3 additional arguments needed by handle_display_spec.
15775 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
15776 values: lists, `(when COND...)' forms, etc.
15777 (single_display_spec_string_p): Support property values that are
15778 lists with the argument STRING its top-level element.
15779 (display_prop_string_p): Fix the condition for processing a
15780 property that is a list to be consistent with handle_display_spec.
fec2107c 15781 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
15782 last portion of handle_display_prop.
15783 (compute_display_string_pos): Accept additional argument
15784 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15785 value of a `display' property is a "replacing spec".
15786 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15787 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15788 the display property, but just return a value indicating whether
15789 the display property will replace the characters it covers.
15790 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15791 frame_window_p members of struct bidi_it.
d6d100dd
SM
15792 (compute_display_string_pos, compute_display_string_end):
15793 New functions.
fec2107c
EZ
15794 (push_it): Accept second argument POSITION, where pop_it should
15795 jump to continue iteration.
15796 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 15797
fec2107c
EZ
15798 * keyboard.c (adjust_point_for_property): Adjust the call to
15799 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
15800
15801 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
15802 (bidi_init_it): Update prototypes.
15803 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
15804 (compute_display_string_pos, compute_display_string_end):
15805 Declare prototypes.
fec2107c
EZ
15806 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15807 EMACS_INT.
fc6f18ce 15808
40087514 158092011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 15810
57f53182
PE
15811 Malloc failure behavior now depends on size of allocation.
15812 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15813 * lisp.h: Change signatures accordingly.
15814 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15815 All callers changed. (Bug#8762)
15816
15817 * gnutls.c: Use Emacs's memory allocators.
15818 Without this change, the gnutls library would invoke malloc etc.
15819 directly, which causes problems on non-SYNC_INPUT hosts, and which
15820 runs afoul of improving memory_full behavior. (Bug#8761)
15821 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15822 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15823 xfree instead of the default malloc, realloc, free.
15824 (Fgnutls_boot): No need to check for memory allocation failure,
15825 since xmalloc does that for us.
15826
ac32cd99 15827 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
15828 * category.c (hash_get_category_set):
15829 * ccl.c (ccl_driver):
15830 * charset.c (Fdefine_charset_internal):
15831 * charset.h (struct charset.hash_index):
15832 * composite.c (get_composition_id, gstring_lookup_cache)
15833 (composition_gstring_put_cache):
15834 * composite.h (struct composition.hash_index):
15835 * dispextern.h (struct image.hash):
15836 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15837 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15838 (hashfn_equal, hashfn_user_defined, make_hash_table)
15839 (maybe_resize_hash_table, hash_lookup, hash_put)
15840 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15841 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15842 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15843 * image.c (make_image, search_image_cache, lookup_image)
15844 (xpm_put_color_table_h):
15845 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 15846 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 15847 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 15848 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
15849 * alloc.c (allocate_vectorlike):
15850 Check for overflow in vector size calculations.
15851 * ccl.c (ccl_driver):
15852 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
15853 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15854 need to be updated by these changes.
40087514
PE
15855 * fns.c (make_hash_table, maybe_resize_hash_table):
15856 Check for integer overflow with large hash tables.
0de4bb68
PE
15857 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15858 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15859 (SXHASH_REDUCE): New macro.
15860 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15861 Use it instead of discarding useful hash info with large hash values.
15862 (sxhash_float): New function.
15863 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15864 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
15865 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15866 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
15867 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15868 Adjust signatures to match updated version of code.
15869 (consing_since_gc): Now EMACS_INT, since a single hash table can
15870 use more than INT_MAX bytes.
15871
698d32e2
DN
158722011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15873
15874 Make it possible to build with GCC-4.6+ -O2 -flto.
15875
15876 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15877
fd6fa53f
SM
158782011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15879
15880 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15881 Call minibuffer-inactive-mode.
15882
864db017
JB
158832011-05-31 Juanma Barranquero <lekktu@gmail.com>
15884
15885 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15886 Update dependencies.
15887
2ad0baf4
DN
158882011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15889
15890 * data.c (init_data): Remove code for UTS, this system is not
15891 supported anymore.
15892
4fcc2638
DN
158932011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15894
15895 Don't force ./temacs to start in terminal mode.
15896
15897 * frame.c (make_initial_frame): Initialize faces in all cases, not
15898 only when CANNOT_DUMP is defined.
15899 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15900
c56e0fd5
DN
159012011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15902
15903 * dispnew.c (add_window_display_history): Use const for the string
15904 pointer. Remove declaration, not needed.
15905
333d54da 159062011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 15907
55d4c1b2 15908 Use 'inline', not 'INLINE'.
333d54da 15909 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
15910 * alloc.c, fontset.c (INLINE): Remove.
15911 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15912 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15913 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15914 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15915 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15916
738db178
DN
159172011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15918
15919 Make it possible to run ./temacs.
15920
15921 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15922 syms_of_callproc does the same thing. Remove test for
15923 "initialized", do it in the caller.
15924 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15925
620c53a6
SM
159262011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15927
15928 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15929 (read_minibuf): Use get_minibuffer.
15930 (syms_of_minibuf): Use DEFSYM.
15931 (Qmetadata): New var.
15932 * data.c (Qbuffer): Don't make it static.
15933 (syms_of_data): Use DEFSYM.
15934
e003a292
PE
159352011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15936
15937 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15938 (CCL_CODE_MIN): New macro.
15939
ed008a6d
PE
159402011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15941
3687c2ef
PE
15942 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15943
ed008a6d
PE
15944 * eval.c (Qdebug): Now static.
15945 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15946 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15947 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15948
d66c4c7c
CY
159492011-05-29 Chong Yidong <cyd@stupidchicken.com>
15950
15951 * image.c: Various fixes to ImageMagick code comments.
15952 (Fimagemagick_types): Doc fix.
15953
5fbc2025
PE
159542011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15955
0196f88a
PE
15956 Minor fixes prompted by GCC 4.6.0 warnings.
15957
15958 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15959
5fbc2025
PE
15960 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15961 (x_clipboard_manager_save_all): Move extern decl to ...
15962 * xterm.h: ... here, so that it can be checked for consistency.
15963
1dd3c2d9
CY
159642011-05-29 Chong Yidong <cyd@stupidchicken.com>
15965
15966 * xselect.c (x_clipboard_manager_save_frame)
15967 (x_clipboard_manager_save_all): New functions.
15968 (Fx_clipboard_manager_save): Lisp function deleted.
15969
15970 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15971 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15972
15973 * xterm.h: Update prototype.
15974
5ba6571d
WX
159752011-05-28 William Xu <william.xwl@gmail.com>
15976
15977 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15978 exiting (Bug#8239).
15979
3eaff834
JM
159802011-05-28 Jim Meyering <meyering@redhat.com>
15981
e1900994 15982 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
15983 * fns.c (to_uchar): Define.
15984 (crypto_hash_function): Use it to convert some newly-signed
15985 variables to unsigned, to avoid sign-extension bugs. For example,
15986 without this change, (md5 "truc") would evaluate to
15987 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15988 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 15989 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 15990
0f6990a7
PE
159912011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15992
15993 Integer overflow fixes.
c8a9ca5a 15994
08686060
PE
15995 * dbusbind.c: Serial number integer overflow fixes.
15996 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
15997 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15998 to hold a serial number that is too large for a fixnum.
15999 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16000 Check for serial numbers out of range. Decode any serial number
59568bf0 16001 that was so large that it became a float. (Bug#8722)
08686060 16002
2d1fc3c7
PE
16003 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16004 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16005 Use XFASTINT rather than XUINT when numbers are nonnegative.
16006 (xd_append_arg, Fdbus_method_return_internal):
16007 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16008 arguments, check that Lisp number is nonnegative, rather than
59568bf0 16009 silently wrapping negative numbers around. (Bug#8722)
30217ff0 16010 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 16011 (Bug#8722)
2d1fc3c7 16012
c8a9ca5a
PE
16013 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16014
519e1d69
PE
16015 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16016
6df6ae42 16017 ccl: Add integer overflow checks.
30569699
PE
16018 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16019 (IN_INT_RANGE): New macros.
16020 (ccl_driver): Use them to check for integer overflow when
16021 decoding a CCL program. Many of the new checks are whether XINT (x)
16022 fits in int; it doesn't always, on 64-bit hosts. The new version
16023 doesn't catch all possible integer overflows, but it's an
847044ea 16024 improvement. (Bug#8719)
30569699 16025
c11285dc
PE
16026 * alloc.c (make_event_array): Use XINT, not XUINT.
16027 There's no need for unsigned here.
16028
fdccd48e
PE
16029 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16030 This follows up to the 2011-05-06 change that substituted uintptr_t
16031 for EMACS_INT. This case wasn't caught back then.
16032
37910ab2
PE
16033 Rework Fformat to avoid integer overflow issues.
16034 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16035 now (part of C89). Include <verify.h>.
16036 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16037 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16038 (Fformat): Avoid the prepass trying to compute sizes; it was only
16039 approximate and thus did not catch overflow reliably. Instead, walk
16040 through the format just once, formatting and computing sizes as we go,
16041 checking for integer overflow at every step, and allocating a larger
16042 buffer as needed. Keep track separately whether the format is
16043 multibyte. Keep only the most-recently calculated precision, rather
16044 than them all. Record whether each argument has been converted to
16045 string. Use EMACS_INT, not int, for byte and char and arg counts.
16046 Support field widths and precisions larger than INT_MAX. Avoid
16047 sprintf's undefined behavior with conversion specifications such as %#d
16048 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16049 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16050 formatting out-of-range floating point numbers with int
9173deec 16051 formats. (Bug#8668)
37910ab2 16052
2e6578fb
PE
16053 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16054
0ae6bdee
PE
16055 * data.c: Avoid integer truncation in expressions involving floats.
16056 * data.c: Include <intprops.h>.
16057 (arith_driver): When there's an integer overflow in an expression
16058 involving floating point, convert the integers to floating point
16059 so that the resulting value does not suffer from catastrophic
16060 integer truncation. For example, on a 64-bit host (* 4
16061 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16062 Do not rely on undefined behavior after integer overflow.
16063
de883a70
PE
16064 merge count_size_as_multibyte, parse_str_to_multibyte
16065 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 16066 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
16067 Check for integer overflow.
16068 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16069 since it's now a duplicate of the other. This is more of
16070 a character than a buffer op, so better that it's in character.c.
16071 * fns.c, print.c: Adjust to above changes.
16072
2ff916cb
PE
160732011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16074
16075 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16076
f1b54466
PE
160772011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16078
fb1ac845
PE
16079 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16080 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16081 (x_clipboard_manager_save): Now static.
16082 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16083
f1b54466
PE
16084 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16085 (crypto_hash_function): Now static.
16086 Fix pointer signedness problems. Avoid unnecessary initializations.
16087
a9f737ee
CY
160882011-05-27 Chong Yidong <cyd@stupidchicken.com>
16089
16090 * termhooks.h (Vselection_alist): Make it terminal-local.
16091
16092 * terminal.c (create_terminal): Initialize it.
16093
16094 * xselect.c: Support for clipboard managers.
16095 (Vselection_alist): Move to termhooks.h as terminal-local var.
16096 (LOCAL_SELECTION): New macro.
16097 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16098 (symbol_to_x_atom): Remove gratuitous arg.
16099 (x_handle_selection_request, lisp_data_to_selection_data)
16100 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
16101 (x_own_selection, x_get_local_selection, x_convert_selection):
16102 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
16103 (some_frame_on_display): Delete unused function.
16104 (Fx_own_selection_internal, Fx_get_selection_internal)
16105 (Fx_disown_selection_internal, Fx_selection_owner_p)
16106 (Fx_selection_exists_p): New optional frame arg.
16107 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16108 (x_handle_selection_clear): Don't treat other terminals with the
16109 same keyboard specially. Use the terminal-local Vselection_alist.
16110 (x_clear_frame_selections): Use Frun_hook_with_args.
16111
16112 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16113
16114 * xterm.h: Add support for those atoms.
16115
e067f0c1
CY
161162011-05-26 Chong Yidong <cyd@stupidchicken.com>
16117
16118 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16119 (converted_selections, conversion_fail_tag): New global variables.
16120 (x_selection_request_lisp_error): Free the above.
16121 (x_get_local_selection): Remove unnecessary code.
16122 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
16123 of converted selections stored in converted_selections.
16124 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
16125 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16126 (x_convert_selection): New function.
16127 (x_handle_selection_event): Simplify.
16128 (x_get_foreign_selection): Don't ignore incoming requests while
16129 waiting for an answer; this will fail when we implement
16130 SAVE_TARGETS, and seems unnecessary anyway.
16131 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16132 (Vx_sent_selection_functions): Doc fix.
16133
0f4aebc0
LL
161342011-05-26 Leo Liu <sdl.web@gmail.com>
16135
16136 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16137
e61124cd
YM
161382011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16139
16140 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16141
16142 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16143 for fringe update if it has periodic bitmap.
ac389d0c 16144 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
16145 and fringe_bitmap_periodic_p.
16146
16147 * fringe.c (get_fringe_bitmap_data): New function.
16148 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16149 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16150 row. Mark glyph row for fringe update if periodicity changed.
16151
16152 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16153 for fringe update unless it has periodic bitmap.
16154
f16d9837
KH
161552011-05-25 Kenichi Handa <handa@m17n.org>
16156
16157 * xdisp.c (get_next_display_element): Set correct it->face_id for
16158 a static composition.
16159
e1b90ef6
LL
161602011-05-24 Leo Liu <sdl.web@gmail.com>
16161
16162 * deps.mk (fns.o):
16163 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16164
16165 * fns.c (crypto_hash_function, Fsha1): New function.
16166 (Fmd5): Use crypto_hash_function.
16167 (syms_of_fns): Add Ssha1.
16168
7400048f
PE
161692011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16170
16171 * gnutls.c: Remove unused macros.
16172 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16173 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16174 Remove macros that are defined and never used.
16175 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16176
abb71cf4
CY
161772011-05-22 Chong Yidong <cyd@stupidchicken.com>
16178
16179 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16180 (Fx_get_selection_internal): Minor cleanup.
16181 (Fx_own_selection_internal): Rename arguments for consistency with
16182 select.el.
16183
6307db39
PE
161842011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16185
16186 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16187
f3d4e0a4
CY
161882011-05-22 Chong Yidong <cyd@stupidchicken.com>
16189
16190 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16191
4d8ade89
YM
161922011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16193
16194 * dispnew.c (scrolling_window): Don't exclude the case that the
16195 last enabled row in the desired matrix touches the bottom boundary.
16196
32078c8d
GM
161972011-05-21 Glenn Morris <rgm@gnu.org>
16198
16199 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
16200 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16201 and add some more files.
32078c8d 16202
7285dc67
EZ
162032011-05-20 Eli Zaretskii <eliz@gnu.org>
16204
16205 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16206 report_file_error introduced by the change from 2011-05-07.
16207
89d1bd22
PE
162082011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16209
16210 * systime.h (Time): Define only if emacs is defined.
16211 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16212 where the include path doesn't have X11/X.h by default. See
16213 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16214
cd394be1 162152011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
16216
16217 * composite.c (find_automatic_composition): Fix previous change.
16218
b9704ad9
GM
162192011-05-20 Glenn Morris <rgm@gnu.org>
16220
16221 * lisp.mk: New file, split from Makefile.in.
16222 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16223 (shortlisp): Remove.
16224 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16225
4a720484
GM
162262011-05-19 Glenn Morris <rgm@gnu.org>
16227
16228 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16229 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16230 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16231 (lisp): Set the order to that of loadup.el.
16232 (shortlisp): Make it a copy of $lisp.
16233 (SOME_MACHINE_LISP): Remove.
16234 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16235 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16236
a28d4396
KH
162372011-05-18 Kenichi Handa <handa@m17n.org>
16238
16239 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16240 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16241 (find_automatic_composition): Mostly rewrite for efficiency.
16242
a2b1fa8e
JB
162432011-05-18 Juanma Barranquero <lekktu@gmail.com>
16244
16245 * makefile.w32-in: Update dependencies.
16246
8e1f5610
CS
162472011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16248
16249 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 16250 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 16251
7025ee00 162522011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 16253
cdfa6eab
PE
16254 Fix some integer overflow issues, such as string length overflow.
16255
06d6db33
PE
16256 * insdel.c (count_size_as_multibyte): Check for string overflow.
16257
2b4560a8
PE
16258 * character.c (lisp_string_width): Check for string overflow.
16259 Use EMACS_INT, not int, for string indexes and lengths; in
16260 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16261 the resulting string length overflows an EMACS_INT; instead,
16262 report a string overflow if no precision given. When checking for
16263 precision exhaustion, use a check that cannot possibly have
16264 integer overflow. (Bug#8675)
16265 * character.h (lisp_string_width): Adjust to new signature.
16266
cb93f9be
PE
16267 * alloc.c (string_overflow): New function.
16268 (Fmake_string): Use it. This doesn't change behavior, but saves
16269 a few bytes and will simplify future changes.
16270 * character.c (string_escape_byte8): Likewise.
16271 * lisp.h (string_overflow): New decl.
16272
1a1f3366
PE
16273 Fixups, following up to the user-interface timestamp change.
16274 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16275 for UI timestamps, instead of unsigned long.
9fbd6841
PE
16276 * msdos.c (mouse_get_pos): Likewise.
16277 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
16278 * w32gui.h (Time): Define by including "systime.h" rather than by
16279 declaring it ourselves. (Bug#8664)
16280
d4e3e4d3
PE
16281 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16282 * image.c (clear_image_cache): Likewise.
16283
f6a24d19
PE
16284 * term.c (term_mouse_position): Don't assume time_t wraparound.
16285
08dc5ae6
PE
16286 Be more systematic about user-interface timestamps.
16287 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
16288 and sometimes 'EMACS_UINT', to represent these timestamps.
16289 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
16290 This makes the code easier to follow, and makes it easier to catch
16291 integer overflow bugs such as Bug#8664.
16292 * frame.c (Fmouse_position, Fmouse_pixel_position):
16293 Use Time, not unsigned long, for user-interface timestamps.
16294 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16295 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16296 * keyboard.h (last_event_timestamp): Likewise.
16297 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16298 * menu.h (xmenu_show): Likewise.
16299 * term.c (term_mouse_position): Likewise.
16300 * termhooks.h (struct input_event.timestamp): Likewise.
16301 (struct terminal.mouse_position_hook): Likewise.
16302 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16303 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16304 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16305 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16306 what it was before.
16307 * menu.h, termhooks.h: Include "systime.h", for Time.
16308
8e55734a
PE
16309 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16310 Don't assume that the difference between two unsigned long values
16311 can fit into an integer. At this point, we know button_down_time
16312 <= event->timestamp, so the difference must be nonnegative, so
16313 there's no need to cast the result if double-click-time is
16314 nonnegative, as it should be; check that it's nonnegative, just in
16315 case. This bug is triggered when events are more than 2**31 ms
86db42d2 16316 apart (about 25 days). (Bug#8664)
8e55734a 16317
841f1b75 16318 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 16319 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 16320
3e26f69c
PE
16321 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16322 that always fit in int. Use a sentinel instead of a counter, to
16323 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
16324 * frame.h (struct frame): Use int for menu_bar_items_used
16325 instead of EMACS_INT, since it always fits in int.
3e26f69c 16326
5cc152c0
PE
16327 * menu.c (grow_menu_items): Check for int overflow.
16328
d89eb65e
PE
16329 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16330
5235bd3e
PE
16331 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16332 Before, the code was not consistent. These values cannot exceed
16333 2**31 - 1 so there's no need to make them unsigned.
16334 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16335 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16336 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16337 as modifiers.
16338 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16339
bc827e23
PE
16340 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16341 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16342 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16343 presumably because the widths might not match.
16344
78eb494e
PE
16345 * window.c (size_window): Avoid needless test at loop start.
16346
04f2d78b
CB
163472011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16348
16349 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16350
d2fc7e3d 163512011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
16352
16353 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16354
d2fc7e3d 163552011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
16356
16357 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16358 `width' to `bar_area_x' and `bar_area_width', respectively.
16359 (x_scroll_run): Take account of fringe background extension.
16360
04f2d78b
CB
16361 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16362 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
16363 `bar_area_width', respectively.
16364 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16365 background extension.
16366
79b70037
GM
163672011-05-10 Jim Meyering <meyering@redhat.com>
16368
16369 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16370
2f142cc5
JB
163712011-05-10 Juanma Barranquero <lekktu@gmail.com>
16372
16373 * image.c (Finit_image_library): Return t for built-in image types,
16374 like pbm and xbm. (Bug#8640)
16375
57679c86
AS
163762011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16377
16378 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16379
888c9e86
EZ
163802011-05-07 Eli Zaretskii <eliz@gnu.org>
16381
b0512a1d
EZ
16382 * w32console.c (Fset_screen_color): Doc fix.
16383 (Fget_screen_color): New function.
16384 (syms_of_ntterm): Defsubr it.
16385
7285dc67
EZ
16386 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16387 unlink the temporary file if Fcall_process didn't create it in the
16388 first place.
16389 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16390 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
16391 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16392 cue to call_process_cleanup not to close that handle.
16393
4d3fcc8e
BK
163942011-05-07 Ben Key <bkey76@gmail.com>
16395
16396 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16397 one of two shell specific rules, either bootstrap-temacs-CMD or
16398 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16399 to the previous implementation of the bootstrap-temacs rule.
16400 The bootstrap-temacs-CMD rule is similar to the previous
16401 implementation of the bootstrap-temacs rule except that it
16402 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16403 variable.
16404
16405 These changes, along with some changes to nt/configure.bat,
16406 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16407 earlier fix to add support for --cflags and --ldflags options
16408 that include quotes so that it works whether make uses cmd or
16409 sh as the shell.
16410
b4289b64
MA
164112011-05-06 Michael Albinus <michael.albinus@gmx.de>
16412
16413 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16414 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16415 is a constant.
16416 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16417 a string. Handle both cases.
16418 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16419 (Fdbus_register_method): Use Qinvalid_function.
16420
af4c0e28
JB
164212011-05-06 Juanma Barranquero <lekktu@gmail.com>
16422
16423 * makefile.w32-in: Update dependencies.
16424 (LISP_H): Add inttypes.h and stdin.h.
16425 (PROCESS_H): Add unistd.h.
16426
c51453d9
EZ
164272011-05-06 Eli Zaretskii <eliz@gnu.org>
16428
16429 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16430 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16431
8ff0ac3c 164322011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 16433
4c4b566b
PE
16434 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16435
aab2b9b5
PE
16436 * term.c (vfatal): Remove stray call to va_end.
16437 It's not needed and the C Standard doesn't allow it here anyway.
16438
c378da0b
PE
16439 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16440 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16441
288b08c7
PE
16442 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16443 bytes.
16444
e3601888
PE
16445 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16446
db6c0e74
PE
16447 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16448
dd5963ea
PE
16449 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16450
88c9450f
PE
16451 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16452
2f9442b8
PE
16453 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16454
c032b5f8
PE
16455 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16456 * charset.c (Fdefine_charset_internal): Don't initialize
16457 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 16458 32-bit int (Bug#8600).
a108c10b
PE
16459
16460 * lread.c (read_integer): Be more consistent with string-to-number.
16461 Use string_to_number to do the actual conversion; this avoids
16462 rounding errors and fixes some other screwups. Without this fix,
16463 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16464 (digit_to_number): Move earlier, for benefit of read_integer.
16465 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 16466 not a digit in any supported base. (Bug#8602)
a108c10b 16467
ad5f9eea
PE
16468 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16469
aec1708a
PE
16470 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16471 to match comment at start of function. This also removes a
16472 GCC warning about overflow in a 32+64-bit port.
16473
47be4ab5
PE
16474 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16475
371cac43
PE
16476 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16477 Reported by Stefan Monnier in
16478 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
16479 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16480 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 16481
d01a7826
PE
16482 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16483 (EMACS_UINTPTR): Likewise, with uintptr_t.
16484
7fd47d5c
PE
16485 * lisp.h: Prefer 64-bit EMACS_INT if available.
16486 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16487 on 32-bit hosts that have 64-bit int, so that they can access
16488 large files.
122b0c86
PE
16489 However, temporarily disable this change unless the temporary
16490 symbol WIDE_EMACS_INT is defined.
7fd47d5c 16491
8727937b
PE
16492 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16493
8ac068ac
PE
16494 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16495 This removes an assumption that EMACS_INT and long are the same
16496 width as pointers. The assumption is true for Emacs porting targets
16497 now, but we want to make other targets possible.
16498 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16499 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16500 In the rest of the code, change types of integers that hold casted
16501 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16502 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16503 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16504 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16505 No need to cast type when ORing.
16506 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16507 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16508 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16509 assume EMACS_INT is the same width as char *.
16510 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16511 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16512 Remove no-longer-needed casts.
16513 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16514 (xg_tool_bar_help_callback, xg_make_tool_item):
16515 Use EMACS_INTPTR to hold an integer
16516 that will be cast to void *; this can avoid a GCC warning
16517 if EMACS_INT is not the same width as void *.
16518 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16519 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16520 (current_message_1, set_message_1):
16521 Use a local to convert to proper width without a cast.
16522 * xmenu.c (dialog_selection_callback): Likewise.
16523
ede49d71
PE
16524 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16525 Also, don't assume VALBITS / RAND_BITS is less than 5,
16526 and don't rely on undefined behavior when shifting a 1 left into
16527 the sign bit.
16528 * lisp.h (get_random): Change signature to match.
16529
2f30ecd0
PE
16530 * lread.c (hash_string): Use size_t, not int, for hash computation.
16531 Normally we prefer signed values; but hashing is special, because
16532 it's better to use unsigned division on hash table sizes so that
16533 the remainder is nonnegative. Also, size_t is the natural width
16534 for hashing into memory. The previous code used 'int', which doesn't
16535 retain enough info to hash well into very large tables.
16536 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16537
2a866e7b
PE
16538 * dbusbind.c: Don't possibly lose pointer info when converting.
16539 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16540 Use XPNTR rather than XHASH, so that the high-order bits of
16541 the pointer aren't lost when converting through void *.
16542
51639eac
PE
16543 * eval.c (Fautoload): Don't double-shift a pointer.
16544
92394119
PE
16545 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16546
dbdb9a7c
JB
165472011-05-06 Juanma Barranquero <lekktu@gmail.com>
16548
16549 * gnutls.c (DEF_GNUTLS_FN):
16550 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16551
db7a0b4f
AS
165522011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16553
16554 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16555 marker. (Bug#8610)
16556
cd394be1 165572011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
16558
16559 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16560 New version that can reserve upto 2GB of heap space.
16561
f7ff1b0f 165622011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
16563
16564 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16565
639c109b
TZ
165662011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16567
16568 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16569 `gnutls_certificate_set_x509_key_file'.
16570
d2127135
JB
165712011-05-05 Juanma Barranquero <lekktu@gmail.com>
16572
16573 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16574 Update dependencies.
16575
e968f4f3
JB
165762011-05-04 Juanma Barranquero <lekktu@gmail.com>
16577
16578 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16579 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16580 Remove unused parameter `fildes'.
16581 * process.c (read_process_output, send_process): Don't pass it.
16582
84d358f0
JB
165832011-05-04 Juanma Barranquero <lekktu@gmail.com>
16584
16585 Fix previous change: the library cache is defined in w32.c.
16586 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16587 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16588
0898ca10
JB
165892011-05-04 Juanma Barranquero <lekktu@gmail.com>
16590
16591 Implement dynamic loading of GnuTLS on Windows.
16592
16593 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16594 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16595 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16596 Declare.
16597
16598 * gnutls.c (Qgnutls_dll): Define.
16599 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16600 (gnutls_*): Declare function pointers.
16601 (init_gnutls_functions): New function to initialize function pointers.
16602 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16603 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16604 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16605 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16606 (emacs_gnutls_write, emacs_gnutls_read)
16607 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16608 (Fgnutls_available_p): New function.
16609 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16610 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16611 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16612
16613 * image.c: Include w32.h.
16614 (Vimage_type_cache): Delete.
16615 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16616 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16617 (w32_delayed_load): Move to w32.c.
16618
16619 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16620
16621 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16622 (w32_delayed_load): Move from image.c. When loading a library, record
16623 its filename in the :loaded-from property of the library id.
16624 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16625 Initialize and staticpro them.
16626 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16627
16628 * process.c: Include lisp.h before w32.h, not after.
16629 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16630 instead of gnutls_record_check_pending.
16631
16632 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16633
ff4de4aa
TZ
166342011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16635
16636 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16637 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16638 as passed in.
16639
abe95abb
JD
166402011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16641
16642 * xterm.c (x_set_frame_alpha): Do not set property on anything
16643 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16644
e16e55d4
JB
166452011-05-02 Juanma Barranquero <lekktu@gmail.com>
16646
16647 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16648
bafcf6a5
JB
166492011-05-02 Juanma Barranquero <lekktu@gmail.com>
16650
16651 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16652 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16653 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16654 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16655 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16656 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16657 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16658 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16659 (Qgnutls_bootprop_callbacks_verify): Make static.
16660
e7a6747f
AS
166612011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16662
19ed11ba
AS
16663 * callproc.c: Indentation fixup.
16664
e7a6747f 16665 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
16666 (wait_for_termination, interruptible_wait_for_termination):
16667 Move after wait_for_termination_1.
e7a6747f 16668
1ef14cb4
LMI
166692011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16670
16671 * sysdep.c (interruptible_wait_for_termination): New function
16672 which is like wait_for_termination, but allows keyboard
16673 interruptions.
16674
16675 * callproc.c (Fcall_process): Add (:file "file") as an option for
16676 the STDOUT buffer.
16677 (Fcall_process_region): Ditto.
16678
330d880c
EZ
166792011-04-30 Eli Zaretskii <eliz@gnu.org>
16680
8db90b73
EZ
16681 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16682 rather than `XVECTOR (FOO)->size'.
16683
330d880c
EZ
16684 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16685 inttypes.h, as a gnulib replacement is used if it not available in
16686 system headers.
16687
15cbd324
EZ
166882011-04-21 Eli Zaretskii <eliz@gnu.org>
16689
16690 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16691 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16692 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16693
16694 * coding.c (coding_alloc_by_realloc): Error out if destination
16695 will grow beyond MOST_POSITIVE_FIXNUM.
16696 (decode_coding_emacs_mule): Abort if there isn't enough place in
16697 charbuf for the composition carryover bytes. Reserve an extra
16698 space for up to 2 characters produced in a loop.
16699 (decode_coding_iso_2022): Abort if there isn't enough place in
16700 charbuf for the composition carryover bytes.
16701
167022011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 16703
ae940cca
EZ
16704 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16705 aborting when %lld or %lll format is passed.
16706 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16707 %llo or %llx format is passed. (Bug#8545)
16708
03ab8921
EZ
16709 * window.c (window_scroll_line_based): Use a marker instead of
16710 simple variables to record original value of point. (Bug#7952)
16711
afda1437
EZ
16712 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16713 produced by %s or %c overflows available buffer space. (Bug#8545)
16714
f76dee0c
PE
167152011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16716
16717 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 16718 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 16719
fdc5744d
JB
167202011-04-28 Juanma Barranquero <lekktu@gmail.com>
16721
16722 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16723
638f053a
JB
167242011-04-28 Juanma Barranquero <lekktu@gmail.com>
16725
16726 * keyboard.c (Qdelayed_warnings_hook): Define.
16727 (command_loop_1): Run `delayed-warnings-hook'
16728 if Vdelayed_warnings_list is non-nil.
16729 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16730 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16731
d178f871
EZ
167322011-04-28 Eli Zaretskii <eliz@gnu.org>
16733
16734 * doprnt.c (doprnt): Don't return value smaller than the buffer
16735 size if the message was truncated. (Bug#8545).
16736
b124fd93
JB
167372011-04-28 Juanma Barranquero <lekktu@gmail.com>
16738
16739 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16740 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16741
e810457d
PE
167422011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16743
16744 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16745
ea51cceb
JB
167462011-04-27 Juanma Barranquero <lekktu@gmail.com>
16747
16748 * makefile.w32-in: Update dependencies.
16749
94dcfacf
EZ
167502011-04-27 Eli Zaretskii <eliz@gnu.org>
16751
16752 Improve `doprnt' and its usage. (Bug#8545)
16753 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16754 `format_end'. Remove support for %l as a conversion specifier.
16755 Don't use xrealloc. Improve diagnostics when the %l size modifier
16756 is used. Update the commentary.
16757
16758 * eval.c (verror): Simplify calculation of size_t.
16759
16760 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16761 messages.
16762
f61f41d7
PE
167632011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16764
16765 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16766 change.
16767
96fb4434
PE
167682011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16769
16770 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16771 This makes this file independent of the recent pseudovector change.
16772
671875da 167732011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 16774
69e9b5a3
PE
16775 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16776
b5f869a7 16777 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 16778 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 16779 Remove unused local.
c8926152 16780 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 16781
841a1577 16782 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
16783 GCC 4.6.0 optimizes based on type-based alias analysis.
16784 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
16785 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16786 != &v->size, and therefore "v->size = 1; b->size = 2; return
16787 v->size;" must therefore return 1. This assumption is incorrect
16788 for Emacs, since it type-puns struct Lisp_Vector * with many other
16789 types. To fix this problem, this patch adds a new type struct
f904488f 16790 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
16791 and pseudovectors, and helps optimizing compilers not get fooled
16792 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16793 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
16794 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16795 the size member.
eab3844f
PE
16796 (XSETPVECTYPE): Rewrite in terms of new macro.
16797 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16798 This is a bit clearer, and further avoids the possibility of
16799 undesirable aliasing.
16800 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 16801 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
16802 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16803 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
16804 (ASIZE): Now uses header.size rather than size.
16805 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
16806 to avoid the hassle of writing XVECTOR (foo)->header.size.
16807 (struct vectorlike_header): New type.
eab3844f
PE
16808 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16809 object, to help avoid aliasing.
16810 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16811 (SUBRP): Likewise, since Lisp_Subr is a special case.
16812 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16813 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16814 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 16815 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
16816 changed to be "header.size" and "header.next".
16817 * buffer.h (struct buffer): Likewise.
16818 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16819 * frame.h (struct frame): Likewise.
16820 * process.h (struct Lisp_Process): Likewise.
16821 * termhooks.h (struct terminal): Likewise.
16822 * window.c (struct save_window_data, struct saved_window): Likewise.
16823 * window.h (struct window): Likewise.
16824 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16825 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16826 * buffer.c (init_buffer_once): Likewise.
16827 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16828 special case.
16829 * process.c (Fformat_network_address): Use local var for size,
16830 for brevity.
16831
0df1eac5
PE
16832 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16833
847ab9d1 16834 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
16835 * data.c (atof): Remove decl; no longer used or needed.
16836 (digit_to_number): Move to lread.c.
16837 (Fstring_to_number): Use new string_to_number function, to be
16838 consistent with how the Lisp reader treats infinities and NaNs.
16839 Do not assume that floating-point numbers represent EMACS_INT
16840 without losing information; this is not true on most 64-bit hosts.
16841 Avoid double-rounding errors, by insisting on integers when
16842 parsing non-base-10 numbers, as the documentation specifies.
16843 * lisp.h (string_to_number): New decl, replacing ...
16844 (isfloat_string): Remove.
bc0a5c13 16845 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 16846 (read1): Do not accept +. and -. as integers; this
452f4150
PE
16847 appears to have been a coding error. Similarly, do not accept
16848 strings like +-1e0 as floating point numbers. Do not report
16849 overflow for integer overflows unless the base is not 10 which
16850 means we have no simple and reliable way to continue.
16851 Break out the floating-point parsing into a new
16852 function string_to_number, so that Fstring_to_number parses
16853 floating point numbers consistently with the Lisp reader.
04f2d78b 16854 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
16855 (E_CHAR, EXP_INT): Remove, replacing with ...
16856 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16857 (string_to_number): New function, replacing isfloat_string.
16858 This function checks for valid syntax and produces the resulting
16859 Lisp float number too. Rework it so that string-to-number
bc0a5c13 16860 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
16861 so that overflow for non-base-10 numbers is reported only when
16862 there's no portable and simple way to convert to floating point.
452f4150 16863
67769ffc
PE
16864 * textprop.c (set_text_properties_1): Rewrite for clarity,
16865 and to avoid GCC warning about integer overflow.
16866
c20db43f
PE
16867 * intervals.h (struct interval): Use EMACS_INT for members
16868 where EMACS_UINT might cause problems. See
16869 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16870 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16871 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16872 All uses changed.
37aa2f85
PE
16873 (offset_intervals): Tell GCC not to worry about length overflow
16874 when negating a negative length.
c20db43f 16875
2538aa2f
PE
16876 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16877 (overrun_check_free): Likewise.
16878
f2d3008d
PE
16879 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16880 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16881 word size.
16882
ec8df744
PE
16883 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16884 (gnutls_make_error): Rename local to avoid shadowing.
16885 (gnutls_emacs_global_deinit): ifdef out; not used.
16886 (Fgnutls_boot): Use const for pointer to readonly storage.
16887 Comment out unused local. Fix pointer signedness problems.
16888
640ee02d
PE
16889 * lread.c (openp): Don't stuff size_t into an 'int'.
16890 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16891 about possible signed overflow.
16892
6048fb2a
PE
16893 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16894 (GDK_KEY_g): Don't define if already defined.
16895 (xg_prepare_tooltip): Avoid pointer signedness problem.
16896 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16897
fa3c87e1
PE
16898 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16899 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16900
2172544b
PE
16901 * xfns.c (Fx_window_property): Simplify a bit,
16902 to make a bit faster and to avoid GCC 4.6.0 warning.
16903 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16904
9b821a21
PE
16905 * fns.c (internal_equal): Don't assume size_t fits in int.
16906
3c616cfa
PE
16907 * alloc.c (compact_small_strings): Tighten assertion a little.
16908
c2982e87
PE
16909 Replace pEd with more-general pI, and fix some printf arg casts.
16910 * lisp.h (pI): New macro, generalizing old pEd macro to other
16911 conversion specifiers. For example, use "...%"pI"d..." rather
16912 than "...%"pEd"...".
16913 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 16914 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
16915 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16916 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16917 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16918 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16919 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16920 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16921 64-bit hosts.
16922 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16923 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16924 * print.c (safe_debug_print, print_object): Likewise.
16925 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16926 to int.
6f04d126
PE
16927 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16928 avoiding the 0 flag, which is not portable.
c2982e87
PE
16929 * process.c (Fmake_network_process): Use pI to avoid cast.
16930 * region-cache.c (pp_cache): Likewise.
16931 * xdisp.c (decode_mode_spec): Likewise.
16932 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16933 behavior on 64-bit hosts with printf arg.
6f04d126 16934 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
16935 (x_stop_queuing_selection_requests): Likewise.
16936 (x_get_window_property): Don't truncate byte count to an 'int'
16937 when tracing.
0b432f21 16938
5e073ec7
PE
16939 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16940 here, since it parses constructs like leading '-' and spaces,
16941 which are not wanted; and it overflows with large numbers.
16942 Instead, simply match F[0-9]+, which is what is wanted anyway.
16943
36372bf9
PE
16944 * alloc.c: Remove unportable assumptions about struct layout.
16945 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16946 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16947 (allocate_vectorlike, make_pure_vector): Use the new macros,
16948 plus offsetof, to remove unportable assumptions about struct layout.
16949 These assumptions hold on all porting targets that I know of, but
16950 they are not guaranteed, they're easy to remove, and removing them
16951 makes further changes easier.
16952
0b432f21
PE
16953 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16954 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
16955 (string_overrun_cookie): Now const. Use initializers that
16956 don't formally overflow signed char, to avoid warnings.
000098c1
PE
16957 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16958 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
16959 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16960 multiple of sizeof (EMACS_INT); it need not be, if
16961 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 16962 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 16963
895009e1
JB
169642011-04-26 Juanma Barranquero <lekktu@gmail.com>
16965
16966 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16967
6a7a1b0b
TZ
169682011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16969
16970 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 16971 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
16972 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16973
841a1577 169742011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
16975
16976 * lisp.h (Qdebug): List symbol.
895009e1 16977 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
16978 * keyboard.c (debug-on-event): New variable.
16979 (handle_user_signal): Break into debugger when debug-on-event
16980 matches the current signal symbol.
16981
f2d3ba6f
DN
169822011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16983
16984 * alloc.c (check_sblock, check_string_bytes)
16985 (check_string_free_list): Convert to standard C.
16986
42ce4c63
TZ
169872011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16988
16989 * w32.c (emacs_gnutls_push): Fix typo.
16990
825cd63c
EZ
169912011-04-25 Eli Zaretskii <eliz@gnu.org>
16992
fb11d64d
EZ
16993 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16994 "cast to pointer from integer of different size".
16995
825cd63c
EZ
16996 Improve doprnt and its use in verror. (Bug#8545)
16997 * doprnt.c (doprnt): Document the set of format control sequences
16998 supported by the function. Use SAFE_ALLOCA instead of always
16999 using `alloca'.
17000
17001 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17002 is one byte too soon. Don't use xrealloc; instead xfree and
17003 xmalloc anew.
17004
e061a11b
TZ
170052011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17006
17007 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17008 callbacks stage.
17009
17010 * gnutls.c: Renamed global_initialized to
17011 gnutls_global_initialized. Added internals for the
17012 :verify-hostname-error, :verify-error, and :verify-flags
17013 parameters of `gnutls-boot' and documented those parameters in the
17014 docstring. Start callback support.
9173deec
JB
17015 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17016 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17017 on error. Return error code.
e061a11b
TZ
17018 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17019 (emacs_gnutls_read): Likewise.
17020 (Fgnutls_boot): Return handshake error code.
17021 (emacs_gnutls_handle_error): New function.
17022 (wsaerror_to_errno): Likewise.
17023
17024 * w32.h (emacs_gnutls_pull): Add prototype.
17025 (emacs_gnutls_push): Likewise.
17026
17027 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17028 (emacs_gnutls_push): Likewise.
17029
170302011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17031
17032 * process.c (wait_reading_process_output): Check if GnuTLS
17033 buffered some data internally if no FDs are set for TLS
17034 connections.
17035
17036 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17037 (LIBS): Link to USER_LIBS.
17038 ($(BLD)/gnutls.$(0)): New target.
17039
fa6996bc
EZ
170402011-04-24 Eli Zaretskii <eliz@gnu.org>
17041
eb35682e
EZ
17042 * xdisp.c (handle_single_display_spec): Rename the
17043 display_replaced_before_p argument into display_replaced_p, to
17044 make it consistent with the commentary. Fix typos in the
17045 commentary.
17046
e2ad650c
EZ
17047 * textprop.c (syms_of_textprop): Remove dead code.
17048 (copy_text_properties): Delete obsolete commentary about an
17049 interface that was deleted long ago. Fix typos in the description
17050 of arguments.
17051
1b2de274
EZ
17052 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17053 to changes in oldXMenu/XMenu.h from 2011-04-16.
17054 <menu_help_message, prev_menu_help_message>: Constify.
17055 (IT_menu_make_room): menu->help_text is now `const char **';
17056 adjust.
17057
17058 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17059 to changes in oldXMenu/XMenu.h from 2011-04-16.
17060 (struct XMenu): Declare `help_text' `const char **'.
17061
17062 * xfaces.c <Qunspecified>: Make extern again.
17063
17064 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 17065 required by POSIX.
1b2de274 17066
762b15be
EZ
17067 * doc.c (get_doc_string): Improve the format passed to `error'.
17068
17069 * doprnt.c (doprnt): Improve commentary.
17070
17071 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17072
17073 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17074 them with etags.
17075
f1052e5d
EZ
17076 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17077 changes in globals.h immediately force recompilation.
762b15be
EZ
17078 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17079 $(CURDIR)/s/ms-w32.h.
17080 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 17081
fa6996bc
EZ
17082 * character.c (Fchar_direction): Function deleted.
17083 (syms_of_character): Don't defsubr it.
17084 <char-direction-table>: Deleted.
17085
e6c3da20
EZ
170862011-04-23 Eli Zaretskii <eliz@gnu.org>
17087
17088 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17089 * doprnt.c: Include limits.h.
17090 (SIZE_MAX): New macro.
04f2d78b
CB
17091 (doprnt): Return a size_t value. 2nd arg is now size_t.
17092 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
17093 Improve overflow protection. Support `l' modifier for integer
17094 conversions. Support %l conversion. Don't assume an EMACS_INT
17095 argument for integer conversions and for %c.
17096
17097 * lisp.h (doprnt): Restore prototype.
17098
17099 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17100 $(SRC)/character.h.
17101
17102 * Makefile.in (base_obj): Add back doprnt.o.
17103
17104 * deps.mk (doprnt.o): Add back prerequisites.
17105 (callint.o): Depend on character.h.
17106
17107 * eval.c (internal_lisp_condition_case): Include the handler
17108 representation in the error message.
17109 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17110 when breaking from the loop.
17111
17112 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17113
17114 * callint.c (Fcall_interactively): When displaying error message
17115 about invalid control letter, pass the character's codepoint, not
17116 a pointer to its multibyte form. Improve display of the character
17117 in octal and display also its hex code.
17118
17119 * character.c (char_string): Use %x to display the (unsigned)
17120 codepoint of an invalid character, to avoid displaying a bogus
17121 negative value.
17122
17123 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17124 `error', not SYMBOL_NAME itself.
17125
17126 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17127 character arguments to `error'.
17128
17129 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17130 to `error' in error message about FINAL_CHAR argument. Make sure
17131 FINAL_CHAR is a character, and use %c when it is passed as
17132 argument to `error'.
17133
4ffd0d6b 171342011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
17135
17136 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17137
17138 * w32.c: Include <time.h>.
17139 (sys_localtime): New function.
17140
4ffd0d6b 171412011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
17142
17143 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17144
4ffd0d6b 17145 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 17146
4ffd0d6b 171472011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 17148
4ffd0d6b
GM
17149 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17150 zombies (Bug#8467).
aac0c6e3 17151
04c56954
EZ
171522011-04-19 Eli Zaretskii <eliz@gnu.org>
17153
17154 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17155 gl_state.e_property when gl_state.object is Qt.
17156
17157 * insdel.c (make_gap_larger): Remove limitation of buffer size
17158 to <= INT_MAX.
17159
16a43933
CY
171602011-04-18 Chong Yidong <cyd@stupidchicken.com>
17161
17162 * xdisp.c (lookup_glyphless_char_display)
17163 (produce_glyphless_glyph): Handle cons cell entry in
17164 glyphless-char-display.
17165 (Vglyphless_char_display): Document it.
17166
17167 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17168 glyphless-char-display.
17169
4581706e
CY
171702011-04-17 Chong Yidong <cyd@stupidchicken.com>
17171
17172 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17173
17174 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17175
17176 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17177 definition for no-X builds.
17178
4887c6e2 171792011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 17180
fd35b6f9
PE
17181 Static checks with GCC 4.6.0 and non-default toolkits.
17182
5c1ccb01
PE
17183 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17184
006c5daa
PE
17185 * process.c (keyboard_bit_set): Define only if SIGIO.
17186 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17187 (send_process): Repair possible setjmp clobbering.
17188
efc736d3
PE
17189 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17190
4e2fe2e6
PE
17191 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17192
f97334a2
PE
17193 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17194
4e75f29d
PE
17195 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17196 Define only if needed.
17197
90efadd1
PE
17198 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17199 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 17200 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 17201
3c647824
PE
17202 * dispextern.h (struct redisplay_interface): Rename param
17203 to avoid shadowing.
e264f262 17204 * termhooks.h (struct terminal): Likewise.
761383f4 17205 * xterm.c (xembed_send_message): Likewise.
3c647824 17206
b58c5c4a
PE
17207 * insdel.c (make_gap_smaller): Define only if
17208 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17209
cad59032
PE
17210 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17211 it.
17212
c339dc2e
PE
17213 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17214 so that we aren't warned about unused symbols.
17215
91a3e27b
PE
17216 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17217
399c71d3 17218 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 17219
8ffc96f5
PE
17220 * xfns.c (x_real_positions): Mark locals as initialized.
17221
eef9bc79
PE
17222 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17223
098db9dd
PE
17224 * xterm.c: Fix problems found by static analysis with other toolkits.
17225 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
17226 (x_dispatch_event): Declare static if USE_GTK, and
17227 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 17228 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 17229 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
17230 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17231 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 17232
eb18f6cc
PE
17233 * xmenu.c (menu_help_callback): Pointer type fixes.
17234 Use const pointers when pointing at readonly data. Avoid pointer
17235 signedness clashes.
17236 (FALSE): Remove unused macro.
17237 (update_frame_menubar): Remove unused decl.
17238
1fe72bf8
PE
17239 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17240
60d9e1db
PE
17241 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17242 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17243 (single_menu_item): Rename local to avoid shadowing.
17244
39261c26
PE
17245 * keyboard.c (make_lispy_event): Remove unused local var.
17246
018c5e19
PE
17247 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17248 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17249
63d2b86e
PE
17250 * bitmaps: Change bitmaps from unsigned char back to the X11
17251 compatible char. Avoid the old compiler warnings about
17252 out-of-range initializers by using, for example, '\xab' rather
17253 than 0xab.
17254
aefd87e1
PE
17255 * xgselect.c (xgselect_initialize): Check vs interface
17256 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17257
bf501fb9
PE
17258 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17259
e9829fdf
PE
17260 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17261 to read-only memory.
17262
1086c095
PE
17263 * fns.c (vector): Remove; this old hack is no longer needed.
17264
2baccd04 17265 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 17266 Remove unused var.
dde42981 17267 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 17268
72391843 17269 * xrdb.c (x_load_resources): Omit unused local.
3565b346 17270
436c16df 17271 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 17272 (x_window): Rename locals to avoid shadowing.
dc5ddd85 17273 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 17274
92bb796d 17275 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 17276 (x_term_init): Remove local to avoid shadowing.
92bb796d 17277
764430a3 17278 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
17279
17280 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17281 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17282
d1dfb56c
EZ
172832011-04-16 Eli Zaretskii <eliz@gnu.org>
17284
c4354cb4
EZ
17285 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17286
d1dfb56c
EZ
17287 Fix regex.c, syntax.c and friends for buffers > 2GB.
17288 * syntax.h (struct gl_state_s): Declare character position members
17289 EMACS_INT.
17290
17291 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17292
04f2d78b
CB
17293 * textprop.c (verify_interval_modification, interval_of):
17294 Declare arguments EMACS_INT.
d1dfb56c
EZ
17295
17296 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17297 EMACS_INT.
17298
17299 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17300
17301 * indent.c (Fvertical_motion): Local variable it_start is now
17302 EMACS_INT.
17303
17304 * regex.c (re_match, re_match_2, re_match_2_internal)
17305 (bcmp_translate, regcomp, regexec, print_double_string)
17306 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17307 (re_compile_pattern, re_exec): Declare arguments and local
17308 variables `size_t' and `ssize_t' and return values `regoff_t', as
17309 appropriate.
17310 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17311 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17312 <compile_stack_type>: `size' and `avail' are now `size_t'.
17313
17314 * regex.h <regoff_t>: Use ssize_t, not int.
17315 (re_search, re_search_2, re_match, re_match_2): Arguments that
17316 specify buffer/string position and length are now ssize_t and
17317 size_t. Return type is regoff_t.
17318
613052cd
BK
173192011-04-16 Ben Key <bkey76@gmail.com>
17320
17321 * nsfont.m: Fixed bugs in ns_get_family and
17322 ns_descriptor_to_entity that were caused by using free to
17323 deallocate memory blocks that were allocated by xmalloc (via
17324 xstrdup). This caused Emacs to crash when compiled with
17325 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17326 --enable-checking=xmallocoverrun). xfree is now used to
17327 deallocate these memory blocks.
17328
4170f62f 173292011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 17330
71b41406
PE
17331 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17332
9587a89d
PE
17333 emacs_write: Accept and return EMACS_INT for sizes.
17334 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17335 et seq.
17336 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17337 Accept and return EMACS_INT.
17338 (emacs_gnutls_write): Return the number of bytes written on
17339 partial writes.
17340 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
17341 (emacs_read, emacs_write): Remove check for negative size, as the
17342 Emacs source code has been audited now.
9587a89d
PE
17343 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17344 (emacs_read, emacs_write): Use it.
273a5f82
PE
17345 * process.c (send_process): Adjust to the new signatures of
17346 emacs_write and emacs_gnutls_write. Do not attempt to store
17347 a byte offset into an 'int'; it might overflow.
9587a89d 17348 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 17349
3e047f51
PE
17350 * sound.c: Don't assume sizes fit in 'int'.
17351 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 17352 Return EMACS_INT, not int.
3e047f51 17353 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
17354 Accept EMACS_INT, not int.
17355 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
17356 record read return values.
17357
cc39a9db
BK
173582011-04-15 Ben Key <bkey76@gmail.com>
17359
c9d0ec6d
JB
17360 * keyboard.c (Qundefined): Don't declare static since it is used
17361 in nsfns.m.
17362 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17363 static since they are used in nsfont.m.
cc39a9db 17364
6c60eb9f
SM
173652011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17366
17367 * process.c (Qprocessp): Don't declare static.
17368 * lisp.h (Qprocessp): Declare again.
17369
7990b61a
JB
173702011-04-15 Juanma Barranquero <lekktu@gmail.com>
17371
17372 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17373
5d4cb038
PE
173742011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17375
8bd7b830 17376 Improve C-level modularity by making more things 'static'.
cd64ea1d 17377
e3b27b31
PE
17378 Don't publish debugger-only interfaces to other modules.
17379 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17380 (verify_bytepos, count_markers): Move decls to the only modules
17381 that need them.
17382 * region-cache.h (pp_cache): Likewise.
17383 * window.h (check_all_windows): Likewise.
17384 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17385
5d4cb038
PE
17386 * sysdep.c (croak): Now static, if
17387 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17388 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
17389
17390 * alloc.c (refill_memory_reserve): Now static if
17391 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17392 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 17393
e87b6180
PE
17394 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17395 Define only if USE_LUCID.
17396
ac64929e
PE
17397 * xrdb.c (x_customization_string, x_rm_string): Now static.
17398
6f37259d
PE
17399 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17400 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17401
1683e3ab
PE
17402 * xdisp.c (draw_row_with_mouse_face): Now static.
17403 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17404
de9c2632
PE
17405 * window.h (check_all_windows): Mark externally visible.
17406
2b96acb7
PE
17407 * window.c (window_deletion_count): Now static.
17408
17409 * undo.c: Make symbols static if they're not exported.
17410 (last_undo_buffer, last_boundary_position, pending_boundary):
17411 Now static.
17412
50436f33
PE
17413 * textprop.c (interval_insert_behind_hooks): Now static.
17414 (interval_insert_in_front_hooks): Likewise.
17415
64520e5c
PE
17416 * term.c: Make symbols static if they're not exported.
17417 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17418 (max_frame_lines, tty_set_terminal_modes):
17419 (tty_reset_terminal_modes, tty_turn_off_highlight):
17420 (get_tty_terminal): Now static.
17421 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17422 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 17423 HAVE_WINDOW_SYSTEM.
64520e5c
PE
17424 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17425 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17426
1fa53021
PE
17427 * sysdep.c: Make symbols static if they're not exported.
17428 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17429 Now static.
17430 (sigprocmask_set, full_mask): Remove; unused.
17431 (wait_debugging): Mark as visible.
17432 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17433 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17434
d4b43b22
PE
17435 * syntax.c (syntax_temp): Define only if !__GNUC__.
17436
b7c513d0
PE
17437 * sound.c (current_sound_device, current_sound): Now static.
17438
989b29ad
PE
17439 * search.c (searchbufs, searchbuf_head): Now static.
17440
13a55a78
PE
17441 * scroll.c (scroll_cost): Remove; unused.
17442 * dispextern.h (scroll_cost): Remove decl.
17443
de68a1fc
PE
17444 * region-cache.h (pp_cache): Mark as externally visible.
17445
40ccffa6
PE
17446 * process.c: Make symbols static if they're not exported.
17447 (process_tick, update_tick, create_process, chan_process):
17448 (Vprocess_alist, proc_buffered_char, datagram_access):
17449 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17450 (deactivate_process): Mark defn as static, as well as decl.
17451 * lisp.h (create_process): Remove decl.
17452 * process.h (chan_process, Vprocess_alist): Remove decls.
17453
ad64fc97
PE
17454 * print.c: Make symbols static if they're not exported.
17455 (print_depth, new_backquote_output, being_printed, print_buffer):
17456 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17457 (print_interval, print_number_index, initial_stderr_stream):
17458 Now static.
17459 * lisp.h (Fprinc): Remove decl.
17460 (debug_output_compilation_hack): Mark as externally visible.
17461
adddb265
PE
17462 * sysdep.c (croak): Move decl from here to syssignal.h.
17463 * syssignal.h (croak): Put it here, so the API can be checked when
17464 'croak' is called from dissociate_if_controlling_tty.
17465
1717ede2
PE
17466 * minibuf.c: Make symbols static if they're not exported.
17467 (minibuf_save_list, choose_minibuf_frame): Now static.
17468 * lisp.h (choose_minibuf_frame): Remove decl.
17469
fa5fb2bc
PE
17470 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17471
1e3890d1
PE
17472 * lread.c: Make symbols static if they're not exported.
17473 (read_objects, initial_obarray, oblookup_last_bucket_number):
17474 Now static.
17475 (make_symbol): Remove; unused.
17476 * lisp.h (initial_obarray, make_symbol): Remove decls.
17477
8a1414fa
PE
17478 * keyboard.c: Make symbols static if they're not exported.
17479 (single_kboard, recent_keys_index, total_keys, recent_keys):
17480 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17481 (this_single_command_key_start, echoing, last_auto_save):
17482 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17483 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17484 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17485 (Vlispy_mouse_stem, double_click_count):
17486 Now static.
17487 (force_auto_save_soon): Define only if SIGDANGER.
17488 (ignore_mouse_drag_p): Now static if
17489 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17490 (print_help): Remove; unused.
17491 (stop_character, last_timer_event): Mark as externally visible.
17492 * keyboard.h (ignore_mouse_drag_p): Declare only if
17493 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17494 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17495 * lisp.h (echoing): Remove decl.
17496 (force_auto_save_soon): Declare only if SIGDANGER.
17497 * xdisp.c (redisplay_window): Simplify code, to make it more
17498 obvious that ignore_mouse_drag_p is not accessed if !defined
17499 USE_GTK && !defined HAVE_NS.
17500
93ea6e8f
PE
17501 * intervals.c: Make symbols static if they're not exported.
17502 (merge_properties_sticky, merge_interval_right, delete_interval):
17503 Now static.
17504 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17505
77382fcc
PE
17506 * insdel.c: Make symbols static if they're not exported.
17507 However, leave prepare_to_modify_buffer alone. It's never
17508 called from outside this function, but that appears to be a bug.
17509 (combine_after_change_list, combine_after_change_buffer):
4889fc82 17510 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
17511 (adjust_after_replace_noundo): Remove; unused.
17512 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 17513 (signal_before_change): Remove decls.
77382fcc 17514
9306c32e
PE
17515 * indent.c (val_compute_motion, val_vmotion): Now static.
17516
cd44d2eb
PE
17517 * image.c: Make symbols static if they're not exported.
17518 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17519 if USE_GTK.
17520 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17521 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17522
ad9a7a06
PE
17523 * fringe.c (standard_bitmaps): Now static.
17524 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17525
81626931
PE
17526 * frame.c: Make symbols static if they're not exported.
17527 (x_report_frame_params, make_terminal_frame): Now static.
17528 (get_frame_param): Now static, unless HAVE_NS.
17529 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17530 (x_get_resource_string): Remove; not used.
17531 * frame.h (make_terminal_frame, x_report_frame_params):
17532 (x_get_resource_string); Remove decls.
17533 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17534 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17535
239f9db9
PE
17536 * font.c, fontset.c: Make symbols static if they're not exported.
17537 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17538 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17539 * font.c (font_close_object): Now static.
17540 * font.h (font_close_object): Remove.
17541 * fontset.c (FONTSET_OBJLIST): Remove.
17542 (free_realized_fontset) #if-0 the body, which does nothing.
17543 (face_suitable_for_char_p): #if-0, as it's never called.
17544 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
17545 * xfaces.c (face_at_string_position):
17546 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
17547 since 0 is always ASCII.
17548
dfcf3579
PE
17549 * fns.c (weak_hash_tables): Now static.
17550
5045092b
PE
17551 * fileio.c: Make symbols static if they're not exported.
17552 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17553 (Vwrite_region_annotation_buffers): Now static.
17554
57a96f5c
PE
17555 * eval.c: Make symbols static if they're not exported.
17556 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17557 * lisp.h (backtrace_list): Remove decl.
17558
35f08c38
PE
17559 * emacs.c: Make symbols static if they're not exported.
17560 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17561 (fatal_error_code, fatal_error_signal_hook, standard_args):
17562 Now static.
17563 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17564 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17565 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17566 * lisp.h (fatal_error_signal_hook): Remove decl.
17567 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17568
f44bd759
PE
17569 * editfns.c: Move a (normally-unused) function to its only use.
17570 * editfns.c, lisp.h (get_operating_system_release): Remove.
17571 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17572 worth the hassle of breaking this out.
17573
b532497d
PE
17574 * xterm.c: Make symbols static if they're not exported.
17575 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17576 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17577 (x_destroy_window, x_delete_display):
17578 Now static.
17579 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17580 (x_mouse_leave): Remove; unused.
17581 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17582 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17583 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17584 Remove decls.
17585 (x_mouse_leave): Declare only if WINDOWSNT.
17586 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17587 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17588 USE_X_TOOLKIT.
17589
1675728f
PE
17590 * ftxfont.c: Make symbols static if they're not exported.
17591 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17592 HAVE_FREETYPE.
17593 * font.h (ftxfont_driver): Likewise.
17594
e4cebfca
PE
17595 * xfns.c: Make symbols static if they're not exported.
17596 (x_last_font_name, x_display_info_for_name):
17597 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17598 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17599 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17600 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17601 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17602 (last_show_tip_args): Now static.
17603 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17604 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17605 (x_screen_planes): Remove; unused.
17606 * dispextern.h (x_screen_planes): Remove decl.
17607
5bf46f05
PE
17608 * dispnew.c: Make symbols static if they're not exported.
17609 * dispextern.h (redraw_garbaged_frames, scrolling):
17610 (increment_row_positions): Remove.
17611 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17612 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17613 Now static.
17614 (redraw_garbaged_frames): Remove; unused.
17615
435f4c28
PE
17616 * xfaces.c: Make symbols static if they're not exported.
17617 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17618 Remove decls.
17619 * xterm.h (defined_color): Remove decls.
17620 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17621 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17622 (menu_face_changed_default, defined_color, free_realized_face):
17623 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17624 (ascii_face_of_lisp_face): Remove; unused.
17625
8524aef3
PE
17626 * xdisp.c: Make symbols static if they're not exported.
17627 * dispextern.h (scratch_glyph_row, window_box_edges):
17628 (glyph_to_pixel_coords, set_cursor_from_row):
17629 (get_next_display_element, set_iterator_to_next):
17630 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17631 (show_mouse_face): Remove decls
17632 * frame.h (message_buf_print): Likewise.
17633 * lisp.h (pop_message, set_message, check_point_in_composition):
17634 Likewise.
17635 * xterm.h (set_vertical_scroll_bar): Likewise.
17636 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17637 (message_buf_print, scratch_glyph_row, displayed_buffer):
17638 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17639 (get_next_display_element, show_mouse_face, window_box_edges):
17640 (frame_to_window_pixel_xy, check_point_in_composition):
17641 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17642 (glyph_to_pixel_coords): Remove; unused.
17643
16390cd2
PE
17644 * dired.c (file_name_completion): Now static.
17645
17646 * dbusbind.c (xd_in_read_queued_messages): Now static.
17647
a25f4dfa
PE
17648 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17649 * data.c (circular_list_error): Remove.
17650
14a9c8df
PE
17651 * commands.h (last_point_position, last_point_position_buffer):
17652 (last_point_position_window): Remove decls.
17653 * keyboard.c: Make these variables static.
17654
04f2d78b
CB
17655 * coding.h (coding, code_convert_region, encode_coding_gap):
17656 Remove decls.
74ab6df5
PE
17657 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17658 (iso_code_class, detect_coding, code_convert_region): Now static.
17659 (encode_coding_gap): Remove; unused.
17660
38dfbee1
PE
17661 * chartab.c (chartab_chars, chartab_bits): Now static.
17662
a2cb4e63
PE
17663 * charset.h (charset_iso_8859_1): Remove decl.
17664 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17665 Now static.
17666
127198fd
PE
17667 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17668 * ccl.c (Vccl_program_table): Now static.
17669 (check_ccl_update): Remove; unused.
17670
d85b608f
PE
17671 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17672 * category.h: ... from here.
17673 * category.c (check_category_table, set_category_set): Now static.
17674
31cd66f3
PE
17675 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17676 * lisp.h: Remove these decls.
17677
c358e587
PE
17678 * buffer.c (buffer_count): Remove unused var.
17679
e78aecca
PE
17680 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17681 so that it's not optimized away.
17682 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17683 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17684 exported only to the debugger.
17685
e192d7d3 17686 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 17687 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 17688
92470028
PE
17689 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17690 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17691 was inaccessible from Lisp.
17692 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17693 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17694
244ed907
PE
17695 alloc.c: Import and export fewer symbols, and remove unused items.
17696 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17697 is defined.
17698 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17699 it's not optimized away by whole-program optimization.
17700 (message_enable_multibyte, free_misc): Remove.
17701 (catchlist, handlerlist, mark_backtrace):
17702 Declare only if BYTE_MARK_STACK.
17703 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17704 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17705 (message_enable_multibyte): Remove decl.
17706 (free_misc, interval_free_list, float_block, float_block_index):
17707 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17708 (cons_free_list, last_marked_index):
17709 Now static.
17710 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17711 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17712 (mark_backtrace): Define only if BYTE_MARK_STACK.
17713 * xdisp.c (message_enable_multibyte): Now static.
17714
61c2b50e 17715 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
17716 This makes it easier for human readers (and static analyzers)
17717 to see whether these variables are used from other modules.
17718 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17719 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17720 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17721 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17722 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17723 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17724 * xmenu.c, xselect.c:
17725 Declare Q* vars static if they are not used in other modules.
17726 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17727 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17728 Remove decls of unexported vars.
17729 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17730
95c82688
PE
17731 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17732
16a97296
PE
17733 Make Emacs functions such as Fatom 'static' by default.
17734 This makes it easier for human readers (and static analyzers)
17735 to see whether these functions can be called from other modules.
17736 DEFUN now defines a static function. To make the function external
17737 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
17738 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17739 (Finit_image_library):
16a97296
PE
17740 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17741 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17742 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17743 Remove decls, since these functions are now static.
17744 (Funintern, Fget_internal_run_time): New decls, since these functions
17745 were already external.
95c82688 17746
16a97296
PE
17747 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17748 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17749 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17750 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17751 * keyboard.c, keymap.c, lread.c:
17752 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17753 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17754 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17755 Mark functions with DEFUE instead of DEFUN,
17756 if they are used in other modules.
17757 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17758 decls for now-static functions.
17759 * buffer.h (Fdelete_overlay): Remove decl.
17760 * callproc.c (Fgetenv_internal): Mark as internal.
17761 * composite.c (Fremove_list_of_text_properties): Remove decl.
17762 (Fcomposition_get_gstring): New forward static decl.
17763 * composite.h (Fcomposite_get_gstring): Remove decl.
17764 * dired.c (Ffile_attributes): New forward static decl.
17765 * doc.c (Fdocumntation_property): New forward static decl.
17766 * eval.c (Ffetch_bytecode): New forward static decl.
17767 (Funintern): Remove extern decl; now in .h file where it belongs.
17768 * fileio.c (Fmake_symbolic_link): New forward static decl.
17769 * image.c (Finit_image_library): New forward static decl.
17770 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17771 * intervals.h (Fprevious_property_change):
17772 (Fremove_list_of_text_properties): Remove decls.
17773 * keyboard.c (Fthis_command_keys): Remove decl.
17774 (Fcommand_execute): New forward static decl.
17775 * keymap.c (Flookup_key): New forward static decl.
17776 (Fcopy_keymap): Now static.
17777 * keymap.h (Flookup_key): Remove decl.
17778 * process.c (Fget_process): New forward static decl.
17779 (Fprocess_datagram_address): Mark as internal.
17780 * syntax.c (Fsyntax_table_p): New forward static decl.
17781 (skip_chars): Remove duplicate decl.
17782 * textprop.c (Fprevious_property_change): New forward static decl.
17783 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17784 Now internal.
17785 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17786 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17787
785bbd42
PE
17788 * editfns.c (Fformat): Remove unreachable code.
17789
8b913b57
AS
177902011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17791
17792 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17793 change. (Bug#8496)
17794
a6744a35
EZ
177952011-04-13 Eli Zaretskii <eliz@gnu.org>
17796
17797 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17798 when at ZV. (Bug#8487)
17799
e7974947
AS
178002011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17801
baad03f0
AS
17802 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17803 (Bug#8437)
17804 * keyboard.c (parse_tool_bar_item): Likewise.
17805 * sound.c (sound_cleanup, alsa_close): Likewise.
17806 * termcap.c (tgetent): Likewise.
17807 * xfns.c (x_default_font_parameter): Likewise.
17808 * xsettings.c (read_and_apply_settings): Likewise.
17809
e7974947
AS
17810 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17811 (overrun_check_free): Protoize.
17812
28272684
PE
178132011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17814
17815 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17816 since callers should never pass a negative size.
17817 Change the signature to match that of plain 'read' and 'write'; see
17818 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17819 * lisp.h: Update prototypes of emacs_write and emacs_read.
17820
11997c76
EZ
178212011-04-11 Eli Zaretskii <eliz@gnu.org>
17822
17823 * xdisp.c (redisplay_window): Don't try to determine the character
17824 position of the scroll margin if the window start point w->startp
e896f03c 17825 is outside the buffer's accessible region. (Bug#8468)
11997c76 17826
8a2cbd72
EZ
178272011-04-10 Eli Zaretskii <eliz@gnu.org>
17828
17829 Fix write-region and its subroutines for buffers > 2GB.
17830 * fileio.c (a_write, e_write): Modify declaration of arguments and
17831 local variables to support buffers larger than 2GB.
17832 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17833
17834 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17835 argument, local variables, and return value.
17836
17837 * lisp.h: Update prototypes of emacs_write and emacs_read.
17838
17839 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17840
4073e537 178412011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 17842
1ebfdcb6
PE
17843 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17844
b2ded58d
PE
17845 Fix more problems found by GCC 4.6.0's static checks.
17846
7d66342c
PE
17847 * xdisp.c (vmessage): Use a better test for character truncation.
17848
bbf47d44
PE
17849 * charset.c (load_charset_map): <, not <=, for optimization,
17850 and to avoid potential problems with integer overflow.
9248994d 17851 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 17852 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 17853 * editfns.c (Fformat): Likewise.
1e69125e 17854 * syntax.c (skip_chars): Likewise.
3befa583 17855
e3019616
PE
17856 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17857 This also lets GCC 4.6.0 generate slightly better loop code.
17858
becfa255
PE
17859 * callint.c (Fcall_interactively): <, not <=, for optimization.
17860 (Fcall_interactively): Count the number of arguments produced,
17861 not the number of arguments given. This is simpler and lets GCC
17862 4.6.0 generate slightly better code.
17863
dae0cd48
PE
17864 * ftfont.c: Distingish more carefully between FcChar8 and char.
17865 The previous code passed unsigned char * to a functions like
17866 strlen and xstrcasecmp that expect char *, which does not
17867 conform to the C standard.
17868 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17869 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17870 char * when the C standard requires it.
17871
76032d70
PE
17872 * keyboard.c (read_char): Remove unused var.
17873
eb3f1cc8
PE
17874 * eval.c: Port to Windows vsnprintf (Bug#8435).
17875 Include <limits.h>.
17876 (SIZE_MAX): Define if the headers do not.
17877 (verror): Do not give up if vsnprintf returns a negative count.
17878 Instead, grow the buffer. This ports to Windows vsnprintf, which
17879 does not conform to C99. Problem reported by Eli Zaretskii.
17880 Also, simplify the allocation scheme, by avoiding the need for
17881 calling realloc, and removing the ALLOCATED variable.
17882
70476b54
PE
17883 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17884
12020a9e
PE
17885 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17886 But keep the doprint source code for now, as we might revamp it
17887 and use it again (Bug#8435).
ea6c7ae6
PE
17888 * lisp.h (doprnt): Remove.
17889 * Makefile.in (base_obj): Remove doprnt.o.
17890 * deps.mk (doprnt.o): Remove.
17891
5fdb398c
PE
17892 error: Print 32- and 64-bit integers portably (Bug#8435).
17893 Without this change, on typical 64-bit hosts error ("...%d...", N)
17894 was used to print both 32- and 64-bit integers N, which relied on
17895 undefined behavior.
61bdb816 17896 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
17897 * lisp.h (error, verror): Mark as printf-like functions.
17898 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17899 Report overflow in size calculations when allocating printf buffer.
17900 Do not truncate output string at its first null byte.
17901 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17902 Truncate the output at a character boundary, since vsnprintf does not
17903 do that.
17904 * charset.c (check_iso_charset_parameter): Convert internal
17905 character to string before calling 'error', since %c now has the
17906 printf meaning.
17907 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17908 overflow when computing char to be passed to 'error'. Do not
17909 pass Lisp_Object to 'error'; pass the integer instead.
17910 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17911 formatted with plain %d.
17912
b189fa66
PE
17913 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17914
bff87ef0
PE
17915 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17916
7e2cac20
PE
17917 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17918
ce4d90b5
PE
17919 * xterm.c (x_catch_errors): Remove duplicate declaration.
17920
266c9547
PE
17921 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17922
79c49ad2
PE
17923 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17924
368f4090
JM
179252011-04-10 Jim Meyering <meyering@redhat.com>
17926
17927 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17928 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17929 return ssize_t not "int", and use size_t as the buffer length.
17930 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17931 * gnutls.h: Update declarations.
17932 * process.c (read_process_output): Use ssize_t, to match.
17933 (send_process): Likewise.
17934
a32d4040
CY
179352011-04-09 Chong Yidong <cyd@stupidchicken.com>
17936
17937 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17938
8546720e 179392011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 17940
04f2d78b
CB
17941 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17942 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 17943
8546720e
GM
17944 * xterm.c (handle_one_xevent):
17945 * xmenu.c (create_and_show_popup_menu):
17946 * xselect.c (x_decline_selection_request)
17947 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 17948
0a2f5c1a 179492011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
17950
17951 Fix some uses of `int' instead of EMACS_INT.
17952 * search.c (string_match_1, fast_string_match)
17953 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17954 (scan_buffer, find_next_newline_no_quit)
17955 (find_before_next_newline, search_command, Freplace_match)
17956 (Fmatch_data): Make some `int' variables be EMACS_INT.
17957
17958 * xdisp.c (display_count_lines): 3rd argument and return value now
17959 EMACS_INT. All callers changed.
17960 (pint2hrstr): Last argument is now EMACS_INT.
17961
17962 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17963 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17964 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17965 (decode_coding_utf_16, decode_coding_emacs_mule)
17966 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17967 (decode_coding_ccl, decode_coding_charset)
17968 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17969 (decode_coding_iso_2022, decode_coding_emacs_mule)
17970 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17971 <char_offset, last_offset>: Declare EMACS_INT.
17972 (encode_coding_utf_8, encode_coding_utf_16)
17973 (encode_coding_emacs_mule, encode_invocation_designation)
17974 (encode_designation_at_bol, encode_coding_iso_2022)
17975 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17976 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17977 Declare EMACS_INT.
17978 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17979 (encode_invocation_designation): Last argument P_NCHARS is now
17980 EMACS_INT.
17981 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17982 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17983
17984 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17985 All users changed.
17986
17987 * ccl.c (Fccl_execute_on_string): Declare some variables
17988 EMACS_INT.
17989
8546720e 179902011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
17991
17992 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17993
4e19a977
CS
179942011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17995
17996 * process.c (Fformat_network_address): Doc fix.
17997
87302331
R
179982011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17999
ee7683eb 18000 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 18001
cbb59342
CY
180022011-04-08 Chong Yidong <cyd@stupidchicken.com>
18003
18004 * keyboard.c (read_char): Call Lisp function help-form-show,
18005 instead of using internal_with_output_to_temp_buffer.
18006 (Qhelp_form_show): New var.
e0d38eeb 18007 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
18008
18009 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18010
18011 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18012
e67a13ab
CY
180132011-04-06 Chong Yidong <cyd@stupidchicken.com>
18014
04f2d78b
CB
18015 * process.c (Flist_processes): Remove to Lisp.
18016 (list_processes_1): Delete.
e67a13ab 18017
973f782d
EZ
180182011-04-06 Eli Zaretskii <eliz@gnu.org>
18019
7c106b1e
EZ
18020 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18021
973f782d
EZ
18022 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18023
41cf7d1a 180242011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 18025
ca23cc88
PE
18026 Fix more problems found by GCC 4.6.0's static checks.
18027
f390e2d5
PE
18028 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18029
42eea0d0
PE
18030 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18031
b69769da 18032 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 18033
f9541e84
PE
18034 * xdisp.c (vmessage): Mark as a printf-like function.
18035
13841b55
PE
18036 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18037
c136c10f
PE
18038 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18039
5e2d4a30
PE
18040 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18041 printf-like functions.
18042 (tiff_load): Add casts to remove these marks before passing them
18043 to system-supplied API.
18044
583f48b9
PE
18045 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18046
b25d760e
PE
18047 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18048 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
18049 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18050 directly, rather than having caller test rule sign. This avoids
18051 some unnecessary tests.
18052 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18053 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18054 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 18055
bc7b6697 18056 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 18057 (xfont_open): Avoid unnecessary tests.
bc7b6697 18058
27ccc379
PE
18059 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18060
dcd5c89a
PE
18061 * composite.h, composite.c (composition_gstring_put_cache):
18062 Use EMACS_INT, not int, for length.
18063
b13a45c6
PE
18064 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18065 breaking out part of COMPOSITION_DECODE_RULE.
18066 (COMPOSITION_DECODE_RULE): Use it.
18067 * composite.c (get_composition_id): Remove unused local vars,
18068 by using the new macro.
18069
1e792e4d
PE
18070 * textprop.c (set_text_properties_1): Change while to do-while,
18071 since the condition is always true at first.
18072
dc6c6455 18073 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
18074 (interval_deletion_adjustment): Return unsigned value.
18075 All uses changed.
dc6c6455 18076
aba7731a
PE
18077 * process.c (list_processes_1, create_pty, read_process_output):
18078 (exec_sentinel): Remove vars that were set but not used.
afd4052b 18079 (create_pty): Remove unnecessary "volatile"s.
bc57d757 18080 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 18081 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 18082 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 18083
fdfc4bf3
PE
18084 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18085
fca8fe46 18086 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 18087 (update_syntax_table): Use unsigned instead of int.
fca8fe46 18088
06a0259a 18089 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 18090 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 18091 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 18092
e7b9e80f
PE
18093 * print.c (print_error_message): Avoid int overflow.
18094
56201685
PE
18095 * font.c (font_list_entities): Redo for clarity,
18096 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18097
78834453 18098 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 18099 (font_score): Avoid potential overflow in diff calculation.
78834453 18100
0bc0b309 18101 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 18102 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 18103
e610eaca
PE
18104 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18105
b895abce
PE
18106 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18107 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18108 can always succeed if overflow has undefined behavior.
18109
1f1d9321 18110 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 18111 (wordify): Omit three unnecessary tests.
1f1d9321 18112
c59478bc
PE
18113 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18114 All callers changed. This avoids the need for an unused var.
18115
79b73827
PE
18116 * casefiddle.c (casify_region): Remove var that is set but not used.
18117
a4db5dfe
PE
18118 * dired.c (file_name_completion): Remove var that is set but not used.
18119
43aae36e
PE
18120 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18121
2a47c44d 18122 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 18123 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 18124
a37c69bf
PE
18125 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18126 Check for integer overflow on size calculations.
18127
328ab8e7
PE
18128 * buffer.c (Fprevious_overlay_change): Remove var that is set
18129 but not used.
18130
e5a2a5cb
PE
18131 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18132 Remove vars that are set but not used.
8d84a6eb 18133 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 18134 (timer_check_2): Mark vars as initialized.
e5a2a5cb 18135
a60e5f68
PE
18136 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18137
f661cb61 18138 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 18139 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 18140
f0397f5a
PE
18141 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18142 that are set but not used.
18143
8664db06 18144 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 18145 if XCreateBitmapFromData fails (Bug#8410).
8664db06 18146
6abdaa4a
PE
18147 * xselect.c (x_get_local_selection, x_handle_property_notify):
18148 Remove vars that are set but not used.
18149
0ce7538d 18150 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 18151 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 18152
9ae848fc
PE
18153 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18154 Remove var that is set but not used.
0b918413
PE
18155 (scroll_bar_windows_size): Now size_t, not int.
18156 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18157 Check for overflow.
9ae848fc 18158
a5a62657
PE
18159 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18160 (map_tty_color) [!defined MSDOS]: Likewise.
18161
5c5cdd39
PE
18162 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18163
66ebf983
PE
18164 * coding.c: Remove vars that are set but not used.
18165 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18166 All callers changed.
18167 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18168 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18169 (decode_coding_charset): Remove vars that are set but not used.
18170
1be4d761
PE
18171 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18172 that is set but not used.
18173
47553fa8
PE
18174 * print.c (print_object): Remove var that is set but not used.
18175
1f7196bf 18176 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
18177 The gnulib version avoids calling malloc in the usual case,
18178 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18179 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18180 * filelock.c (current_lock_owner): Likewise.
18181 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18182 * sysdep.c: Include allocator.h, careadlinkat.h.
18183 (emacs_no_realloc_allocator): New static constant.
18184 (emacs_readlink): New function.
fdb61804
PE
18185 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18186 ../lib/careadlinkat.h.
d1fdcab7 18187
f84c17c7
SM
181882011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18189
18190 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18191 first non-nil return value).
18192
ef3862ad
JD
181932011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18194
18195 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18196 if not defined (Bug#8403).
18197
376a7006
JB
181982011-04-02 Juanma Barranquero <lekktu@gmail.com>
18199
18200 * xdisp.c (display_count_lines): Remove parameter `start',
18201 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18202 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18203 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18204 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18205 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18206 and thereabouts. All callers changed.
18207 (get_per_char_metric): Remove parameter `f', unused since
18208 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18209
6ca3801d
JM
182102011-04-02 Jim Meyering <meyering@redhat.com>
18211
18212 do not dereference NULL upon failed strdup
18213 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18214 (ns_get_family): Likewise.
18215
d8e2b5ba
JB
182162011-04-02 Juanma Barranquero <lekktu@gmail.com>
18217
18218 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18219
8c74fcbd
JD
182202011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18221
18222 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18223 later (Bug#8403).
18224
7200d79c
SM
182252011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18226
03408648 18227 Add lexical binding.
7200d79c 18228
03408648
SM
18229 * window.c (Ftemp_output_buffer_show): New fun.
18230 (Fsave_window_excursion):
18231 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18232
18233 * lread.c (lisp_file_lexically_bound_p): New function.
18234 (Fload): Bind Qlexical_binding.
18235 (readevalloop): Remove `evalfun' arg.
18236 Bind Qinternal_interpreter_environment.
18237 (Feval_buffer): Bind Qlexical_binding.
18238 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18239 Mark as dynamic.
18240 (syms_of_lread): Declare `lexical-binding'.
18241
18242 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18243
18244 * keyboard.c (eval_dyn): New fun.
18245 (menu_item_eval_property): Use it.
ca105506
SM
18246
18247 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 18248
03408648
SM
18249 * fns.c (concat, mapcar1): Accept byte-code-functions.
18250
18251 * eval.c (Fsetq): Handle lexical vars.
18252 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18253 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18254 (FletX, Flet): Obey lexical binding.
18255 (Fcommandp): Handle closures.
18256 (Feval): New `lexical' arg.
18257 (eval_sub): New function extracted from Feval. Use it almost
18258 everywhere where Feval was used. Look up vars in lexical env.
18259 Handle closures.
18260 (Ffunctionp): Move from subr.el.
18261 (Ffuncall): Handle closures.
18262 (apply_lambda): Remove `eval_flags'.
18263 (funcall_lambda): Handle closures and new byte-code-functions.
18264 (Fspecial_variable_p): New function.
18265 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18266 but without exporting it to Lisp.
23aba0ea 18267
23aba0ea 18268 * doc.c (Fdocumentation, store_function_docstring):
03408648 18269 * data.c (Finteractive_form): Handle closures.
23aba0ea 18270
03408648
SM
18271 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18272 interactive spec.
ba83908c 18273
04f2d78b
CB
18274 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18275 New byte-codes.
03408648
SM
18276 (exec_byte_code): New function extracted from Fbyte_code to handle new
18277 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 18278
03408648 18279 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 18280
03408648 18281 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 18282
e2abce01
JB
182832011-03-31 Juanma Barranquero <lekktu@gmail.com>
18284
18285 * xdisp.c (redisplay_internal): Fix prototype.
18286
63696a73 182872011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 18288
63696a73 18289 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
18290 (try_scrolling): Use it when setting scroll_limit.
18291 Limit scrolling to 100 screen lines.
63696a73
EZ
18292 (redisplay_window): Even when falling back on "recentering",
18293 position point in the window according to scroll-conservatively,
18294 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18295
18296 (try_scrolling): When point is above the window, allow searching
18297 as far as scroll_max, or one screenful, to compute vertical
18298 distance from PT to the scroll margin position. This prevents
18299 try_scrolling from unnecessarily failing when
18300 scroll-conservatively is set to a value slightly larger than the
18301 window height. Clean up the case of PT below the margin at bottom
18302 of window: scroll_max can no longer be INT_MAX. When aggressive
18303 scrolling is in use, don't let point enter the opposite scroll
18304 margin as result of the scroll.
18305 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
18306 threshold of 100 lines for never-recentering scrolling.
18307
e4cc2dfc
JB
183082011-03-31 Juanma Barranquero <lekktu@gmail.com>
18309
18310 * dispextern.h (move_it_by_lines):
18311 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18312 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18313 (message_log_check_duplicate): Remove parameters `prev_bol' and
18314 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18315 (redisplay_internal): Remove parameter `preserve_echo_area',
18316 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18317
18318 * indent.c (Fvertical_motion):
18319 * window.c (window_scroll_pixel_based, Frecenter):
18320 Don't pass `need_y_p' to `move_it_by_lines'.
18321
1c470562
SM
183222011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18323
44f230aa
SM
18324 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18325 steal a few bits to be more compact.
18326 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18327 Remove unneeded casts.
18328
1c470562
SM
18329 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18330
888adce9
ZK
183312011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18332
18333 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18334 binding" message (bug#7967).
18335
f838ed7b
PE
183362011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18337
77861b95
PE
18338 Fix more problems found by GCC 4.6.0's static checks.
18339
de6dbc14
PE
18340 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18341 Remove unused local var.
18342
f838ed7b
PE
18343 * editfns.c (Fmessage_box): Remove unused local var.
18344
792c7b2b
PE
18345 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18346 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18347 Omit unused local vars.
c499e557 18348 * window.c (shrink_windows): Omit unused local var.
b01a1c29 18349 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
18350 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18351 Omit unused local var.
18352
ba0165e1
PE
18353 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18354 Don't assume string length fits in int.
32ad8845 18355 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 18356 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 18357
3c59b4c9
PE
18358 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18359 instead of alloca (Bug#8344).
18360
a3eed478 18361 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 18362 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 18363
eb4d412d
PE
18364 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18365
1658b401
PE
18366 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18367 concerns.
18368
18369 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18370
18371 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 18372
9a2c6e05
PE
18373 * keyboard.c (syms_of_keyboard): Use the same style as later
18374 in this function when indexing through an array. This also
18375 works around GCC bug 48267.
18376
03d0a109
PE
18377 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18378
44f730c8
PE
18379 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18380
fe75f926
PE
18381 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18382 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18383
ffa8c828
PE
18384 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18385 This avoids undefined behavior on integer overflow, and is a bit
18386 more convenient anyway since it is compared to a size_t variable.
18387
c5101a77
PE
18388 Variadic C functions now count arguments with size_t, not int.
18389 This avoids an unnecessary limitation on 64-bit machines, which
18390 caused (substring ...) to crash on large vectors (Bug#8344).
18391 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18392 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 18393 All variadic functions and their callers changed accordingly.
c5101a77
PE
18394 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18395 * data.c (arith_driver, float_arith_driver): Likewise.
18396 * editfns.c (general_insert_function): Likewise.
18397 * eval.c (struct backtrace.nargs, interactive_p)
18398 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18399 (funcall_lambda, mark_backtrace): Likewise.
18400 * fns.c (concat): Likewise.
18401 * frame.c (x_set_frame_parameters): Likewise.
18402 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18403 0 if not found, not -1. All callers changed.
18404
dd3f25f7
PE
18405 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18406 (stack_copy_size): Now size_t, not int.
18407 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18408
461c2ab9
JB
184092011-03-28 Juanma Barranquero <lekktu@gmail.com>
18410
18411 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18412 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18413 All callers changed.
18414
18415 * lisp.h (multibyte_char_to_unibyte):
18416 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18417 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18418 * character.h (CHAR_TO_BYTE8):
18419 * cmds.c (internal_self_insert):
18420 * editfns.c (general_insert_function):
18421 * keymap.c (push_key_description):
18422 * search.c (Freplace_match):
18423 * xdisp.c (message_dolog, set_message_1): All callers changed.
18424
f6d62986
SM
184252011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18426
18427 * keyboard.c (safe_run_hook_funcall): New function.
18428 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18429 don't set the hook to nil, but remove the offending function instead.
18430 (Qcommand_hook_internal): Remove, unused.
18431 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18432 Vcommand_hook_internal.
18433
18434 * eval.c (enum run_hooks_condition): Remove.
18435 (funcall_nil, funcall_not): New functions.
18436 (run_hook_with_args): Call each function through a `funcall' argument.
18437 Remove `cond' argument, now redundant.
18438 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18439 (Frun_hook_with_args_until_failure): Adjust accordingly.
18440 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18441
1db5b1ad
JB
184422011-03-28 Juanma Barranquero <lekktu@gmail.com>
18443
18444 * dispextern.h (string_buffer_position): Remove declaration.
18445
18446 * print.c (strout): Remove parameter `multibyte', unused since
18447 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18448
18449 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18450 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18451 All callers changed.
18452
18453 * w32.c (_wsa_errlist): Use braces for struct initializers.
18454
18455 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18456 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18457 All callers changed.
18458 (string_buffer_position): Likewise. Also, make static (it's never
18459 used outside xdisp.c).
18460 (cursor_row_p): Remove parameter `w', unused since
18461 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18462 (decode_mode_spec): Remove parameter `precision', introduced during
18463 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18464 All callers changed.
18465
5ffb62aa
JD
184662011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18467
18468 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18469
461c2ab9 184702011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
18471
18472 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18473 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18474 (ns_update_auto_hide_menu_bar): New functions.
18475 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18476 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18477 ns_constrain_all_frames.
18478 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18479 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18480
5c380ffb
JD
184812011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18482
18483 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18484
9af30bdf
GM
184852011-03-27 Glenn Morris <rgm@gnu.org>
18486
18487 * syssignal.h: Replace RETSIGTYPE with void.
18488 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18489 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18490 Replace SIGTYPE with void everywhere.
18491 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18492 * s/template.h (SIGTYPE): Remove commented out definition.
18493
e2abce01
JB
184942011-03-26 Eli Zaretskii <eliz@gnu.org>
18495
18496 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18497 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18498
f868cd8a
JB
184992011-03-26 Juanma Barranquero <lekktu@gmail.com>
18500
59eb0929
JB
18501 * w32.c (read_unc_volume): Use parameter `henum', instead of
18502 global variable `wget_enum_handle'.
18503
18504 * keymap.c (describe_vector): Remove parameters `indices' and
18505 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18506 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18507
f868cd8a
JB
18508 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18509
18510 * keyboard.c (timer_check): Remove parameter `do_it_now',
18511 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18512 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18513 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18514
18515 * keyboard.c (read_char):
18516 * w32menu.c (w32_menu_display_help):
18517 * xmenu.c (show_help_event, menu_help_callback):
18518 Adjust calls to `show_help_echo'.
18519
18520 * gtkutil.c (xg_maybe_add_timer):
18521 * keyboard.c (readable_events):
18522 * process.c (wait_reading_process_output):
18523 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18524
18525 * insdel.c (adjust_markers_gap_motion):
18526 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18527 (gap_left, gap_right): Don't call it.
18528
2ecf6fdb
CY
185292011-03-25 Chong Yidong <cyd@stupidchicken.com>
18530
18531 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18532 incurred during fontification.
18533
6b1f9ba4
JB
185342011-03-25 Juanma Barranquero <lekktu@gmail.com>
18535
18536 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18537 (DEFVAR_PER_BUFFER): Don't pass it.
18538
18539 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18540 (scrolling_window): Don't pass it.
18541
0f4a96b5
JB
185422011-03-25 Juanma Barranquero <lekktu@gmail.com>
18543
18544 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18545
18546 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18547 and `suffix'.
18548 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18549 of variables specific to SELinux and computation of `encoded_absname'.
18550
18551 * image.c (XPutPixel): Remove unused variable `height'.
18552
18553 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18554
18555 * unexw32.c (get_section_info): Remove unused variable `section'.
18556
18557 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18558 (system_process_attributes): Remove unused variable `sess'.
18559 (sys_read): Remove unused variable `err'.
18560
18561 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18562 (w32_wnd_proc): Remove unused variable `isdead'.
18563 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18564 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18565 (x_create_tip_frame): Remove unused variable `tem'.
18566
18567 * w32inevt.c (w32_console_read_socket):
18568 Remove unused variable `no_events'.
18569
18570 * w32term.c (x_draw_composite_glyph_string_foreground):
18571 Remove unused variable `width'.
18572
1149507c
JB
185732011-03-24 Juanma Barranquero <lekktu@gmail.com>
18574
18575 * w32term.c (x_set_glyph_string_clipping):
18576 Don't pass uninitialized region to CombineRgn.
18577
9c88f339
JB
185782011-03-23 Juanma Barranquero <lekktu@gmail.com>
18579
18580 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18581 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18582 (Fx_close_connection): Remove unused variable `i'.
18583
18584 * w32font.c (w32font_draw): Return number of glyphs.
18585 (w32font_open_internal): Remove unused variable `i'.
18586 (w32font_driver): Add missing initializer.
18587
18588 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18589 (fill_in_menu): Remove unused variable `items_added'.
18590
18591 * w32term.c (last_mouse_press_frame): Remove static global variable.
18592 (w32_clip_to_row): Remove unused variable `f'.
18593 (x_delete_terminal): Remove unused variable `i'.
18594
18595 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18596 (NOTHING): Remove unused static global variable.
18597 (uniscribe_check_otf): Remove unused variable `table'.
18598 (uniscribe_font_driver): Add missing initializers.
18599
dee091a3
JD
186002011-03-23 Julien Danjou <julien@danjou.info>
18601
18602 * term.c (Fsuspend_tty, Fresume_tty):
18603 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18604 * window.c (temp_output_buffer_show):
18605 * insdel.c (signal_before_change):
18606 * frame.c (Fhandle_switch_frame):
18607 * fileio.c (Fdo_auto_save):
18608 * emacs.c (Fkill_emacs):
18609 * editfns.c (save_excursion_restore):
18610 * cmds.c (internal_self_insert):
18611 * callint.c (Fcall_interactively):
18612 * buffer.c (Fkill_all_local_variables):
18613 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18614 Use Frun_hooks.
0f4a96b5 18615 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 18616 unconditionally since it does the check itself.
dee091a3 18617
2c520ab5 186182011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 18619
c9c49752
PE
18620 Fix more problems found by GCC 4.5.2's static checks.
18621
8abc3f12
PE
18622 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18623 the first time through the loop, since we know p0 < p1 then.
18624 This also avoids a gcc -Wstrict-overflow warning.
18625
a2d26660
PE
18626 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18627 leading to a memory leak, possible in functions like
18628 load_charset_map_from_file that can allocate an unbounded number
b12ef411 18629 of objects (Bug#8318).
a2d26660 18630
916c72e9
PE
18631 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18632 that could (at least in theory) be that large.
18633
19ab8a18
PE
18634 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18635 This is less likely to overflow, and avoids undefined behavior if
18636 overflow does occur. All callers changed. Use strtoul to scan
18637 for the unsigned long integer.
b7cbbd6f
PE
18638 (pint2hrstr): Simplify and tune code slightly.
18639 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 18640
f0641eff
PE
18641 * scroll.c (do_scrolling): Work around GCC bug 48228.
18642 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18643
7f650bb9
PE
18644 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18645 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
18646 (validate_x_resource_name): Simplify count usage.
18647 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 18648
37dd57d1
PE
18649 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18650 fail (Bug#8306).
81e56e61 18651
699979fc 18652 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 18653
401bf9b4
PE
18654 * process.c (Fmake_network_process): Use socklen_t, not int,
18655 where POSIX says socklen_t is required in portable programs.
18656 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 18657 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
18658 (Fmake_network_process, server_accept_connection):
18659 (wait_reading_process_output, read_process_output):
18660 Likewise.
18661
b93aacde
PE
18662 * process.c: Rename or move locals to avoid shadowing.
18663 (list_processes_1, Fmake_network_process):
18664 (read_process_output_error_handler, exec_sentinel_error_handler):
18665 Rename or move locals.
4dc343ee 18666 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 18667 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 18668 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 18669 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 18670 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 18671
af8a867c 18672 Make tparam.h and terminfo.c consistent.
44f230aa
SM
18673 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18674 Include tparam.h instead, since it declares them.
af8a867c
PE
18675 * cm.h (PC): Remove extern decl; tparam.h now does this.
18676 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18677 * terminfo.c: Include tparam.h, to check interfaces.
18678 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18679 (tparam): Adjust signature to match interface in tparam.h;
18680 this removes some undefined behavior. Check that outstring and len
18681 are zero, which they always are with Emacs.
18682 * tparam.h (PC, BC, UP): New extern decls.
18683
0248044d 18684 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 18685 (xftfont_open): Rename locals to avoid shadowing.
0248044d 18686
8ff096c1 18687 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
18688 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18689 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 18690 (ftfont_list): Remove unused local.
49eaafba
PE
18691 (get_adstyle_property, ftfont_pattern_entity):
18692 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18693 Rename locals to avoid shadowing.
8ff096c1 18694
e2be39f6
PE
18695 * xfont.c (xfont_list_family): Mark var as initialized.
18696
c9735e30
PE
18697 * xml.c (make_dom): Now static.
18698
8f5201ae
PE
18699 * composite.c (composition_compute_stop_pos): Rename local to
18700 avoid shadowing.
b246f932
PE
18701 (composition_reseat_it): Remove unused locals.
18702 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 18703 (composition_update_it): Mark var as initialized.
11b61122
PE
18704 (find_automatic_composition): Mark vars as initialized,
18705 with a FIXME (Bug#8290).
8f5201ae 18706
760fbc2c
PE
18707 character.h: Rename locals to avoid shadowing.
18708 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18709 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18710 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18711 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18712 to avoid shadowing.
18713
ff08eb85
PE
18714 * textprop.c (property_change_between_p): Remove; unused.
18715
fc7bf025
PE
18716 * intervals.c (interval_start_pos): Now static.
18717
235d7abc
PE
18718 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18719
44f230aa
SM
18720 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18721 Rename locals to avoid shadowing.
3e7d6594 18722
50060332
PE
18723 * sound.c (wav_play, au_play, Fplay_sound_internal):
18724 Fix pointer signedness.
d01f234b 18725 (alsa_choose_format): Remove unused local var.
c83b8872
PE
18726 (wav_play): Initialize a variable to 0, to prevent undefined
18727 behavior (Bug#8278).
50060332 18728
c4fc4e30
PE
18729 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18730
918436ed
PE
18731 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18732
c939f91b
PE
18733 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18734 clobbering (Bug#8298).
b9c7f648
PE
18735 * sysdep.c (sys_subshell): Likewise.
18736 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 18737
6bd8c144
PE
18738 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18739 This should get cleaned up, so that child_setup has the
18740 same signature on all platforms.
18741
7710357c 18742 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 18743 (relocate_fd): Rename locals to avoid shadowing.
7710357c 18744
c59da222
CY
187452011-03-22 Chong Yidong <cyd@stupidchicken.com>
18746
18747 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18748 not to be necessary, and produces flickering.
18749
66b87493
GM
187502011-03-20 Glenn Morris <rgm@gnu.org>
18751
18752 * config.in: Remove file.
18753
45b6f6d5
JB
187542011-03-20 Juanma Barranquero <lekktu@gmail.com>
18755
18756 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18757 are now in src/globals.h.
18758 (syms_of_minibuf): Remove spurious & from previous change.
18759
cd394be1 187602011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
18761
18762 * minibuf.c (completing-read-function): New variable.
18763 (completing-read-default): Rename from completing-read.
18764 (completing-read): Call completing-read-function.
18765
b14e3e21
CY
187662011-03-19 Juanma Barranquero <lekktu@gmail.com>
18767
18768 * xfaces.c (Fx_load_color_file):
18769 Read color file from absolute filename (bug#8250).
18770
f2b726e6
JB
187712011-03-19 Juanma Barranquero <lekktu@gmail.com>
18772
18773 * makefile.w32-in: Update dependencies.
18774
09f6ff02
EZ
187752011-03-17 Eli Zaretskii <eliz@gnu.org>
18776
18777 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18778
29a6015a
PE
187792011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18780
a3a6c54e
PE
18781 Fix more problems found by GCC 4.5.2's static checks.
18782
b766f867
PE
18783 * process.c (make_serial_process_unwind, send_process_trap):
18784 (sigchld_handler): Now static.
18785
be02381c
PE
18786 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18787 That way, the code declares only the vars that it needs.
18788 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18789 * s/cygwin.h (PTY_ITERATION): Likewise.
18790 * s/darwin.h (PTY_ITERATION): Likewise.
18791 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18792
57048744
PE
18793 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18794 * process.c (allocate_pty): Don't declare stb unless it's needed.
18795
7914961c 18796 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
18797 (CONSTANTLIM): Remove; unused.
18798 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18799 Define only if needed.
7914961c 18800
b3967b18
PE
18801 * unexelf.c (unexec): Name an expression,
18802 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
18803 Use a different way to cause a compilation error if anyone uses
18804 n rather than nn, a way that does not involve shadowing.
73366a00 18805 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 18806
29a6015a
PE
18807 * deps.mk (unexalpha.o): Remove; unused.
18808
43cfc33e 18809 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 18810 * unexec.h: New file.
ce701a33
PE
18811 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18812 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18813 Depend on unexec.h.
18814 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18815 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18816 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 18817 Change as necessary to match prototype in unexec.h.
ce701a33 18818
01f44d5a
PE
18819 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18820 shadowing.
4f63c6bb 18821 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 18822
a6670b0b
PE
18823 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18824 Rename locals to avoid shadowing.
18825
cef2010d 18826 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 18827 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 18828
d4d7173a
PE
18829 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18830
f08b802a
PE
18831 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18832 warning when compiling print.c.
18833
3ddb0639
PE
18834 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18835 instead of using an uninitialized var.
5ad03b97 18836 (font_sort_entities): Mark var as initialized.
3ddb0639 18837
170a2692
PE
18838 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18839
e663c700
PE
18840 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18841 pointers to constants.
89bc529a 18842 (font_parse_fcname): Remove unused vars.
7b81e2d0 18843 (font_delete_unmatched): Now static.
ea838e10 18844 (font_get_spec): Remove; unused.
13a547c6
PE
18845 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18846 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18847 Rename or move locals to avoid shadowing.
e663c700 18848
2a80c887 18849 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 18850 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 18851
1384fa33 18852 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 18853 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 18854
8b2c52e9
PE
18855 * alloc.c (mark_backtrace): Move decl from here ...
18856 * lisp.h: ... to here, so that it can be checked.
18857
475545b5 18858 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 18859 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
18860 (lisp_indirect_variable): Name an expression,
18861 to avoid gcc -Wbad-function-cast warning.
1faed8ae 18862 (Fdefvar): Rename locals to avoid shadowing.
475545b5 18863
b1349114 18864 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 18865 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 18866 Use const pointer when appropriate.
b1349114 18867
a2928364
PE
18868 * lisp.h (get_system_name, get_operating_system_release):
18869 Move decls here, to check interfaces.
18870 * process.c (get_operating_system_release): Move decl to lisp.h.
18871 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
18872 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18873 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18874 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
18875 (Fformat_time_string, Fencode_time, Finsert_char):
18876 (Ftranslate_region_internal, Fformat):
18877 Rename or remove local vars to avoid shadowing.
9710023e 18878 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 18879
a415e694
PE
18880 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18881 avoid shadowing.
18882
8ef4622d
PE
18883 * lisp.h (eassert): Check that the argument compiles, even if
18884 ENABLE_CHECKING is not defined.
18885
946f9a5b
PE
18886 * data.c (Findirect_variable): Name an expression, to avoid
18887 gcc -Wbad-function-cast warning.
112396d6 18888 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 18889 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
18890 (Fmake_variable_buffer_local, Fmake_local_variable):
18891 Mark variables as initialized.
52746918 18892 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 18893
e5aab7e7 18894 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
18895 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18896 Rename locals to avoid shadowing.
dff45157
PE
18897 (mark_stack): Move local variables into the #ifdef region where
18898 they're used.
7bc26fdb
PE
18899 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18900 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18901 needed otherwise.
18902 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18903 (GC_STRING_CHARS): Remove; not used.
d40d4be1 18904 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 18905
e5aab7e7
PE
18906 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18907 avoids undefined behavior in theory.
18908
4da60324
PE
18909 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18910
88043301
PE
18911 Use functions, not macros, for up- and down-casing (Bug#8254).
18912 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18913 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18914 to use the following functions instead of these macros.
18915 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18916 EMACS_INT, since callers assume the returned value fits in int.
18917 (upcase1): Likewise, for UPCASE_TABLE.
18918 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 18919 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 18920 the race-condition problem in the old DOWNCASE.
88043301 18921
19ed5445
PE
18922 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18923 Rename locals to avoid shadowing.
18924 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
18925 (regex_compile, re_search_2, re_match_2_internal):
18926 Remove unused local vars.
952db0d7
PE
18927 (FREE_VAR): Rewrite so as not to use empty "else",
18928 which gcc can warn about.
da053e48 18929 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
18930 (RETALLOC_IF): Define only if needed.
18931 (WORDCHAR_P): Likewise. This one is never needed, but is used
18932 only in a comment talking about a compiler bug, so put inside
18933 the #if 0 of that comment.
18934 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18935 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18936 Remove; unused.
19ed5445 18937
1f3561e4 18938 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
18939 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18940 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 18941
ded6f8f7
PE
18942 * search.c (simple_search): Remove unused var.
18943
dbd37a95
PE
18944 * dired.c (compile_pattern): Move decl from here ...
18945 * lisp.h: ... to here, so that it can be checked.
18946 (struct re_registers): New forward decl.
18947
7e47afad
PE
18948 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18949
85f24f61
PE
18950 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18951 All uses changed.
18952 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18953 Rename locals to avoid shadowing.
5671df8f 18954 (Fvertical_motion): Mark locals as initialized.
85f24f61 18955
181aa2be 18956 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 18957 (casify_region): Mark local as initialized.
181aa2be 18958
930d429c
PE
18959 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18960
7082eac6
PE
18961 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18962 New macros, so that the caller can use some names other than
18963 gcpro1, gcpro2, etc.
18964 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18965 of the new macros.
18966 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18967 argument, for consistency with GCPRO2_VAR, etc: it is now the
18968 prefix of the variable, not the variable itself. All uses
18969 changed.
38b2c076
PE
18970 * dired.c (directory_files_internal, file_name_completion):
18971 Rename locals to avoid shadowing.
18972
15206ed9
PE
18973 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18974 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18975 dired.c's scmp function, had undefined behavior.
18976 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18977 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18978 * buffer.h: ... to here, because these macros use current_buffer,
18979 and the new implementation with inline functions needs to have
18980 current_buffer in scope now, rather than later when the macros
18981 are used.
18982 (downcase, upcase1): New static inline functions.
18983 (DOWNCASE, UPCASE1): Reimplement using these functions.
18984 This avoids undefined behavior in expressions like
18985 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18986 from race conditions in accessing the global variables
18987 case_temp1 and case_temp2.
18988 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18989 * lisp.h (case_temp1, case_temp2): Remove their decls.
18990 * character.h (ASCII_CHAR_P): Move from here ...
18991 * lisp.h: ... to here, so that the inline functions mentioned
18992 above can use them.
18993
4a6bea26
PE
18994 * dired.c (directory_files_internal_unwind): Now static.
18995
f14b7e14
PE
18996 * fileio.c (file_name_as_directory, directory_file_name):
18997 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18998 Now static.
2893f146
PE
18999 (file_name_as_directory): Use const pointers when appropriate.
19000 (Fexpand_file_name): Likewise. In particular, newdir might
19001 point at constant storage, so make it a const pointer.
fd4ead52 19002 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
19003 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19004 signedness issues.
f839df0c
PE
19005 (Fset_file_times, Finsert_file_contents, auto_save_error):
19006 Rename locals to avoid shadowing.
f14b7e14 19007
5716756e 19008 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
19009 (Ftry_completion, Fall_completions): Rename or remove locals
19010 to avoid shadowing.
5716756e 19011
b4c3046a
PE
19012 * marker.c (bytepos_to_charpos): Remove; unused.
19013
b45db522
PE
19014 * lisp.h (verify_bytepos, count_markers): New decls,
19015 so that gcc does not warn that these functions aren't declared.
19016
85876d07
PE
19017 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19018 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 19019 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 19020 (copy_text): Remove unused local var.
85876d07 19021
03d78a21 19022 * filelock.c (within_one_second): Now static.
b3dd38ab 19023 (lock_file_1): Rename local to avoid shadowing.
03d78a21 19024
5df8f01b
PE
19025 * buffer.c (fix_overlays_before): Mark locals as initialized.
19026 (fix_start_end_in_overlays): Likewise. This function should be
19027 simplified by using pointers-to-pointers, but that's a different
19028 matter.
b1d876f1 19029 (switch_to_buffer_1): Now static.
8f54f30a
PE
19030 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19031 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 19032
a70072c9 19033 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 19034 Fix pointer signedness issue.
edced198
PE
19035 (sys_subshell): Mark local as volatile if checking for lint,
19036 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 19037 (MAXPATHLEN): Define only if needed.
a70072c9 19038
a0977c44
PE
19039 * process.c (serial_open, serial_configure): Move decls from here ...
19040 * systty.h: ... to here, so that they can be checked.
19041
a884fdcc
PE
19042 * fns.c (get_random, seed_random): Move extern decls from here ...
19043 * lisp.h: ... to here, so that they can be checked.
19044
604efe86 19045 * sysdep.c (reset_io): Now static.
b8950c94 19046 (wait_for_termination_signal): Remove; unused.
604efe86 19047
38fc62d9
PE
19048 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19049 (copy_keymap_item, append_key, push_text_char_description):
19050 Now static.
1004a21a 19051 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 19052 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
19053 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19054 (describe_map_tree):
19055 Rename locals to avoid shadowing.
38fc62d9 19056
2f2650da
PE
19057 * keyboard.c: Declare functions static if they are not used elsewhere.
19058 (echo_char, echo_dash, cmd_error, top_level_2):
19059 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
19060 (read_char, kbd_buffer_get_event, make_lispy_position):
19061 (make_lispy_event, make_lispy_movement, apply_modifiers):
19062 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19063 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19064 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 19065 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 19066 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 19067
a053e86c 19068 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
19069 (mark_kboards): Move decl here ...
19070 * alloc.c (mark_kboards): ... from here.
a053e86c 19071
4752793e
PE
19072 * lisp.h (force_auto_save_soon): New decl.
19073
74f10ca7 19074 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
19075 (DEFINE_DUMMY_FUNCTION): New macro.
19076 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19077 Use it.
c03cd23f
PE
19078 (main): Add casts to avoid warnings
19079 if GCC considers string literals to be constants.
74f10ca7 19080
022e70d4
PE
19081 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19082
59d6fe83
PE
19083 * dbusbind.c: Pointer signedness fixes.
19084 (xd_signature, xd_append_arg, xd_initialize):
19085 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19086 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19087 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19088 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19089
78320123
PE
19090 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19091 if GCC considers string literals to be constants.
49cebcca 19092 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 19093
35ac2a97
SM
190942011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19095
fb103ca9
SM
19096 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19097 (print_preprocess, print_object): New macro to fix last change.
19098
35ac2a97
SM
19099 * print.c (print_preprocess): Don't forget font objects.
19100
62973b41
JB
191012011-03-16 Juanma Barranquero <lekktu@gmail.com>
19102
19103 * emacs.c (USAGE3): Doc fixes.
19104
0e48bb22
AS
191052011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19106
19107 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19108 structure.
19109
7684e57b
JB
191102011-03-14 Juanma Barranquero <lekktu@gmail.com>
19111
19112 * lisp.h (VWindow_system, Qfile_name_history):
19113 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19114 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19115 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19116
19117 * w32select.c: Don't #include "keyboard.h".
c96bbc66 19118 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
19119
19120 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19121 * w32console.c (detect_input_pending, read_input_pending)
19122 (encode_terminal_code):
19123 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19124 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19125 (w32_system_caret_y, Qfile_name_history):
19126 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19127 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19128 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19129 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19130 * w32proc.c (Qlocal, report_file_error):
19131 * w32term.c (Vwindow_system, updating_frame):
19132 * w32uniscribe.c (initialized, uniscribe_font_driver):
19133 Remove unneeded extern declarations.
19134
2aa46d6c
CY
191352011-03-14 Chong Yidong <cyd@stupidchicken.com>
19136
c96bbc66 19137 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 19138
cffc6f3b
CY
191392011-03-13 Chong Yidong <cyd@stupidchicken.com>
19140
19141 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19142 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19143 These macros can no longer be used for assignment.
19144
44f230aa
SM
19145 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19146 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
19147 (record_buffer_markers, fetch_buffer_markers): New functions for
19148 recording and fetching special buffer markers.
19149 (set_buffer_internal_1, set_buffer_temp): Use them.
19150
19151 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19152
19153 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19154
19155 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19156 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19157
19158 * xdisp.c (hscroll_window_tree):
19159 (reconsider_clip_changes): Use PT instead of BUF_PT.
19160
d251f04b
EZ
191612011-03-13 Eli Zaretskii <eliz@gnu.org>
19162
19163 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19164 $(EMACS_ROOT)/lib/intprops.h.
19165
f0c77cd1
PE
191662011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19167
3eca4629
PE
19168 Fix more problems found by GCC 4.5.2's static checks.
19169
7c86ee98
PE
19170 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19171 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
19172 (xg_free_frame_widgets): Make it clear that a local variable is
19173 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
19174 (gdk_window_get_screen): Make it clear that this macro is needed
19175 only if USE_GTK_TOOLTIP.
1e5524e7
PE
19176 (int_gtk_range_get_value): New function, which avoids a diagnostic
19177 from gcc -Wbad-function-cast.
19178 (xg_set_toolkit_scroll_bar_thumb): Use it.
19179 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19180 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
19181 (get_utf8_string, xg_get_file_with_chooser):
19182 Rename locals to avoid shadowing.
19183 (create_dialog): Move locals to avoid shadowing.
7c86ee98 19184
41729b81
PE
19185 * xgselect.c (xg_select): Remove unused var.
19186
f0c77cd1
PE
19187 * image.c (four_corners_best): Mark locals as initialized.
19188 (gif_load): Initialize transparent_p to zero (Bug#8238).
19189 Mark another local as initialized.
ec6cf4c6 19190 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 19191
ce0ad53d 19192 * image.c (clear_image_cache): Now static.
d5d5a617 19193 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 19194 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
19195 (x_edge_detection): Remove unnecessary cast that
19196 gcc -Wbad-function-cast diagnoses.
2037898d 19197 (gif_load): Fix pointer signedness.
6ae141d6
PE
19198 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19199 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 19200
33383987 192012011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 19202
d32df629
PE
19203 Improve quality of tests for time stamp overflow.
19204 For example, without this patch (encode-time 0 0 0 1 1
19205 1152921504606846976) returns the obviously-bogus value (-948597
19206 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19207 reports time overflow. See
19208 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
19209 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19210 * editfns.c: Include limits.h and intprops.h.
19211 (TIME_T_MIN, TIME_T_MAX): New macros.
19212 (time_overflow): Move earlier, to before first use.
19213 (hi_time, lo_time): New functions, for an accurate test for
19214 out-of-range times.
19215 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19216 (Fget_internal_run_time): Don't assume time_t fits in int.
19217 (make_time): Use list2 instead of Fcons twice.
19218 (Fdecode_time): More accurate test for out-of-range times.
19219 (check_tm_member): New function.
19220 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
19221 (lisp_time_argument): Don't rely on undefined left-shift and
19222 right-shift behavior when checking for time stamp overflow.
8be6f318 19223
fe31d94c
PE
19224 * editfns.c (time_overflow): New function, refactoring common code.
19225 (Fformat_time_string, Fdecode_time, Fencode_time):
19226 (Fcurrent_time_string): Use it.
19227
8be6f318
PE
19228 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19229 * dired.c (make_time): Move to ...
19230 * editfns.c (make_time): ... here.
19231 * systime.h: Note the move.
19232
09d9db2c 192332011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 19234
126bc0dc
YM
19235 * fringe.c (update_window_fringes): Remove unused variables.
19236
c47cbdfd
YM
19237 * unexmacosx.c (copy_data_segment): Also copy __got section.
19238 (Bug#8223)
19239
7ac80be9
EZ
192402011-03-12 Eli Zaretskii <eliz@gnu.org>
19241
c96bbc66 19242 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
19243 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19244 Constify `char *' arguments and their references according to
19245 prototypes in tparam.h.
19246
ecb0f94d 19247 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 19248
7ac80be9
EZ
19249 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19250 Adapt all references accordingly.
19251
19252 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19253
ef1fd07e
TT
192542011-03-11 Tom Tromey <tromey@redhat.com>
19255
19256 * buffer.c (syms_of_buffer): Remove obsolete comment.
19257
7ef4b50c
EZ
192582011-03-11 Eli Zaretskii <eliz@gnu.org>
19259
19260 * termhooks.h (encode_terminal_code): Declare prototype.
19261
19262 * msdos.c (encode_terminal_code): Don't declare prototype.
19263
19264 * term.c (encode_terminal_code): Now external again, used by
19265 w32console.c and msdos.c.
19266
44f230aa
SM
19267 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19268 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 19269
4b1ec863 192702011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 19271
1714f52b 19272 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 19273
4b1ec863
PE
19274 * fringe.c (update_window_fringes): Mark locals as initialized
19275 (Bug#8227).
19276 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 19277
524c7aa6
PE
19278 * alloc.c (mark_fringe_data): Move decl from here ...
19279 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19280 to check its interface.
19281 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19282
a5c0af81 19283 * fontset.c (free_realized_fontset): Now static.
7519b8cd 19284 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 19285 (fontset_font): Mark local as initialized.
a9a06e0b 19286 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 19287
b4716021
PE
19288 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19289
811e9bac 19290 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 19291 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
19292 (x_own_selection, Fx_disown_selection_internal): Rename locals
19293 to avoid shadowing.
19294 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 19295
7e3ab302
PE
19296 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19297 so that the caller can use some name other than gcpro1.
19298 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
19299 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19300 (Fx_backspace_delete_keys_p):
19301 Use them to avoid shadowing, and rename vars to avoid shadowing.
19302 (x_decode_color, x_set_name, x_window): Now static.
6b437900 19303 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 19304 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
19305 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19306 Remove unused locals.
7e3ab302
PE
19307 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19308 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19309 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19310 macros.
f78faa98 19311
e2b13473
PE
19312 * xterm.h (x_mouse_leave): New decl.
19313
77f23912
PE
19314 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19315 Remove unused functions.
cdf4ba58
PE
19316 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19317 (x_calc_absolute_position): Now static.
7411c686 19318 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 19319 Don't declare local "event" unless it's used.
ed7bf3a5
PE
19320 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19321 unless they are used.
38d0b34a
PE
19322 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19323 (x_fatal_error_signal): Remove; not used.
a6067996
PE
19324 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19325 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19326 (x_error_catcher, x_connection_closed, x_error_handler):
19327 (x_error_quitter, xembed_send_message, x_iconify_frame):
19328 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 19329 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 19330 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 19331
44f230aa
SM
19332 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19333 Rename or move locals to avoid shadowing.
6b463e58 19334 (tty_defined_color, merge_face_heights): Now static.
5967d051 19335 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
19336 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19337 does not deduce is never used uninitialized.
73719eba
PE
19338 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19339 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 19340
426994c3 19341 * terminal.c (store_terminal_param): Now static.
5489860b 19342
032f1620 19343 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 19344 (set_frame_menubar): Remove unused local.
d4323972 19345 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
19346 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19347 since they might point to immutable storage.
281585b0
PE
19348 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19349 since it's unused otherwise.
032f1620 19350
367c19e5 19351 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 19352 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
19353 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19354 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 19355 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
19356 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19357 does not deduce are never used uninitialized.
70739cbe 19358
07b48fa9
PE
19359 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19360
8868a238 19361 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
19362 * window.c (window_loop, size_window):
19363 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 19364
7e5cf297 19365 * window.c (display_buffer): Now static.
d6550a9f
PE
19366 (size_window): Mark variables that gcc -Wuninitialized
19367 does not deduce are never used uninitialized.
a586633d
PE
19368 * window.h (check_all_windows): New decl, to forestall
19369 gcc -Wmissing-prototypes diagnostic.
5b555da1 19370 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 19371
f6095868
PE
19372 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19373 shadowing.
19374 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
19375 Include <limits.h>.
19376 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19377 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
19378 (load_charset_map): Mark variables that gcc -Wuninitialized
19379 does not deduce are never used uninitialized.
53df7c11 19380 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 19381
f38b440c
PE
19382 * coding.c (coding_set_source, coding_set_destination):
19383 Use "else { /* comment */ }" rather than "else /* comment */;"
19384 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
19385 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19386 a block, when the outer 'i' will do.
19387 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19388 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19389 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19390 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19391 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19392 Rename locals to avoid shadowing.
19393 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
19394 * coding.c (emacs_mule_char, encode_invocation_designation):
19395 Now static, since they're not used elsewhere.
413bb2db 19396 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 19397 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
19398 (decode_coding_emacs_mule): Mark variables that gcc
19399 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
19400 (detect_coding_iso_2022): Initialize a local variable that might
19401 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 19402 this initialization is needed. (Bug#8211)
5f58e762
PE
19403 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19404 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19405 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19406 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19407 Remove unused macros.
f38b440c 19408
232b38b9 19409 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 19410 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 19411 * character.c (string_count_byte8): Likewise.
232b38b9 19412
fb90da1b
PE
19413 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19414 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19415
fb93dbc2
PE
19416 * chartab.c (copy_sub_char_table): Now static, since it's not used
19417 elsewhere.
5c156ace
PE
19418 (sub_char_table_ref_and_range, char_table_ref_and_range):
19419 Rename locals to avoid shadowing.
bbcd0949 19420 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 19421
7d3b3862 19422 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 19423 (BIDI_BOB): Remove unused macro.
7d3b3862 19424
6be7d3da
PE
19425 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19426 deduce are never used uninitialized.
c2ed9c8b 19427 * term.c (encode_terminal_code): Likewise.
6be7d3da 19428
75f8807f 19429 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 19430
50938595
PE
19431 * tparam.h: New file.
19432 * term.c, tparam.h: Include it.
19433 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19434 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19435 Move these decls to tparam.h, and make them agree with what
19436 is actually in tparam.c. The previous trick of using incompatible
19437 decls in different modules does not conform to the C standard.
19438 All callers of tparam changed to use tparam's actual API.
19439 * tparam.c (tparam1, tparam, tgoto):
19440 Use const pointers where appropriate.
19441
fbceeba2
PE
19442 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19443 * cm.h (struct cm): Likewise.
19444 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19445 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19446 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19447 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19448 (turn_on_face, init_tty): Likewise.
19449 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 19450
7f3f1250
PE
19451 * term.c (term_mouse_position): Rename local to avoid shadowing.
19452
e6ca6543
PE
19453 * alloc.c (mark_ttys): Move decl from here ...
19454 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19455
c40f8d15
AS
194562011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19457
19458 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19459
cfe0661d
JB
194602011-03-09 Juanma Barranquero <lekktu@gmail.com>
19461
19462 * search.c (compile_pattern_1): Remove argument regp, unused since
19463 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19464 (compile_pattern): Don't pass it.
19465
0afb4571
J
194662011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19467
19468 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19469 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19470 for ! HAVE_GTK3.
19471 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19472
19473 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19474
19475 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19476 gdk_window_get_screen, gdk_window_get_geometry,
19477 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19478 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19479 (xg_get_pixbuf_from_pixmap): New function.
19480 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19481 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19482 Call xg_get_pixbuf_from_pixmap instead of
19483 gdk_pixbuf_get_from_drawable.
19484 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19485 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19486 (xg_check_special_colors): Use GtkStyleContext and its functions
19487 for HAVE_GTK3.
19488 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19489 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19490 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
19491 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19492 Call gtk_widget_get_preferred_size.
0afb4571
J
19493 (xg_frame_resized): gdk_window_get_geometry only takes 5
19494 parameters.
44f230aa
SM
19495 (xg_win_to_widget, xg_event_is_for_menubar):
19496 Call gdk_x11_window_lookup_for_display.
0afb4571
J
19497 (xg_set_widget_bg): New function.
19498 (delete_cb): New function.
895009e1 19499 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 19500 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
19501 (xg_set_background_color): Call xg_set_widget_bg.
19502 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19503 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19504 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19505 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19506 if ! HAVE_GTK3.
19507 (update_frame_tool_bar): Call gtk_widget_hide.
19508 (xg_initialize): Use GDK_KEY_g.
19509
19510 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19511 if ! HAVE_GTK3
19512 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19513
19514 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19515 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19516 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19517
1c2cc4ef
JB
195182011-03-08 Juanma Barranquero <lekktu@gmail.com>
19519
19520 * w32xfns.c (select_palette): Check success of RealizePalette against
19521 GDI_ERROR, not zero.
19522
33383987 19523See ChangeLog.11 for earlier changes.
aac0c6e3
MR
19524
19525;; Local Variables:
19526;; coding: utf-8
aac0c6e3
MR
19527;; End:
19528
2f097256 19529 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
19530
19531 This file is part of GNU Emacs.
19532
19533 GNU Emacs is free software: you can redistribute it and/or modify
19534 it under the terms of the GNU General Public License as published by
19535 the Free Software Foundation, either version 3 of the License, or
19536 (at your option) any later version.
19537
19538 GNU Emacs is distributed in the hope that it will be useful,
19539 but WITHOUT ANY WARRANTY; without even the implied warranty of
19540 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19541 GNU General Public License for more details.
19542
19543 You should have received a copy of the GNU General Public License
19544 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.