Fix bug #12878 with compilation failure with Visual C++ 11.0.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
d8715cdf
EZ
12012-11-17 Eli Zaretskii <eliz@gnu.org>
2
3 * w32select.c: Include w32common.h before w32term.h, so that
4 windows.h gets included before w32term.h uses some of its
5 features, see below.
6
7 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
8 typedefs.
9 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
10 prototypes.
11 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
12
7436fc63
JD
132012-11-17 Jan Djärv <jan.h.d@swipnet.se>
14
15 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
16 (ns_select): Return at once if events are held (Bug#12834).
17
86dcf21c 182012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
19
20 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
21 Needed following 2012-10-20 change. (Bug#12902)
22
d56f2e49
GM
232012-11-16 Glenn Morris <rgm@gnu.org>
24
25 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
26
5c2a7148
SM
272012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
28
29 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
30
730b2d8f
EZ
312012-11-14 Eli Zaretskii <eliz@gnu.org>
32
33 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
34 use the same value of thread handle.
35 (start_timer_thread): If the timer thread exited (due to error),
36 clean up by closing the two handles it used. Duplicate the caller
37 thread's handle here, so it gets duplicated only once, when
38 launching the timer thread. Set priority of the timer thread, not
39 the caller thread.
40 (getitimer): Don't duplicate the caller thread's handle here.
41 (Bug#12832)
42
f99c65e5
JD
432012-11-13 Jan Djärv <jan.h.d@swipnet.se>
44
45 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
46 called (Bug#12834).
47
32520273
EZ
482012-11-12 Eli Zaretskii <eliz@gnu.org>
49
50 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
51 passed to pint2str and pint2hrstr to be at most the size of the
52 frame's decode_mode_spec_buffer. This avoids crashes with very
53 large values of FIELD_WIDTH argument to decode_mode_spec.
54 (Bug#12867)
55
fdaf534a
MR
562012-11-07 Martin Rudalics <rudalics@gmx.at>
57
58 * window.c (Fsplit_window_internal): Set combination limit of
59 new parent window to t iff Vwindow_combination_limit is t;
60 fixing a regression introduced with the change from 2012-09-22.
5c2a7148
SM
61 (Fwindow_combination_limit, Fset_window_combination_limit):
62 Fix doc-strings.
fdaf534a 63
acf93bcf
EZ
642012-11-06 Eli Zaretskii <eliz@gnu.org>
65
66 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
67 amount when the scroll margins are too large. When scrolling
68 backwards in the buffer, give up if cannot reach point or the
5c2a7148
SM
69 scroll margin within a reasonable number of screen lines.
70 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
71 point is positioned many lines beyond the window top/bottom.
72 (Bug#12811)
73
508f51f5
EZ
742012-11-05 Eli Zaretskii <eliz@gnu.org>
75
76 * ralloc.c (relinquish): If real_morecore fails to return memory
77 to the system, don't crash; instead, leave the last heap
78 unchanged and return. (Bug#12774)
79
67b50ba4 802012-11-03 Eli Zaretskii <eliz@gnu.org>
ad10696b 81
1d4341f9
EZ
82 * lisp.mk: Adjust comments to the fact that term/internal is now
83 loaded from loadup.el.
ad10696b 84
b3cf17f6
EZ
85 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
86 (msdos_fatal_signal): New function.
87 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
88 its argument list.
89
90 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
91 for GCC versions before 4.
92 (emacs_raise): Define to call msdos_fatal_signal.
67b50ba4
EZ
93
94 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
95 iterator when starting in the middle of a display or overlay
96 string. (Bug#12745)
97
858f0f24
EZ
982012-11-03 Jan Djärv <jan.h.d@swipnet.se>
99
100 * widget.c (resize_cb): New function.
101 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
102 (EmacsFrameResize): Check if all is up to date before changing frame
103 size.
104
7e8b50d9
EZ
1052012-11-01 Eli Zaretskii <eliz@gnu.org>
106
107 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
108
322aea6d
PE
1092012-10-31 Paul Eggert <eggert@cs.ucla.edu>
110
111 Fix crash when using Emacs as commit editor for git (Bug#12697).
112 * callproc.c (setpgrp): Remove macro, as we now use setpgid
113 and it is configured in conf_post.h.
114 (Fcall_process): Don't invoke both setsid and setpgid; the former
115 is enough, if it exists.
116 * callproc.c (Fcall_process, child_setup):
117 * process.c (create_process): Use setpgid.
118 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
119 for the real thing.
120 * dispnew.c (init_display): Initialize the foreground group
121 if we are running a tty display.
122 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
123 * lisp.h (init_foreground_group): New decl.
124 * sysdep.c (inherited_pgroup): New static var.
125 (init_foreground_group, tcsetpgrp_without_stopping)
126 (narrow_foreground_group, widen_foreground_group): New functions.
127 (init_sys_modes): Narrow foreground group.
128 (reset_sys_modes): Widen foreground group.
129
220cb2bd
MA
1302012-10-31 Michael Albinus <michael.albinus@gmx.de>
131
132 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
133
218e997a
MR
1342012-10-31 Martin Rudalics <rudalics@gmx.at>
135
136 * minibuf.c (read_minibuf): Restore current buffer since
137 choose_minibuf_frame calling Fset_frame_selected_window may
138 change it (Bug#12766).
139
02615da0
JD
1402012-10-30 Jan Djärv <jan.h.d@swipnet.se>
141
142 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
143
aee5b18e
KH
1442012-10-30 Kenichi Handa <handa@gnu.org>
145
146 * font.c (Ffont_at): If WINDOW is specified and it is not
147 displaying the current buffer, signal an error.
148
ba116008
DC
1492012-10-29 Daniel Colascione <dancol@dancol.org>
150
5c2a7148
SM
151 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
152 In preparation for fixing bug#12739, move these functions from
ba116008
DC
153 here...
154
155 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
156 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
157 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 158
640bf8ad
EZ
1592012-10-28 Eli Zaretskii <eliz@gnu.org>
160
161 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
162 (timer_loop, getitimer, setitimer): Use it instead of
163 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
164 'clock'.
165 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
166 literal 10000.
167
64ccff5f
JD
1682012-10-28 Jan Djärv <jan.h.d@swipnet.se>
169
170 * nsterm.m (NO_APPDEFINED_DATA): New define.
171 (last_appdefined_event_data): New variable
172 (last_appdefined_event): Remove.
173 (ns_select): Initialize t from last_appdefined_event_data instead
174 of [last_appdefined_event data1].
175 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
176 remove last_appdefined_event (Bug#12698).
177
e483264c
SM
1782012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
179
180 * frame.c (x_set_font): Catch internal error.
181
6c16c13e
EZ
1822012-10-27 Eli Zaretskii <eliz@gnu.org>
183
e483264c
SM
184 Avoid overflow in w32 implementation of interval timers.
185 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
186 actually executes.
187 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
188 'volatile ULONGLONG' types. All the other data which was
189 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
190 (GetThreadTimes_Proc): New typedef.
191 (w32_get_timer_time): New function, returns a suitable time value
192 for the timer.
193 (timer_loop): Enter critical section when accessing ULONGLONG
194 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
195 atomic. Call 'w32_get_timer_time' instead of 'clock'.
196 Remove unused variable.
6c16c13e
EZ
197 (init_timers): Initialize s_pfn_Get_Thread_Times.
198 (start_timer_thread): Don't assign itimer->caller_thread here.
199 (getitimer): Assign itimer->caller_thread here.
200 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 201 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 202
ccc83f50
EZ
2032012-10-26 Eli Zaretskii <eliz@gnu.org>
204
205 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
206 mouse movement events if the menu bar is active. This avoids
207 producing a busy "hour-glass" cursor by Windows if the mouse
208 pointer is positioned over a tooltip shown for some menu item.
209
69deda53
PE
2102012-10-25 Paul Eggert <eggert@cs.ucla.edu>
211
212 Don't assume process IDs fit in int.
213 * emacs.c (shut_down_emacs) [!DOS_NT]:
214 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
215 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
216 Use pid_t, not int, to store process IDs, as 'int'
217 is not wide enough on a few platforms (e.g., AIX and IRIX).
218
7e70a152
KH
2192012-10-23 Kenichi Handa <handa@gnu.org>
220
221 The following change is to make face-font-rescale-alist work
222 correctly for non-ASCII fonts.
223
224 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
225 (font_open_for_lface): Handle Vface_font_rescale_alist.
226
49238e7f
CY
2272012-10-23 Chong Yidong <cyd@gnu.org>
228
229 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
230
5ec86886
JD
2312012-10-21 Jan Djärv <jan.h.d@swipnet.se>
232
ef446959
JD
233 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
234 for screen font.
235 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
236
5ec86886
JD
237 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
238 event (Bug#12681).
239
ee7a418d
GM
2402012-10-21 Glenn Morris <rgm@gnu.org>
241
242 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
243
4973679b
PE
2442012-10-20 Paul Eggert <eggert@cs.ucla.edu>
245
246 Port to OpenBSD 5.1.
247 * frame.c (Fmouse_position, Fmouse_pixel_position):
248 * xdisp.c (produce_stretch_glyph):
249 Declare local vars only when they're needed.
250 This is clearer and avoids a warning on OpenBSD about unused vars.
251 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
252 This is safer, and avoids OpenBSD warnings about unused vars.
253 * keyboard.c (record_menu_key): Remove unnecessary decl.
254 (poll_timer): Define only if POLL_FOR_INPUT is defined.
255 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
256 as our definition clashes with OpenBSD's.
257 * xfaces.c (load_face_colors, check_lface_attrs)
258 (get_lface_attributes_no_remap, get_lface_attributes)
259 (lface_fully_specified_p, x_supports_face_attributes_p)
260 (tty_supports_face_attributes_p, face_fontset, realize_face)
261 (realize_x_face, realize_tty_face):
262 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
263 merely Lisp_Object *. This is more informative and avoids
264 a warning on OpenBSD about accessing beyond an object's size.
265
c664f463
CY
2662012-10-20 Chong Yidong <cyd@gnu.org>
267
268 * lread.c (Fload): Doc fix (Bug#12592).
269
6ec83f92 2702012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
271
272 * font.c (Ffont_at): Fix previous change.
273
d2824928
EZ
2742012-10-19 Eli Zaretskii <eliz@gnu.org>
275
e483264c
SM
276 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
277 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
278 for the reasons.
279
d2824928
EZ
280 * alloc.c (NSTATICS): Decrease to 0x800.
281
f60d391f
SM
2822012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
283
284 * fns.c (Fnreverse): Include the problem element when signalling an
285 error (bug#12677).
286
1a9327d5
JD
2872012-10-18 Jan Djärv <jan.h.d@swipnet.se>
288
289 * nsterm.m (ns_select): Check writefds before call to
290 FD_ISSET (Bug#12668).
291
14145a1e
DC
2922012-10-18 Daniel Colascione <dancol@dancol.org>
293
294 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
295 (staticpro): If we run out of staticpro slots, die with an
296 informative error instead of just calling emacs_abort.
297
1f76f6f5
MR
2982012-10-18 Martin Rudalics <rudalics@gmx.at>
299
300 Fix two flaws reported by Dmitry Antipov.
301 * window.c (Ftemp_output_buffer_show): Remove.
302 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
303 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
304
fcf14875
EZ
3052012-10-17 Eli Zaretskii <eliz@gnu.org>
306
1f76f6f5
MR
307 * makefile.w32-in ($(BLD)/w32.$(O)):
308 ($(BLD)/vm-limit.$(O)):
309 ($(BLD)/term.$(O)):
310 ($(BLD)/unexw32.$(O)):
311 ($(BLD)/fileio.$(O)):
a68089e4
EZ
312 ($(BLD)/dispnew.$(O)): Update dependencies.
313
314 * w32term.h (w32_initialize_display_info, initialize_w32_display):
315 Add prototypes.
316
317 * w32proc.c: Include ctype.h.
318
319 * w32.h (init_environment, check_windows_init_file)
320 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
321 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
322 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
323 (sys_link): Add prototypes.
324
325 * w32.c: Include w32select.h.
326 (sys_access, e_malloc, sys_select): Add prototypes.
327 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
328
329 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
330
331 * unexw32.c: Include lisp.h and w32.h.
332
333 * term.c [WINDOWSNT]: Include w32term.h.
334
335 * process.c [WINDOWSNT]: Add prototype of sys_select.
336
337 * fileio.c [WINDOWSNT]: Include w32.h.
338
339 * dispnew.c [WINDOWSNT]: Include w32.h.
340
fcf14875
EZ
341 * cygw32.c (Fcygwin_convert_path_to_windows)
342 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
343 Lisp_Object values. (Bug#12661)
344
345 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
346 to Lisp_Object. (Bug#12661)
347
fe0b1ec4
KH
3482012-10-17 Kenichi Handa <handa@gnu.org>
349
350 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
351 invalidate.
352
d556ebf9
DA
3532012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
354
355 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 356 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 357
f0863a54
DA
3582012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
359
360 Do not verify indirection counters of killed buffers (Bug#12579).
361 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
362 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
363
12fbe755
DA
3642012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
365
366 * alloc.c (Fmake_byte_code): Fix typo in comment.
367 * print.c (print_interval): Define as static to match prototype.
368 * indent.c (disptab_matches_widthtab, recompute_width_table):
369 Convert to eassert.
370
61655b89
DA
3712012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
372
373 * editfns.c (get_system_name): Remove.
374 * lisp.h (get_system_name): Remove prototype.
375 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
376 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
377
9520f2f2
DC
3782012-10-15 Daniel Colascione <dancol@dancol.org>
379
380 * dbusbind.c: Add comment explaining reason for previous change.
381
dca778d5
MR
3822012-10-15 Martin Rudalics <rudalics@gmx.at>
383
384 * window.c (Fwindow_end): Rewrite check whether cached position
385 can be used (Bug#12600).
386 (resize_frame_windows, grow_mini_window, shrink_mini_window):
387 Set windows_or_buffers_changed.
388
3e0341b0
DC
3892012-10-15 Daniel Colascione <dancol@dancol.org>
390
391 * dbusbind.c: Fix cygw32 build break when compiling with dbus
392 enabled by undefining the symbol "interface", which the platform
393 headers define to something incompatible.
394
33d4113c
DC
3952012-10-14 Daniel Colascione <dancol@dancol.org>
396
397 * image.c (init_tiff_functions, init_imagemagick_functions)
398 (init_svg_functions): Fix cygw32 build break by using these
399 functions only when WINDOWSNT _and_ HAVE_NTGUI.
400
a36fb15e
JD
4012012-10-14 Jan Djärv <jan.h.d@swipnet.se>
402
403 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
404
537f336d
JD
4052012-10-13 Jan Djärv <jan.h.d@swipnet.se>
406
407 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
408
0ba06a77
KH
4092012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
410
411 * coding.c (detect_coding): Set coding->id before calling
412 this->detector.
413
ce2fe65a
AS
4142012-10-13 Andreas Schwab <schwab@linux-m68k.org>
415
416 * fileio.c: Formatting fixes.
417
d6453ce4
PE
4182012-10-13 Paul Eggert <eggert@cs.ucla.edu>
419
420 Fix some stat-related races.
421 * fileio.c (Fwrite_region): Avoid race condition if a file is
422 removed or renamed by some other process immediately after Emacs
423 writes it but before Emacs stats it. Do not assume that stat (or
424 fstat) succeeds.
425 * image.c (slurp_file): Resolve the file name with fopen + fstat
426 rather than stat + fopen.
427 (pbm_read_file) [0]: Remove unused code with stat race.
428 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
429 Remove ineffective code with stat race.
430
06485aa8
SM
4312012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
432
433 * doc.c (get_doc_string): Don't signal an error if the file is missing.
434
167e3640
JD
4352012-10-12 Jan Djärv <jan.h.d@swipnet.se>
436
437 * nsterm.m (hold_event_q): New static variable.
438 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
439 ! q_event_ptr.
440 (hold_event): New function.
441 (ns_read_socket): If hold_event_q have events, store them and
442 return (Bug#12384).
443 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
444 is zero (Bug#12384).
445
c40239df
JB
4462012-10-12 Juanma Barranquero <lekktu@gmail.com>
447
448 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
449
bb385a92
EZ
4502012-10-12 Eli Zaretskii <eliz@gnu.org>
451
2a9f1099
EZ
452 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
453
bb385a92
EZ
454 * fileio.c (check_existing): New function.
455 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
456 instead of calling 'stat', when what's needed is to check whether
457 a file exists. This avoids expensive system calls on MS-Windows.
458 (Bug#12587)
459
8599b23a 460 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
461
462 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
463 determine whether a file exists and is not a directory.
464
465 * lisp.h (check_existing): Add prototype.
466
2b9c2e68
JD
4672012-10-12 Jan Djärv <jan.h.d@swipnet.se>
468
469 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
470
81749a23
GM
4712012-10-12 Glenn Morris <rgm@gnu.org>
472
473 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
474
5253a5fd
SM
4752012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
476
389a94a5
SM
477 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
478
5253a5fd
SM
479 * eval.c (Fautoload): Remember previous autoload status in load-history.
480
7cded46f
PE
4812012-10-11 Paul Eggert <eggert@cs.ucla.edu>
482
483 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
484 * lread.c (load_each_byte, new_backquote_flag, readchar)
485 (read_filtered_event, lisp_file_lexically_bound_p)
486 (safe_to_load_version, Fload, complete_filename_p, openp)
487 (build_load_history, readevalloop, read_escape, read1)
488 (string_to_number, read_vector, read_list):
489 * macros.c (Fstart_kbd_macro):
490 * marker.c (CONSIDER):
491 * menu.c (parse_single_submenu, digest_single_submenu)
492 (find_and_return_menu_selection, Fx_popup_menu):
493 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
494 (Ftry_completion):
495 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
496 (ns_menu_show):
497 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
498 (xmenu_show, xdialog_show):
499 Use bool for booleans.
500 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
501 as it's not a predicate. All uses changed. Omit unnecessary
502 buffer termination.
503
549c3414
DA
5042012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
505
506 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
507 (save_excursion_restore): Do not restore mark if it was not saved.
508
e85aafe7
PE
5092012-10-11 Paul Eggert <eggert@cs.ucla.edu>
510
fd2f90cf
PE
511 * marker.c (cached_modiff): EMACS_INT, not int.
512
c1af190b
PE
513 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
514 instead of having a wrong decl.
e85aafe7
PE
515 * nsmenu.m (waiting_for_input): Remove wrong decl.
516
e738ca56
PE
5172012-10-10 Paul Eggert <eggert@cs.ucla.edu>
518
9fa1de30
PE
519 keyboard.c, keymap.c: Use bool for booleans.
520 * dispnew.c (sit_for): Distinguish between 3-way display_option
521 and boolean do_display.
522 * keyboard.c (single_kboard, this_command_key_count_reset)
523 (waiting_for_input, echoing, immediate_quit, input_pending)
524 (interrupt_input, interrupts_deferred, pop_kboard)
525 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
526 (command_loop_1, adjust_point_for_property)
527 (safe_run_hooks_error, input_polling_used, read_char):
528 (help_char_p, readable_events, kbd_buffer_events_waiting)
529 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
530 (lucid_event_type_list_p, get_input_pending):
531 (gobble_input, menu_separator_name_p, menu_bar_item)
532 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
533 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
534 (keyremap_step, test_undefined, read_key_sequence)
535 (detect_input_pending, detect_input_pending_ignore_squeezables)
536 (detect_input_pending_run_timers, requeued_events_pending_p)
537 (quit_throw_to_read_char, Fset_input_interrupt_mode):
538 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
539 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
540 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
541 (accessible_keymaps_1, Fkey_description, push_key_description):
542 (shadow_lookup, struct where_is_internal_data)
543 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
544 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
545 (describe_map, describe_vector):
546 * menu.c (single_menu_item):
547 * nsmenu.m (ns_update_menubar):
548 * process.c (wait_reading_process_output):
549 * search.c (scan_buffer, scan_newline):
550 Use bool for boolean.
551 * keyboard.c (timers_run, swallow_events)
552 (detect_input_pending_run_timers):
553 * process.c (wait_reading_process_output):
554 Use unsigned for counter where wraparound-on-overflow is desired,
555 since unsigned is guaranteed to have that behavior and signed is not.
556 (read_char): Use ptrdiff_t for string length.
557 (get_input_pending): Remove first argument, since it was always
558 the same pointer-to-int (now pointer-to-boolean) &input_pending,
559 and behave as if it had that value. Return new value of
560 input_pending. All callers changed.
561 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
562 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
563 a string length.
564 * keymap.c (push_key_description): Omit last arg, which was always 1.
565 All callers changed.
566
e738ca56
PE
567 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
568
29f21cdf
JB
5692012-10-10 Juanma Barranquero <lekktu@gmail.com>
570
571 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
572 ($(BLD)/term.$(O)): Update dependencies.
573
6aea7528
DA
5742012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
575
576 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
577 * lisp.h (enum pvec_type): Adjust comments and omit explicit
578 initializer for PVEC_NORMAL_VECTOR.
579
5f3f57be
PE
5802012-10-10 Paul Eggert <eggert@cs.ucla.edu>
581
582 Clean out old termopts cruft.
583 * termopts.h (flow_control, meta_key): Remove unused decls.
584 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
585 Don't include termopts.h.
586
3e98c68e
DA
5872012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
588
589 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
590
77e344e5
PE
5912012-10-10 Paul Eggert <eggert@cs.ucla.edu>
592
593 * commands.h (immediate_quit): Remove duplicate decl.
594
5683d7cd
JD
5952012-10-09 Jan Djärv <jan.h.d@swipnet.se>
596
597 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
598 caching.
599 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 600 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 601
cf5fc6db
EZ
6022012-10-09 Eli Zaretskii <eliz@gnu.org>
603
b15736e6
EZ
604 * w32fns.c (w32_last_error): Change the return value to DWORD, to
605 match what GetLastError returns. Explain why the function is
606 needed.
607
cf5fc6db
EZ
608 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
609 'is_tooltip_frame', to avoid confusion with its global namesake.
610
f99714ce
DC
6112012-10-08 Daniel Colascione <dancol@dancol.org>
612
613 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
614 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
615 build that caused Emacs to display the hourglass cursor forever.
f99714ce 616
fd59cb29
GM
617 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
618 which is broken under remote desktop, calculate the number of
619 colors available for a display based on the display's number of
620 planes and number of bits per pixel per plane. (bug#10397).
621
62c480c9 6222012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 623
62c480c9
JD
624 * nsfont.m (Vfonts_in_cache): New variable.
625 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
626 are used. Add cached fonts to Vfonts_in_cache.
627 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
628
607446ba
JB
6292012-10-08 Juanma Barranquero <lekktu@gmail.com>
630
fd5125ad
JB
631 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
632 in nt/config.nt.
46979e0b
JB
633 (FONT_H): Define after FRAME_H.
634 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
635 Update dependencies.
fd5125ad 636
607446ba
JB
637 * w32term.c: Remove leftover declaration of keyboard_codepage.
638
b6f4e300
EZ
6392012-10-08 Eli Zaretskii <eliz@gnu.org>
640
c54ebba4
EZ
641 * makefile.w32-in (FONT_H): Add $(FRAME_H).
642 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
643 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
644 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
645 ($(BLD)/unexw32.$(O)):
646 ($(BLD)/w32.$(O)):
647 ($(BLD)/w32console.$(O)):
648 ($(BLD)/w32fns.$(O)):
649 ($(BLD)/w32heap.$(O)):
650 ($(BLD)/w32menu.$(O)):
15c720a3 651 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 652
b6f4e300
EZ
653 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
654 'const char *'.
655 (x_to_w32_color): Don't modify the argument, modify a copy instead.
656
501199a3
DC
6572012-10-08 Daniel Colascione <dancol@dancol.org>
658
659 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
660 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
661 accidental message numbering hole. Change other messages to
662 match.
663
664 * w32select.h (HAVE_W32SELECT): Remove.
665
666 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 667 w32common.h instead of w32heap.h.
501199a3
DC
668
669 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
670 (get_allocation_unit, get_processor_type, get_w32_major_version)
671 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
672 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
673 (OS_NT, os_subtype, cache_system_info): Move declarations to
674 w32common.
675
676 * w32heap.c: Include w32common.h.
677 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
678 (w32_minor_version, w32_build_number, w32_subtype):
679 Remove duplicate definitions.
501199a3
DC
680
681 * w32fns.c: Include w32common.h; include w32heap.h only in
682 WINDOWSNT.
683
684 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
685 Use `report_file_error' instead of `error' in order to better
686 inform users of what went wrong. Increase NTGUI_UNICODE file
687 dialog box file name length to 32k, the maximum allowed by the NT
688 kernel.
689
690 * w32common.h: New file.
691 (ROUND_UP, ROUND_DOWN, get_page_size)
692 (get_allocation_unit, get_processor_type, get_w32_major_version)
693 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
694 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
695 (OS_NT, os_subtype, cache_system_info): Move here.
696
697 * unexw32.c, unexcw.c: Include w32common.h.
698
699 * emacs.c (main): Use (defined (WINDOWSNT) || defined
700 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
701 to call syms_of_w32select.
702
703 * cygw32.h: Remove obsolete EXFUN declarations.
704
705 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
706
707 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
708 of w32inevt.o from SOME_MACHINE_OBJECTS.
709
93aa5c81
DC
7102012-10-08 Daniel Colascione <dancol@dancol.org>
711
712 * image.c: Permanent fix for JPEG compilation issue --- limit
713 jpeglib `boolean' redefinition to Cygwin builds.
714
d424f3d8
EZ
7152012-10-08 Eli Zaretskii <eliz@gnu.org>
716
8ee4c6ce
EZ
717 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
718
d424f3d8
EZ
719 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
720 Cygwin.
721
e08348a0
DC
7222012-10-08 Daniel Colascione <dancol@dancol.org>
723
724 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
725 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
726 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
727 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
728 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
729 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
730 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
731 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
732 now a supported configuration.
733
734 * Makefile.in: consolidate image variables into LIBIMAGE; add
735 W32_OBJ and W32_LIBS. Compile new files.
736
737 * conf_post.h:
738 (_DebPrint) declare tracing facility for W32 debugging. We need
739 to unify tracing later.
740
741 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
742 unconditional use of W32 Unicode functions. Cygwin runs only on
743 100% Unicode operating systems.
744
745 * cygw32.c: New file. Define Cygwin-specific facilities.
746 (Fcygwin_convert_path_to_windows)
747 (Fcygwin_convert_path_from_windows): New user functions for
748 accessing Cygwin path-munging routines.
749
750 * cygw32.h: New file.
751 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
752 UTF-16LE strings temporarily inside non-Lisp-visible string
753 objects.
754
755 (w32_strerror): Just what it says on the tin.
756
757 * emacs.c: Make the NS fork-then-exec code for daemon-launching
758 also run for Cygwin; both systems have the same problem with using
759 GUI facilities in a forked child. Also call syms_of_cygw32,
760 syms_of_w32select in correct places.
761
762 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
763 needs fork-then-exec for daemon launching.
764
765 * font.h: Include frame.h.
766
767 * image.c: Use the image library cache machinery only when we're
768 compiling for native WINDOWSNT; Cygwin can use shared libraries
769 like any other Unixlike system.
770
771 * keyboard.c: Clarify a comment regarding the input loop.
772
773 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
774 functions directly instead of trying to detect at runtime that our
775 host operating system supports them. We make this change for two
776 reasons: Cygwin lacks support for the multibyte character
777 conversion functions used by the legacy menu code, and Cygwin
778 never needs to rely on non-Unicode APIs.
779
780 * unexw32.c (hinst): Declare extern.
781
782 * w32.c: Change header order;
783 (w32_strerror): Move to w32fns.c because we need it for
784 non-WINDOWSNT builds.
785
786 * w32.h: Add #error macro to make sure we don't include w32.h for
787 Cygwin builds. Remove w32select declarations.
788
789 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 790 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
791
792 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
793 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
794 POSIXy alternative.
795 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
796 (w32_major_version, w32_minor_version, w32_build_number)
797 (os_subtype, sound_type): Define here
798 (w32_defined_color): Make color parameter const for consistency
799 with other _defined_color functions.
800 (w32_createwindow): Unconditionally call w32_init_class instead of
801 doing so only when hprevinst is non-NULL. Plumbing hprevinst
802 through the code is complex and unnecessary because class
803 registration is practically free.
804 (w32_name_of_message): New EMACSDEBUG-only function.
805 (Fset_message_beep): Move here
806 (Fx_open_connection): Require that the display name for Windows be
807 "w32" for consistency, emacsclient disambiguation, and maybe, one
808 day, multi-window-system support.
809 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
810 Cygwin files for W32 GUI facilities, since these clearly don't
811 expect Cygwin names.
812 (_DebPrint): Define.
813 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
814 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
815 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
816 (w32_last_error): Remove.
817
818 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
819
820 * w32heap.c (syspage_mask): Declare here.
821 (cache_system_info): Remove.
822
823 * w32inevt.c (faked_key): Define globally, not statically.
824 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
825 (w32_console_toggle_lock_key): Move to w32fns.c.
826
827 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
828
829 * w32proc.c (_DebPrint): Move to w32fns.c.
830 * w32select.c: Include string.h, stdio.h for Cygwin.
831 * w32select.h: New File.
832
833 * w32term.c: Include io.h for non-CYGWIN builds; needed for
834 get_osfhandle.
835 (w32_message_fd): New variable. Under Cygwin, holds the file
836 descriptor the system used to tell us about pending thread
837 messages.
838
839 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
840 that prevented compilation under non-WINDOWSNT systems.
841
842 (w32_initialize): Open /dev/windows and assign it to
843 w32_message_fd. Provide w32 feature.
844
845 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
846 (WM_EMACS_INPUT_READY): add.
847 (prepend_msg, w32_message_fd): Declare globally.
848
849 * w32xfns.c:
850 (keyboard_handle): Use only when WINDOWSNT.
851 (notify_msg_ready): New function. Posts a message to the main
852 thread's message queue under CYGWIN, which wakes up the main
853 thread from select(2) by making the /dev/windows file descriptor
854 ready. Under WINDOWSNT, it sets an event the same way the old
855 code did.
856
857 (post, prepend_msg): Actually call notify_msg_ready instead of
858 setting the input event directly.
859
98daa893
EZ
8602012-10-07 Eli Zaretskii <eliz@gnu.org>
861
862 * ralloc.c (relinquish): If a heap is ready to be relinquished,
863 but it still has blocs in it, don't return it to the system,
864 instead of aborting. (Bug#12402)
865
3bc0a2f7
JD
8662012-10-07 Jan Djärv <jan.h.d@swipnet.se>
867
8ad5b73b 868 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 869
335f5ae4
JD
870 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
871 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
872 (syms_of_nsterm): Remove comment about Panther and above for
873 ns-antialias-text.
335f5ae4
JD
874 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
875 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
876 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
877
878 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
879 MAC_OS_X_VERSION_10_4.
880
8ad5b73b
JD
881 * nsmenu.m (fillWithWidgetValue:): Remove code for <
882 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
883
884 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
885
886 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
887 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
888
3bc0a2f7
JD
889 * nsterm.m (ns_in_resize): Remove (Bug#12479).
890 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
891 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
892 Remove ns_in_resize check.
3bc0a2f7
JD
893 (ns_clear_frame_area): Remove resize handle code.
894
895 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
896 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
897 Remove ns_in_resize check.
3bc0a2f7 898
c622b48f
PE
8992012-10-07 Paul Eggert <eggert@cs.ucla.edu>
900
901 Improve sys_siglist detection.
902 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
903 defined as a macro, as is done in Solaris.
904 (sys_siglist_entries): New macro.
905 (save_strsignal): Use it.
906 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
907 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
908
04fafa46
JD
9092012-10-06 Jan Djärv <jan.h.d@swipnet.se>
910
911 * nsfns.m (Fx_create_frame): Call x_default_parameter with
912 fullscreen/Fullscreen.
913
914 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
915 tobar_height is new.
916
917 * nsterm.m (x_make_frame_visible): Check for fullscreen.
918 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
919 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
920 (windowDidResize:): Check for correct window if old style fullscreen.
921 Capitalize word in comment. Remove incorrect comment.
922 (initFrameFromEmacs:): tbar_height renamed tibar_height.
923 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
924 error in drawing background.
1f9f395d 925 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
926 Set toolbar values to zero, save old height in tobar_height.
927 Restore tool bar height when leaving fullscreen.
928 (canBecomeMainWindow): New function.
929
c6e21c03
PE
9302012-10-06 Paul Eggert <eggert@cs.ucla.edu>
931
932 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
933
0d9f584b
EZ
9342012-10-05 Eli Zaretskii <eliz@gnu.org>
935
a65fbb5f
EZ
936 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
937
0d9f584b 938 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
939 that time stamps of directories could also be changed.
940 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
941 FILE_WRITE_ATTRIBUTES access rights.
942
943 * fileio.c (Fset_file_times): Special-case ignoring errors for
944 directories only on MSDOS, not on MS-Windows.
945
e8757f09 9462012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
947
948 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
949
7604f298
EZ
9502012-10-04 Eli Zaretskii <eliz@gnu.org>
951
952 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
953 see whether CreateFile failed.
954
88d69b7d
PE
9552012-10-04 Paul Eggert <eggert@cs.ucla.edu>
956
957 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
958 to avoid similar races.
959 * keyboard.c (pending_signals): Now bool, not int.
960
7509f454
PE
961 Port timers to OpenBSD, plus check for timer failures.
962 OpenBSD problem reported by Han Boetes.
963 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
964 and/or setitimer.
965 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
966 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
967 like OpenBSD, which has timer_settime but does not declare it.
968 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
969 whether to use itimerspec-related primitives. All uses of
970 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
971
a3c5c0c5
PE
9722012-10-02 Paul Eggert <eggert@cs.ucla.edu>
973
974 * profiler.c (handle_profiler_signal): Fix a malloc race
975 that caused Emacs to hang on Fedora 17 when profiling Lisp.
976
914e743b
JD
9772012-10-02 Jan Djärv <jan.h.d@swipnet.se>
978
979 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
980
d8ab37a8
EZ
9812012-10-02 Eli Zaretskii <eliz@gnu.org>
982
983 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
984 consistent with the change in return value of 'safe_strsignal'.
985
b3ecad33
PE
9862012-10-02 Paul Eggert <eggert@cs.ucla.edu>
987
0a99eee1
PE
988 Prefer plain 'static' to 'static inline' (Bug#12541).
989 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
990 (bidi_set_sor_type, bidi_push_embedding_level)
991 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
992 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
993 (bidi_cache_search, bidi_cache_ensure_space)
994 (bidi_cache_iterator_state, bidi_cache_find)
995 (bidi_peek_at_next_level, bidi_set_paragraph_end)
996 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
997 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
998 Now 'static', not 'static inline'.
999
b3ecad33
PE
1000 Count overruns when profiling; change units to ns.
1001 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1002 Give extra weight to samples after overruns, to attempt to count
1003 the time more accurately.
1004 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1005 the underlying primitives nominally do ns.
1006 (Fprofiler_cpu_start): Document the change. Mention that
1007 the sampling intervals are only approximate.
1008
090cf9db
SM
10092012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1010
1011 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1012
1013 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1014 case for the special 0 coding-system.
1015
1016 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1017 (Fmake_overlay): Remove redundant tests.
64edc777 1018 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 1019
81550bf4
JB
10202012-10-02 Juanma Barranquero <lekktu@gmail.com>
1021
1022 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1023 Update dependencies.
1024
aa1ba90e
PE
10252012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1026
1027 Fix a malloc race condition involving strsignal.
1028 A signal can arrive in the middle of a malloc, and Emacs's signal
1029 handler can invoke strsignal, which can invoke malloc, which is
1030 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1031 Fix it by altering the signal handler so that it does not invoke
1032 strsignal.
1033 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1034 * process.c (status_message): Use const pointer, in case strsignal
1035 is #defined to safe_strsignal.
1036 * sysdep.c (sys_siglist, init_signals): Always define and
1037 initialize a substitute sys_siglist if the system does not define
1038 one, even if HAVE_STRSIGNAL.
1039 (safe_strsignal): Rename from strsignal. Always define,
1040 using sys_siglist. Return a const pointer.
1041 * syssignal.h (safe_strsignal): New decl.
1042 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1043
ace917bd
EZ
10442012-10-01 Eli Zaretskii <eliz@gnu.org>
1045
1046 * w32proc.c (timer_loop): Fix code that waits for timer
1047 expiration, to avoid high CPU usage.
1048
9eb71b9c
SM
10492012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1050
1051 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1052 (sweep_weak_table): Remove redundant prototypes.
1053
b3317662
FP
10542012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1055
1056 * emacs.c: Move the inclusion of TERM_HEADER after including
1057 windows.h on WINDOWSNT. This avoids compilation problems with
1058 MSVC.
1059
f0e5f225
EZ
10602012-10-01 Eli Zaretskii <eliz@gnu.org>
1061
2d7d1608
EZ
1062 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1063 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1064 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1065 as the previous version used 'void *'.
1066
1067 * ralloc.c (ROUNDUP): Fix last change.
1068 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1069 'size_t'.
1070
f0e5f225
EZ
1071 * w32proc.c <disable_itimers>: New static flag.
1072 (init_timers): Initialize it to zero, after creating the critical
1073 sections used by the timer threads.
1074 (term_timers): Set to 1 before deleting the critical sections.
1075 (getitimer, setitimer): If disable_itimers is non-zero, return an
1076 error indication without doing anything. Reported by Fabrice
1077 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
1078 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1079 return results.
1080 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1081 support timers.
f0e5f225
EZ
1082
1083 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1084 term_ntproc after all the other bookkeeping, to get timers working
1085 as long as possible.
1086
82ef37c1
PE
10872012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1088
b3a4c387
PE
1089 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1090 Suggested by Juri Linkov in
1091 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1092
b0ab8123
PE
1093 Prefer plain 'static' to 'static inline' (Bug#12541).
1094 With static functions, modern compilers inline pretty well by
1095 themselves; advice from programmers often hurts as much as it helps.
1096 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1097 this change shrinks the text size of the Emacs executable by 1.1%
1098 without affecting CPU significantly in my benchmark.
1099 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1100 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1101 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1102 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1103 (bset_auto_fill_function, bset_auto_save_file_format)
1104 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1105 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1106 (bset_cache_long_line_scans, bset_case_fold_search)
1107 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1108 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1109 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1110 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1111 (bset_header_line_format, bset_indicate_buffer_boundaries)
1112 (bset_indicate_empty_lines, bset_invisibility_spec)
1113 (bset_left_fringe_width, bset_major_mode, bset_mark)
1114 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1115 (bset_name, bset_overwrite_mode, bset_pt_marker)
1116 (bset_right_fringe_width, bset_save_length)
1117 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1118 (bset_scroll_up_aggressively, bset_selective_display)
1119 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1120 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1121 (set_buffer_overlays_after):
1122 * category.c (bset_category_table):
1123 * charset.c (read_hex):
1124 * coding.c (produce_composition, produce_charset)
1125 (handle_composition_annotation, handle_charset_annotation)
1126 (char_encodable_p):
1127 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1128 (assign_row, set_frame_matrix_frame, make_current)
1129 (add_row_entry):
1130 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1131 * fns.c (maybe_resize_hash_table):
1132 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1133 * gmalloc.c (register_heapinfo):
1134 * image.c (lookup_image_type):
1135 * intervals.c (set_interval_object, set_interval_left)
1136 (set_interval_right, copy_interval_parent, rotate_right)
1137 (rotate_left, balance_possible_root_interval):
1138 * keyboard.c (kset_echo_string, kset_kbd_queue)
1139 (kset_keyboard_translate_table, kset_last_prefix_arg)
1140 (kset_last_repeatable_command, kset_local_function_key_map)
1141 (kset_overriding_terminal_local_map, kset_real_last_command)
1142 (kset_system_key_syms, clear_event, set_prop):
1143 * lread.c (digit_to_number):
1144 * marker.c (attach_marker, live_buffer, set_marker_internal):
1145 * nsterm.m (ns_compute_glyph_string_overhangs):
1146 * process.c (pset_buffer, pset_command)
1147 (pset_decode_coding_system, pset_decoding_buf)
1148 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1149 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1150 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1151 * syntax.c (bset_syntax_table, dec_bytepos):
1152 * terminal.c (tset_param_alist):
1153 * textprop.c (interval_has_some_properties)
1154 (interval_has_some_properties_list):
1155 * window.c (wset_combination_limit, wset_dedicated)
1156 (wset_display_table, wset_hchild, wset_left_fringe_width)
1157 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1158 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1159 (wset_right_fringe_width, wset_right_margin_cols)
1160 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1161 (wset_vertical_scroll_bar_type, wset_window_parameters):
1162 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1163 (wset_column_number_displayed, wset_region_showing)
1164 (window_box_edges, run_window_scroll_functions)
1165 (append_glyph_string_lists, prepend_glyph_string_lists)
1166 (append_glyph_string, set_glyph_string_background_width)
1167 (append_glyph, append_composite_glyph)
1168 (take_vertical_position_into_account):
1169 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1170 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1171 (lface_hash, lface_same_font_attributes_p, lookup_face):
1172 * xml.c (libxml2_loaded_p):
1173 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1174 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1175 Now 'static', not 'static inline'.
1176
05584c31
PE
1177 * bidi.c: Tune.
1178 (bidi_copy_it): Do the whole copy with a single memcpy.
1179 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1180
86ec63ba
PE
1181 Revert the FOLLOW-SYMLINKS change for file-attributes.
1182 Doing it right would require several changes to Tramp, and there's
1183 not enough time to get that tested before the freeze today.
1184 * dired.c (directory_files_internal, Ffile_attributes):
1185 Undo last change.
1186
82ef37c1
PE
1187 * frame.c (x_report_frame_params): Port better to wider ints.
1188 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1189 or that pointers can be printed in 15 decimal digits.
1190 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1191
62aba0d4
FP
11922012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1193
1194 Support x64 build on MS-Windows.
1195 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1196 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1197 compatibility with x64.
5e4daaf3 1198 (x_get_focus_frame): Add prototype.
62aba0d4
FP
1199
1200 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1201 defining an XRectangle structure.
1202
1203 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1204 arithmetics for compatibility with x64.
1205
1206 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1207 compatibility with x64.
1208
1209 * w32heap.h: Adjust prototypes and declarations.
1210
1211 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1212 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1213 DWORD, long, and unsigned long, for compatibility with x64.
1214 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1215 (sbrk): Argument is now of type ptrdiff_t.
1216
1217 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1218 less than 0x0500.
1219 (w32_msg_pump): Use WPARAM type for 'result'.
1220
1221 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1222 architecture.
1223 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1224 compatibility with x64.
1225
1226 * vm-limit.c (lim_data): Now size_t.
1227 (check_memory_limits): Adjust prototypes of real_morecore and
1228 __morecore to receive argument of type ptrdiff_t. Use size_t for
1229 five_percent and data_size.
1230
1231 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1232 variables, for compatibility with x64.
1233 (rva_to_section, offset_to_section, relocate_offset)
1234 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1235 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1236 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1237 for compatibility with x64.
1238
1239 * sysdep.c (STDERR_FILENO): Define if not already defined.
1240
1241 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1242 (__morecore): Argument type is now ptrdiff_t.
1243 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1244 (relinquish): Use ptrdiff_t type for 'excess'.
1245 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1246
1247 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1248 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1249 instead of a literal number.
1250
1251 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1252 (min): Define only if not already defined.
1253
1254 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1255 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1256 hosts.
1257
1258 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1259 'bitmaps' is a pointer.
1260
1261 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1262
1263 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1264
e7a2937b
PE
12652012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1266
1267 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1268 * dired.c (directory_files_internal, Ffile_attributes):
1269 New arg follow_symlinks. All uses changed.
1270
b43d62ae
SM
12712012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1272
1273 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1274
c06c382a
EZ
12752012-09-30 Eli Zaretskii <eliz@gnu.org>
1276
1277 Support atimers and CPU profiler via profile.c on MS-Windows.
1278 * w32proc.c (sig_mask, crit_sig): New static variables.
1279 (sys_signal): Support SIGALRM and SIGPROF.
1280 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 1281 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
1282 sigfillset, and sigprocmask are no longer no-ops.
1283 (sigismember): New function.
1284 (struct itimer_data): New definition.
1285 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1286 (crit_prof): New static variables.
1287 (MAX_SINGLE_SLEEP): New definition.
1288 (timer_loop, stop_timer_thread, term_timers, init_timers)
1289 (start_timer_thread, getitimer, setitimer): New functions.
1290 (alarm): No longer a no-op, calls setitimer.
1291
1292 * w32.c (term_ntproc): Call term_timers.
1293 (init_ntproc): Make sure all signals are unblocked at startup, to
1294 erase any traces of dumping. Call init_timers.
1295
1296 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1297 Windows-specific code to display the hourglass mouse pointer is no
1298 longer used.
1299 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1300 to hourglass timer expiration.
1301 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1302 Remove, no longer used.
b43d62ae
SM
1303 (w32_note_current_window, show_hourglass, hide_hourglass):
1304 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
1305 window systems.
1306 (syms_of_w32fns): Don't initialize hourglass_timer.
1307
1308 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1309 WINDOWSNT as well.
1310 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1311
1312 * w32.h (init_timers, term_timers): Add prototypes.
1313
95402d5f
KH
13142012-09-30 Kenichi Handa <handa@gnu.org>
1315
1316 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1317 to the buffer relocation which may be caused by ccl_driver.
1318
dd946752
JD
13192012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1320
d7e642cc
JD
1321 * xfns.c (Fx_file_dialog): Update comment.
1322
1323 * w32fns.c (Fx_file_dialog): Update comment.
1324
1325 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1326 Initialize panel name field if OSX >= 10.6.
1327
1328 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1329
dd946752
JD
1330 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1331
1332 * nsterm.m (NEW_STYLE_FS): New define.
1333 (ns_fullscreen_hook, windowWillEnterFullScreen)
1334 (windowDidEnterFullScreen, windowWillExitFullScreen)
1335 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1336 (setFSValue): New functions.
1337 (EmacsFSWindow): New implementation.
1338 (canBecomeKeyWindow): New function for EmacsFSWindow.
1339 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1340 (dealloc): Release nonfs_window if in fullscreen.
1341 (updateFrameSize:): Call windowDidMove to update top/left.
1342 (windowWillResize:toSize:): Check if frame is still maximized.
1343 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1344 next_maximized, maximized_width, maximized_height and nonfs_window.
1345 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1346 tbar_height.
1347 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 1348 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
1349
1350 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1351 (EmacsView): Add variables for fullscreen.
1352 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1353 (EmacsFSWindow): New interface for fullscreen.
1354
427730eb
JB
13552012-09-30 Juanma Barranquero <lekktu@gmail.com>
1356
1357 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1358
48de8b12
CY
13592012-09-30 Chong Yidong <cyd@gnu.org>
1360
1361 * fns.c (Frandom): Doc fix.
1362
5938d519
MR
13632012-09-30 Martin Rudalics <rudalics@gmx.at>
1364
1365 * window.c (Vwindow_combination_limit): New default value.
1366 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1367
cb5b0266
PE
13682012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1369
1370 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1371 Suggested by Eli Zaretskii in
1372 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1373
84f72efd
EZ
13742012-09-30 Eli Zaretskii <eliz@gnu.org>
1375
1376 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1377 HAVE_TIMER_SETTIME is defined.
1378
9d4dcdc9
PE
13792012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1380
d89460ed
PE
1381 Profiler improvements: more-accurate timers, overflow checks.
1382 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1383 signal.h, setjmp.h. Include systime.h instead.
1384 (saturated_add): New function.
1385 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1386 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1387 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1388 New static vars.
84f72efd 1389 (enum profiler_cpu_running): New enum.
d89460ed
PE
1390 (profiler_cpu_running): Now of that enum type, not bool.
1391 All uses changed to store the new value.
1392 (handle_profiler_signal): Rename from sigprof_handler_1,
1393 for consistency with other handlers. Do not check whether
1394 cpu_log is a hash-table if garbage collecting, since it
1395 doesn't matter in that case.
1396 (deliver_profiler_signal): Rename from sigprof_handler,
1397 for consistency with other handlers.
1398 (setup_cpu_timer): New function, with much of what used to be in
1399 Fprofiler_cpu_start. Check for out-of-range argument.
1400 Prefer timer_settime if available, and prefer
1401 thread cputime clocks, then process cputime clocks, then
1402 monotonic clocks, to the old realtime clock. Use make_timeval
1403 to round more-correctly when falling back to setitimer.
1404 (Fprofiler_cpu_start): Use it.
1405 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1406 Don't assume that passing NULL as the 2nd argument of setitimer
1407 is the same as passing a pointer to all-zero storage.
1408 Ignore SIGPROF afterwards.
1409 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1410 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1411 non-fatal signal handlers. Ignore SIGPROF on startup.
1412 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1413 in profiler.c, since sysdep.c now uses it.
1414
9d4dcdc9
PE
1415 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1416 Suggested by Eli Zaretskii in
1417 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1418
8e5691a0
JB
14192012-09-29 Juanma Barranquero <lekktu@gmail.com>
1420
1421 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1422
e7c1b6ef
SM
14232012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1424
1425 * lisp.h (struct backtrace): Remove indirection for `function' field.
1426 * xdisp.c (redisplay_internal):
1427 * profiler.c (record_backtrace, sigprof_handler_1):
1428 * alloc.c (Fgarbage_collect):
1429 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1430 (Fbacktrace_frame): Adjust accordingly.
1431
e61d39cd 14322012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
1433
1434 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1435 (Frun_hook_with_args_until_failure): Doc fixes.
1436
404043ea
EZ
14372012-09-28 Eli Zaretskii <eliz@gnu.org>
1438
1439 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1440 Qautomatic_redisplay and change the symbol name. All users changed.
1441
704d3f45
TM
14422012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1443
1444 * profiler.c (sigprof_handler): Fix race condition.
1445
757140ff
GM
14462012-09-28 Glenn Morris <rgm@gnu.org>
1447
1448 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1449
a615a3ae
PE
14502012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1451
1452 Check more robustly for timer_settime.
89d17fd0
PE
1453 * Makefile.in (LIB_TIMER_TIME): New macro.
1454 (LIBES): Add it.
a615a3ae
PE
1455 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1456 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1457 call timer_settime.
1458
3670daf7
TM
14592012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1460
1461 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1462
6a586b7f
JB
14632012-09-26 Juanma Barranquero <lekktu@gmail.com>
1464
1465 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1466
41c8bfcf
PE
14672012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1468
1469 * character.h (MAYBE_UNIFY_CHAR): Remove.
1470 * charset.c, charset.h (maybe_unify_char): Now static.
1471 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1472 Since this stuff is now private to charset.c, there's no need for
1473 a public macro and no need to inline by hand.
1474
3a880af4
SM
14752012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1476 Stefan Monnier <monnier@iro.umontreal.ca>
1477 Juanma Barranquero <lekktu@gmail.com>
611b7507 1478
3a880af4
SM
1479 * profiler.c: New file.
1480 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
1481 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1482 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
1483 * emacs.c (main): Call syms_of_profiler.
1484 * alloc.c (Qautomatic_gc): New constant.
1485 (MALLOC_PROBE): New macro.
1486 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1487 (total_bytes_of_live_objects): New function.
1488 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1489 Call malloc_probe for the memory profiler.
1490 (syms_of_alloc): Define Qautomatic_gc.
1491 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1492 race condition.
1493 (struct backtrace): Move definition...
1494 * lisp.h (struct backtrace): ..here.
1495 (Qautomatic_gc, profiler_memory_running): Declare vars.
1496 (malloc_probe, syms_of_profiler): Declare functions.
1497 * xdisp.c (Qautomatic_redisplay): New constant.
1498 (redisplay_internal): Record itself in backtrace_list.
1499 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 1500
5938d519 15012012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
15022012-09-25 Juanma Barranquero <lekktu@gmail.com>
1503
1504 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1505
e26fd2e4
PE
15062012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1507
1508 Prefer POSIX timers if available.
1509 They avoid a race if the timer is too close to the current time.
1510 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1511 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 1512 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 1513
eedec3ee
EZ
15142012-09-25 Eli Zaretskii <eliz@gnu.org>
1515
1516 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1517 CHAR_STRING_ADVANCE.
1518 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1519 STRING_CHAR_ADVANCE.
1520
aa15c6bb
JB
15212012-09-25 Juanma Barranquero <lekktu@gmail.com>
1522
1523 Move Vlibrary_cache to emacs.c and reset before dumping.
1524
1525 * lisp.h (reset_image_types): Declare.
1526 [WINDOWSNT] (Vlibrary_cache): Declare.
1527
1528 * image.c (reset_image_types): New function.
1529
1530 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1531 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1532 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1533
1534 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1535 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1536
1537 * w32.h (Vlibrary_cache): Do not declare.
1538
54d629be
EZ
15392012-09-25 Eli Zaretskii <eliz@gnu.org>
1540
16b22fef
EZ
1541 * w32proc.c (sys_signal): Handle all signals defined by the
1542 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1543 handlers for signals supported by Windows. Don't override
1544 term_ntproc as the handler for SIGABRT.
1545 (sigaction): Rewrite to call sys_signal instead of duplicating its
1546 code.
1547 (sys_kill): Improve commentary.
1548
1549 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1550 consistency with a signature of a signal handler. All callers
1551 changed.
1552 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1553 install term_ntproc as a signal handler for SIGABRT, as that
1554 should be done by the dumped Emacs.
1555
1556 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1557
1558 * w32select.c (term_w32select): Protect against repeated
1559 invocation by setting clipboard_owner to NULL after calling
1560 DestroyWindow.
1561
1562 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1563 and term_ntproc to their modified signatures.
1564
54d629be
EZ
1565 * character.c (char_string, string_char): Remove calls to
1566 MAYBE_UNIFY_CHAR. See the discussion starting at
1567 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1568 for the details.
1569
59f7af81
CY
15702012-09-25 Chong Yidong <cyd@gnu.org>
1571
1572 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1573
22e8cf4a
SM
15742012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1575
1576 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1577 when encountering an unknown bytecode.
1578
578098f3
PE
15792012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1580
1581 image.c, indent.c: Use bool for booleans.
1582 * dispextern.h (struct image_type): Members valid_p, load, init
1583 now return bool, not int. All uses changed.
1584 * image.c: Omit unnecessary static decls.
1585 (x_create_bitmap_mask, x_build_heuristic_mask):
1586 Return void, not int, since callers don't care about the return value.
1587 (x_create_bitmap_mask, define_image_type, valid_image_p)
1588 (struct image_keyword, parse_image_spec, image_spec_value)
1589 (check_image_size, image_background)
1590 (image_background_transparent, x_clear_image_1)
1591 (postprocess_image, lookup_image, x_check_image_size)
1592 (x_create_x_image_and_pixmap, xbm_image_p)
1593 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1594 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1595 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1596 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1597 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1598 (png_image_p, init_png_functions, png_load_body, png_load)
1599 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1600 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1601 (init_gif_functions, gif_load, imagemagick_image_p)
1602 (imagemagick_load_image, imagemagick_load, svg_image_p)
1603 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1604 (gs_load):
1605 * nsimage.m (ns_load_image):
1606 * nsterm.m (ns_defined_color):
1607 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1608 * xfns.c (x_defined_color):
1609 * xterm.c (x_alloc_lighter_color_for_widget)
1610 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1611 (x_alloc_lighter_color):
1612 * indent.c (disptab_matches_widthtab, current_column)
1613 (scan_for_column, string_display_width, indented_beyond_p)
1614 (compute_motion, vmotion, Fvertical_motion):
1615 Use bool for booleans.
1616
a5f2b6ec
CY
16172012-09-24 Chong Yidong <cyd@gnu.org>
1618
1619 * chartab.c (Fset_char_table_default): Obsolete function removed.
1620
18e27ea8
PE
16212012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1622
afea8a8a
PE
1623 Move pid_t related decls out of lisp.h.
1624 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1625 (interruptible_wait_for_termination):
1626 Move these decls from lisp.h to syswait.h, since they use pid_t.
1627 Needed on FreeBSD; see Herbert J. Skuhra in
1628 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1629 * callproc.c: Include syswait.h.
1630
18e27ea8
PE
1631 gnutls.c, gtkutil.c: Use bool for boolean.
1632 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1633 (emacs_gnutls_handle_error):
1634 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1635 (xg_hide_tooltip, xg_create_frame_widgets)
1636 (create_dialog, xg_uses_old_file_dialog)
1637 (xg_get_file_with_chooser, xg_get_file_with_selection)
1638 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1639 (xg_item_label_same_p, xg_update_menubar)
1640 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1641 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1642 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1643 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1644 (update_frame_tool_bar, free_frame_tool_bar):
1645 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1646 * nsmenu.m (ns_update_menubar):
1647 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1648 * xfns.c (Fx_show_tip) [USE_GTK]:
1649 Use bool for boolean.
1650 * gtkutil.c (xg_update_frame_menubar):
1651 * xmenu.c (update_frame_menubar):
1652 Return void, not int, since caller ignores return value.
1653 * gtkutil.c (xg_change_toolbar_position):
1654 Return void, not 1.
1655
af0e9f75
JB
16562012-09-23 Juanma Barranquero <lekktu@gmail.com>
1657
1658 * makefile.w32-in (BLOCKINPUT_H): Remove.
1659 (SYSSIGNAL_H): New macro.
1660 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1661 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1662 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1663 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1664 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1665 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1666 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1667 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1668 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1669 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1670 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1671 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1672 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1673 ($(BLD)/w32xfns.$(O)): Update dependencies.
1674
5101529e
EZ
16752012-09-23 Eli Zaretskii <eliz@gnu.org>
1676
1677 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1678 fatal_error_backtrace.
1679
1680 * w32proc.c (sys_kill): Undo last change: don't do anything when
1681 invoked to deliver SIGABRT to our own process. This is now
1682 handled by emacs_raise.
1683
2c3ee0ad
JB
16842012-09-23 Juanma Barranquero <lekktu@gmail.com>
1685
1686 * w32term.c (w32_read_socket): Remove leftover reference to
1687 interrupt_input_pending.
1688
62a1d661
PE
16892012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1690
1691 Do not use SA_NODEFER.
1692 Problem reported by Dani Moncayo in
1693 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1694 * alloc.c (die):
1695 * sysdep.c (emacs_abort): Do not reset signal handler.
1696 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1697 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1698 wanted even on POSIXish hosts, and it doesn't work on Windows.
1699
a0942b9a
JD
17002012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1701
1702 * xterm.c (x_term_init): Call fixup_locale before and after calling
1703 gtk_init (Bug#12392).
1704
d07ff9db
CY
17052012-09-23 Chong Yidong <cyd@gnu.org>
1706
1707 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1708 Vdynamic_library_alist.
1709
1710 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1711 (Fgnutls_available_p): Caller changed.
1712
1713 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1714 (Flibxml_parse_xml_region): Likewise.
1715
1716 * dispextern.h (struct image_type): Remove arg from init function.
1717
1718 * image.c (Finit_image_library, lookup_image_type)
1719 (define_image_type): Remove now-unneeded second arg.
1720 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1721 (init_tiff_functions, init_gif_functions, init_svg_functions):
1722 Arglist and w32_delayed_load calling convention changed.
1723 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 1724 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 1725
4d7e6e51
PE
17262012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1727
1728 Simplify and avoid signal-handling races (Bug#12471).
1729 * alloc.c (die):
1730 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1731 Avoid recursive loop if there's a fatal error in the function itself.
1732 * atimer.c (pending_atimers):
1733 * blockinput.h: Don't include "atimer.h"; no longer needed.
1734 (interrupt_input_pending): Remove. All uses removed.
1735 pending_signals now counts both atimers and ordinary interrupts.
1736 This is less racy than having three separate pending-signal flags.
1737 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1738 (input_blocked_p):
1739 Rename from their upper-case counterparts BLOCK_INPUT,
1740 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1741 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1742 This makes it easier to access volatile variables more accurately.
1743 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1744 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1745 that's more reliable if the code is buggy and sets
1746 interrupt_input_blocked to a negative value. All uses changed.
1747 * atimer.c (deliver_alarm_signal):
1748 Remove. No need to deliver this to the parent; any thread can
1749 handle this signal now. All uses replaced by underlying handler.
1750 * atimer.c (turn_on_atimers):
1751 * dispnew.c (handle_window_change_signal):
1752 * emacs.c (handle_danger_signal):
1753 * keyboard.c (kbd_buffer_get_event):
1754 Don't reestablish signal handler; not needed with sigaction.
1755 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1756 (UNBLOCK_INPUT_TO):
1757 Rework to avoid unnecessary accesses to volatile variables.
1758 (UNBLOCK_INPUT_TO): Now a function.
1759 (totally_unblock_input, unblock_input): New decls.
1760 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1761 (init_data): Remove. Necessary stuff now done in init_signal.
1762 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1763 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1764 (fatal_error_code): Remove; no longer needed.
1765 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1766 it doesn't always backtrace. All uses changed. No need to reset
1767 signal to default, since sigaction and/or die does that for us now.
1768 Use emacs_raise (FOO), not kill (getpid (), FOO).
1769 (main): Check more-accurately whether we're dumping.
1770 Move fatal-error setup to sysdep.c
1771 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1772 * gtkutil.c (xg_get_file_name, xg_get_font):
1773 Remove no-longer-needed signal-mask manipulation.
1774 * keyboard.c, process.c (POLL_FOR_INPUT):
1775 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1776 * keyboard.c (read_avail_input): Remove.
1777 All uses replaced by gobble_input.
1778 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1779 (kbd_buffer_store_event_hold, gobble_input):
1780 (record_asynch_buffer_change) [USABLE_SIGIO]:
1781 (store_user_signal_events):
1782 No need to mess with signal mask.
1783 (gobble_input): If blocking input and there are terminals, simply
1784 set pending_signals to 1 and return. All hooks changed to not
1785 worry about whether input is blocked.
1786 (process_pending_signals): Clear pending_signals before processing
1787 them, in case a signal comes in while we're processing.
1788 By convention callers now test pending_signals before calling us.
1789 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1790 New functions, to support changes to blockinput.h.
1791 (handle_input_available_signal): Now extern.
1792 (reinvoke_input_signal): Remove. All uses replaced by
1793 handle_async_input.
1794 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
1795 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1796 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
1797 Clear sigmask reliably, even if Fsignal returns, which it can.
1798 Omit unnecessary accesses to volatile var.
1799 (quit_throw_to_read_char): No need to restore sigmask.
1800 * keyboard.c (gobble_input, handle_user_signal):
1801 * process.c (wait_reading_process_output):
1802 Call signal-handling code rather than killing ourselves.
1803 * lisp.h: Include <float.h>, for...
1804 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1805 (pending_signals): Now volatile.
1806 (syms_of_data): Now const if IEEE floating point.
1807 (handle_input_available_signal) [USABLE_SIGIO]:
1808 (terminate_due_to_signal, record_child_status_change): New decls.
1809 * process.c (create_process): Avoid disaster if memory is exhausted
1810 while we're processing a vfork, by tightening the critical section
1811 around the vfork.
1812 (send_process_frame, process_sent_to, handle_pipe_signal)
1813 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1814 ignores SIGPIPE.
1815 (send_process): No need for setjmp/longjmp any more, since the
1816 SIGPIPE stuff is now gone. Instead, report an error if errno
1817 is EPIPE.
1818 (record_child_status_change): Now extern. PID and W are now args.
1819 Return void, not bool. All callers changed.
1820 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1821 Remove. All uses removed. This bug should be fixed now in a
1822 different way.
1823 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1824 and record the child status change directly. This avoids the
1825 need to futz with the signal mask.
1826 (process_fatal_action): Move here from emacs.c.
1827 (emacs_sigaction_flags): New function, containing
1828 much of what used to be in emacs_sigaction_init.
1829 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1830 caught by emacs, to make races less likely.
1831 (deliver_process_signal): Rename from handle_on_main_thread.
1832 All uses changed.
1833 (BACKTRACE_LIMIT_MAX): Now at top level.
1834 (thread_backtrace_buffer, threadback_backtrace_pointers):
1835 New static vars.
1836 (deliver_thread_signal, deliver_fatal_thread_signal):
1837 New functions, for more-accurate delivery of thread-specific signals.
1838 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1839 (deliver_arith_signal): Handle in this thread, not
1840 in the main thread, since it's triggered by this thread.
1841 (maybe_fatal_sig): New function.
1842 (init_signals): New arg DUMPING so that we can be more accurate
1843 about whether we're dumping. Caller changed.
1844 Treat thread-specific signals differently from process-general signals.
1845 Block all signals while handling fatal error; that's safer.
1846 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1847 on IEEE hosts.
1848 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1849 Ignore SIGPIPE unless batch.
1850 (emacs_backtrace): Output backtrace for the appropriate thread,
1851 which is not necessarily the main thread.
1852 * syssignal.h: Include <stdbool.h>.
1853 (emacs_raise): New macro.
1854 * xterm.c (x_connection_signal): Remove; no longer needed
1855 now that we use sigaction.
1856 (x_connection_closed): No need to mess with sigmask now.
1857 (x_initialize): No need to reset SIGPIPE handler here, since
1858 init_signals does this for us now.
1859
8f4635e9
JD
18602012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1861
1862 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 1863 background rect may be larger (Bug#12245).
8f4635e9 1864
3296976d
CY
18652012-09-23 Chong Yidong <cyd@gnu.org>
1866
1867 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1868
d41e491e
PE
18692012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1870
1871 * .gdbinit: Just stop at fatal_error_backtrace.
1872 See Stefan Monnier's request in
1873 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1874 Remove no-longer-used query of system type.
1875
c88b867f
CY
18762012-09-22 Chong Yidong <cyd@gnu.org>
1877
1878 * search.c (Freplace_match): Doc fix (Bug#12325).
1879
1880 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1881
1882 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1883 (Fline_end_position): Doc fix.
1884
1885 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1886
bb4d86b4
CY
18872012-09-22 Chong Yidong <cyd@gnu.org>
1888
1889 * dispextern.h (struct image_type): Add new slot, storing a type
1890 initialization function.
1891
1892 * image.c (define_image_type): Call the image initializer function
1893 if it is defined. Arguments and return value changed.
1894 (valid_image_p, make_image): Callers changed.
1895 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
1896 (gif_type, imagemagick_type, svg_type, gs_type):
1897 Add initialization functions.
bb4d86b4
CY
1898 (Finit_image_library): Call lookup_image_type.
1899 (CHECK_LIB_AVAILABLE): Macro deleted.
1900 (lookup_image_type): Call define_image_type here, rather than via
1901 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1902 (syms_of_image): Move define_image_type calls for xbm_type and
1903 pbm_type to lookup_image_type.
1904
df9685f3
EZ
19052012-09-22 Eli Zaretskii <eliz@gnu.org>
1906
1907 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1908 'idle_timers' from here ...
1909 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1910 lists, to avoid infloops when the timer does something stupid,
1911 like reinvoke itself with the same or smaller time-out.
1912 (Bug#12447)
1913
8e17c9ba
MR
19142012-09-22 Martin Rudalics <rudalics@gmx.at>
1915
1916 * window.c (Fsplit_window_internal): Handle only Qt value of
1917 Vwindow_combination_limit separately.
1918 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
1919 (Vwindow_combination_limit): New default value.
1920 Rewrite doc-string.
8e17c9ba 1921
589bd69b
EZ
19222012-09-22 Eli Zaretskii <eliz@gnu.org>
1923
1924 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1925 the new overlay string. (Bug#10159)
1926
01108e3f
PE
19272012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1928
1929 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1930 or that fprintf is async-signal-safe. POSIX doesn't require
1931 either assumption.
1932
82f8cd94
CY
19332012-09-22 Chong Yidong <cyd@gnu.org>
1934
1935 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1936 (Bug#8207).
1937
3cccbd87
KH
19382012-09-22 Kenichi Handa <handa@gnu.org>
1939
1940 * composite.c (composition_reseat_it): Handle the case that a
1941 grapheme cluster is not covered by a single font (Bug#12352).
1942
09c01941
CY
19432012-09-21 Chong Yidong <cyd@gnu.org>
1944
1945 * image.c (define_image_type): Avoid adding duplicate types to
1946 image_types (Bug#12463). Suggested by Jörg Walter.
1947
acfa068f 19482012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
1949
1950 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1951 (print_load_command_name): Add case LC_DATA_IN_CODE.
1952 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1953
acfa068f 19542012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
1955
1956 * eval.c (Frun_hook_with_args_until_success)
1957 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1958
acfa068f 19592012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
1960
1961 * fileio.c (Ffile_selinux_context): Only call freecon when
1962 lgetfilecon succeeded.
1963 (Fset_file_selinux_context): Likewise. (Bug#12444)
1964
acfa068f 19652012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
1966
1967 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1968 reordering, locate the cursor by calling set_cursor_from_row; if
1969 that fails, clear the desired glyph matrix before returning a
1970 failure indication to the caller. Fixes leaving garbled display
1971 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
1972 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1973 scrolling through multibyte text.
aa36e4d2 1974
e99f70c8
SM
19752012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1976
1977 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1978 calling mark_vectorlike since that's the one that marks the window.
1979 (mark_discard_killed_buffers): Mark the final cdr.
1980 * window.h (struct window): Move prev/next_buffers to the
1981 non-standard fields.
1982 * window.c (make_window): Initialize prev/next_buffers manually.
1983
f75beb47
PE
19842012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1985
1986 Omit unused arg EXPECTED from socket hooks.
1987 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1988 * nsterm.m (ns_term_init):
1989 * termhooks.h (struct terminal.read_socket_hook):
1990 * w32inevt.c (w32_console_read_socket):
1991 * w32term.c (w32_read_socket):
1992 * xterm.c (XTread_socket):
1993 Omit unused arg EXPECTED. All callers changed.
1994 (store_user_signal_events): Return void, not int, since callers no
1995 longer care about the return value. All uses changed.
1996
b019b76a
JB
19972012-09-20 Juanma Barranquero <lekktu@gmail.com>
1998
1999 * w32gui.h (XParseGeometry): Do not declare.
2000
05642592
PE
20012012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2002
e4bce92a 2003 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 2004 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
2005 <http://bugs.gnu.org/12471#8> (last line).
2006
05642592
PE
2007 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2008 (XParseGeometry): Now static. Substitute extremal values for
2009 values that are out of range.
2010
e543ae91
JD
20112012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2012
2013 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2014
2015 * nsfns.m (XParseGeometry): Remove.
2016 (Fx_create_frame): Call x_set_offset to correctly interpret
2017 top_pos in geometry.
2018
3a880af4 2019 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
2020 (Fx_parse_geometry): If there is a space in string, call
2021 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2022
45ba16c7
EZ
20232012-09-17 Eli Zaretskii <eliz@gnu.org>
2024
c8b9f1bc
EZ
2025 * search.c (scan_buffer): Use character positions in calls to
2026 region_cache_forward and region_cache_backward, not byte
2027 positions. (Bug#12196)
2028
b4c932a2
EZ
2029 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2030 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2031
45ba16c7
EZ
2032 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2033 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2034 emacs_blocked_malloc, now deleted.
2035
eeceac93
PE
20362012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2037
2038 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2039 The workaround was for improving performance on Solaris 2.4, but
2040 is getting in the way now. Emacs will still work if someone is
2041 still running Solaris 2.4 in a museum somewhere; Sun dropped
2042 support for Solaris 2.4 in 2003.
2043 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2044 * process.c (create_process) [HAVE_WORKING_VFORK]:
2045 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2046 since Emacs no longer uses vfork on that platform.
2047
78f83752
GM
20482012-09-17 Glenn Morris <rgm@gnu.org>
2049
2050 * emacs.c: Use COPYRIGHT.
2051
634b8cac
PE
20522012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2053
0caaedb1
PE
2054 Remove configure's --without-sync-input option (Bug#12450).
2055 When auditing signal-handling in preparation for cleaning it up,
2056 I found that SYNC_INPUT has race conditions and would be a real
2057 pain to fix. Since it's an undocumented and deprecated
2058 configure-time option, now seems like a good time to remove it.
2059 Also see <http://bugs.gnu.org/11080#16>.
2060 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2061 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2062 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2063 (malloc_hysteresis):
2064 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2065 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2066 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2067 (dont_register_blocks, bytes_used_when_reconsidered)
2068 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2069 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2070 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 2071 Remove. All uses removed.
0caaedb1
PE
2072 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2073 implementation, one that depends on whether the new macro
2074 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2075 is defined.
2076 * atimer.c (run_timers, handle_alarm_signal):
2077 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2078 (handle_async_input, process_pending_signals)
2079 (handle_input_available_signal, init_keyboard):
2080 * nsterm.m (ns_read_socket):
2081 * process.c (wait_reading_process_output):
2082 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2083 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2084 (emacs_write):
2085 * xterm.c (XTread_socket):
2086 Assume SYNC_INPUT.
2087 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2088 * eval.c (handling_signal): Remove. All uses removed.
2089 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2090 All uses replaced with the SYNC_INPUT version.
2091 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2092 Remove decls.
2093 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2094 Now static.
2095
634b8cac
PE
2096 * font.c (Ffont_shape_gstring): Remove unused local.
2097
83da1b55
GM
20982012-09-16 Glenn Morris <rgm@gnu.org>
2099
518650a5
GM
2100 * Makefile.in (clean): No longer run nextstep's clean.
2101
83da1b55
GM
2102 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2103 (ns_frag): Remove.
2104 (ns-app): Move here from ns.mk, and simplify.
2105 (clean): Simplify nextstep entry.
2106 * ns.mk: Remove file.
2107
85a43e2e
KH
21082012-09-17 Kenichi Handa <handa@gnu.org>
2109
2110 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2111 not covert the last few charactes.
2112
ba13e616 21132012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
2114
2115 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2116 here, but just check the validity of glyphs in the glyph-string.
2117
a8c729af
MR
21182012-09-16 Martin Rudalics <rudalics@gmx.at>
2119
3a880af4
SM
2120 * window.c (Fwindow_parameter, Fset_window_parameter):
2121 Accept any window as argument (Bug#12452).
a8c729af 2122
c077c059
JD
21232012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2124
2125 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2126 to ns_term_init to avoid memory leak.
2127
2128 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2129 explicit retain/release.
2130 (ns_term_init): Only allow one display. Initialize outerpool and
2131 ns_*_types.
2132
39a57ad0
PE
21332012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2134
2135 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2136 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2137 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2138 the Microsoft problem in a different way, by altering ../nt/config.nt.
2139
7105c8cb
EZ
21402012-09-15 Eli Zaretskii <eliz@gnu.org>
2141
2142 * w32xfns.c:
2143 * w32uniscribe.c:
2144 * w32term.c:
2145 * w32select.c:
2146 * w32reg.c:
2147 * w32proc.c:
2148 * w32menu.c:
2149 * w32inevt.c:
2150 * w32heap.c:
2151 * w32font.c:
2152 * w32fns.c:
2153 * w32console.c:
2154 * w32.c:
2155 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2156 by lisp.h. This completes removal of setjmp.h inclusion
2157 erroneously announced in the previous commit. (Bug#12446)
2158
2159 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2160 more accurate.
2161
2162 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2163 not defined as a macro. The latter happens on MS-Windows.
2164 (Bug#12446)
2165
0328b6de
PE
21662012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2167
2168 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2169 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 2170 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
2171 only reason for the instance was because "lisp.h" was included.
2172 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2173 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2174 and _longjmp with the new symbols. Emacs already uses _setjmp if
2175 available, so this change affects only POSIXish hosts that have
2176 sigsetjmp but not _setjmp, such as some versions of Solaris and
2177 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2178 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2179 (png_load_body) [HAVE_PNG]:
2180 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2181 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2182 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2183 since PNG requires jmp_buf. This is the only exception to the
2184 general rule that we now use sys_setjmp and sys_longjmp.
2185 This exception is OK since this code does not change the signal
2186 mask or longjmp out of a signal handler.
2187
2af03429
PE
21882012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2189
2190 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2191 Include "syssignal.h", for 'main_thread'.
2192
2f294edf
DA
21932012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2194
2195 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
2196 * insdel.c (replace_range, replace_range_2):
2197 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
2198 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2199 Remove redundant check before calling offset_intervals.
2200
6b533e9c
MR
22012012-09-14 Martin Rudalics <rudalics@gmx.at>
2202
2203 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2204 current buffer (Bug#12387).
2205
2a7931e3
JB
22062012-09-14 Juanma Barranquero <lekktu@gmail.com>
2207
2208 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2209
c18e885b
PE
22102012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2211
2212 Use a more backwards-compatible timer format (Bug#12430).
2213 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2214 vector element, not from the 4th, since PSECS is now at the end.
2215 (Fcurrent_idle_time): Doc fix.
2216
d59a1afb
DA
22172012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2218
2219 Function to mark objects and remove killed buffers at once.
2220 * alloc.c (discard_killed_buffers): Rename to ...
2221 (mark_discard_killed buffers) ... new name. Add marking
2222 of remaining objects. Fix comment. Adjust users.
2223 (mark_object): Do not touch frame buffer lists here.
2224 * frame.c (delete_frame): Reset frame buffer lists here.
2225
5f0cb45a
PE
22262012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2227
8ea47e3a
PE
2228 Better workaround for GNOME bug when --enable-gcc-warnings.
2229 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2230 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2231 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2232
4a4bbad2
PE
2233 Simplify SIGIO usage (Bug#12408).
2234 The code that dealt with SIGIO was crufty and confusing, e.g., it
2235 played tricks like "#undef SIGIO" but these tricks were not used
2236 consistently. Simplify mostly by not #undeffing standard symbols,
2237 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2238 or not as we please) rather than "defined SIGIO" (standard symbol
2239 that we probably shouldn't #undef).
2240 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2241 Modules that need it can include it.
2242 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2243 * dispextern.h (ignore_sigio): New decl.
2244 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2245 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2246 * emacs.c (shut_down_emacs):
2247 * keyboard.c (kbd_buffer_store_event_hold):
2248 Use ignore_sigio rather than invoking 'signal' directly.
2249 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2250 for FIONREAD.
2251 (FIONREAD, SIGIO): Do not #undef.
2252 (tty_read_avail_input): Use #error rather than a syntax error.
2253 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2254 for I_PIPE, used by SETUP_SLAVE_PTY.
2255 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2256 * sysdep.c (croak): Remove; no longer needed. This bit of
2257 temporary code, with Fred N. Fish's comment that it's temporary,
2258 has been in Emacs since at least 1992!
2259 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2260 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2261 * syssignal.h (croak): Remove decl.
2262 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2263 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2264 now that we're termios-only.
2265 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2266 * term.c (dissociate_if_controlling_tty): Use #error rather than
2267 a run-time error.
2268
5f0cb45a
PE
2269 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2270 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2271 to work around GNOME bug 683906.
2272 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2273 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2274 This works around GCC bug 54561.
2275
40bce90b
PE
22762012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2277
2278 More fixes for 'volatile' and setjmp/longjmp.
2279 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2280 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2281 (png_load_body) [HAVE_PNG]:
2282 (jpeg_load_body) [HAVE_JPEG]:
2283 New function, with most of the old parent function's body.
2284 (png_load) [HAVE_PNG]:
2285 (jpeg_load) [HAVE_JPEG]:
2286 Invoke the new function, to avoid longjmp munging our locals.
2287 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2288 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2289 longjmp is passed 2, as the C standard doesn't guarantee this.
2290 Instead, store the failure code into mgr->failure_code.
2291
bfeae2cf
SM
22922012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2293
2294 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2295 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2296 (syms_of_keyboard): Remove support for unread-command-char.
2297
8099e36b
EZ
22982012-09-12 Eli Zaretskii <eliz@gnu.org>
2299
2300 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2301 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2302 violation. (Bug#12426)
2303
92547ff9
PE
23042012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2305
2306 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2307
45b82ad0
SM
23082012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2309
2310 * eval.c: Add `inhibit-debugger'.
2311 (Qinhibit_debugger): New symbol.
2312 (call_debugger): Bind it instead of Qdebug_on_error.
2313 (maybe_call_debugger): Test Vinhibit_debugger.
2314 (syms_of_eval): Define inhibit-debugger.
2315 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2316 (syms_of_xdisp): Remove inhibit-debug-on-message.
2317
5779a1dc
PE
23182012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2319
50f2e553
PE
2320 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2321 If a nonvolatile local variable is written before a _longjmp to
2322 the frame containing the variable, and is read after the _longjmp,
2323 the value read is indeterminate. Some local variables of type
2324 'struct handler' and 'struct catchtag' are used in this way, so
2325 mark each of their slots as volatile if the slot can be set before
2326 _longjmp and read afterwards.
2327 * lisp.h (struct handler): var and chosen_clause are now volatile.
2328 (struct catchtag): val, next, and pdlcount are now volatile.
2329
ae1d87e2
PE
2330 * bidi.c (bidi_push_it, bidi_pop_it):
2331 * fns.c (copy_hash_table):
2332 * image.c (define_image_type):
2333 * keyboard.c (kbd_buffer_store_event_hold):
2334 * process.c (Fprocess_send_eof):
2335 * xfaces.c (x_create_gc) [HAVE_NS]:
2336 * xgselect.c (xg_select):
2337 Prefer assignment to memcpy when either will do.
2338
5779a1dc
PE
2339 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2340 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2341 time an item is removed. No need to mark this function 'inline';
2342 the compiler knows better than we do.
2343
c4c9756b
JD
23442012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2345
2346 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2347 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2348 to change_frame_size (Bug#12388).
2349 (windowDidResize:): Pass YES to updateFrameSize.
2350
2351 * nsterm.h: Add delay parameter to updateFrameSize.
2352
d73e321c
DA
23532012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2354
2355 Discard killed buffers from deleted window and frame objects.
2356 This reduces an amount of references to killed buffers and
2357 helps GC to reclaim them faster.
2358 * alloc.c (discard_killed_buffers): New function.
2359 (mark_object): Use it for deleted windows and frames.
2360 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 2361 or deleted frame, restore its global binding.
d73e321c
DA
2362 * data.c (swap_in_global_binding): Add GC notice.
2363 (swap_in_symval_forwarding): Use convenient set_blv_where.
2364 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2365 * window.h: ... to here.
2366
e578f381
DA
23672012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2368
2369 Convenient macro to check whether the buffer is live.
2370 * buffer.h (BUFFER_LIVE_P): New macro.
2371 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2372 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2373
3057e615
YM
23742012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2375
2376 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2377 composition cases (Bug#12364).
2378
2379 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2380 overhang of succeeding glyphs overlapping box cursor.
2381
2382 * w32term.c (x_draw_glyph_string): Likewise.
2383
6fda35f2
PE
23842012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2385
c990426a
PE
2386 Simplify, document, and port floating-point (Bug#12381).
2387 The porting part of this patch fixes bugs on non-IEEE platforms
2388 with frexp, ldexp, logb.
2389 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2390 Now static.
2391 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2392 support, by removing commented-out code and briefly listing the
2393 C89 functions excluded. The commented-out stuff was confusing
2394 maintenance, e.g., we thought we needed cbrt but it was commented out.
2395 (logb): Remove decl; no longer needed.
2396 (isfinite): New macro, if not already supplied.
2397 (isnan): Don't replace any existing macro.
2398 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2399 are present on all C89 platforms.
2400 (Ffrexp): Do not special-case zero, as frexp does the right thing
2401 for that case.
2402 (Flogb): Do not use logb, as it doesn't have the desired meaning
2403 on hosts that use non-base-2 floating point. Instead, stick with
2404 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2405 frexp, to avoid getting an unspecified result.
2406
6fda35f2
PE
2407 * xdisp.c (Qinhibit_debug_on_message): Now static.
2408
16130a58
JD
24092012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2410
2411 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2412 NSBezierPath (Bug#12131).
2413
d105a573
CY
24142012-09-10 Chong Yidong <cyd@gnu.org>
2415
2416 * fns.c (Fdelq, Fdelete): Doc fix.
2417
ff55dfe8
PE
24182012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2419
2420 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2421 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2422
e7032e7c
SM
24232012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2424
2425 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2426 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2427 Use it.
2428
e9957956
EZ
24292012-09-09 Eli Zaretskii <eliz@gnu.org>
2430
aba05ce9
EZ
2431 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2432 left fringe if the window has a left margin. This avoids leaving
2433 traces of the cursor because its leftmost pixel is not drawn over.
2434
e9957956
EZ
2435 * dispnew.c (update_window_line): When the left margin area of a
2436 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2437 that screen line. (Bug#12277)
2438
f6196b87
PE
24392012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2440
2441 Assume C89 or later for math functions (Bug#12381).
2442 This simplifies the code, and makes it a bit smaller and faster,
2443 and (most important) makes it easier to clean up signal handling
2444 since we can stop worring about floating-point exceptions in
2445 library code. That was a problem before C89, but the problem
2446 went away many years ago on all practical Emacs targets.
2447 * data.c, image.c, lread.c, print.c:
2448 Don't include <math.h>; no longer needed.
2449 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2450 might be autoconfigured, as that never happens.
2451 * data.c (fmod):
2452 * doprnt.c (DBL_MAX_10_EXP):
2453 * print.c (DBL_DIG):
2454 Remove. C89 or later always defines these.
2455 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2456 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2457 (arith_error, domain_error, domain_error2):
2458 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2459 no longer needed -- we simply return what C returns. All uses removed.
2460 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2461 the wrapped code.
2462 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2463 Remove. All uses expanded, as these macros are no longer used
2464 more than once and are now more trouble than they're worth.
2465 (Ftan): Use tan, not sin / cos.
2466 (Flogb): Assume C89 frexp.
2467 (fmod_float): Assume C89 fmod.
2468 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2469 (init_floatfns): Remove. All uses removed.
2470
9d7f1863
JD
24712012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2472
2473 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2474 compositeToPoint for OSX < 10.6 (Bug#12390).
2475
eabf0404
PE
24762012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2477
2478 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2479 This produces more-accurate results.
2480
0b3b1d23
JD
24812012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2482
2483 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2484 changes (Bug#12088).
2485
6dcef6ec
CY
24862012-09-08 Chong Yidong <cyd@gnu.org>
2487
2488 * syntax.c (Fstring_to_syntax): Doc fix.
2489
aa7d57c5
JD
24902012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2491
2492 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2493 in the internal border.
2494 (x_set_window_size): Remove static variables and their usage.
2495 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
2496 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2497 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
2498 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2499 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2500 (ns_fix_rect_ibw): Remove.
2501 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2502 (ns_dumpglyphs_box_or_relief): Ditto.
2503 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2504 adjustment.
2505 (ns_dumpglyphs_image): Ditto.
fc0c31f8 2506 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
2507 border adjustment.
2508 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2509 their usage. Add fringe_extended_p and its use as in other terms.
2510 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2511 scroll bar was removed.
2512 (updateFrameSize): New function.
2513 (windowDidResize): Move code to updateFrameSize and call it.
2514
2515 * nsterm.h (EmacsView): Add updateFrameSize.
2516
1a5432bc
CY
25172012-09-07 Chong Yidong <cyd@gnu.org>
2518
b4f5313e
CY
2519 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2520
1a5432bc
CY
2521 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2522
1a4f1e9b
PE
25232012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2524
2525 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
2526 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2527 Problem introduced when merging patches. Noted by Eli Zaretskii in
2528 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
2529 * floatfns.c: Comment fix.
2530 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2531 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2532 and anyway the declaration is harmless even if SIGDANGER is not defined.
2533 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2534 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2535 source files not surprisingly expected syssignal.h to define, or
2536 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2537 Include <sys/ioctl.h>, for FIONREAD.
2538 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2539 This eliminates a problem whereby other files mysteriously had
2540 to include "syssignal.h" before including "systty.h" if they
2541 wanted to use "#ifdef SIGIO".
2542
bc8000ff
EZ
25432012-09-07 Eli Zaretskii <eliz@gnu.org>
2544
3e6d6928
EZ
2545 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2546
2547 * w32.c (sigemptyset): Empty the set.
2548 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2549
bc8000ff
EZ
2550 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2551
b4fa72f2
DA
25522012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2553
2554 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2555 (mark_object): Likewise for frame objects.
2556
30730c93
PE
25572012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2558
2559 * syssignal.h (handle_on_main_thread): Always declare,
2560 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2561 This ports to platforms without HAVE_PTHREAD.
2562
2fe28299
PE
25632012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2564
2565 Signal-handler cleanup (Bug#12327).
2566 Emacs's signal handlers were written in the old 4.2BSD style with
2567 sigblock and sigmask and so forth, and this led to some
2568 inefficiencies and confusion. Rewrite these to use
2569 pthread_sigmask etc. without copying signal sets around. Also,
2570 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2571 'signal', and instead use functions that do not attempt to take
2572 over the system name space. This patch causes Emacs's text
2573 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2574 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2575 Do not include <signal.h> or "syssignal.h", as these
2576 modules do not use signals.
2577 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2578 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2579 Do not include <signal.h>, as "syssignal.h" does that for us now.
2580 * atimer.c (sigmask_atimers): New function.
2581 (block_atimers, unblock_atimers): New functions,
2582 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2583 All uses replaced.
2584 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2585 no longer needed here.
2586 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 2587 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
2588 * sysdep.c (struct save_signal): New member 'action', replacing
2589 old member 'handler'.
2590 (save_signal_handlers, restore_signal_handlers):
2591 Use sigaction instead of 'signal' to save and restore.
2592 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2593 New function. All users of 'signal' modified to use set_sighandler
2594 if they're writeonly, and to use sys_signal if they're read+write.
2595 (emacs_sigaction_init, forwarded_signal): New functions.
2596 (sys_signal): Remove. All uses replaced by calls to sigaction
2597 and emacs_sigaction_init, or by direct calls to 'signal'.
2598 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2599 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2600 all uses replaced by pthread_sigmask etc. calls.
2601 * syssignal.h: Include <signal.h>.
2602 (emacs_sigaction_init, forwarded_signal): New decls.
2603 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2604 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2605 (sigmask, sys_sigmask): Remove; no longer needed.
2606 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2607 (sigblock, sigunblock, sigfree):
2608 (sigsetmask) [!defined sigsetmask]:
2609 Remove. All uses replaced by pthread_sigmask.
2610 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2611 no longer need to be replaced, and its typical old uses
2612 are now done via emacs_sigaction_init and sigaction.
2613 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2614 (sys_sigdel): Remove; unused.
2615 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2616
0216c128
EZ
26172012-09-06 Eli Zaretskii <eliz@gnu.org>
2618
2619 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2620 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2621
c752cfa9
DA
26222012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2623
2624 Explicitly mark buffer_defaults and buffer_local_symbols.
2625 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2626 mark_local_symbols here.
2627 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2628 since special buffers aren't marked here any more.
2629 (allocate_buffer): Chain new buffer with all_buffers here...
2630 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2631 not here.
2632 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2633 (syms_of_buffer): Remove staticpro of the above.
2634 (init_buffer_once): Set names for buffer_defaults and
2635 buffer_local_symbols.
2636
a864ef14
PE
26372012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2638
2639 Use bool for booleans in font-related modules.
2640 * font.c (font_intern_prop, font_style_to_value)
2641 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2642 (generate_otf_features, font_check_otf_features, font_check_otf)
2643 (font_match_p, font_list_entities, font_at):
2644 * fontset.c (fontset_id_valid_p, reorder_font_vector
2645 (fontset_find_font, Fset_fontset_font)
2646 (face_suitable_for_char_p) [0]:
2647 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2648 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2649 (m17n_flt_initialized, ftfont_shape_by_flt):
2650 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2651 * nsfont.m (nsfont_draw):
2652 * w32font.c (w32font_draw):
2653 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2654 Use bool for booleans.
2655 * font.h: Adjust to above API changes.
2656 (struct font, struct font_driver, struct font_driver_list):
2657 Use bool for booleans.
2658 (struct font): Remove useless member encoding_type.
2659 All users removed.
2660 * fontset.c, xftfont.c: Omit unnecessary static decls.
2661
0699fc18
DA
26622012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2663
2664 * alloc.c (mark_object): Revert window marking code
2665 since it's unsafe for the Fset_window_configuration.
2666
20ef56db
PE
26672012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2668
2fe28299 2669 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
2670 Be more systematic about preserving errno whenever a signal
2671 handler returns, even if it's not in the main thread. Do this by
2672 renaming signal handlers to distinguish between signal delivery
2673 and signal handling. All uses changed.
2674 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2675 * data.c (deliver_arith_signal): Rename from arith_error.
2676 * dispnew.c (deliver_window_change_signal): Rename from
2677 window_change_signal.
2678 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2679 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2680 * keyboard.c (deliver_input_available_signal): Rename from
2681 input_available_signal.
2682 (deliver_user_signal): Rename from handle_user_signal.
2683 (deliver_interrupt_signal): Rename from interrupt_signal.
2684 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2685 (deliver_child_signal): Rename from sigchld_handler.
2686 * atimer.c (handle_alarm_signal):
2687 * data.c (handle_arith_signal):
2688 * dispnew.c (handle_window_change_signal):
2689 * emacs.c (handle_fatal_signal, handle_danger_signal):
2690 * keyboard.c (handle_input_available_signal):
2691 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2692 * process.c (handle_pipe_signal, handle_child_signal):
2693 New functions, with the actual signal-handling code taken from the
2694 original respective signal handlers, sans the sporadic attempts to
2695 preserve errno, since that's now done by handle_on_main_thread.
2696 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2697 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2698 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2699 Move to sysdep.c.
2700 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2701 Move initialization of main_thread to sysdep.c's init_signals.
2702 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2703 our usage, and simplifies the mainline code.
2704 (record_child_status_change): New static function, as a helper
2705 for handle_child_signal, and with most of the old child handler's
2706 contents.
2707 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2708 (handle_child_signal): Use the above.
2709 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2710 Moved here from emacs.c.
2711 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2712 code moved here from emacs.c's main function.
2713 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
2714 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2715 This lets callers save and restore errno properly.
20ef56db 2716
e3ccf108
DA
27172012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2718
2719 Remove redundant or unused things here and there.
2720 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2721 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2722 * editfns.c (Fcompare_buffer_substrings): Likewise.
2723 * frame.h (struct terminal, struct font_driver_list):
2724 Remove redundant declarations.
2725 * window.h (Qleft, Qright): Likewise.
2726
697e1e39
DA
27272012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2728
2729 Do not mark objects from deleted buffers, windows and frames.
2730 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2731 (mark_object): Likewise for windows and frames.
2732
c1ca42ca
DA
27332012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2734
2735 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2736 buffer_defaults and buffer_local_symbols as valid objects.
2737 Return special value to denote them.
2738
014d93be
PE
27392012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2740
f75d7a91
PE
2741 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2742 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2743 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2744 (file_name_absolute_p, Fsubstitute_in_file_name):
2745 (check_executable, check_writable, Ffile_accessible_directory_p)
2746 (Fset_file_selinux_context, Fdefault_file_modes)
2747 (Finsert_file_contents, choose_write_coding_system)
2748 (Fwrite_region, build_annotations, a_write, e_write)
2749 (Fdo_auto_save):
2750 * filelock.c (boot_time_initialized, get_boot_time)
2751 (get_boot_time_1, lock_file_1, within_one_second):
2752 * floatfns.c (in_float):
2753 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2754 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2755 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2756 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2757 * window.c (compare_window_configurations):
2758 Use bool for booleans.
2759 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2760 (Fdefault_file_modes): Now mode_t, not int, for modes.
2761 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2762 (internal_delete_file): Now returns void, not a (boolean) int,
2763 since nobody was looking at the return value.
2764 * lisp.h, window.h: Adjust to above API changes.
2765
014d93be
PE
2766 * xdisp.c (set_message): Simplify and reindent last change.
2767
776f29e1
JB
27682012-09-05 Juanma Barranquero <lekktu@gmail.com>
2769
2770 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2771
7f7e0167
LI
27722012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2773
2774 * eval.c (call_debugger): Make the function non-static so that we
2775 can call it from set_message.
2776
2777 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2778 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2779
cf29dd84
PE
27802012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2781
2782 Give more-useful info on a fatal error (Bug#12328).
2783 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2784 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2785 of doing the work ourselves.
2786 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2787 do most of the work.
2788 (fatal_error_backtrace): New function, taken from the guts
2789 of the old fatal_error_signal, but with a new option to output
2790 a backtrace.
2791 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2792 info about the signal than just its number.
2793 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2794 * sysdep.c: Include <execinfo.h>
2795 (emacs_backtrace): New function, taken partly from the previous
2796 code of the 'die' function.
2797 (emacs_abort): Call fatal_error_backtrace rather than abort.
2798
972debf2
SM
27992012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2800
2801 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2802 eager (load-time) macro-expansion.
2803 * lisp.mk (lisp): Add macroexp.
2804
1088b922
PE
28052012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2806
2807 Simplify redefinition of 'abort' (Bug#12316).
2808 Do not try to redefine the 'abort' function. Instead, redo
2809 the code so that it calls 'emacs_abort' rather than 'abort'.
2810 This removes the need for the NO_ABORT configure-time macro
2811 and makes it easier to change the abort code to do a backtrace.
2812 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2813 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2814 Remove; sysdep.c's emacs_abort now takes its place.
2815 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2816 'abort' changed to use 'emacs_abort'.
2817 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2818 (abort) [!defined abort]: Rename to ...
2819 (emacs_abort): ... new name.
2820 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2821 the place of the old 'abort' in emacs.c.
2822 * w32.c, w32fns.c (abort): Do not #undef.
2823 * w32.c (emacs_abort): Rename from w32_abort.
2824
30934d33
EZ
28252012-09-04 Eli Zaretskii <eliz@gnu.org>
2826
2827 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2828 offsets[j].dv, since the y axis of the screen coordinates points
2829 down, while the y axis of the font definition coordinates points
2830 up. This fixes display of Arabic diacritics such as KASRA and
2831 KASRATAN. (Bug#11860)
2832
af26b72c
PE
28332012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2834
2835 Be more systematic about _setjmp vs setjmp.
2836 * alloc.c (test_setjmp, mark_stack):
2837 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2838 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2839 (png_load, my_error_exit, jpeg_load):
2840 * process.c (send_process_trap, send_process):
2841 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2842 The underscored versions are up to 30x faster on some hosts.
2843 Formerly, the code used setjmp+longjmp sometimes and
2844 _setjmp+_longjmp at other times, with no particular reason to
2845 prefer setjmp+longjmp.
2846
26d4541d
PE
28472012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2848
d42f4f0f 2849 Fix minor problem found by static checking.
26d4541d 2850 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 2851
c5e28e39
MR
28522012-09-03 Martin Rudalics <rudalics@gmx.at>
2853
2854 * buffer.c (Fdelete_all_overlays): New function.
2855
3eab3ca9
CY
28562012-09-03 Chong Yidong <cyd@gnu.org>
2857
2858 * gtkutil.c: Add extern decl for Qxft.
2859
c04889f8
PE
28602012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2861
1882aa38
PE
2862 * emacs.c, eval.c: Use bool for boolean.
2863 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2864 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2865 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2866 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2867 (main, decode_env_path, Fdaemon_initialized):
2868 * eval.c (call_debugger, Finteractive_p, interactive_p):
2869 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2870 (maybe_call_debugger, Fbacktrace):
2871 * process.c (read_process_output, exec_sentinel):
2872 Use bool for booleans.
2873 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2874 All callers changed.
2875 * eval.c (interactive_p): Omit always-true boolean argument
2876 EXCLUDE_SUBRS_P. All callers changed.
2877 * dispextern.h, lisp.h: Reflect above API changes.
2878 * firstfile.c (dummy): Use the address of 'main', whose signature
2879 won't change, instead of the address of 'initialize', whose
2880 signature just changed from int to bool.
2881 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2882 * msdos.c (fatal_error_in_progress): ... from here.
2883 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2884 of incrementing it.
2885 (redisplay_internal, unwind_redisplay): Simply clear
2886 REDISPLAYING_P when unwinding, instead of saving its previous,
2887 always-false value and then restoring it.
2888
a411ac43
PE
2889 Clean up some extern decls.
2890 Mostly, this hoists extern decls out of .c files and into .h files.
2891 That way, we're more likely to catch errors if the interfaces change.
2892 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2893 declare xg_mark_data.
2894 * dispextern.h (x_frame_parm_handlers):
2895 * font.h (Qxft):
2896 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2897 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2898 (Qultra_bold, Qoblique, Qitalic):
2899 Move extern decl here from .c file.
2900 * alloc.c (xg_mark_data) [USE_GTK]:
2901 * doc.c (Qclosure):
2902 * eval.c (Qlexical_binding):
2903 * fns.c (time) [!HAVE_UNISTD_H]:
2904 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2905 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2906 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2907 * lread.c (Qinternal_interpreter_environment):
2908 * minibuf.c (Qbuffer):
2909 * process.c (QCfamily, QCfilter):
2910 * widget.c (free_frame_faces):
2911 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2912 * xfont.c (x_clear_errors):
2913 * xterm.c (x_frame_parm_handlers):
2914 Remove now-redundant extern decls.
2915 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2916 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2917 Now static.
2918 * xfaces.c: Remove unnecessary static decls.
2919 * xterm.c (updating_frame): Remove decl of nonexistent object.
2920
c04889f8
PE
2921 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2922 when building globals.h, as the objects that are not built on
2923 this host are not needed to compile C files on this host.
2924
8b339673
JD
29252012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2926
2927 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2928
2929 * frame.h: Add missing prototype for x_wm_set_size_hint.
2930
a08d4ba7
PE
29312012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2932
2933 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2934 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2935 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2936 (Fsubstitute_command_keys):
2937 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2938 (save_excursion_save, save_excursion_restore)
2939 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2940 (format_time_string, general_insert_function)
2941 (make_buffer_string, make_buffer_string_both)
2942 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2943 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2944 (copy_text, insert_1, insert_1_both, insert_from_string)
2945 (insert_from_string_before_markers, insert_from_string_1)
2946 (insert_from_buffer, insert_from_buffer_1, replace_range)
2947 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2948 (del_range_2, modify_region):
2949 * intervals.c (intervals_equal, balance_possible_root_interval)
2950 (adjust_intervals_for_insertion, merge_properties_sticky)
2951 (graft_intervals_into_buffer, lookup_char_property)
2952 (adjust_for_invis_intang, set_point_both)
2953 (get_property_and_range, compare_string_intervals)
2954 (set_intervals_multibyte_1, set_intervals_multibyte):
2955 * keyboard.c (decode_timer):
2956 Use bool for boolean.
2957 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2958 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2959
48c948de
CY
29602012-09-02 Chong Yidong <cyd@gnu.org>
2961
2962 * keymap.c (push_key_description): Print M-TAB as C-M-i
2963 (Bug#11758).
2964
6c49a40b
JB
29652012-09-02 Juanma Barranquero <lekktu@gmail.com>
2966
2967 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2968 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2969 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2970 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2971 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2972 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2973 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2974
4dfbd238
EZ
29752012-09-01 Eli Zaretskii <eliz@gnu.org>
2976
7e510e28
EZ
2977 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2978 more than one grapheme cluster passed to the shaper: compute the
2979 offset adjustment values separately for each cluster. (Bug#11860)
2980
4dfbd238
EZ
2981 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2982 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2983 about implicit conversions from integer to pointer.
2984
86571ae0
DC
29852012-09-01 Daniel Colascione <dancol@dancol.org>
2986
2987 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2988 system used too early.
2989
0e23ef9d
PE
29902012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2991
2992 Better seed support for (random).
2993 * emacs.c (main): Call init_random.
2994 * fns.c (Frandom): Set the seed from a string argument, if given.
2995 Remove long-obsolete Gentzel cruft.
2996 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2997 (init_random): New function.
2998
17a2cbbd
DC
29992012-09-01 Daniel Colascione <dancol@dancol.org>
3000
3001 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3002 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3003 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3004 x_wm_set_size_hint, x_query_colors, x_real_positions,
3005 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3006 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3007 all of which have been moved to common code.
3008
3009 * xfaces.c: Include TERM_HEADER instead of listing all possible
3010 window-system headers.
3011
3012 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3013 to match header.
3014
3015 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3016 directly accessing frame internals.
3017
f18cbb28 3018 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
3019 globals_of_w32font.
3020
3021 * process.c: Include TERM_HEADER instead of listing all possible
3022 window-system headers.
3023
3a880af4
SM
3024 * nsterm.h: Remove declarations now in frame.h.
3025 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
3026
3027 * menu.c: Include TERM_HEADER instead of listing all possible
3028 window-system headers.
3029
3030 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3031 window system.
3032
3033 * keyboard.c: Include TERM_HEADER instead of listing all possible
3034 window-system headers.
3035
3036 * image.c: Include TERM_HEADER instead of listing all possible
3037 window-system headers. Declare Vlibrary_cache when compiling for
3038 Windows.
3039
3040 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3041 window system declarations.
3042
3043 * frame.h: Move common functions here: set_frame_menubar,
3044 x_set_window_size, x_sync, x_get_focus_frame,
3045 x_set_mouse_position, x_set_mouse_pixel_position,
3046 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3047 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3048 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3049 x_activate_menubar, x_real_positions, x_bitmap_icon,
3050 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3051 and x_query_colors.
3052
3053 * frame.c: Include TERM_HEADER instead of listing all possible
3054 window-system headers.
3055
3056 * font.c: Include TERM_HEADER instead of listing all possible
3057 window-system headers.
3058
3059 * emacs.c: Include TERM_HEADER.
3060
f18cbb28
EZ
3061 * dispnew.c: Include TERM_HEADER instead of listing all possible
3062 window-system headers.
17a2cbbd 3063
f18cbb28 3064 * ccl.h: Include character.h.
17a2cbbd
DC
3065
3066 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3067 the current window system; include in list of objects to link into
3068 Emacs.
3069
c650a5de
DA
30702012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3071
3072 Remove mark_ttys function and fix tty_display_info initialization.
3073 * lisp.h (mark_ttys): Remove prototype.
3074 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3075 to mark_ttys because all possible values of 'top_frame' slot are
3076 the frames which are reachable from Vframe_list.
3077 * term.c (mark_ttys): Remove.
3078 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3079
4e0f6479
DA
30802012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3081
3082 Change struct frame bitfields from unsigned char to unsigned.
3083 * frame.h (struct frame): Change type of 'display_preempted',
3084 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3085 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3086 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3087 bitfields from unsigned char to unsigned.
3088
8b96a52c
DA
30892012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3090
3091 Remove unused member of struct x_output and struct w32_output.
3092 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3093 * w32term.h (struct w32_output): Likewise.
3094
b4444c8a
JD
30952012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3096
3097 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3098 does not become zero (Bug#12234).
3099
b98521db
PE
31002012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3101
3102 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3103 for GCC 4.7.1 x86-64.
3104
31d02438
GM
31052012-08-30 Glenn Morris <rgm@gnu.org>
3106
3107 * lread.c (init_lread): For out-of-tree builds, only add the
3108 source directory's site-lisp dir to the load-path if it exists,
3109 consistent with in-tree builds. (Bug#12302)
3110
7f8941d8
JD
31112012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3112
3113 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 3114 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
3115 (windowShouldClose:): Set window_closed.
3116 (dealloc): New member, free button_values.
fc0c31f8
JB
3117 (process_dialog:): Make member function. Remove window argument,
3118 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
3119 in button_values.
3120 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 3121 with tag. Remove return self, declare return value as void.
7f8941d8
JD
3122 (addString:row:): Remove return self, declare return value as void.
3123 (addSplit): Remove return self, declare return value as void.
3124 (clicked:): Remove return self, declare return value as void.
fc0c31f8 3125 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
3126 (initFromContents:isQuestion:): Adjust call to process_dialog.
3127 Code formatting change.
3128 (timeout_handler:): Set timer_fired to YES.
3129 (runDialogAt:): Set timer_fired to NO.
3130 Handle click on close button as quit.
3131
3132 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3133 Add window_closed and button_values. Add void as return value for
3134 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3135 Add process_dialog as new member.
3136
eada0861 31372012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 3138
eada0861
GM
3139 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3140 is not one of the heaps we manage. (Bug#12242)
3141
31422012-08-28 Glenn Morris <rgm@gnu.org>
3143
3144 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3145
457294dd
MR
31462012-08-28 Martin Rudalics <rudalics@gmx.at>
3147
3148 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
3149 auto-buffer-name window parameter. Install revision of reverted
3150 fix.
457294dd 3151
4f2daf31
DA
31522012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3153
3154 Do not allow to set major mode for a dead buffer.
3155 * buffer.c (Fset_buffer_major_mode): Signal an error
3156 if the buffer is dead.
3157 (Fother_buffer, other_buffer_safely): Remove redundant
3158 nested declaration.
3159
66322887
DA
31602012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3161
3162 Always use set_buffer_if_live to restore original buffer at unwind.
3163 * buffer.h (record_unwind_current_buffer): New function.
3164 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3165 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3166 * undo.c, window.c: Adjust users.
3167 * buffer.c (set_buffer_if_live): Fix comment.
3168
a3d794a1
DA
31692012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3170
3171 Fix usage of set_buffer_internal.
3172 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3173 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3174 * coding.c (decode_coding): Omit redundant test.
3175 * fileio.c (decide_coding_unwind): Likewise.
3176 * fns.c (secure_hash): Likewise.
3177 * insdel.c (modify_region): Likewise.
3178 * keyboard.c (command_loop_1): Likewise.
3179 * print.c (PRINTFINISH): Likewise.
3180 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3181
59ea14cd
PE
31822012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3183
3184 * dispnew.c: Use bool for boolean.
3185 (frame_garbaged, display_completed, delayed_size_change)
3186 (fonts_changed_p, add_window_display_history)
3187 (add_frame_display_history, verify_row_hash)
3188 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3189 (row_equal_p, realloc_glyph_pool)
3190 (allocate_matrices_for_frame_redisplay)
3191 (showing_window_margins_p)
3192 (adjust_frame_glyphs_for_frame_redisplay)
3193 (build_frame_matrix_from_leaf_window, make_current)
3194 (mirrored_line_dance, mirror_line_dance, update_frame)
3195 (update_window_tree, update_single_window)
3196 (check_current_matrix_flags, update_window, update_text_area)
3197 (update_window_line, set_window_update_flags, scrolling_window)
3198 (update_frame_1, scrolling, buffer_posn_from_coords)
3199 (do_pending_window_change, change_frame_size)
3200 (change_frame_size_1, sit_for):
3201 Use bool for boolean.
3202 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3203 and remove last int (actually boolean) argument, which was always 0.
3204 All callers changed.
3205 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3206 * dispextern.h (struct composition_it): Use bool for boolean.
3207 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3208 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3209 * dired.c (file_name_completion):
3210 Use bool for boolean. (This was missed in an earlier change.)
3211
95072a94
MR
32122012-08-27 Martin Rudalics <rudalics@gmx.at>
3213
3214 * window.c (Fset_window_configuration): Revert first part of
3215 last change.
3216
0f19feff
JD
32172012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3218
3219 * nsterm.h (NSPanel): New class variable dialog_return.
3220
3a880af4
SM
3221 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3222 Initialize dialog_return.
0f19feff
JD
3223 (windowShouldClose:): Use stop instead of stopModalWithCode.
3224 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3225 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3226 event.
3227 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3228 modal loop returns.
3229
f10fe38f
PE
32302012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3231
de1339b0
PE
3232 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3233 * composite.c (find_composition, composition_gstring_p)
3234 (composition_reseat_it, find_automatic_composition):
3235 * data.c (let_shadows_buffer_binding_p)
3236 (let_shadows_global_binding_p, set_internal, make_blv)
3237 (Fmake_variable_buffer_local, Fmake_local_variable)
3238 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3239 (cons_to_signed, arith_driver):
3240 * dbusbind.c (xd_in_read_queued_messages):
3241 * dired.c (directory_files_internal, file_name_completion):
3242 Use bool for booleans.
3243 * dired.c (file_name_completion):
3244 * process.h (fd_callback):
3245 Omit int (actually boolean) argument. It wasn't being used.
3246 All uses changed.
3247 * composite.h, lisp.h: Reflect above API changes.
3248
f10fe38f
PE
3249 * cmds.c, coding.c: Use bool for booleans.
3250 * cmds.c (move_point, Fself_insert_command):
3251 * coding.h (struct composition status, struct coding_system):
3252 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3253 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3254 (emacs_mule_char, decode_coding_emacs_mule)
3255 (encode_coding_emacs_mule, detect_coding_iso_2022)
3256 (decode_coding_iso_2022, encode_invocation_designation)
3257 (encode_designation_at_bol, encode_coding_iso_2022)
3258 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3259 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3260 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3261 (encode_coding_raw_text, detect_coding_charset)
3262 (decode_coding_charset, encode_coding_charset, detect_eol)
3263 (detect_coding, get_translation_table, produce_chars)
3264 (consume_chars, reused_workbuf_in_use)
3265 (make_conversion_work_buffer, code_conversion_save)
3266 (decode_coding_object, encode_coding_object)
3267 (detect_coding_system, char_encodable_p)
3268 (Funencodable_char_position, code_convert_region)
3269 (code_convert_string, code_convert_string_norecord)
3270 (Fset_coding_system_priority):
3271 * fileio.c (Finsert_file_contents):
3272 Use bool for booleans.
3273 * coding.h, lisp.h: Reflect above API changes.
3274 * coding.c: Remove unnecessary static function decls.
3275 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3276 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3277 not a boolean 'int', since callers never look at the return value.
3278 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3279 * coding.h (decoding_buffer_size, encoding_buffer_size)
3280 (emacs_mule_string_char): Remove unused extern decls.
3281 (struct iso_2022_spec, struct coding_system):
3282 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3283 (struct emacs_mule_spec): Remove unused field 'full_support'.
3284 All initializations removed.
3285 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3286
5474c384
DA
32872012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3288
f10fe38f 3289 Fix spare memory change (Bug#12286).
5474c384
DA
3290 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3291 (valid_lisp_object_p): Likewise.
3292
c4b6914d
MR
32932012-08-27 Martin Rudalics <rudalics@gmx.at>
3294
3295 * window.c (Fset_window_configuration): Record any window's old
3296 buffer if it's replaced (see Bug#8789). If the new current
3297 buffer doesn't appear in the selected window, go to its old
3298 point (Bug#12208).
3299
35aaa1ea
DA
33002012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3301
3302 Special MEM_TYPE_SPARE to denote reserved memory.
3303 * alloc.c (enum mem_type): New memory type.
3304 (refill_memory_reserve): Use new type for spare memory.
3305 This prevents live_cons_p and live_string_p from incorrect
3306 detection of uninitialized objects from spare memory as live.
3307
6af64513
PE
33082012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3309
8b2e00a3
PE
3310 Spelling fixes.
3311 * Makefile.in (.PHONY): versioclean -> versionclean.
3312
b52d6985
PE
3313 Remove unused external symbols.
3314 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3315 * window.c (Qwindow_valid_p, decode_valid_window):
3316 Now static, not extern.
3317 * data.c (Qinterval): Remove; unused.
3318 (syms_of_data): Do not define 'interval'.
3319 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3320 * window.h (decode_valid_window):
3321 Remove decls.
3322
d5172d4f
PE
3323 * character.c, charset.c, chartab.c: Use bool for booleans.
3324 * character.c (lisp_string_width, string_count_byte8)
3325 (string_escape_byte8):
3326 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3327 (load_charset_map_from_file, map_charset_chars)
3328 (Fdefine_charset_internal, define_charset_internal)
3329 (Fdeclare_equiv_charset, find_charsets_in_text)
3330 (Ffind_charset_region, char_charset, Fiso_charset):
3331 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3332 (sub_char_table_set, sub_char_table_set_range)
3333 (char_table_set_range, optimize_sub_char_table)
3334 (map_sub_char_table):
3335 Use bool for boolean.
3336 * character.c (str_to_unibyte): Omit last boolean argument; it was
3337 always 0. All callers changed.
3338 * character.h, charset.h: Adjust to match previous changes.
3339 * character.h (char_printable_p): Remove decl of nonexistent function.
3340 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3341 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3342 are all boolean, so make them single-bit bitfields.
3343
6af64513
PE
3344 * lisp.h (ASET): Remove attempt to detect side effects.
3345 It was meant to be temporary and it often doesn't work,
3346 because when IDX has side effects the behavior of IDX==IDX
3347 is undefined. See Stefan Monnier in
3348 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3349
e1f29348
BR
33502012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3351
3352 * lisp.h (functionp): New function (extracted from Ffunctionp).
3353 (FUNCTIONP): Use it.
3354 * eval.c (Ffunctionp): Use it.
3355
17c05d74
PE
33562012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3357
0f46bc75
PE
3358 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3359 as that's faster and simpler than static storage. Don't bother
3360 with the g_main_context_query overhead if g_main_context_pending
3361 says no events are pending.
3362 (gfds, gfds_size): Remove these static vars.
3363 (xgselect_initialize): Remove; no longer needed.
3364 All uses and decls removed.
3365
ee4c0f69
PE
3366 * emacs.c (fatal_error_signal_hook): Remove.
3367 All uses removed. This leftover from old code was always 0.
3368
17c05d74
PE
3369 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3370 * casefiddle.c (casify_object, casify_region):
3371 * casetab.c (set_case_table):
3372 * category.c, category.h (word_boundary_p):
3373 * category.h (CHAR_HAS_CATEGORY):
3374 Use bool for booleans, instead of int.
3375
391ceac5
EZ
33762012-08-25 Eli Zaretskii <eliz@gnu.org>
3377
3378 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3379
2f221583
PE
33802012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3381
f4a681b0
PE
3382 On assertion failure, print backtrace if available.
3383 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3384 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3385 * Makefile.in (LIB_EXECINFO): New macro.
3386 (LIBES): Use it.
3387
2f221583
PE
3388 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3389 * bytecode.c (exec_byte_code):
3390 * callint.c (check_mark, Fcall_interactively):
3391 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3392 (getenv_internal, sync_process_alive, call_process_exited):
3393 * lisp.h (USE_SAFE_ALLOCA):
3394 Use bool for booleans, instead of int.
3395 * lisp.h, process.h: Adjust prototypes to match above changes.
3396 * callint.c (Fcall_interactively): Don't assume the mark's
3397 offset fits in 'int'.
3398
37ef52bb
PE
33992012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3400
3401 * buffer.c, buffer.h: Use bool for boolean.
3402 * buffer.c (reset_buffer_local_variables)
3403 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3404 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3405 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3406 (overlay_touches_p, overlay_strings, Foverlay_put)
3407 (report_overlay_modification, call_overlay_mod_hooks):
3408 (mmap_enlarge, mmap_set_vars):
3409 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3410 Use bool for booleans, instead of int.
3411 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3412 since the 1-or-0 return value is always ignored anyway.
3413 (mmap_initialized_p):
3414 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3415 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3416
2cc21167
PE
34172012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3418
3419 * bidi.c: Use bool for boolean.
3420 This is a bit more readable, and makes the text segment of bidi.o
3421 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3422 Presumably it's faster too.
3423 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3424 Now bool.
3425 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3426 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3427 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3428 (bidi_explicit_dir_char, bidi_level_of_next_char)
3429 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3430 Use bool for booleans, instead of int.
3431 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3432 (bidi_unshelve_cache): Adjust decls to match code.
3433
7db4ddf4
MR
34342012-08-23 Martin Rudalics <rudalics@gmx.at>
3435
3436 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3437 argument.
3438
b1bb8011
PE
34392012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3440
3441 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3442 * atimer.h: Include <stdbool.h>.
3443
ff687885
DN
34442012-08-22 Dan Nicolaescu <dann@gnu.org>
3445
3446 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3447 compile time tests instead of run time tests on systems that do
3448 not use them.
3449 (FRAME_MAC_P): Remove leftover from deleted code.
3450 * frame.c (syms_of_frame): Remove leftover from deleted code.
3451
4ce7a138
JD
34522012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3453
3454 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3455
d733ec6d
PE
34562012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3457
3458 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3459 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 3460 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
3461 (fontset_add): Return void, for FONTSET_ADD.
3462
d0d2d26f
PE
34632012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3464
fce31d69
PE
3465 * alloc.c: Use bool for booleans.
3466 (gc_in_progress, abort_on_gc)
3467 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3468 (dont_register_blocks) [GC_MALLOC_CHECK]:
3469 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3470 (check_string_bytes, make_specified_string, memory_full)
3471 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3472 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3473 (mark_stack, valid_pointer_p, make_pure_string)
3474 (Fgarbage_collect, survives_gc_p, gc_sweep):
3475 Use bool for booleans, instead of int.
3476 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3477 Remove unused local.
3478 * alloc.c (PURE_POINTER_P):
3479 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3480 * editfns.c (Fformat):
3481 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3482 (Fdo_auto_save):
3483 * fns.c (sweep_weak_table):
3484 * lisp.h (suppress_checking, push_message, survives_gc_p)
3485 (make_pure_string, gc_in_progress, abort_on_gc):
3486 * lread.c (readchar, read1):
3487 * print.c (Fprin1_to_string):
3488 * xdisp.c (push_message):
3489 Use bool for booleans affected directly or indirectly by
3490 alloc.c's changes.
3491
d0d2d26f
PE
3492 Make recently-introduced setters macros.
3493 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3494 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3495 (set_fontset_default, set_fontset_fallback): Rename from their
3496 upper-case counterparts, and make them functions rather than macros.
3497 This is more consistent with the other recently-introduced setters.
3498 These don't need to be inline, since they're local.
3499
d18e2bb6
JD
35002012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3501
3502 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3503 the loop (Bug#12247).
3504
1b9d9d16
PE
35052012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3506
3507 * lisp.h (vcopy): Use memcpy rather than our own loop.
3508 This fixes a performance regression introduced by the recent
3509 addition of vcopy. This means 'vcopy' will need to be modified
3510 for a copying collector, but that's OK. Also, tighten the
3511 checking in the assertion.
3512
b2f09701
EZ
35132012-08-21 Eli Zaretskii <eliz@gnu.org>
3514
3515 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3516 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3517 non-base glyph for the width of the base character, according to
e1f29348
BR
3518 what x_draw_composite_glyph_string_foreground expects.
3519 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
3520 expectations, to produce correct width of the composed character.
3521 Reverse the sign of the DU offset produced by ScriptPlace.
3522
9b994fed
PE
35232012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3524
3525 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3526
086ca913
DA
35272012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3528
3529 Avoid direct writes to contents member of struct Lisp_Vector.
3530 * lisp.h (vcopy): New function to copy data into vector.
3531 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3532 * fns.c (Ffillarray): Use ASET.
3533 * keyboard.c (timer_check_2): Use AREF and ASET.
3534 (append_tool_bar_item, Frecent_keys): Use vcopy.
3535 * lread.c (read_vector): Use ASET.
3536 * msdos.c (Frecent_doskeys): Use vcopy.
3537 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3538 (Finternal_merge_in_global_face): Use ASET and vcopy.
3539 * xfont.c (xfont_list_pattern): Likewise.
3540
5481664a
MR
35412012-08-21 Martin Rudalics <rudalics@gmx.at>
3542
3543 * window.c (Fwindow_point): For the selected window always return
3544 the position of its buffer's point.
3545 (Fset_window_point): For the selected window always go in its
3546 buffer to the specified position.
3547
6d470bdd
DA
35482012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3549
3550 Setter macros for fontsets.
3551 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3552 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3553 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3554 Adjust users.
3555
24564fe1
GM
35562012-08-20 Glenn Morris <rgm@gnu.org>
3557
3558 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3559 Don't assume that `ln -f' works.
3560
0a05a035
EZ
35612012-08-20 Eli Zaretskii <eliz@gnu.org>
3562
3563 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3564 and later about non-assignments with no effect. See discussion at
3565 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3566 details.
3567
e46f2325
DA
35682012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3569
3570 Inline setter functions for Lisp_Objects slots of struct specbinding.
3571 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3572 Adjust users.
3573
734fbd86
MR
35742012-08-20 Martin Rudalics <rudalics@gmx.at>
3575
3576 * window.c (select_window): Always make selected window's buffer
3577 current.
3578
f1a95992
DA
35792012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3580
3581 Use AREF and ASET for docstrings of category tables.
3582 * category.h (CATEGORY_DOCSTRING): Use AREF.
3583 (SET_CATEGORY_DOCSTRING): Use ASET.
3584 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3585
e83064be
DA
35862012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3587
3588 Inline setter functions for hash table members.
3589 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3590 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3591 (set_hash_key_and_value, set_hash_index, set_hash_next)
3592 (set_hash_hash): New functions.
3593 * charset.c, fns.c: Adjust users.
3594
4ce60d2e
DA
35952012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3596
3597 Inline getter and setter functions for per-buffer values.
3598 * buffer.h (per_buffer_default, set_per_buffer_default)
3599 (per_buffer_value, set_per_buffer_value): New functions.
3600 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3601 * buffer.c, data.c: Adjust users.
3602
c06c9690
JB
36032012-08-20 Juanma Barranquero <lekktu@gmail.com>
3604
3605 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3606
32bd4250
PE
36072012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3608
bad03192 3609 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
3610 as gnulib does this if the system doesn't.
3611 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
3612 Remove declaration. MS-Windows declares it on stdlib.h which is
3613 included by conf_post.h.
b69a6d22
PE
3614 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3615 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3616 * vm-limit.c: Include <unistd.h>, for 'environ'.
3617
22d7feb2
PE
3618 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3619 (start_of_data): Remove decl; mem-limits.h provides it.
3620
32bd4250
PE
3621 * xdisp.c (handle_invisible_prop): Make it a bit faster
3622 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3623
450809af
CY
36242012-08-19 Chong Yidong <cyd@gnu.org>
3625
3626 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3627 ends (Bug#3874).
3628
9e677988
AS
36292012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3630
6b1319ce
AS
3631 * .gdbinit: Use call instead of set when calling a function in the
3632 inferior.
3633
9e677988
AS
3634 * data.c (set_internal): Don't use set_blv_found.
3635 (Fkill_local_variable): Likewise.
3636
d7191076
AA
36372012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3638
3639 * nsfont.m (ns_ascii_average_width): Ensure the string
3640 ascii_printable is initialized with a null-terminated character
3641 array. Otherwise, it can contain undesired extra characters.
3642
e757f1c6
PE
36432012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3644
3645 port new setting code to Sun C 5.8 2005/10/13
3646 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3647 Return void, not Lisp_Object. Otherwise, the compiler
3648 complains about (A?B:C) where B is void and C is Lisp_Object
3649 when compiling CHAR_TABLE_SET, due to the recent change to
3650 the API of sub_char_table_set_contents.
3651
a999ce26
CY
36522012-08-18 Chong Yidong <cyd@gnu.org>
3653
3654 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3655 for the string case (Bug#3874).
3656
3f22b86f
PE
36572012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3658
39eb03f1
PE
3659 * buffer.h (BSET): Remove (Bug#12215).
3660 Replace all uses with calls to new setter functions.
3661 (bset_bidi_paragraph_direction, bset_case_canon_table)
3662 (bset_case_eqv_table, bset_directory, bset_display_count)
3663 (bset_display_time, bset_downcase_table)
3664 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3665 (bset_last_selected_window, bset_local_var_alist)
3666 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3667 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3668 (bset_width_table):
3669 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3670 (bset_auto_fill_function, bset_auto_save_file_format)
3671 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3672 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3673 (bset_cache_long_line_scans, bset_case_fold_search)
3674 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3675 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3676 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3677 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3678 (bset_header_line_format, bset_indicate_buffer_boundaries)
3679 (bset_indicate_empty_lines, bset_invisibility_spec)
3680 (bset_left_fringe_width, bset_major_mode, bset_mark)
3681 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3682 (bset_name, bset_overwrite_mode, bset_pt_marker)
3683 (bset_right_fringe_width, bset_save_length)
3684 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3685 (bset_scroll_up_aggressively, bset_selective_display)
3686 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3687 (bset_word_wrap, bset_zv_marker):
3688 * category.c (bset_category_table):
3689 * syntax.c (bset_syntax_table):
3690 New setter functions.
3691
6a09a33b
PE
3692 * process.h (PSET): Remove (Bug#12215).
3693 Replace all uses with calls to new setter functions.
3694 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3695 (PROCESS_INLINE): New macro.
3696 (pset_childp): New setter function.
3697 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3698 * process.c (PROCESS_INLINE):
3699 Define to EXTERN_INLINE, so that the corresponding functions
3700 are compiled into code.
3701 (pset_buffer, pset_command, pset_decode_coding_system)
3702 (pset_decoding_buf, pset_encode_coding_system)
3703 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3704 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3705 (pset_type, pset_write_queue): New setter functions.
3706
e8c17b81
PE
3707 * window.h (WSET): Remove (Bug#12215).
3708 Replace all uses with calls to new setter functions.
3709 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3710 (WINDOW_INLINE): New macro.
3711 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3712 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3713 (wset_total_lines, wset_vertical_scroll_bar)
3714 (wset_window_end_pos, wset_window_end_valid)
3715 (wset_window_end_vpos): New setter functions.
3716 * window.c (WINDOW_INLINE):
3717 Define to EXTERN_INLINE, so that the corresponding functions
3718 are compiled into code.
3719 (wset_combination_limit, wset_dedicated, wset_display_table)
3720 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3721 (wset_new_normal, wset_new_total, wset_next_buffers)
3722 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3723 (wset_prev_buffers, wset_right_fringe_width)
3724 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3725 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3726 (wset_window_parameters):
3727 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3728 (wset_column_number_displayed, wset_region_showing):
3729 New setter functions.
3730
3f22b86f
PE
3731 * termhooks.h (TSET): Remove (Bug#12215).
3732 Replace all uses with calls to new setter functions.
3733 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3734 (TERMHOOKS_INLINE): New macro.
3735 (tset_charset_list, tset_selection_alist): New setter functions.
3736 * terminal.c (TERMHOOKS_INLINE):
3737 Define to EXTERN_INLINE, so that the corresponding functions
3738 are compiled into code.
3739 (tset_param_alist): New setter function.
3740
742af32f
PE
37412012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3742
15dbb4d6
PE
3743 * keyboard.h (KSET): Remove (Bug#12215).
3744 Replace all uses with calls to new setter functions.
3745 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3746 (KEYBOARD_INLINE): New macro.
3747 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3748 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3749 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3750 New setter functions.
3751 * keyboard.c (KEYBOARD_INLINE):
3752 Define to EXTERN_INLINE, so that the corresponding functions
3753 are compiled into code.
3754 (kset_echo_string, kset_kbd_queue)
3755 (kset_keyboard_translate_table, kset_last_prefix_arg)
3756 (kset_last_repeatable_command, kset_local_function_key_map)
3757 (kset_overriding_terminal_local_map, kset_real_last_command)
3758 (kset_system_key_syms): New setter functions.
3759
f00af5b1
PE
3760 * frame.h (FSET): Remove (Bug#12215).
3761 Replace all uses with calls to new setter functions.
3762 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3763 (FRAME_INLINE): New macro.
3764 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3765 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3766 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3767 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3768 (fset_param_alist, fset_root_window, fset_scroll_bars)
3769 (fset_selected_window, fset_title, fset_tool_bar_items)
3770 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3771 * frame.c (FRAME_INLINE):
3772 Define to EXTERN_INLINE, so that the corresponding functions
3773 are compiled into code.
3774 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3775
0c94c8d6
PE
3776 A few more naming-convention fixes for getters and setters.
3777 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3778 and rename from buffer_overlays_set_before.
3779 (set_buffer_overlays_after): Move here from buffer.h, and rename
3780 from buffer_overlays_set_after.
3781 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3782 All uses changed.
3783 (set_buffer_intervals): Rename from buffer_set_intervals.
3784 * intervals.c (set_interval_object): Move here from intervals.h,
3785 and rename from interval_set_object.
3786 (set_interval_left): Move here from intervals.h, and rename from
3787 interval_set_left.
3788 (set_interval_right): Move here from intervals.h, and rename from
3789 interval_set_right.
3790 (copy_interval_parent): Move here from intervals.h, and rename from
3791 interval_copy_parent.
3792 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3793 (set_interval_plist): Rename from interval_set_plist.
3794 Return void, not Lisp_Object, since no caller uses the result.
3795 * lisp.h (string_intervals): Rename from string_get_intervals.
3796 (set_string_intervals): Rename from string_set_intervals.
3797
34dabdb7
PE
3798 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3799 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 3800 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
3801 All uses changed. See the end of
3802 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3803
742af32f
PE
3804 * lisp.h (CSET): Remove (Bug#12215).
3805 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3806 (set_char_table_purpose): New functions,
3807 replacing CSET. All uses changed. For example, replace
3808 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 3809 "set_char_table_parent (char_table, parent);".
742af32f
PE
3810 The old version was confusing because it used the same name
3811 'parent' for two different things.
3812
a04e2c62
DA
38132012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3814
3815 Functions to get and set Lisp_Object fields of buffer-local variables.
3816 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3817 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3818 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3819 * data.c, eval.c, frame.c: Adjust users.
3820
383dcbf9
CY
38212012-08-17 Chong Yidong <cyd@gnu.org>
3822
3823 * xfaces.c (merge_face_vectors): If the target font specfies a
3824 font spec, make the font's attributes take precedence over
3825 directly-specified attributes.
3826 (merge_face_ref): Recognize :font.
3827
44386687
DA
38282012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3829
3830 Do not use memcpy for copying intervals.
3831 * intervals.c (reproduce_interval): New function.
3832 (reproduce_tree, reproduce_tree_obj): Use it.
3833 (reproduce_tree_obj): Remove prototype.
3834
927c7216
PE
38352012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3836
3837 * lisp.h (duration_to_sec_usec): Remove unused decl.
3838
93044f7b
AA
38392012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3840
3841 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3842 to an allocated instance of NSString, not to the class itself.
3843
9851e4a5
JB
38442012-08-17 Juanma Barranquero <lekktu@gmail.com>
3845
3846 * makefile.w32-in (C_CTYPE_H): New macro.
3847 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3848 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3849 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3850
620f13b0
PE
38512012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3852
3853 Use ASCII tests for character types.
3854 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3855 * xfns.c, xterm.c:
3856 Don't include <ctype.h>; was not needed.
3857 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3858 * sysdep.c, xfaces.c:
3859 Include <c-ctype.h> instead of <ctype.h>.
3860 * nsterm.m: Include <c-ctype.h>.
3861 * charset.c (read_hex):
3862 * doc.c (Fsnarf_documentation):
3863 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3864 (DRIVE_LETTER) [DOS_NT]:
3865 (Ffile_name_directory, Fexpand_file_name)
3866 (Fsubstitute_in_file_name):
3867 * font.c (font_parse_xlfd, font_parse_fcname):
3868 * frame.c (x_set_font_backend):
3869 * gtkutil.c (xg_get_font):
3870 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3871 * nsimage.m (hexchar):
3872 * nsterm.m (ns_xlfd_to_fontname):
3873 * sysdep.c (system_process_attributes):
3874 * xfaces.c (hash_string_case_insensitive):
3875 Use C-locale tests instead of locale-specific tests for character
3876 types, since we want the ASCII interpretation here, not the
3877 interpretation suitable for whatever happens to be the current locale.
3878
52162052
MR
38792012-08-16 Martin Rudalics <rudalics@gmx.at>
3880
3881 Consistently check windows for validity/liveness
3882 (Bug#11984, Bug#12025, Bug#12026).
3883 * lisp.h (CHECK_VALID_WINDOW): New macro.
3884 * window.c (decode_window): Rename to decode_live_window.
3885 (decode_valid_window, Fwindow_valid_p): New functions.
3886 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3887 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3888 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3889 (Fwindow_prev_sibling, Fwindow_combination_limit)
3890 (Fset_window_combination_limit, Fwindow_use_time)
3891 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3892 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3893 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3894 (Fwindow_hscroll, Fset_window_hscroll)
3895 (Fwindow_redisplay_end_trigger)
3896 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3897 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3898 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3899 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3900 (Fwindow_end, Fset_window_point, Fset_window_start)
3901 (Fpos_visible_in_window_p, Fwindow_line_height)
3902 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3903 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3904 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3905 (Fset_window_parameter, Fwindow_display_table)
3906 (Fset_window_display_table, Fdelete_other_windows_internal)
3907 (Fset_window_buffer, Fset_window_new_total)
3908 (Fset_window_new_normal, Fdelete_window_internal)
3909 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3910 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3911 (Fwindow_scroll_bars): Check whether argument window is a valid or
3912 live window. Update doc-strings.
3913 (syms_of_window): New symbol Qwindow_valid_p.
3914 * keyboard.c (Fposn_at_x_y): Check whether argument
3915 frame_or_window denotes a valid window.
3916
2751c80f
DA
39172012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3918
3919 Fix previous char table change.
3920 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3921 * chartab.c (optimize_sub_char_table): Likewise.
3922
032a42c8
CY
39232012-08-16 Chong Yidong <cyd@gnu.org>
3924
a2d19368
CY
3925 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3926
032a42c8
CY
3927 * xfont.c (xfont_open):
3928 * xftfont.c (xftfont_open): Set the font's max_width field.
3929
3930 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3931 min_width to space_width and average_width to the average over
3932 printable ASCII characters.
3933 (ns_char_width): Code cleanup.
3934 (ns_ascii_average_width): New utility function.
3935
3936 * font.h (struct font): Update comments.
3937
a098c930
DA
39382012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3939
032a42c8 3940 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
3941 * lisp.h (CSET): New macro.
3942 (char_table_set_extras, char_table_set_contents)
3943 (sub_char_table_set_contents): New function.
3944 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3945 * syntax.c: Adjust users.
3946
8be3a09c
SM
39472012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3948
3949 * eval.c (eval_sub): Bind lexical-binding.
3950 * lread.c (Qlexical_binding): Make non-static.
3951
ac4845a6
JD
39522012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3953
ddee6515
JD
3954 * nsmenu.m (popupSession): Remove.
3955 (pop_down_menu): Remove endModalSession.
3956 (timeout_handler:): New method.
3957 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3958 Call runModalForWindow. Check timer_fired when it returns.
3959 If not set, cancel timer and break out of loop.
3960 Otherwise loop again, with a new timeout.
3961
3962 * nsterm.m: Include fcntl.h if present.
3963 (fd_entry, t_readfds, inNsSelect): Remove.
3964 (select_writefds, select_valid, select_timeout, selfds)
3965 (select_mutex, apploopnr): Add.
3966 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3967 Otherwise call kbd_buffer_store_event.
3968 (ns_send_appdefined): Remove release of fd_entry.
3969 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3970 Increment and decrement apploopnr.
3971 (ns_select): If no file descriptors, just do a NSTimer.
3972 Otherwise copy read/write masks and start select thread (fd_handler).
3973 Start main loop and wait for application defined event.
3974 Inform select thread to stop selecting after main loop is exited.
3975 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 3976 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
3977 (fd_handler:): Loop forever, wait for info from the main thread
3978 to either start or stop selecting. When select returns, send
3979 and appdefined event.
3980 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3981 If not call kbd_buffer_store_event.
3982
3983 * nsterm.h (EmacsApp): fd_handler takes id argument.
3984 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3985
ac4845a6
JD
3986 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3987
eb424fe3
EZ
39882012-08-15 Eli Zaretskii <eliz@gnu.org>
3989
3990 * region-cache.c (move_cache_gap): Update gap_len using the actual
3991 growth of the boundaries array. Do not change cache_len.
3992 (Bug#12196)
3993
4e6a86c6
DA
39942012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3995
3996 Generalize and cleanup font subsystem checks.
3997 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
3998 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3999 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 4000
5bf192ca
DA
40012012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4002
4003 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4004
f2045622
CY
40052012-08-15 Chong Yidong <cyd@gnu.org>
4006
8be3a09c
SM
4007 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4008 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4009 extract the font descriptor instead of just the font name.
4010 In that case, return a font spec instead of a string.
f2045622
CY
4011 (x_last_font_name): Move to this file from xfns.c.
4012
4013 * xfns.c (Fx_select_font): The return value can also be a font
4014 spec. Move x_last_font_name management to gtkutil.c.
4015
4016 * xfaces.c: Make font weight and style symbols non-static.
4017
7f6feb56
SM
40182012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4019
4020 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4021 (bug#12117).
4022
fecbd8ff
SM
40232012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4024
4025 * alloc.c (Fgarbage_collect): Use plural form consistently.
4026
9b8d5165
EZ
40272012-08-14 Eli Zaretskii <eliz@gnu.org>
4028
4029 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4030 iteration through the command loop. Fixes a problem whereby mouse
4031 movements are ignored until the first mouse click.
4032
f5d9e83a
PE
40332012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4034
4035 Use bool, not int, for Lisp booleans.
4036 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4037 makes Emacs a bit smaller and presumably a bit faster.
4038 * lisp.h: Include <stdbool.h>.
4039 (struct Lisp_Boolfwd, defvar_bool):
4040 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4041 * regex.c [!emacs]: Include <stdbool.h>.
4042 (false, true): Remove; <stdbool.h> does this for us now.
4043
55802e4a
CY
40442012-08-14 Chong Yidong <cyd@gnu.org>
4045
4abcdac8
CY
4046 * character.c (Fcharacterp): Doc fix (Bug#12076).
4047
4048 * data.c (Findirect_variable): Doc fix (Bug#11040).
4049
55802e4a
CY
4050 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4051
4052 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 4053 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 4054
8e99d072
BR
40552012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4056
4057 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4058 (bug#12022).
4059
08908aca
MR
40602012-08-14 Martin Rudalics <rudalics@gmx.at>
4061
4062 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4063 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4064 * minibuf.c (choose_minibuf_frame, read_minibuf):
4065 * w32fns.c (x_create_tip_frame):
4066 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4067 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4068
56120d6f
PE
40692012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4070
4071 * intervals.c (offset_intervals): Remove obsolete comment.
4072
67b77c0b
AS
40732012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4074
4075 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4076
f48b82fd
GR
40772012-08-14 Gergely Risko <gergely@risko.hu>
4078
4079 * coding.c (decode_coding): Record buffer modification before
4080 disabling undo_list (Bug#11773).
4081
fd318b54
DA
40822012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4083
4084 Revert and cleanup some recent overlay changes.
4085 * buffer.h (enum overlay_type): Remove.
4086 (buffer_get_overlays, buffer_set_overlays): Likewise.
4087 (buffer_set_overlays_before, buffer_set_overlays_after):
4088 New function. Adjust users.
4089 (unchain_both): Add eassert.
4090
41a62dd9
DA
40912012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4092
4093 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4094
5884c324
PE
40952012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4096
4097 * gtkutil.c (xg_mark_data): Don't assume C99.
4098
ca06f160
JD
40992012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4100
4101 * gtkutil.c (xg_frame_tb_info): New struct.
4102 (TB_INFO_KEY): New define.
4103 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4104 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4105 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4106 if not present.
4107 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 4108 is up to date. Otherwise store new data.
ca06f160
JD
4109 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4110
7864a3f7
DA
41112012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4112
4113 Use KSET for write access to Lisp_Object members of struct kboard.
4114 * keyboard.h (KSET): New macro.
4115 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4116 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4117 * xterm.c: Adjust users.
4118
4c31be61
DA
41192012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4120
4121 Use BSET for write access to Lisp_Object members of struct buffer.
4122 * buffer.h (BSET): New macro.
4123 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4124 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4125 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4126 * window.c, xdisp.c, xfns.c: Adjust users.
4127
14ae4239
BT
41282012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4129
4130 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4131
32bcadb4
JD
41322012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4133
3d29b2ce 4134 * nsterm.m (not_in_argv): New function.
fc0c31f8 4135 (application:openFile, application:openTempFile:):
3d29b2ce
JD
4136 (application:openFileWithoutUI:, application:openFiles:): Open file
4137 if not_in_argv returns non-zero (bug#12171).
4138
32bcadb4 4139 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
4140 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4141 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
4142 (xg_get_font_name): Use those functions/macros here.
4143 Reported by Frans Oilinki <moilinki@gmail.com>.
4144
9ff9402d 41452012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
4146
4147 * unexmacosx.c (copy_data_segment): Copy initialized data in
4148 statically linked libraries from input file rather than memory.
4149
db74a5fc
YM
4150 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4151 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4152 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4153
25e65510
GM
41542012-08-10 Glenn Morris <rgm@gnu.org>
4155
4156 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4157 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4158
7961135c
DA
41592012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4160
4161 Fix last change to allow compilation with low optimization levels.
4162 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4163 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4164
42b3a444
DA
41652012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4166
4167 Use common inline syntax in intervals.h.
4168 * intervals.h (INTERVALS_INLINE): New macro.
4169 Change all users from LISP_INLINE.
4170
9fb0c957
DA
41712012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4172
4173 Define Qnone once for all platforms.
4174 * frame.c (Qnone): Define here.
4175 (syms_of_frame): DEFSYM it.
4176 * lisp.h (Qnone): New declaration.
4177 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4178 * xfns.c: Remove duplication. Adjust users.
4179
65e8ee52
DA
41802012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4181
4182 Remove unused macros from intervals.h.
4183 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4184 * intervals.c: Adjust comment.
4185
9b855fd6
EZ
41862012-08-10 Eli Zaretskii <eliz@gnu.org>
4187
4188 * w32fns.c <w32_unicode_gui>: New static variable.
4189 (globals_of_w32fns): Initialize it according to os_subtype.
4190 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4191 testing os_subtype.
4192
39cb9e56 41932012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
4194 Eli Zaretskii <eliz@gnu.org>
4195
4196 Fix bug #10299 with Unicode characters sent by customized
4197 keyboards created by MSKLC.
4198 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4199 (w32_init_class): Use it to initialize the Emacs class with either
4200 ANSI or Unicode API calls.
4201 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4202 later.
4203 (w32_wnd_proc): If the character code sent by WM_CHAR or
4204 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4205 original message. Call DefWindowProcW on NT and later.
4206
9374581a
GM
42072012-08-10 Glenn Morris <rgm@gnu.org>
4208
4b94e8cf
GM
4209 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4210
9374581a
GM
4211 * lisp.h (DIRECTORY_SEP): Let configure set it.
4212
a2752828
DA
42132012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4214
4215 Use TSET for write access to Lisp_Object slots of struct terminal.
4216 * termhooks.h (TSET): New macro.
4217 * coding.c, terminal.c, xselect.c: Adjust users.
4218
cc92c454
SM
42192012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4220
4221 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4222 the failing expression, include them in the error message.
4223 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4224 * lisp.h (internal_condition_case_n): Update declaration.
4225
4cb3e6b3
DA
42262012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4227
4228 Inline functions to examine and change buffer overlays.
4229 * buffer.c (unchain_both): New function.
4230 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4231 (buffer_has_overlays): New function.
4232 (enum overlay_type): New enum.
4233 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4234 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4235
8707c1e5
DA
42362012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4237
4238 Inline functions to examine and change buffer intervals.
4239 * alloc.c (mark_interval_tree): Remove.
4240 (MARK_INTERVAL_TREE): Simplify.
4241 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4242 * intervals.c (buffer_balance_intervals): New function.
4243 (graft_intervals_into_buffer): Adjust indentation.
4244 (set_intervals_multibyte): Simplify.
4245 * buffer.h (BUF_INTERVALS): Remove.
4246 (buffer_get_intervals, buffer_set_intervals): New function.
4247 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4248 * intervals.c, textprop.c: Adjust users.
4249
ad8c997f
DA
42502012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4251
4252 Inline functions to examine and change string intervals.
4253 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4254 (string_get_intervals, string_set_intervals): New function.
4255 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4256 * lread.c, print.c, textprop.c: Adjust users.
4257
32ac3a6b
GM
42582012-08-08 Glenn Morris <rgm@gnu.org>
4259
4260 * lisp.mk (lisp): Remove language/persian.elc.
4261
77c7bcb1
DA
42622012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4263
4264 Cleanup intervals.
4265 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4266 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
4267 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4268 Adjust comment. Move under #if 0.
77c7bcb1
DA
4269 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4270 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4271
9c08a8d4
DA
42722012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4273
4274 Check total length of intervals with eassert.
4275 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4276 * intervals.c: Change all users to eassert.
4277
26d16b35
EZ
42782012-08-07 Eli Zaretskii <eliz@gnu.org>
4279
14ae4239
BT
4280 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4281 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
4282 INTERNAL_FIELD in Lisp_Cons.
4283
c644523b
DA
42842012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4285
4286 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4287 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4288 name since all xname users are fixed long time ago. Do not
4289 use INTERNAL_FIELD.
4290 (set_symbol_name, set_symbol_function, set_symbol_plist):
4291 (set_symbol_next, set_overlay_plist): New function.
4292 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4293 (struct Lisp_Overlay): Likewise.
4294 (CVAR, MVAR, SVAR): Remove.
4295 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4296 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4297 * xterm.c: Adjust users.
4298 * .gdbinit: Change to use name field of struct Lisp_Symbol
4299 where appropriate.
4300
6a3d20cc
DA
43012012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4302
4303 Basic functions to set Lisp_Object and pointer slots of intervals.
4304 * intervals.h (interval_set_parent, interval_set_object):
4305 (interval_set_left, interval_set_right, interval_set_plist):
4306 (interval_copy_parent): New function.
4307 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
4308 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4309 Adjust indentation.
6a3d20cc
DA
4310 (INTERVAL_SIZE): Remove. Adjust users.
4311 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4312
4d2b044c
DA
43132012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4314
4315 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4316 * process.h (PGET): Remove.
4317 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4318 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4319
d3d50620
DA
43202012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4321
4322 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4323 * window.h (WGET): Remove.
4324 (struct window): Do not use INTERNAL_FIELD.
4325 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4326 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4327 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4328 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4329 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4330 Adjust users.
4331
d10a51dc
CY
43322012-08-07 Chong Yidong <cyd@gnu.org>
4333
4334 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4335 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4336 (Fdelete_window_internal): Signal an error if the window is not on
4337 a live frame (Bug#12025).
4338
e69b0960
DA
43392012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4340
4341 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4342 * frame.h (FGET): Remove.
4343 (struct frame): Do not use INTERNAL_FIELD.
4344 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4345 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4346 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4347 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4348
25a20a3a
JB
43492012-08-06 Juanma Barranquero <lekktu@gmail.com>
4350
4351 * w32.c: Silence compiler warnings.
4352 (map_w32_filename): Remove unused variable `is_fat'.
4353 (chase_symlinks): Add parentheses around expression.
4354
1c6f11f4
GM
43552012-08-06 Glenn Morris <rgm@gnu.org>
4356
1db4583a
GM
4357 * sysdep.c: Respect BROKEN_GETWD.
4358
1c6f11f4
GM
4359 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4360 Let configure handle it.
4361 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4362
2b90362b
DA
43632012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4364
4365 Use GCALIGNMENT where appropriate.
4366 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4367 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4368 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4369
5f50daf2
EZ
43702012-08-06 Eli Zaretskii <eliz@gnu.org>
4371
14ae4239
BT
4372 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4373 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 4374
cbcc7007
SM
43752012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4376
4377 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4378 that should be sufficient for everyone.
4379
4d365fa4
JD
43802012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4381
4382 * keyboard.c (timer_check_2): Add break so timer_check returns next
4383 timeout.
4384
dd86bd82
DA
43852012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4386
4387 Fix Windows build errors introduced after converting to WGET and WSET.
4388 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4389 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4390
054e1668
JD
43912012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4392
4393 * nsterm.m (ns_frame_rehighlight): Use FSET.
4394
4395 * nsmenu.m (ns_update_menubar): Use FSET.
4396
21238f11
DA
43972012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4398
4399 Separate read and write access to Lisp_Object slots of Lisp_Process.
4400 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4401 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4402
077288cf
DA
44032012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4404
4405 Separate read and write access to Lisp_Object slots of struct window.
4406 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4407 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4408 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4409 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4410 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4411 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4412 Adjust users.
4413
71688bd7
DA
44142012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4415
4416 Fix Windows build errors introduced after converting to FGET and FSET.
4417 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4418 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4419 (w32_judge_scroll_bars): Change to use FSET.
4420 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4421
f99bac93
DA
44222012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4423
4424 Fix replacement typo.
4425 * window.c (replace_window): Set root_window instead of
4426 selected_window. This fixes a total window subsystem
4427 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4428
8c2a0f2d
GM
44292012-08-06 Glenn Morris <rgm@gnu.org>
4430
4431 * lisp.mk (lisp): Add language/persian.elc.
4432
edd74c35
DA
44332012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4434
4435 Separate read and write access to Lisp_Object slots of struct frame.
4436 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4437 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4438 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4439 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4440 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4441
8671676c
AS
44422012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4443
4444 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4445
663e2b3f
DA
44462012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4447
4448 Generalize common compile-time constants.
4449 * lisp.h (header_size, bool_header_size, word_size): Now here.
4450 (struct Lisp_Vector): Add comment.
4451 (struct Lisp_Bool_Vector): Move up to define handy constants.
4452 (VECSIZE, PSEUDOVECSIZE): Simplify.
4453 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4454 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4455 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4456 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4457 * xfont.c, xmenu.c: Use word_size where appropriate.
4458
d32e47af
LM
44592012-08-05 Lawrence Mitchell <wence@gmx.li>
4460
4461 * search.c (Freplace_match): Treat \? in the replacement text
4462 literally (Bug#8161).
4463
e5d9c0d1
CY
44642012-08-05 Chong Yidong <cyd@gnu.org>
4465
4466 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4467 * frame.c (Vdelete_frame_functions):
4468 * emacs.c (Vkill_emacs_hook): Doc fix.
4469
8da0576b
EZ
44702012-08-04 Eli Zaretskii <eliz@gnu.org>
4471
4472 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4473 --with-x-toolkit=no builds.
4474 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4475
02676e5d
CY
44762012-08-04 Chong Yidong <cyd@gnu.org>
4477
4478 * syntax.c (Fmodify_syntax_entry): Doc fix.
4479
97147da9
EZ
44802012-08-04 Eli Zaretskii <eliz@gnu.org>
4481
76151e2c
EZ
4482 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4483 * w32.c (init_environment): Change the default values of many
4484 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
4485 them into environment when they were not already defined.
4486 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 4487 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
4488 (check_windows_init_file): Now external, not static.
4489 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
4490 called when Vload_path is already set up.
4491
4492 * w32.h (check_windows_init_file): Add prototype.
4493
4494 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4495 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4496 compatibility with Posix platforms.
4497 (main): Move the call to check_windows_init_file to here from
4498 w32.c.
4499 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4500 any, in the DEFALT argument into the root of the Emacs build or
4501 installation tree, as appropriate.
4502
4503 * callproc.c (init_callproc_1): Call decode_env_path instead of
4504 doing its equivalent by hand.
4505 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4506 the code that sets Vexec_path run on MS-Windows.
4507
4508 * lread.c (init_lread): Add comments to #ifdef's.
4509
97147da9
EZ
4510 * msdos.c (dos_set_window_size, IT_update_begin)
4511 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4512 instead of direct references.
4513
185ee146
PE
45142012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4515
4516 Export DEFAULT_REHASH_* to GDB.
4517 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4518 Now constants, not macros.
4519
8834c57a
PE
45202012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4521
98c6f1e3
PE
4522 Remove unnecessary casts involving pointers.
4523 These casts are no longer needed now that we assume C89 or later,
4524 since they involve casting to or from void *.
4525 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4526 (make_pure_float, make_pure_vector):
4527 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4528 * macros.c (Fstart_kbd_macro):
4529 * menu.c (find_and_return_menu_selection):
4530 * minibuf.c (read_minibuf_noninteractive):
4531 * sysdep.c (closedir):
4532 * xdisp.c (x_produce_glyphs):
4533 * xfaces.c (compare_fonts_by_sort_order):
4534 * xfns.c (x_real_positions, select_visual):
4535 * xselect.c (x_stop_queuing_selection_requests)
4536 (x_get_window_property, x_get_window_property_as_lisp_data):
4537 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4538 Remove unnecessary pointer casts.
4539 * alloc.c (record_xmalloc): New function.
4540 * lisp.h (record_xmalloc): New decl.
4541 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4542 more like a function. This is because the pointer cast is not
4543 needed. All uses changed.
4544 * print.c (print_string, print_error_message): Avoid length recalc.
4545
8834c57a
PE
4546 Improve fix for macroexp crash with debugging (Bug#12118).
4547 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4548 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4549 not supposed to be invoked from the garbage collector.
4550 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4551 (gc_aset): New function, which is like ASET but can be
4552 used in the garbage collector.
4553 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4554 (set_hash_index): Use it instead of ASET.
4555
6dad7178
EZ
45562012-08-03 Eli Zaretskii <eliz@gnu.org>
4557
4558 Support symlinks on latest versions of MS-Windows.
4559 * w32.c: Include winioctl.h and aclapi.h.
4560 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4561 (revert_to_self): Forward declarations of static functions.
4562 <static BOOL g_b_init_get_security_info>:
4563 <g_b_init_create_symbolic_link>: New static flags.
4564 (globals_of_w32): Initialize them to zero.
4565 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4566 (map_w32_filename): Improve commentary. Simplify switch.
4567 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4568 headers (most versions of MinGW w32api don't).
4569 (get_security_info, create_symbolic_link)
4570 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4571 New functions.
4572 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4573 in the argument file name.
4574 (sys_access): Call unc_volume_file_attributes only if
4575 GetFileAttributes fails with network-related error codes.
4576 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4577 have the required privileges.
14ae4239 4578 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
4579 get_file_security_desc.
4580 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
4581 with addition of handling of symlinks and support for 'lstat'.
4582 If possible, get file's attributes and security information by
6dad7178
EZ
4583 handle, not by name. Produce S_IFLNK bit for symlinks, when
4584 called from 'lstat'.
4585 (stat, lstat): New functions, call 'stat_worker'.
4586 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4587 symlinks when the underlying filesystem supports them.
4588
f162bcc3
PE
45892012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4590
79ea6c20
PE
4591 Fix macroexp crash on Windows with debugging (Bug#12118).
4592 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4593 checking subscripts; problem introduced with the recent
4594 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4595 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4596 since it's used in non-static inline functions now.
4597
c0ce93fd
PE
4598 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4599 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 4600
f162bcc3
PE
4601 Use C99-style 'extern inline' if available.
4602 * buffer.h (BUFFER_INLINE):
4603 * category.h (CATEGORY_INLINE):
4604 * character.h (CHARACTER_INLINE):
4605 * charset.h (CHARSET_INLINE):
4606 * composite.h (COMPOSITE_INLINE):
4607 * dispextern.h (DISPEXTERN_INLINE):
4608 * lisp.h (LISP_INLINE):
4609 * systime.h (SYSTIME_INLINE):
4610 New macro, replacing 'static inline' in this header.
4611 * buffer.h, category.h, character.h, charset.h, composite.h:
4612 * dispextern.h, lisp.h, systime.h:
4613 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4614 * alloc.c (LISP_INLINE):
4615 * buffer.c (BUFFER_INLINE):
4616 * category.c (CATEGORY_INLINE):
4617 * character.c (CHARACTER_INLINE):
4618 * charset.c (CHARSET_INLINE):
4619 * composite.c (COMPOSITE_INLINE):
4620 * dispnew.c (DISPEXTERN_INLINE):
4621 * sysdep.c (SYSTIME_INLINE):
4622 Define to EXTERN_INLINE, so that the corresponding functions
4623 are compiled into code.
4624 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4625 (INLINE_HEADER_END): New macros.
4626 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4627 since it's used in non-static inline functions now.
a8333d03 4628 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 4629
837b365b
GM
46302012-08-02 Glenn Morris <rgm@gnu.org>
4631
d66b744d
GM
4632 * s/: Remove empty directory.
4633
837b365b
GM
4634 * s/ms-w32.h: Move to ../nt/inc.
4635 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4636 Update for new ms-w32.h location.
4637
13294f95
PE
46382012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4639
4640 Port to Solaris 8.
4641 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4642
90df0db3
GM
46432012-08-02 Glenn Morris <rgm@gnu.org>
4644
4645 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4646 hard-coding the path separator.
4647
4939150c
PE
46482012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4649
4650 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4651 This how ASET and AREF are supposed to work, and makes
4652 it easier to think about future improvements. See
4653 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4654 * charset.h (set_charset_attr): New function.
4655 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4656 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4657 (aref_addr): New function. All uses of &AREF(...) changed.
4658 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4659 (set_hash_index): New functions. All lvalue-style uses of
4660 HASH_KEY etc. changed.
4661 * keyboard.c (set_prop): New function. All lvalue-style uses
4662 of PROP changed.
4663
947b2afd
AA
46642012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4665
4666 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4667 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 4668 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
4669 * nsfns.m (ns_set_name_as_filename): Likewise.
4670 * nsmenu.m (ns_update_menubar): Likewise.
4671 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4672
4f5d0325
EZ
46732012-08-01 Eli Zaretskii <eliz@gnu.org>
4674
2008beae
EZ
4675 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4676 Adapt to latest changes in field names of the corresponding Lisp
288479f6 4677 objects.
2008beae 4678
4f5d0325
EZ
4679 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4680
fe3cc771
GM
46812012-08-01 Glenn Morris <rgm@gnu.org>
4682
4683 * s/msdos.h: Remove file.
4684 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4685 * Makefile.in (S_FILE): Remove.
4686 (config_h): Remove S_FILE.
4687
c90acc54
JB
46882012-08-01 Juanma Barranquero <lekktu@gmail.com>
4689
4690 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4691 Remove; moved to nt/config.nt.
4692
d8a05828
DA
46932012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4694
4695 Use INTERNAL_FIELD for conses and overlays.
4696 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4697 Remove obsolete comment.
4698 (MVAR): New macro.
4699 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4700 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4701
8271d590
DA
47022012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4703
4704 Use INTERNAL_FIELD for symbols.
4705 * lisp.h (SVAR): New macro. Adjust users.
4706 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4707 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4708
3193acd2
DA
47092012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4710
4711 Use INTERNAL_FIELD for processes.
4712 * process.h (PVAR): New macro. Adjust style.
4713 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4714 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4715
3a45383a
DA
47162012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4717
4718 Use INTERNAL_FIELD for windows.
4719 * window.h (WVAR): New macro.
4720 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4721 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4722 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4723 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4724 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4725 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4726
c1dbc63c
PE
47272012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4728
4729 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4730
5c0c0e8a
GM
47312012-08-01 Glenn Morris <rgm@gnu.org>
4732
4733 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4734 Move to configure.ac.
4735
552a99b4
JB
47362012-08-01 Juanma Barranquero <lekktu@gmail.com>
4737
4738 * makefile.w32-in (CONFIG_H): Update dependencies.
4739 (CONF_POST_H): New macro.
4740
4741 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4742
8d8e2dfe
GM
47432012-07-31 Glenn Morris <rgm@gnu.org>
4744
bc96620a
GM
4745 * Makefile.in (S_FILE): No longer set by configure.
4746
476b1b2d
GM
4747 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4748 is available.
4749 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4750
b2c7a106
GM
4751 * process.h (NULL_DEVICE):
4752 * emacs.c (SEPCHAR):
4753 * editfns.c (USER_FULL_NAME): Let configure set them.
4754
d53d062a
GM
4755 * s/README, s/template.h: Remove files.
4756
4515017f
GM
4757 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4758
8d8e2dfe
GM
4759 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4760 Move to configure.ac.
4761
5b20b3cc
EZ
47622012-07-31 Eli Zaretskii <eliz@gnu.org>
4763
1e0afd9a
EZ
4764 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4765 resulting renaming of 'struct frame' members.
4766
5b20b3cc
EZ
4767 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4768
4769 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4770 after introduction of FVAR.
4771
f1310128
JD
47722012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4773
79e721e0
JD
4774 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4775
4776 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4777 instead of compositeToPoint.
4778 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4779
8d7c7eed 4780 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 4781
e34f7f79
DA
47822012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4783
4784 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4785 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 4786 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
4787 (BVAR): Change to use INTERNAL_FIELD.
4788 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4789 (KVAR): Change to use INTERNAL_FIELD.
4790 * frame.h (FVAR): New macro.
4791 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
4792 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4793 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4794 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
4795 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4796
c09bfb2f
DA
47972012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4798
4799 Miscellaneous fixes for non-default X toolkits.
4800 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4801 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4802 Move under #ifdef USE_LUCID.
4803 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4804 definition and usage to avoid warnings.
4805
14c114ae
JD
48062012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4807
4808 * nsterm.m (openFiles): Fix previous checkin.
4809
3bd21e82
PE
48102012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4811
4812 * indent.c (compute_motion): Remove unused local.
4813
c1529ded
GM
48142012-07-31 Glenn Morris <rgm@gnu.org>
4815
400d5621
GM
4816 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4817
268e2432
GM
4818 * conf_post.h [USG5_4]:
4819 Move remaining contents of s/usg5-4-common.h here.
4820 * s/usg5-4-common.h: Remove file.
4821
7552f3ee
GM
4822 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4823 * s/irix6-5.h: Remove file.
4824
6a381852
GM
4825 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4826 * s/darwin.h: Remove file.
4827
c1529ded
GM
4828 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4829 * s/hpux10-20.h: Remove file, which is now empty.
4830
b429a4ee
GM
48312012-07-30 Glenn Morris <rgm@gnu.org>
4832
4833 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4834 * Makefile.in (config_h): Add conf_post.h.
4835 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4836
adff3182
JD
48372012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4838
4839 * nsterm.m (ns_do_open_file): New variable.
b9031d69 4840 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
4841 (openFile, openTempFile, openFileWithoutUI, openFiles):
4842 Open files only if ns_do_open_file.
adff3182 4843
c32af1e4
PE
48442012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4845
7393bcbb
PE
4846 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4847 This no-op macro hasn't been needed for many years.
4848 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4849
c32af1e4
PE
4850 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4851 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4852 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4853 gdb_make_enums_visible.
4854 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4855 (DIRECTORY_SEP): Now a constant, not a macro.
4856
302fc036
EZ
48572012-07-30 Eli Zaretskii <eliz@gnu.org>
4858
4859 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4860 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4861
4862 * w32term.c <w32_keyboard_codepage>: Renamed from
4863 keyboard_codepage and now external. All users changed.
4864
4865 * w32term.h: Add declaration of w32_keyboard_codepage.
4866
4867 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4868 the codepage to translate keys to Unicode. If this argument is
4869 -1, use the value returned by GetConsoleCP. All callers changed.
4870
88fb40b4
PE
48712012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4872
0aee6912
PE
4873 Update .PHONY listings in makefiles.
4874 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4875 bootstrap-clean, distclean, maintainer-clean, versioclean,
4876 extraclean, frc.
4877
88fb40b4
PE
4878 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4879 This is a bit clearer. Fix some commentary typos.
4880
0a763bd1
GM
48812012-07-30 Glenn Morris <rgm@gnu.org>
4882
32bac6d6
GM
4883 * s/netbsd.h: Let configure include signal.h if needed.
4884 Remove file, which is now empty.
4885
b65e7c46
GM
4886 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4887 Let configure set them.
4888 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4889 No more need to undefine.
0a763bd1 4890
169304bd
AS
48912012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4892
4893 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4894 non-single-byte char when adding meta modifier. (Bug#12090)
4895
6cd7a139
DA
48962012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4897
4898 Convert safe_call to use variable number of arguments.
4899 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4900 (safe_call2): Fix comment.
4901 * lisp.h (safe_call): Adjust prototype.
4902 * coding.c (encode_coding_object): Change to use safe_call2.
4903 * xfaces.c (merge_face_heights): Change to use safe_call1.
4904
d34d6ffc
GM
49052012-07-30 Glenn Morris <rgm@gnu.org>
4906
7b8a48e4 4907 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 4908 does that unconditionally. Remove file, which is now empty.
7b8a48e4 4909
d34d6ffc
GM
4910 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4911 Remove empty files.
4912
03a660a6
PE
49132012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4914
4915 Export to GDB most of lisp.h's remaining object-like macros.
4916 * lisp.h (min, max): Move earlier, because they're used earlier now.
4917 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4918 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4919 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4920 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4921 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4922 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4923 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4924 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4925 Now constants, for GDB. They need not be macros.
4926 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4927 Now constants, for GDB, as well as macros, for static initializers.
4928 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4929 Move to after the definition of struct Lisp_Char_Table,
4930 since the former now needs that type defined.
4931 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4932 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4933 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4934 New enums, for gdb_make_enums_visible.
4935 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 4936 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
4937 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4938 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4939 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4940 enum maxargs, enum MAX_ALLOCA.
4941 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4942 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4943 no longer needed, now that they are done in lisp.h.
4944
e499d0ee
DA
49452012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4946
4947 Cleanup string bytes checking.
4948 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4949 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4950 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4951 (check_sblock, compact_small_strings): Simplify.
4952
d5040d2d
PE
49532012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4954
4955 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4956 These macros are confusing and no longer need to be defined, as
4957 the enum values now suffice. All uses replaced with definiens.
4958 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4959
7f259ae6
JB
49602012-07-29 Juanma Barranquero <lekktu@gmail.com>
4961
4962 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4963 ($(BLD)/w32console.$(O)): Update dependencies.
4964
7e63e0c3
DA
49652012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4966
4967 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4968 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4969 time. Adjust users.
4970 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4971
ffd817eb
JD
49722012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4973
4974 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4975 setting sitelisp (Bug#12010).
4976
417a7a0e
EZ
49772012-07-29 Eli Zaretskii <eliz@gnu.org>
4978
14ae4239 4979 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
4980
4981 * w32heap.c (cache_system_info):
4982 * w32.c (sys_rename):
4983 * w32proc.c (find_child_console, sys_kill): All users changed.
4984
387d4d92
PE
49852012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4986
4987 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4988
55a6cca6
EZ
49892012-07-29 Eli Zaretskii <eliz@gnu.org>
4990
4991 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4992
dbcf001c
DA
49932012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4994
4995 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
4996 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4997 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 4998
e2688e4a
DA
49992012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5000
5001 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5002 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5003 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5004 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5005 (replace_range, replace_range_2, del_range_2): Change to eassert.
5006 * marker.c (byte_char_debug_check): Adjust style.
5007
b46a6a83
PE
50082012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5009
5010 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5011 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5012 long-ago-commented-out code that talks about "WIN32".
5013 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5014 All uses changed.
5015
e32a5799
PE
50162012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5017
5018 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5019 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5020 Simplify by using alignof.
5021 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5022 * lisp.h: Include <stdalign.h>.
5023 (GCALIGNMENT): New macro and constant.
5024 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5025 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5026 (stdalign): New macro, if not already defined.
5027
df81cd29
EZ
50282012-07-28 Eli Zaretskii <eliz@gnu.org>
5029
01bd1b0d
EZ
5030 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5031 * w32inevt.c: Include w32inevt.h.
5032 (w32_read_console_input): New inline function, calls either
5033 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5034 w32_console_unicode_input.
5035 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5036 (w32_kbd_patch_key, key_event): Use the codepage returned by
5037 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5038 (key_event): use uChar.UnicodeChar only if
5039 w32_console_unicode_input is non-zero.
5040
5041 * w32console.c: Include w32heap.h.
5042 <w32_console_unicode_input>: New global variable.
5043 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5044 family of Windows, zero otherwise.
5045
5046 * w32inevt.h: Declare w32_console_unicode_input.
5047
df81cd29
EZ
5048 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5049 --without-x. (Bug#11742)
5050
c20fdd9e
PE
50512012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5052
5053 Adjust GDB to reflect pvec_type changes (Bug#12036).
5054 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
5055 2012-07-04 changes to pseudovector representation.
5056 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 5057
32770973 50582012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
5059
5060 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5061 bus address.
5062 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5063
3438fe21
EZ
50642012-07-27 Eli Zaretskii <eliz@gnu.org>
5065
bcfbc9de
EZ
5066 * alloc.c (listn): Fix the order the arguments are consed onto the
5067 list.
5068
3438fe21
EZ
5069 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5070 enumeration constants, as PURE and HEAP are too general, and clash
5071 with other headers and sources, such as gmalloc.c and the
5072 MS-Windows system headers. All users changed.
5073
eeaea515
DA
50742012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5075
5076 Revert last save_excursion_save and save_excursion_restore changes.
5077 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5078 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5079
073c88c2
DA
50802012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5081
5082 Fix recently-introduced typos in Windows port.
5083 Reported by Martin Rudalics <rudalics@gmx.at>.
5084 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 5085 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 5086
4706125e
PE
50872012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5088
5089 Improve GDB symbol export (Bug#12036).
5090 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5091 arms of an 'if', not using conditional expressions; otherwise GDB
5092 complains about the types in the unevaluated arm when the argument
5093 is an integer literal.
5094 (xgetint): Simplify expression.
5095 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5096 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5097 Zaretskii in <http://bugs.gnu.org/12036#13>.
5098 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5099 needed now that we have gdb_make_enums_visible.
5100 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5101 (enum enum_USE_LSB_TAG):
5102 New enum types, packaging up enums that need to be exported to GDB.
5103
694b6c97
DA
51042012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5105
5106 Utility function to make a list from specified amount of objects.
5107 * lisp.h (enum constype): New datatype.
5108 (listn): New prototype.
5109 * alloc.c (listn): New function.
5110 (Fmemory_use_count, syms_of_alloc): Use it.
5111 * buffer.c (syms_of_buffer): Likewise.
5112 * callint.c (syms_of_callint): Likewise.
5113 * charset.c (define_charset_internal): Likewise.
5114 * coding.c (syms_of_coding): Likewise.
5115 * keymap.c (syms_of_keymap): Likewise.
5116 * search.c (syms_of_search): Likewise.
5117 * syntax.c (syms_of_syntax): Likewise.
5118 * w32.c (init_environment): Likewise.
5119 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5120 * xdisp.c (syms_of_xdisp): Likewise.
5121 * xfns.c (syms_of_xfns): Likewise.
5122
6195f384
DA
51232012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5124
5125 Fast save_excursion_save and save_excursion_restore.
5126 * lisp.h (struct Lisp_Excursion): New data type.
5127 (PVEC_EXCURSION): New pseudovector type.
5128 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5129 to deal with it. Adjust comments.
5130 (init_marker, attach_marker): New prototype.
5131 (unchain_marker): Adjust prototype.
5132 * marker.c (attach_marker): Change to global.
5133 (init_marker): New function.
5134 * alloc.c (Fmake_marker, build_marker): Use it.
5135 (build_marker): More easserts.
5136 (mark_object): Handle struct Lisp_Excursion.
5137 * editfns.c (save_excursion_save, save_excursion_restore):
5138 Reimplement to use struct Lisp_Excursion. Add comments.
5139
5eceb8fb
PE
51402012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5141
5142 Fix export of symbols to GDB (Bug#12036).
5143 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5144 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5145 emacs.c, as this is a more-suitable home. Had this been done earlier
5146 the fix for 12036 would have avoided some of the problems noted in
5147 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5148 would have been more obvious.
562157c8
PE
5149 * emacs.c: Do not include <verify.h>; no longer needed.
5150 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
5151 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5152 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5153 Remove; now done in lisp.h.
5154 * lisp.h (PUBLISH_TO_GDB): New macro.
5155 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5156 (DATA_SEG_BITS): Use it.
5157 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5158 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5159 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5160 not be usable in #if. This simplifies things.
5161
d6749401
JB
51622012-07-26 Juanma Barranquero <lekktu@gmail.com>
5163
5164 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5165
1781b9e9
PE
51662012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5167
d89518db 5168 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
5169 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5170 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5171 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5172 Adjust to changes in lisp.h and emacs.c, by using
5173 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5174 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5175 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5176 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5177 instead of gdb_valbits.
5178 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5179 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5180 instead of gdb_array_mark_flag.
5181 (xboolvector): Get size from $->size, not $->header.size.
5182 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5183 (xreload, hook-run, hookpost-run): Remove.
5184 * emacs.c: Include <verify.h>.
5185 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5186 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5187 Remove.
5188 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5189 (gdb_USE_LSB_TAG): New enum constants.
5190 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5191 Also define these as enum constants, so they're visible to GDB.
5192 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5193 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5194 as constants, so they're visible to GDB.
5195 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5196 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5197 Now enum constants, not macros, so they're visible to GDB.
5198 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5199 more convenient now. All uses changed.
5200 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5201 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5202
3628596a
DA
52032012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5204
5205 Explicitly free restriction data that are not needed anymore.
5206 * editfns.c (save_restriction_restore): Free restriction data.
5207
7abaf5cc
SM
52082012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5209
5210 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5211 add argument, tune behavior, and adjust all callers.
5212
71f88e00
PE
52132012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5214
5215 Use typedef for EMACS_INT, EMACS_UINT.
5216 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5217 than macros. This simplifies debugging in the usual case, since
5218 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5219 and it allows expressions involving EMACS_INT casts.
5220 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5221
57ec3034
JD
52222012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5223
5224 * nsterm.m (ns_read_socket): Return early if there is a modal
5225 window (Bug#12043).
5226
8137e7b3
MR
52272012-07-25 Martin Rudalics <rudalics@gmx.at>
5228
5229 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5230 that FOCUS-FRAME can be omitted.
5231
04e9897c
DA
52322012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5233
5234 Adjust buffer text indirection counters at the end of Fkill_buffer.
5235 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5236 buffer is definitely dead. This should really fix an issue reported
5237 by Christoph Scholtes again. (Bug#12007).
5238 (init_buffer_once): Initialize indirection counters of
5239 buffer_defaults and buffer_local_symbols (for sanity and safety).
5240
8a0484e1
EZ
52412012-07-24 Eli Zaretskii <eliz@gnu.org>
5242
5243 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5244 and continuation glyphs on tooltip frames, leave them at zero.
5245 Avoids continued lines in tooltips. (Bug#11832)
5246
fa691a83
DA
52472012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5248
5249 Simplify copy_overlay.
04e9897c 5250 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
5251 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5252
436bc8e0
EZ
52532012-07-23 Eli Zaretskii <eliz@gnu.org>
5254
5255 * print.c (print_object): Don't crash when a frame's name is nil
5256 or invalid. (Bug#12025)
5257
5258 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5259 it signals an error when a tooltip frame is being created.
5260
d7a7fda3
DA
52612012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5262
5263 Cleanup miscellaneous objects allocation and initialization.
5264 * alloc.c (allocate_misc): Change to static. Add argument to
5265 specify the subtype. Adjust comment and users.
5266 (build_overlay): New function.
5267 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5268 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5269 (allocate_misc): Remove prototype.
5270 (build_overlay): Add prototype.
5271
52722012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
5273
5274 Swap buffer text indirection counters in Fbuffer_swap_text.
5275 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5276 This avoids crash reported by Christoph Scholtes at
5277 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5278
9d7fa573
JD
52792012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5280
5281 * nsmenu.m (Popdown_data): New struct.
5282 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5283 free Popdown_data.
5284 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5285 (initWithContentRect): Make imgView and contentView non-static
5286 and autorelease them. Also autorelease img and matrix (Bug#12005).
5287 (dealloc): Remove (Bug#12005).
5288
0dd6d66d
DA
52892012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5290
5291 Adjust consing_since_gc when objects are explicitly freed.
5292 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5293 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5294 (free_cons, free_misc): Subtract object size from consing_since_gc.
5295
d36d71df
DA
52962012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5297
5298 Simplify and cleanup markers positioning code.
5299 * marker.c (attach_marker): More useful eassert.
5300 (live_buffer, set_marker_internal): New function.
5301 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5302 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5303
fb9ea40f
PE
53042012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5305
5306 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5307 as it's limited by the amount of memory, not by INT_MAX.
5308
2d5c5f7d
EZ
53092012-07-21 Eli Zaretskii <eliz@gnu.org>
5310
07fb592e
EZ
5311 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5312 in special-event-map. See the discussion at
5313 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5314 for the reasons.
5315
37a9eac8 5316 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
5317 info.dwItemData. Fixes crashes on 64-bit Windows.
5318 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 5319
c4328746
JD
53202012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5321
fc0c31f8 5322 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 5323 (conversationIdentifier): Return value is NSInteger.
784051c4 5324 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 5325
6e5d1c12
CY
53262012-07-21 Chong Yidong <cyd@gnu.org>
5327
5328 * window.c (decode_any_window): Signal an error if the window is
5329 on a dead frame (Bug#11984).
5330
9928463d
DA
53312012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5332
5333 Add indirection counting to speed up Fkill_buffer.
5334 * buffer.h (struct buffer): New member.
5335 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5336 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5337 base buffer indirection counter.
5338 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5339 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5340 through buffer list if indirection counter is 0.
5341
f8643a6b
DA
53422012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5343
5344 Extend the value returned by Fgarbage_collect with heap statistics.
5345 * alloc.c (Qheap): New symbol.
5346 (syms_of_alloc): DEFSYM it.
5347 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5348 (Fmemory_free): Remove.
5349 (syms_of_alloc): Don't defsubr it.
5350 * buffer.c (Fcompact_buffer): Remove.
5351 (syms_of_buffer): Don't defsubr it.
5352
dac616ff
DA
53532012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5354
5355 Make maybe_gc inline.
5356 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5357 * lisp.h (consing_since_gc, gc_relative_threshold)
5358 (memory_full_cons_threshold): Revert declaration.
5359 (maybe_gc): Remove prototype, define as inline.
5360 * alloc.c: Remove old commented-out code.
5361 (consing_since_gc, gc_relative_threshold)
5362 (memory_full_cons_threshold): Revert to global.
5363 (maybe_gc): Remove.
5364
d7ea76b4
DA
53652012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5366
5367 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5368 * lisp.h (build_unibyte_string): New function.
5369 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5370 * sysdep.c, w32fns.c, xfns.c: Use it.
5371 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5372 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5373 Adjust users accordingly.
5374 * font.h (font_open_by_name): Adjust prototype.
5375
765e61e3
DA
53762012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5377
5378 Cleanup calls to Fgarbage_collect.
5379 * lisp.h (maybe_gc): New prototype.
5380 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5381 Remove declarations.
5382 * alloc.c (maybe_gc): New function.
5383 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5384 Make them static.
5385 * bytecode.c (MAYBE_GC): Use maybe_gc.
5386 * eval.c (eval_sub, Ffuncall): Likewise.
5387 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5388 to avoid dependency from auto-save feature.
5389
52b852c7
PE
53902012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5391
5392 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5393 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5394 'for_each_per_buffer_object_at'.
5395 All uses changed. It's better to use upper-case for macros that
5396 cannot be implemented as functions, to give the reader a clue
5397 that they're special.
5398
5db81e33
SM
53992012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5400
5401 * alloc.c (Fgarbage_collect): Tweak docstring.
5402
5b835e1d
DA
54032012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5404
5405 Tweak the value returned from Fgarbage_collect again.
5406 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5407 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5408 Adjust documentation.
5409 (total_vector_bytes): Rename to total_vector_slots, adjust
5410 accounting.
5411 (total_free_vector_bytes): Rename to total_free_vector_slots,
5412 adjust accounting.
5413 (Qstring_bytes, Qvector_slots): New symbols.
5414 (syms_of_alloc): DEFSYM them.
5415
9cd47b72
DA
54162012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5417
5418 Buffer compaction primitive which may be used from Lisp.
5419 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5420 (syms_of_buffer): Register Fcompact_buffer.
5421 * alloc.c (Fgarbage_collect): Use compact_buffer.
5422 * buffer.h (compact_buffer): New prototype.
5423 (struct buffer_text): New member.
5424
d17337e5
DA
54252012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5426
5427 New macro to iterate over all buffers, miscellaneous cleanups.
5428 * lisp.h (all_buffers): Remove declaration.
5429 * buffer.h (all_buffers): Add declaration, with comment.
5430 (for_each_buffer): New macro.
5431 * alloc.c (Fgarbage_collect, mark_object): Use it.
5432 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5433 (init_buffer): Likewise.
5434 * data.c (Fset_default): Likewise.
5435 * coding.c (code_conversion_restore): Remove redundant check
5436 for dead buffer.
5437 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5438
60cfd278
AS
54392012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5440
5441 Fix bug that created negative-length intervals.
5442 * intervals.c (merge_interval_right, merge_interval_left):
5443 Do not zero out this interval if it is absorbed by its children,
5444 as this interval's total length doesn't change in that case. See
5445 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5446
d06714cb
PE
54472012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5448
83713154
PE
5449 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5450 when invoking (make-bool-vector N t) and N is a positive
5451 multiple of 8 -- the last 8 bits were mistakenly cleared.
5452
d06714cb
PE
5453 Remove some struct layout assumptions in bool vectors.
5454 * alloc.c (bool_header_size): New constant.
5455 (header_size, word_size): Move earlier, as they're now used earlier.
5456 Use 'word_size' in a few more places, where it's appropriate.
5457 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5458 padding before the data member of a bool vector.
5459 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5460 than doing the check by hand with an abort ().
5461
464d5a5e
SM
54622012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5463
5fbc0409
SM
5464 * eval.c (Fdefvar): Don't check constants since we only set the var if
5465 it's not yet defined anyway (bug#11904).
5466
464d5a5e
SM
5467 * lisp.h (last_undo_boundary): Declare new var.
5468 * keyboard.c (command_loop_1): Set it.
5469 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5470 were auto-added by the command loop (bug#11774).
5471
8dc2e44a
AS
54722012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5473
5474 * w32font.c (Qsymbol): Remove local definition.
5475 (syms_of_w32font): Don't DEFSYM it.
5476
169925ec
DA
54772012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5478
5479 Fix sweep_vectors to handle large bool vectors correctly.
5480 * alloc.c (sweep_vectors): Account total_vector_bytes for
5481 bool vectors larger than VBLOCK_BYTES_MAX.
5482
5fbfb018
CY
54832012-07-18 Chong Yidong <cyd@gnu.org>
5484
5485 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5486 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5487
3ab6e069
DA
54882012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5489
5490 Return more descriptive data from Fgarbage_collect.
5491 Suggested by Stefan Monnier in
5492 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5493 * alloc.c (bounded_number): New function.
5494 (total_buffers, total_vectors): New variable.
5495 (total_string_size): Rename to total_string_bytes, adjust users.
5496 (total_vector_size): Rename to total_vector_bytes, adjust users.
5497 (sweep_vectors): Account total_vectors and total_vector_bytes.
5498 (Fgarbage_collect): New return value. Adjust documentation.
5499 (gc_sweep): Account total_buffers.
5500 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5501 (VECTOR_SIZE): Remove.
5502 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5503 (Qinterval, Qmisc): New symbols.
5504 (syms_of_data): Initialize them.
5505 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5506 (Qcons, Qbuffer): New declarations.
5507
6d02fe5b
PE
55082012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5509
5510 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5511 Round up, not down. Improve doc.
5512
b7ffe040
DA
55132012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5514
5515 Restore old code in allocate_string_data to avoid Faset breakage.
5516 Reported by Julien Danjou <julien@danjou.info> in
5517 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5518 * alloc.c (allocate_string_data): Restore old code with minor
5519 adjustments, fix comment to explain this subtle issue.
5520
4dc7c8d5
SM
55212012-07-17 Eli Zaretskii <eliz@gnu.org>
5522
5523 Remove FILE_SYSTEM_CASE.
5524 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5525
5526 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5527 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5528 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5529 call-process-region passes it through expand-file-name.
5530
5531 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5532
55332012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5534
5535 Fix crash when creating indirect buffer (Bug#11917)
5536 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5537 Don't handle unbound variables specially if non-zero.
5538 (Fbuffer_local_variables): Pass zero.
5539 (clone_per_buffer_values): Pass non-zero.
5540
55412012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5542
5543 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5544 to make the loop interruptible.
5545
55462012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5547
5548 * gnutls.c (emacs_gnutls_handshake): Only retry if
5549 GNUTLS_E_INTERRUPTED.
5550
cce7fefc
DA
55512012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5552
5553 Cleanup and convert miscellaneous checks to eassert.
5554 * alloc.c (mark_interval): Fix comment, partially rephrase
5555 old comment from intervals.h (see below).
5556 * intervals.c (find_interval, adjust_intervals_for_insertion)
5557 (delete_interval, adjust_intervals_for_deletion)
5558 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5559 Convert to eassert.
5560 (adjust_intervals_for_insertion, make_new_interval):
5561 Remove obsolete and unused code.
5562 * intervals.h (struct interval): Remove obsolete comment.
5563 * textprotp.c (erase_properties): Remove unused code.
5564 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5565 (Fremove_list_of_text_properties): Convert to eassert.
5566
9ea10cc3
CY
55672012-07-17 Chong Yidong <cyd@gnu.org>
5568
5569 * editfns.c (Finsert_char): Doc fix.
5570
3900d5de
DA
55712012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5572
5573 Fix previous change to make Fmemory_free always accurate.
5574 * alloc.c (make_interval): Update total_free_intervals.
5575 (make_float): Likewise for total_free_floats.
5576 (free_cons, Fcons): Likewise for total_free_conses.
5577 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5578 Likewise for total_free_vector_bytes.
5579 (Fmake_symbol): Likewise for total_free_symbols.
5580 (bytes_free): Remove.
5581
7098646f
DA
55822012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5583
5584 Simple free memory accounting feature.
5585 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5586 (sweep_vectors): Accumulate size of free vectors.
5587 (Fgarbage_collect): Setup bytes_free.
5588 (Fmemory_free): New function.
5589 (syms_of_alloc): Register it.
5590
22657b40
DA
55912012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5592
5593 Cleanup overlays checking.
5594 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5595 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5596 eassert and OVERLAYP.
5597 (sort_overlays): Change to use OVERLAYP.
5598
ddfc8813
RK
55992012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5600
5601 * editfns.c (Finsert_char): Make it interactive, and make the
5602 second arg optional. Copy interactive spec and docstring from
5603 ucs-insert.
5604
7c26cf3c
PE
56052012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5606
5607 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5608 Unlike the other wrapped functions, fabs has an unspecified
5609 effect on errno.
5610
5d127af9
JD
56112012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5612
5613 * nsterm.m (keyDown): Interpret flags without left/right bits
5614 as the left key (Bug#11670).
5615
6a0dd1d7
DA
56162012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5617
5618 Remove empty and useless init functions.
5619 * lisp.h (init_character_once, init_fns, init_image)
5620 (init_filelock, init_sound): Remove prototype.
5621 * character.c (init_character_once): Remove.
5622 * filelock.c (init_filelock): Likewise.
5623 * fns.c (init_fns): Likewise.
5624 * image.c (init_image): Likewise.
5625 * sound.c (init_sound): Likewise.
5626 * emacs.c (main): Adjust accordingly.
5627
7a6136fd
DA
56282012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5629
5630 * gtkutil.h: Tiny cleanups.
5631 (use_old_gtk_file_dialog): Remove useless declaration.
5632 (xg_uses_old_file_dialog): Add suggested const attribute.
5633
ce811ad9
EZ
56342012-07-15 Eli Zaretskii <eliz@gnu.org>
5635
5636 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5637 (bidi_paragraph_init): Use it to limit search forward for a strong
5638 directional character in abnormally large paragraphs full of
5639 neutral or weak characters. (Bug#11943)
5640
c9adfeaa
SF
56412012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5642
5643 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5644 the toolbar (Bug#9451).
5645 (xg_make_tool_item): Give the widget event box a transparent
5646 background.
5647
fff62aa9
DA
56482012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5649
5650 Cleanup basic allocation variables and functions.
5651 * alloc.c (ignore_warnings, init_intervals, init_float)
5652 (init_cons, init_symbol, init_marker): Remove.
5653 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5654 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5655 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5656 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5657 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5658 (staticidx, init_alloc_once, init_strings, free_ablock):
5659 Remove redundant initialization.
5660 * fns.c (init_weak_hash_tables): Remove.
5661 * lisp.h (init_weak_hash_tables): Remove prototype.
5662
9730daca
DA
56632012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5664
5665 Use zero_vector where appropriate.
5666 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5667 accordingly.
5668 * lisp.h (zero_vector): New declaration.
5669 * font.c (null_vector): Remove.
5670 (syms_of_font): Remove initialization and staticpro.
5671 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5672 * keymap.c (Faccessible_keymaps): Likewise.
5673
2e2d2a13
LL
56742012-07-15 Leo Liu <sdl.web@gmail.com>
5675
5676 * fringe.c: Fix typo in comments.
5677
cd276f6e
LL
56782012-07-14 Leo Liu <sdl.web@gmail.com>
5679
5680 * fringe.c: Add a new bitmap exclamation-mark.
5681
5a1131d9
EZ
56822012-07-14 Eli Zaretskii <eliz@gnu.org>
5683
5684 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5685
5686 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5687 (HAVE_MENUS): Don't define, defined by editing config.in with
5688 msdos/sed2v2.inp.
5689 (GMALLOC_INHIBIT_VALLOC): Don't define.
5690 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5691
22e983b7
JB
56922012-07-14 Juanma Barranquero <lekktu@gmail.com>
5693
5694 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5695
5b3f250f
GM
56962012-07-14 Glenn Morris <rgm@gnu.org>
5697
5698 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5699 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5700 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5701
33d63ff4
GM
57022012-07-13 Glenn Morris <rgm@gnu.org>
5703
5b633342
GM
5704 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5705
33d63ff4
GM
5706 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5707 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5708
b55b9f85
JD
57092012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5710
0dc8cf50
JD
5711 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5712 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5713 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5714 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5715 where appropriate.
5716 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5717 as boolean expression.
5718 (x_set_window_size): Remove unused variable toolbar.
5719 (ns_get_color_default, ns_mod_to_lisp): Remove.
5720 (ns_mouse_position): Remove unused variables xchar and ychar.
5721 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5722 (ns_set_vertical_scroll_bar): Remove unused variable count.
5723 (ns_delete_terminal): Remove unused variable i.
5724 (ns_term_init): Remove unused variables r, g and b.
5725 (mouseDown): Remove unused variable window.
5726 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5727 (initFrameFromEmacs): Remove unused variable vbextra.
5728 (mouseEntered): Remove unused variables p and dpyinfo.
5729 (mouseExited): Remove unused variables p and r.
5730 (ns_define_frame_cursor, ns_clear_frame_area)
5731 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5732 (menuDown): Assign [sender tag] to variable and cast the variable.
5733
5734 * nsterm.h (menuDown): Add id as type to argument sender.
5735 (ns_display_info_for_name): Add Lisp_Object argument.
5736 (ns_term_init): Add Lisp_Object argument.
5737 (ns_map_event_to_object): Add void argument.
5738 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5739 prototype with arguments and only declare if __OBJC__.
5740 (nxatoms_of_nsselect): Add void argument.
5741 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5742 (ns_alloc_autorelease_pool): Add void argument.
5743 (ns_release_autorelease_pool): Add void* argument.
5744 (ns_get_defaults_value): Add const char* argument.
5745
5746 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5747 (initFromContents): Use SSDATA where appropriate.
5748 (ns_update_menubar): Add braces to ambigous if-else.
5749 (initWithTitle): Put () around assignment in if statement.
5750 (ns_menu_show): Remove unused variables window and keymap.
5751 (update_frame_tool_bar): Remove unused variable selected_p.
5752 (initWithContentRect): Remove unused variable this_cmd_name.
5753
5754 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5755 appropriate.
5756 (setXBMColor): Remove unused variable len.
5757 (setPixmapData): Put () around assignment in loop statement.
5758
5759 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5760 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5761 where appropriate.
5762 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5763 around assignment in loop statement.
5764 (nsfont_open): Remove unused variable i.
5765 (nsfont_open): Remove unused variable len.
5766 (nsfont_draw): Remove unused variable cs.
5767
5768 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5769 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5770 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5771 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5772 (Fns_font_name, Fns_perform_service)
5773 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5774 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5775 (ns_set_name): Remove unused variable view.
5776 (x_set_menu_bar_lines): Remove unused variable olines.
5777 (x_set_tool_bar_lines): Remove unused variable root_window.
5778 (Fns_list_colors): Put () around assignment in while statement.
5779 (Fns_perform_service): Remove unused variable len.
5780 (Fns_display_usable_bounds): Remove unused variable top.
5781 (syms_of_nsfns): Remove unused variable i.
5782
b55b9f85
JD
5783 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5784 memcpy (Bug#11907).
5785
ed9265fc 57862012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
5787
5788 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5789 and free it with DestroyExceptionInfo (Bug#11558).
5790
ef099b57
JB
57912012-07-13 Juanma Barranquero <lekktu@gmail.com>
5792
5793 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5794 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5795 Set here, not in nt/config.nt.
5796
ea814a5d
EZ
57972012-07-13 Eli Zaretskii <eliz@gnu.org>
5798
5799 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5800 cursor overflow into the last glyph on display line when the right
5801 fringe is off. (Bug#11832)
5802
1a952767
PE
58032012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5804
5805 * xdisp.c (produce_special_glyphs): Now static.
5806 * dispextern.h (produce_special_glyphs): Remove decl.
5807
983188fd
GM
58082012-07-13 Glenn Morris <rgm@gnu.org>
5809
8d7c7eed 5810 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
5811 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5812
983188fd
GM
5813 * s/usg5-4-common.h (USG, USG5):
5814 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5815 * s/sol2-6.h (SOLARIS2):
5816 * s/irix6-5.h (IRIX6_5):
5817 * s/hpux10-20.h (USG, USG5, HPUX):
5818 * s/gnu-linux.h (USG, GNU_LINUX):
5819 * s/freebsd.h (BSD_SYSTEM):
5820 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5821 * s/cygwin.h (CYGWIN):
5822 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5823 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5824
d1e68667 58252012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
5826
5827 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 5828
6de0e799
GM
58292012-07-13 Glenn Morris <rgm@gnu.org>
5830
739ae010
GM
5831 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5832
dbee5793
GM
5833 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5834
6de0e799
GM
5835 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5836 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5837
b82da769
GM
58382012-07-12 Glenn Morris <rgm@gnu.org>
5839
4fae5a7a 5840 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
5841
5842 * process.c (init_process_emacs): Rename from init_process.
5843 The old name is also the name of a Mach system call.
5844 * lisp.h, emacs.c: Update for this name change.
5845 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5846 longer needed.
5847
5a979817
EZ
58482012-07-12 Eli Zaretskii <eliz@gnu.org>
5849
5850 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5851 memmove call that removes glyphs covered by the left truncation
5852 glyph. Improve commentary.
5853 (display_line): Fix display of continuation glyphs on GUI frames
5854 when the right fringe is turned off and variable-size fonts are
5855 used in the window. Move the code that appends a stretch glyph to
5856 produce_special_glyphs, so that it could be used for truncation
5857 and continuation glyphs alike.
5858 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5859 glyph of a suitably computed width, to align the special glyphs at
5860 the window margin. Code moved from display_line. (Bug#11832)
5861
3e91a053
GM
58622012-07-12 Glenn Morris <rgm@gnu.org>
5863
ba9e4b84
GM
5864 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5865
5866 * s/gnu-linux.h, s/hpux10-20.h:
5867 Do not unconditionally define HAVE_XRMSETDATABASE.
5868
3e91a053
GM
5869 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5870
b300b1f4
PE
58712012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5872
5873 Fix typos that broke OS X build.
5874 Reported by Randal L. Schwartz in
5875 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5876 * nsterm.m (ns_timeout): Add missing local decl.
5877 (ns_get_color): snprintf -> sprintf, to fix typo.
5878
6e777848
GM
58792012-07-12 Glenn Morris <rgm@gnu.org>
5880
3f922c37
GM
5881 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5882 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5883 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5884 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5885
0ab7b23a
GM
5886 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5887 Move PTY_OPEN to configure.
5888
6e777848
GM
5889 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5890 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5891 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5892
4a7edc24
DA
58932012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5894
5895 Use empty_unibyte_string where applicable.
5896 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5897 * lread.c (read1): Likewise.
5898 * xsettings.c (syms_of_xsettings): Likewise.
5899
308aab79
GM
59002012-07-12 Glenn Morris <rgm@gnu.org>
5901
42bd1719
GM
5902 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5903 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
5904 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5905 * s/hpux10-20.h (RUN_TIME_REMAP):
5906 * s/bsd-common.h (TABDLY): Move to configure.
5907
5908 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5909
5910 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5911
ea0bbd17 5912 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 5913 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
5914
5915 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 5916
308aab79
GM
5917 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5918 * s/template.h: Move NARROWPROTO to configure.
5919
ee1cf5cf
GM
59202012-07-11 Glenn Morris <rgm@gnu.org>
5921
30fe9bf4
GM
5922 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5923 unused since 2011-01-17 change to systty.h.
5924
ee1cf5cf
GM
5925 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5926 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5927 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5928
63e47e07
PE
59292012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5930
5931 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5932
c43fb4c3
GM
59332012-07-11 Glenn Morris <rgm@gnu.org>
5934
5935 * s/darwin.h, s/gnu-linux.h, s/template.h:
5936 Move INTERRUPT_INPUT to configure.
5937
e8df9267
DA
59382012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5939
5940 Minor adjustments to interning code.
5941 * lisp.h (intern, intern_c_string): Redefine as static inline
5942 wrappers for intern_1 and intern_c_string_1, respectively.
5943 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
5944 * lread.c (intern_1, intern_c_string_1, oblookup):
5945 Simplify Vobarray checking.
e8df9267
DA
5946 * font.c (font_intern_prop): Likewise. Adjust comment.
5947 * w32font.c (intern_font_name): Likewise.
5948
34348bd4
AS
59492012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5950
d96a1e0c
AS
5951 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5952
34348bd4
AS
5953 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5954 of Fcar/Fcdr if possible.
5955 * font.c (check_otf_features): Likewise.
5956 * fontset.c (Fnew_fontset): Likewise.
5957 * gnutls.c (Fgnutls_boot): Likewise.
5958 * minibuf.c (read_minibuf): Likewise.
5959 * msdos.c (IT_set_frame_parameters): Likewise.
5960 * xmenu.c (Fx_popup_dialog): Likewise.
5961 * w32menu.c (Fx_popup_dialog): Likewise.
5962
c8add24e
GM
59632012-07-11 Glenn Morris <rgm@gnu.org>
5964
4b575b3c
GM
5965 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5966 since nothing has defined it on these platforms.
5967
09f4e3b0
GM
5968 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5969 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5970
172bedef
GM
5971 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5972 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5973 Move CLASH_DETECTION to configure.
5974
249685df
GM
5975 * s/gnu.h: Remove file, which is now empty.
5976
c8add24e
GM
5977 * s/gnu.h, s/gnu-linux.h:
5978 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5979
b41253a3
JW
59802012-07-11 John Wiegley <johnw@newartisans.com>
5981
5982 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5983 function attribute, so we only use it if it exists in the
5984 compiler.
5985
d923b542
DA
59862012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5987
5988 Avoid call to strlen in fast_c_string_match_ignore_case.
5989 * search.c (fast_c_string_match_ignore_case): Change to use
5990 length argument. Adjust users accordingly.
5991 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5992
5ebbef1d
PE
59932012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5994
bb352260
PE
5995 Assume mkdir, rmdir.
5996 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5997 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5998
57054ddd
PE
5999 Assume rename.
6000 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6001
b747d3f7
PE
6002 Assume perror.
6003 * s/hpux10-20.h (HAVE_PERROR): Remove.
6004 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6005 Remove dummy definition, as this problem was obsolete long ago.
6006
5ebbef1d
PE
6007 Assume strerror.
6008 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6009
984e7f30
DA
60102012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6011
6012 Avoid calls to strlen in font processing functions.
6013 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
6014 (font_open_by_name): Change to use length argument.
6015 Adjust users accordingly.
d923b542
DA
6016 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6017 Adjust prototypes.
6018 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6019 Change to return ptrdiff_t.
984e7f30
DA
6020 (xfont_list_pattern, xfont_match): Use length returned by
6021 xfont_decode_coding_xlfd.
6022 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6023
20e94fdd
GM
60242012-07-11 Glenn Morris <rgm@gnu.org>
6025
9d596af3
GM
6026 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6027 Move DONT_REOPEN_PTY to configure.
6028
20e94fdd
GM
6029 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6030 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6031
e99a530f
PE
60322012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6033
22ffb973
PE
6034 Remove "#define unix" that is no longer needed (Bug#11905).
6035 * s/aix4-2.h (unix): Remove; no longer needed.
6036
e9a9ae03
PE
6037 EMACS_TIME simplification (Bug#11875).
6038 This replaces macros (which typically do not work in GDB)
6039 with functions, typedefs and enums, making the code easier to debug.
6040 The functional style also makes code easier to read and maintain.
6041 * systime.h: Include <sys/time.h> on all hosts, not just if
6042 WINDOWSNT, since 'struct timeval' is needed in general.
6043 (EMACS_TIME): Now a typedef, not a macro.
6044 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6045 not macros.
6046 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6047 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6048 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6049 (EMACS_TIME_LE): Now functions, not macros.
6050 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6051 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6052 which are not functions. All uses rewritten to use:
6053 (make_emacs_time): New function.
6054 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6055 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6056 not functions. All uses rewritten to use the following, respectively:
6057 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6058 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 6059 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
6060 * fileio.c (Fcopy_file):
6061 * xterm.c (XTflash): Get the current time closer to when it's used.
6062 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6063
ffacb126
PE
6064 * bytecode.c (targets): Suppress -Woverride-init warnings.
6065
e99a530f
PE
6066 Simplify by avoiding confusing use of strncpy etc.
6067 * doc.c (Fsnarf_documentation):
6068 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6069 * frame.c (Fmake_terminal_frame):
6070 * gtkutil.c (get_utf8_string):
6071 * lread.c (openp):
6072 * nsmenu.m (ns_update_menubar):
6073 * regex.c (regerror):
6074 Prefer memcpy to strncpy and strncat when either will do.
6075 * fileio.c (Fsubstitute_in_file_name):
6076 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6077 (menu_separator_name_p):
6078 * nsmenu.m (ns_update_menubar):
6079 Prefer memcmp to strncmp when either will do.
6080 * nsterm.m: Include <ftoastr.h>.
6081 (ns_get_color):
6082 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6083 Prefer snprintf to strncpy.
6084 * nsterm.m (ns_term_init):
6085 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6086 * nsterm.m (ns_term_init):
6087 Avoid the need for strncpy, by using build_string or
6088 make_unibyte_string directly. Use dtoastr, not snprintf.
6089 * process.c (Fmake_network_process): Diagnose service names that
6090 are too long, rather than silently truncating them or creating
6091 non-null-terminated names.
6092 (Fnetwork_interface_info): Likewise, for interface names.
6093 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6094 Prefer sprintf to strncat.
6095 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6096 Prefer vsnprintf to vsprintf + strncpy.
6097
c59592b3
GM
60982012-07-10 Glenn Morris <rgm@gnu.org>
6099
6100 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6101 Clarify fallback case.
6102
7d7bbefd
DA
61032012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6104
6105 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6106 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6107 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 6108 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
6109 where argument type is known to be a Lisp_Cons.
6110
3a4c8000
TT
61112012-07-10 Tom Tromey <tromey@redhat.com>
6112
6113 * bytecode.c (BYTE_CODE_THREADED): New macro.
6114 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6115 (enum byte_code_op): New type.
6116 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6117 (exec_byte_code): Use them. Use token threading when applicable.
6118
2a0213a6
DA
61192012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6120
6121 Optimize pure C strings initialization.
6122 * lisp.h (make_pure_string): Fix prototype.
6123 (build_pure_c_string): New function, defined as static inline. This
6124 provides a better opportunity to optimize away calls to strlen when
6125 the function is called with compile-time constant argument.
6126 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6127 argument, adjust users accordingly. Use build_pure_c_string where
6128 appropriate.
6129 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6130 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6131 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6132
cb1caeaf
DA
61332012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6134
6135 Avoid calls to strlen in miscellaneous functions.
6136 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6137 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6138 * lread.c (openp): Likewise.
6139
c293e30c
DA
61402012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6141
6142 Avoid calls to strlen in path processing functions.
6143 * fileio.c (file_name_as_directory): Add comment. Change to add
6144 srclen argument and return the length of result. Adjust users
6145 accordingly.
6146 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
6147 swap 1st and 2nd arguments to obey the common convention.
6148 Adjust users accordingly.
c293e30c
DA
6149 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6150
9e059e3f
GM
61512012-07-10 Glenn Morris <rgm@gnu.org>
6152
d02eb359
GM
6153 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6154 Move PENDING_OUTPUT_COUNT definition to configure.
6155
882cf227
GM
6156 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6157 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6158 * s/gnu.h (DATA_START): Move definitions to configure.
6159
af6e839f
GM
6160 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6161 We include usg5-4-common.h, which defines them both.
6162
40289a12
GM
6163 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6164 O_RDONLY already includes it).
6165
9e059e3f
GM
6166 Stop ns builds setting the EMACSLOADPATH environment variable.
6167 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6168 Now it does not set EMACSLOADPATH, just returns the load-path string.
6169 * nsterm.h: Update accordingly.
6170 * lread.c [HAVE_NS]: Include nsterm.h.
6171 (init_lread) [HAVE_NS]: Use ns_load_path.
6172 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6173
7c4e8ec0
GM
61742012-07-09 Glenn Morris <rgm@gnu.org>
6175
d4f600ff
GM
6176 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6177 since the included bsd-common.h does so.
6178
cbb31951
GM
6179 Stop ns builds setting the EMACSPATH environment variable.
6180 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6181 (ns_init_paths): Do not set EMACSPATH.
6182 * nsterm.h (ns_exec_path): Add it.
6183 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6184 Use ns_exec_path.
6185
7c4e8ec0
GM
6186 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6187
26bccfae
PE
61882012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6189
a0bee46f
PE
6190 * process.c (wait_reading_process_output): 'waitchannels' was unset
6191 when read_kbd || !NILP (wait_for_cell); fix this.
6192
5994c183
PE
6193 Add GCC-style 'const' attribute to functions that can use it.
6194 * character.h (char_resolve_modifier_mask):
6195 * keyboard.h (make_ctrl_char):
6196 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6197 (init_character_once, next_almost_prime, init_fns, init_image)
6198 (flush_pending_output, init_sound):
6199 * mem-limits.h (start_of_data):
6200 * menu.h (finish_menu_items):
6201 Add ATTRIBUTE_CONST.
6202 * emacs.c (DEFINE_DUMMY_FUNCTION):
6203 Declare the dummy function with ATTRIBUTE_CONST.
6204 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6205 Add decls with ATTRIBUTE_CONST.
6206
26bccfae
PE
6207 Minor improvements to make_formatted_string.
6208 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6209 where int is good enough, as vsprintf returns an int.
6210 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6211
a8290ec3
DA
62122012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6213
6214 Use make_formatted_string to avoid double length calculation.
6215 * lisp.h (make_formatted_string): New prototype.
6216 * alloc.c (make_formatted_string): New function.
6217 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 6218 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
6219 * editfns.c (Fcurrent_time_zone): Likewise.
6220 * filelock.c (get_boot_time): Likewise.
6221 * frame.c (make_terminal_frame, set_term_frame_name)
6222 (x_report_frame_params): Likewise.
6223 * image.c (gs_load): Likewise.
6224 * minibuf.c (get_minibuffer): Likewise.
6225 * msdos.c (dos_set_window_size): Likewise.
6226 * process.c (make_process): Likewise.
6227 * xdisp.c (ensure_echo_area_buffers): Likewise.
6228 * xsettings.c (apply_xft_settings): Likewise.
6229
d01ba2f1
GM
62302012-07-09 Glenn Morris <rgm@gnu.org>
6231
6232 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6233 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6234 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6235 * nsterm.h (ns_etc_directory): Add it.
6236 * callproc.c [HAVE_NS]: Include nsterm.h.
6237 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6238
f1f924b6
DA
62392012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6240
6241 Move marker debugging code under MARKER_DEBUG.
6242 * marker.c (MARKER_DEBUG): Move marker debugging code under
6243 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6244 for bootstrap with --enable-checking (~3x slowdown reported
6245 by Juanma Barranquero <lekktu@gmail.com>).
6246 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6247
ab531b66
PE
62482012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6249
6250 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6251 See <http://bugs.gnu.org/11825#29>.
6252
c4b3bc8a
EZ
62532012-07-08 Eli Zaretskii <eliz@gnu.org>
6254
6255 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6256 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
6257 (display_line): Add commentary about displaying truncation glyphs
6258 on GUI frames.
6259 (produce_special_glyphs): Move here from term.c.
6260
6261 * term.c (produce_special_glyphs): Move to xdisp.c.
6262
6263 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6264 section.
c4b3bc8a 6265
b676b881
AS
62662012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6267
f17c5273
AS
6268 * xdisp.c (display_line): Avoid warning about implicit declaration
6269 of FRAME_FONT.
6270
298819b9
AS
6271 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6272
b676b881
AS
6273 * lisp.h: Remove empty conditional.
6274
6045c4fd
PE
62752012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6276
b3350bf9
PE
6277 * lread.c (load_path_check): Now static.
6278
6045c4fd
PE
6279 Fix some minor --with-ns problems found by static checking.
6280 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6281 (x_set_font) [!HAVE_X_WINDOWS]:
6282 * image.c (xpm_load_image) [HAVE_NS]:
6283 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6284 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6285 Remove unused local.
6286 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6287 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6288 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6289 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6290 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6291 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6292 Fix pointer signedness problem.
6293 * xfaces.c (FRAME_X_FONT_TABLE):
6294 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6295
929e7845
GM
62962012-07-07 Glenn Morris <rgm@gnu.org>
6297
6298 * lread.c (load_path_check): New function, split from init_lread.
6299 (init_lread): Reorganize. Motivation:
6300 If EMACSLOADPATH is set, check/warn about that rather than the
6301 defaults, which we are not going to use. Hence we can remove
6302 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6303 Don't warn if site-lisp directories are missing.
6304 If not installed, start from a blank load-path, since
6305 PATH_LOADSEARCH refers to the eventual installation directories.
6306
58dd0aa4
EZ
63072012-07-07 Eli Zaretskii <eliz@gnu.org>
6308
6309 Support truncation and continuation glyphs on GUI frames, when
6310 fringes are disabled. (Bug#11832)
6311 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
6312 continuation glyphs even if on GUI frames.
6313 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
6314 or both, are absent.
6315 (start_display, move_it_in_display_line_to): Handle the case of a
6316 GUI frame without a fringe to display continuation or truncation
6317 glyphs.
6318 (insert_left_trunc_glyphs): Support GUI frames: make sure
6319 truncation glyphs overwrite enough glyphs from the current line to
6320 have sufficient space in pixels.
6321 (display_line): Support truncation and continuation glyphs on GUI
6322 frames. If some spare pixels are left on the line after inserting
6323 the truncation glyphs, fill that space with a stretch glyph of a
6324 suitably computed width.
6325
6326 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6327 produce_glyphs, to support GUI sessions.
6328
31571fd7
PE
63292012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6330
5a16b9bc
PE
6331 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6332
f3047c75
PE
6333 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6334
31571fd7
PE
6335 Do not require float-time's arg to fit in time_t (Bug#11825).
6336 This works better on hosts where time_t is unsigned, and where
6337 float-time is applied to the (negative) difference between two times.
6338 * editfns.c (decode_time_components): Last arg is now double *,
6339 not int *, and means to store all the result as a double, without
6340 worrying about whether the seconds part fits in time_t.
6341 All callers changed.
6342 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6343 All callers changed.
6344 (Ffloat_time): Do not fail merely because the specified time falls
6345 outside of time_t range.
6346
4516fbef
GM
63472012-07-07 Glenn Morris <rgm@gnu.org>
6348
6349 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6350 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6351 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6352
07adc2c6
JB
63532012-07-07 Juanma Barranquero <lekktu@gmail.com>
6354
6355 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6356 Update dependencies.
6357
6358 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6359
fd573f31
PE
63602012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6361
fee5959d
PE
6362 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6363 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6364 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6365 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6366 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6367 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6368
fd573f31
PE
6369 * xfont.c (compare_font_names): Redo to omit the need for casts.
6370
ddadbc0e
AS
63712012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6372
fca8d6b6
AS
6373 * xfns.c (Fx_change_window_property): Doc fix.
6374 * w32fns.c (Fx_change_window_property): Doc fix.
6375
ddadbc0e
AS
6376 * w32fns.c (Fx_window_property): Accept the same arguments as the
6377 X Windows version. Doc fix.
6378 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6379
ed9265fc 63802012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
6381 Eli Zaretskii <eliz@gnu.org>
6382
6383 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6384 Windows-specific code from nt/config.nt moved here.
6385 Obsolete settings removed.
6386
216ee680
PE
63872012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6388
6389 * process.c: Avoid unnecessary calls to gettime.
6390 (wait_reading_process_output): Don't get the time of day
6391 when gobbling data immediately and not waiting, as there's no need
6392 for it in that case. This removes a FIXME.
6393
bdd091e4
JD
63942012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6395
6396 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6397 is defined (Bug#11768).
6398
9d44f8ce
DA
63992012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6400
6401 Fix marker debugging code.
6402 * marker.c (byte_char_debug_check): Do not perform the check
6403 if buffer is not multibyte.
090bd7cb
JB
6404 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6405 Call byte_char_debug_check with correct arguments.
9d44f8ce 6406
90fc4786
DA
64072012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6408
6409 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
6410 * marker.c (byte_char_debug_check, count_markers):
6411 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
6412 (byte_debug_flag): Remove.
6413 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6414 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6415
7b7ae965
DA
64162012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6417
4e57b342
DA
6418 Avoid code repetition in marker-related functions.
6419 * marker.c (attach_marker): New function.
6420 (Fset_marker, set_marker_restricted, set_marker_both)
6421 (set_marker_restricted_both): Use it.
6422 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6423 Consistently rename charno to charpos.
6424 (marker_position): Add eassert.
6425 (marker_byte_position): Convert to eassert.
6426
64272012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6428
6429 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 6430 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 6431 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 6432
657924ff
DA
64332012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6434
6435 Introduce fast path for the widely used marker operation.
6436 * alloc.c (build_marker): New function.
6437 * lisp.h (build_marker): New prototype.
6438 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6439 * composite.c (autocmp_chars): Likewise.
6440 * editfns.c (buildmark): Remove.
6441 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6442 (save_restriction_save): Use build_marker.
6443 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6444 * window.c (save_window_save): Likewise.
6445
041a49a6
DA
64462012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6447
6448 Do not use Fdelete_overlay in delete_all_overlays
6449 to avoid redundant calls to unchain_overlay.
6450 * buffer.c (drop_overlay): New function.
6451 (delete_all_overlays, Fdelete_overlay): Use it.
6452 * minibuf.c (get_minibuffer): Fix comment.
6453
7dca65a4
PE
64542012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6455
6456 Port to OpenBSD 5.1 amd64.
6457 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6458 This is needed for OpenBSD, and should be harmless on all BSD systems.
6459 Also, include <sys/sysctl.h>, as it should be available on all
6460 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6461 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6462 use p_pid member, not kp_proc.pid.
6463
8eb876e2
GM
64642012-07-06 Glenn Morris <rgm@gnu.org>
6465
6466 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6467
38182d90
PE
64682012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6469
6470 More xmalloc and related cleanup.
6471 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6472 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6473 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6474 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6475 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6476 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6477 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6478 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6479 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6480 * xterm.c:
6481 Omit needless casts involving void * pointers and allocation.
6482 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6483 as the former is more robust if P's type is changed.
6484 Prefer xzalloc to xmalloc + memset 0.
6485 Simplify malloc-or-realloc to realloc.
6486 Don't worry about xmalloc returning a null pointer.
6487 Prefer xstrdup to xmalloc + strcpy.
6488 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6489 growing it.
6490 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6491 alloca of a constant.
6492
6dd5a677
EZ
64932012-07-05 Eli Zaretskii <eliz@gnu.org>
6494
6495 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6496 hscroll is larger than the line width. Fixes long and futile
6497 looping inside extend_face_to_end_of_line (on a TTY) producing
6498 glyphs that are not needed and thrown away.
6499
6b312f0f
DA
65002012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6501
6502 * marker.c (set_marker_restricted_both): Simplify by using
6503 clip_to_bounds.
6504
f520ef9b
PE
65052012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6506
6507 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6508
383b7c95
JD
65092012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6510
6511 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6512 not defined (Bug#11768).
6513 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6514 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6515 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6516 followed by gtk_box_set_homogeneous (Bug#11768).
6517 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
6518 (update_theme_scrollbar_width, xg_create_scroll_bar):
6519 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
6520 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6521 (is_box_type): New function (Bug#11768).
6522 (xg_tool_item_stale_p): Call is_box_type.
5293d758 6523 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
6524 with default display (Bug#11768).
6525
d6e7bf45
EZ
65262012-07-05 Eli Zaretskii <eliz@gnu.org>
6527
6528 * xdisp.c (window_hscroll_limited): New function.
6529 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6530 coordinates when window's hscroll is set to insanely large
6531 values. (Bug#11857)
6532
431391ec
JB
65332012-07-05 Juanma Barranquero <lekktu@gmail.com>
6534
6535 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6536 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6537
23f86fce
DA
65382012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6539
6540 Cleanup xmalloc.
6541 * lisp.h (xzalloc): New prototype. Omit needless casts.
6542 * alloc.c (xzalloc): New function. Omit needless casts.
6543 * charset.c: Omit needless casts. Convert all calls to
6544 xmalloc with following memset to xzalloc.
6545 * dispnew.c: Likewise.
6546 * fringe.c: Likewise.
6547 * image.c: Likewise.
6548 * sound.c: Likewise.
6549 * term.c: Likewise.
6550 * w32fns.c: Likewise.
6551 * w32font.c: Likewise.
6552 * w32term.c: Likewise.
6553 * xfaces.c: Likewise.
6554 * xfns.c: Likewise.
6555 * xterm.c: Likewise.
6556 * atimer.c: Omit needless casts.
6557 * buffer.c: Likewise.
6558 * callproc.c: Likewise.
6559 * ccl.c: Likewise.
6560 * coding.c: Likewise.
6561 * composite.c: Likewise.
6562 * doc.c: Likewise.
6563 * doprnt.c: Likewise.
6564 * editfns.c: Likewise.
6565 * emacs.c: Likewise.
6566 * eval.c: Likewise.
6567 * filelock.c: Likewise.
6568 * fns.c: Likewise.
6569 * gtkutil.c: Likewise.
6570 * keyboard.c: Likewise.
6571 * lisp.h: Likewise.
6572 * lread.c: Likewise.
6573 * minibuf.c: Likewise.
6574 * msdos.c: Likewise.
6575 * print.c: Likewise.
6576 * process.c: Likewise.
6577 * region-cache.c: Likewise.
6578 * search.c: Likewise.
6579 * sysdep.c: Likewise.
6580 * termcap.c: Likewise.
6581 * terminal.c: Likewise.
6582 * tparam.c: Likewise.
6583 * w16select.c: Likewise.
6584 * w32.c: Likewise.
6585 * w32reg.c: Likewise.
6586 * w32select.c: Likewise.
6587 * w32uniscribe.c: Likewise.
6588 * widget.c: Likewise.
6589 * xdisp.c: Likewise.
6590 * xmenu.c: Likewise.
6591 * xrdb.c: Likewise.
6592 * xselect.c: Likewise.
6593
0497dc44
PE
65942012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6595
6596 * fileio.c (time_error_value): Check the right error number.
6597 Problem reported by Troels Nielsen in
6598 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6599
356e7178
PE
66002012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6601
4e71fd89
PE
6602 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6603 This should be fixed in a better way; see Eli Zaretskii in
6604 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6605 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6606
f0941253
PE
6607 * fileio.c (time_error_value): Rename from special_mtime.
6608 The old name's problems were noted by Eli Zaretskii in
6609 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6610
065c9eb4
PE
6611 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6612 This variable's comment says Emacs needs at least one GDB-visible
6613 symbol of type enum pvec_type, to work around GDB problems.
6614 The symbol's value doesn't matter.
6615
356e7178
PE
6616 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6617 that causes compilation to fail on pre-C99 compilers.
6618
ed9265fc 66192012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
6620
6621 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6622 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6623
3884d954
DA
66242012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6625
d209e2fb 6626 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
6627 headers for buffer_defaults and buffer_local_symbols.
6628 Reported by Juanma Barranquero <lekktu@gmail.com>.
6629
ee28be33
SM
66302012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6631
6632 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6633 * lisp.h (enum pvec_type): Use fewer bits.
6634 (PSEUDOVECTOR_SIZE_BITS): New constant.
6635 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6636 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6637 change in pvec_type.
6638 (PSEUDOVECTOR_TYPEP): New macro.
6639 (TYPED_PSEUDOVECTORP): Use it.
6640 * fns.c (internal_equal): Adapt code to extract pvectype.
6641 * emacs.c (gdb_pvec_type): Update type.
6642 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6643 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6644 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6645 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6646 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6647 abusing vector->header.next.nbytes.
6648 (live_vector_p): Use PVEC_TYPE.
6649 (mark_object): Adapt code to extract pvectype. Use switch.
6650
c7f2cd7f
PE
66512012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6652
6653 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6654 Tighten new eassert a bit.
6655
8ce70ed2
DA
66562012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6657
6658 Fix compilation with --enable-gcc-warnings and -O1
6659 optimization level.
6660 * doprnt.c (doprnt): Change type of tem to int, initialize
6661 to avoid compiler warning. Add eassert.
6662 * search.c (simple_search): Initialize match_byte to avoid
6663 compiler warning. Add eassert.
6664
dea7f1e5
PE
66652012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6666
24a212eb
PE
6667 Avoid weird behavior with large horizontal scrolls.
6668 Without this change, for example, large hscroll values would
6669 mess up Emacs's display on Fedora 15 x86, presumably due to
6670 overflows in int calculations in the display code.
6671 Also, if buffers had long lines, Emacs would freeze.
6672 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6673 (set_window_hscroll): New function, containing the old guts of
6674 Fset_window_hscroll. Return the clipped value.
6675 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6676 This avoids the need to check against PTRDIFF_MAX.
6677
dea7f1e5
PE
6678 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6679
76046526
DA
66802012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6681
6682 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6683
39adff0d
PE
66842012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6685
63807d47
PE
6686 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6687 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6688 since GCC 4.4.6 issues a bogus warning for them.
6689
39adff0d
PE
6690 Fix bugs in file timestamp newness comparisons.
6691 * fileio.c (Ffile_newer_than_file_p):
6692 * lread.c (Fload): Use full timestamp resolution of files,
6693 not just the 1-second resolution, so that files that are only
6694 slightly newer still count as newer.
6695 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6696 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6697
dbeed9a6
PE
66982012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6699
6700 * fileio.c: Improve handling of file time marker. (Bug#11852)
6701 (special_mtime): New function.
6702 (Finsert_file_contents, Fverify_visited_file_modtime):
6703 Use it to set special mtime values consistently.
6704
636334d6
AS
67052012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6706
6707 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6708 marker for non-existing file. (Bug#11852)
6709
e2017fe2
GM
67102012-07-03 Glenn Morris <rgm@gnu.org>
6711
6712 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6713 and did not make it into globals.h).
6714
404dbd37
TT
67152012-07-03 Tom Tromey <tromey@redhat.com>
6716
6717 * window.c (Fset_window_margins, Fset_window_fringes)
6718 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6719 * textprop.c (Fprevious_property_change): No longer static.
6720 * syntax.c (Fsyntax_table_p): No longer static.
6721 * process.c (Fget_process, Fprocess_datagram_address): No longer
6722 static.
6723 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6724 * keyboard.c (Fcommand_execute): No longer static.
6725 Remove EXFUN.
6726 * insdel.c (Fcombine_after_change_execute): No longer static.
6727 * image.c (Finit_image_library): No longer static.
6728 * fileio.c (Fmake_symbolic_link): No longer static.
6729 * eval.c (Ffetch_bytecode): No longer static.
6730 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
6731 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6732 No longer static.
404dbd37
TT
6733 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6734 static.
6735 * dired.c (Ffile_attributes): No longer static.
6736 * composite.c (Fcomposition_get_gstring): No longer static.
6737 * callproc.c (Fgetenv_internal): No longer static.
6738
6739 * ccl.h: Remove EXFUNs.
6740 * buffer.h: Remove EXFUNs.
6741 * dispextern.h: Remove EXFUNs.
6742 * intervals.h: Remove EXFUNs.
6743 * fontset.h: Remove EXFUN.
6744 * font.h: Remove EXFUNs.
6745 * dosfns.c (system_process_attributes): Remove EXFUN.
6746 * keymap.h: Remove EXFUNs.
6747 * lisp.h: Remove EXFUNs.
6748 * w32term.h: Remove EXFUNs.
6749 * window.h: Remove EXFUNs.
6750 * xsettings.h: Remove EXFUN.
6751 * xterm.h: Remove EXFUN.
6752
8e4fd1e1
GM
67532012-07-03 Glenn Morris <rgm@gnu.org>
6754
6755 * lisp.h (Frandom): Make it visible to C.
6756 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6757 buffer for invisible buffers. (Bug#1229)
6758
ca95b3eb
DA
67592012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6760
6761 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6762 values which aren't power of 2.
14ae4239 6763 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 6764 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
6765 accordingly.
6766
7555c33f
SM
67672012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6768
6769 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6770
6771 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6772
d12e8f5a
DA
67732012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6774
6775 * alloc.c (allocate_vector_block): Remove redundant
6776 calls to mallopt if DOUG_LEA_MALLOC is defined.
6777 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6778 avoid calls to mallopt if zero_vector is returned.
6779
296094c3
DA
67802012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6781
6782 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6783 is enabled, avoid dereferencing NULL current_sblock if
6784 running undumped.
6785
36429c89
DA
67862012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6787
6788 Cleanup basic buffer management.
6789 * buffer.h (struct buffer): Change layout to use generic vector
6790 marking code. Fix some comments. Change type of 'clip_changed'
6791 to bitfield. Remove unused #ifndef old.
6792 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6793 (GET_OVERLAYS_AT): Fix indentation.
6794 (for_each_per_buffer_object_at): New macro.
6795 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6796 (Fbuffer_local_variables): Use it.
6797 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6798 * alloc.c (allocate_buffer): Adjust to match new layout of
6799 struct buffer. Fix comment.
6800 (mark_overlay): New function.
6801 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6802 Lisp area of struct buffer.
6803 (mark_object): Use it. Adjust marking of misc objects
6804 and related comments.
6805
3b3e4cac
PE
68062012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6807
6808 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6809 wrapper that is not needed because the wrapped code is a no-op (zero
6810 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6811 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6812
cf5c0175
DA
68132012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6814
6815 * alloc.c (mark_buffer): Simplify. Remove prototype.
6816 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 6817 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
6818 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6819 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 6820
ca26824c
GM
68212012-06-30 Glenn Morris <rgm@gnu.org>
6822
2e4c5312
GM
6823 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6824
ca26824c
GM
6825 * epaths.in (PATH_SITELOADSEARCH): New.
6826 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6827 This is rather than relying on --enable-locallisppath elements
6828 having "site-lisp" in their names. (Bug#10208#25, 11658)
6829
0d23c240
EZ
68302012-06-30 Eli Zaretskii <eliz@gnu.org>
6831
c9240d7a
EZ
6832 * w32proc.c (sys_select): Accept and ignore one more argument.
6833
6834 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6835
0d23c240 6836 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 6837 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
6838
6839 * sysdep.c: Don't include dos.h and dosfns.h.
6840
6841 * process.c (sys_select):
6842 * msdos.c (sys_select): Accept one more argument and ignore it.
6843
6844 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6845 adapt data types and code to that.
6846
6847 * dosfns.c:
6848 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6849 which clashes with the gnulib function of the same name.
6850
af5a5a98
AS
68512012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6852
c5e4379c
AS
6853 * font.c (font_style_to_value, font_style_symbolic)
6854 (font_prop_validate_style): Add type checks for values in
6855 font_style_table.
6856
af5a5a98
AS
6857 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6858 argument.
6859 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6860 uses.
6861
8d38f461
EZ
68622012-06-29 Eli Zaretskii <eliz@gnu.org>
6863
2e5a6631
EZ
6864 * xdisp.c (try_window_id): Undo last change.
6865
8d38f461
EZ
6866 * w32.c (getwd): Adjust commentary about startup_dir.
6867 (init_environment): Always call sys_access, even in non-MSVC
6868 builds. Don't chdir to the directory of the Emacs executable.
6869 This undoes code from 1997 which was justified by the need to
6870 "avoid conflicts when removing and renaming directories". But its
6871 downside was that every relative file name was being interpreted
6872 relative to the directory of the Emacs executable, which can never
6873 be TRT. In particular, it broke sys_access when called with
6874 relative file names.
6875 (sys_access): Map GetLastError to errno.
6876
2af3565e
DA
68772012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6878
6879 * window.h (struct window): Change type of 'fringes_outside_margins'
6880 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 6881 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
6882 Adjust comment.
6883 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6884 to ptrdiff_t.
6885
c8d3a25c 68862012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 6887
c8d3a25c
GM
6888 * gnutls.c (emacs_gnutls_handshake):
6889 Add QUIT to make the loop interruptible.
57570cd3 6890
c8d3a25c 68912012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 6892
c8d3a25c
GM
6893 * charset.c (init_charset): Make lack of etc/charsets fatal.
6894
3e984ee8
DA
68952012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6896
6897 * editfns.c (region_limit): Fix type mismatch.
6898
ef884f23
DA
68992012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6900
6901 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6902 undefined. Convert from xassert to eassert.
6903 * nsmenu.m: Convert from xassert to eassert.
6904 * nsterm.m: Likewise.
6905
7d7e0027
SM
69062012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6907
6908 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6909
aa754e6a
PE
69102012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6911
6912 Avoid integer overflow on scroll-left and scroll-right.
6913 * window.c (HSCROLL_MAX): New macro.
6914 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6915 overflow when requested scroll falls outside ptrdiff_t range.
6916
80b00b08
DA
69172012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6918
6919 * window.h (struct window): Change type of 'hscroll',
6920 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6921 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6922 Adjust users accordingly.
6923 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6924 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6925 from EMACS_INT to ptrdiff_t.
6926 (make_window): Omit redundant initialization.
6927
62b2bcf6
JB
69282012-06-28 Juanma Barranquero <lekktu@gmail.com>
6929
6930 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6931
45942c7d
DA
69322012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6933
6934 * window.h (struct window): Change type of 'use_time' and
6935 'sequence_number' from Lisp_Object to int.
6936 * frame.c (make_frame): Adjust users accordingly.
6937 * print.c (print_object): Likewise.
6938 * window.c (select_window, Fwindow_use_time, make_parent_window)
6939 (make_window): Likewise.
6940
e509cfa6
DA
69412012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6942
6943 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6944 enabled with --enable-checking=[all,glyphs] configure option.
6945 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6946 adjust comments accordingly.
6947 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6948 undefined, adjust comments accordingly.
6949 * image.c: Likewise.
6950 * scroll.c: Likewise.
6951 * w32fns.c: Likewise.
6952 * w32term.c: Likewise.
6953 * xdisp.c: Likewise.
6954 * xfaces.c: Likewise.
6955 * xfns.c: Likewise.
6956 * xterm.c: Likewise.
6957
a54e2c05
DA
69582012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6959
6960 Generalize run-time debugging checks.
6961 * dispextern.h (XASSERTS): Remove.
6962 * fontset.c (xassert): Remove.
6963 Convert from xassert to eassert.
6964 * alloc.c: Convert from xassert to eassert.
6965 * bidi.c: Likewise.
6966 * dispnew.c: Likewise.
6967 * fns.c: Likewise.
6968 * fringe.c: Likewise.
6969 * ftfont.c: Likewise.
6970 * gtkutil.c: Likewise.
6971 * image.c: Likewise.
6972 * keyboard.c: Likewise.
6973 * menu.c: Likewise.
6974 * process.c: Likewise.
6975 * scroll.c: Likewise.
6976 * sound.c: Likewise.
6977 * term.c: Likewise.
6978 * w32console.c: Likewise.
6979 * w32fns.c: Likewise.
6980 * w32term.c: Likewise.
6981 * window.c: Likewise.
6982 * xdisp.c: Likewise.
6983 * xfaces.c: Likewise.
6984 * xfns.c: Likewise.
6985 * xselect.c: Likewise.
6986 * xterm.c: Likewise.
6987
1ec4b7b2
SM
69882012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6989
6990 * fns.c (maybe_resize_hash_table): Output message when growing the
6991 purify-hashtable.
6992
2014308a
DA
69932012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6994
6995 * alloc.c (allocate_string_data): Remove dead code.
6996 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6997 avoid GCC warning about unused macro.
6998
246155eb
DA
69992012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7000
7001 * alloc.c (allocate_string): Omit intervals initialization.
7002 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7003 as in make_pure_string and make_pure_c_string.
7004
43184b7b
DA
70052012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7006
d209e2fb 7007 * alloc.c (allocate_string): Fix last change.
43184b7b 7008
3fe6dd74
DA
70092012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7010
d209e2fb 7011 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
7012 to memset, add explicit initialization where appropriate.
7013
1ba6038a
GM
70142012-06-27 Glenn Morris <rgm@gnu.org>
7015
7016 * lisp.mk (lisp): Remove paths.elc.
7017
c89926a5
CY
70182012-06-27 Chong Yidong <cyd@gnu.org>
7019
7020 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7021
ed6b3510
JW
70222012-06-26 John Wiegley <johnw@newartisans.com>
7023
1ec4b7b2 7024 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
7025 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7026
ed6b3510
JW
7027 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7028 when building with Clang.
7029
8edd4a2b
SM
70302012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7031
7032 * eval.c (Fapply): Allow calling it with a single argument.
7033
f6f62d1b
EZ
70342012-06-26 Eli Zaretskii <eliz@gnu.org>
7035
7036 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7037 _stricmp and _strnicmp.
7038 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7039
62efea5e
DA
70402012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7041
7042 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7043 allocated window.
7044 (allocate_process): Likewise for new process.
8edd4a2b 7045 (allocate_terminal): Change to use offsetof.
62efea5e
DA
7046 (allocate_frame): Likewise.
7047 * frame.c (make_frame): Omit redundant initialization.
7048 * window.c (make_parent_window): Use memset.
7049 (make_window): Omit redundant initialization.
7050 * process.c (make_process): Omit redundant initialization.
7051 * terminal.c (create_terminal): Likewise.
7052
42997f4d
DA
70532012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7054
7055 * term.c (delete_tty): Remove redundant call to memset.
7056
1130ecfc
DA
70572012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7058
7059 * alloc.c: Remove build_string.
7060 * lisp.h: Define build_string as static inline. This provides
7061 a better opportunity to optimize away calls to strlen when the
7062 function is called with compile-time constant argument.
7063 * image.c (imagemagick_error): Convert to build_string.
7064 * w32proc.c (sys_spawnve): Likewise.
7065 * xterm.c (x_term_init): Likewise.
7066
cf38a720
PE
70672012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7068
99027bdd
PE
7069 Use sprintf return value instead of invoking strlen on result.
7070 In the old days this wasn't portable, since some sprintf
7071 implementations returned char *. But they died out years ago and
7072 Emacs already assumes sprintf returns int.
7073 Similarly for float_to_string.
7074 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7075 * ccl.c (ccl_driver):
7076 * character.c (string_escape_byte8):
7077 * data.c (Fnumber_to_string):
7078 * doprnt.c (doprnt):
7079 * print.c (print_object):
7080 * xdisp.c (message_dolog):
7081 * xfns.c (syms_of_xfns):
7082 Use sprintf or float_to_string result to avoid need to call strlen.
7083 * data.c (Fnumber_to_string):
7084 Use make_unibyte_string, since the string must be ASCII.
7085 * lisp.h, print.c (float_to_string): Now returns int length.
7086 * term.c (produce_glyphless_glyph):
7087 Use sprintf result rather than recomputing it.
7088
cf38a720
PE
7089 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7090 * Makefile.in (ALL_CFLAGS):
7091 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7092 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7093
3511c784
DA
70942012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7095
0a08eb21 7096 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
7097 strcasecmp if available.
7098 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7099
fb7da12e
AS
71002012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7101
7102 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7103 Avoid comma operator.
7104 * menu.c (push_submenu_start, push_submenu_end)
7105 (push_left_right_boundary, push_menu_pane): Likewise.
7106 * msdos.c (dos_rawgetc): Likewise.
7107
afa2ffd8
DA
71082012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7109
7110 * xfns.c (xic_create_fontsetname): Remove redundant calls
7111 to memset.
7112
b3b4476b
PE
71132012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7114
4495ff38
PE
7115 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7116 sprintf already null-terminates its output.
7117
b3b4476b
PE
7118 * xfns.c (x_window): Remove redundant cast.
7119
b00876c9
DA
71202012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7121
7122 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7123 `const char *' to `char *' to avoid compiler warning.
7124
d188e26b
PE
71252012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7126
885d1d74
PE
7127 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7128 instead of truncating it to 63 (admittedly a generous limit).
7129
d188e26b
PE
7130 * process.c: Fix spelling and caps in comments.
7131
e2f560b1
DN
71322012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7133
e86db54b 7134 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
7135 * sysdep.c (setpgrp): Remove definition, not used in this file.
7136
7583a3a1
JB
71372012-06-24 Juanma Barranquero <lekktu@gmail.com>
7138
7139 * makefile.w32-in: Update dependencies.
7140
696056c2
EZ
71412012-06-24 Eli Zaretskii <eliz@gnu.org>
7142
7143 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7144 (SYSTIME_H): Add nt/inc/sys/time.h.
7145
7146 * systime.h [WINDOWSNT]: Include sys/time.h.
7147
7148 * s/ms-w32.h (struct timespec): Definition moved from
7149 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7150
845ca893
PE
71512012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7152
7153 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7154 * buffer.h (buffer_slot_type_mismatch):
7155 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7156 * eval.c (unwind_to_catch):
7157 * image.c (my_png_error, my_error_exit):
7158 * keyboard.c (quit_throw_to_read_char, user_error)
7159 (Fexit_recursive_edit, Fabort_recursive_edit):
7160 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7161 (wrong_type_argument, buffer_overflow, __executable_start)
7162 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7163 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7164 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7165 (fatal):
7166 (child_setup) [!DOS_NT]:
7167 * lread.c (end_of_file_error, invalid_syntax):
7168 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7169 * puresize.h (pure_write_error):
7170 * search.c (matcher_overflow):
7171 * sound.c (sound_perror, alsa_sound_perror):
7172 * sysdep.c, syssignal.h (croak):
7173 * term.c (maybe_fatal, vfatal):
7174 * textprop.c (text_read_only):
7175 * undo.c (user_error):
7176 * unexmacosx.c (unexec_error):
7177 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7178 Use _Noreturn rather than NO_RETURN.
7179 No need for separate decl merely because of _Noreturn.
7180 * sound.c (sound_warning, parse_sound):
7181 Remove unnecessary forward decls.
7182
f1dd8073
PE
71832012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7184
7185 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7186 * lisp.h (WAIT_READING_MAX): New macro.
7187 * dispnew.c (Fsleep_for, sit_for):
7188 * keyboard.c (kbd_buffer_get_event):
7189 * process.c (Faccept_process_output):
7190 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7191 This improves on the previous patch, which introduced a bug
7192 when time_t is unsigned and as wide as intmax_t.
7193 See <http://bugs.gnu.org/9000#51>.
7194
b82c1755
EZ
71952012-06-23 Eli Zaretskii <eliz@gnu.org>
7196
7197 * dispnew.c (sit_for, Fsleep_for):
7198 * keyboard.c (kbd_buffer_get_event):
7199 * process.c (Faccept_process_output): Avoid compiler warnings when
7200 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7201
ca300656
JB
72022012-06-23 Juanma Barranquero <lekktu@gmail.com>
7203
049ec95b
JB
7204 * makefile.w32-in: Update dependencies.
7205
ca300656
JB
7206 * w32.c (ltime): Add return type and declare static.
7207 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7208
db7b8d06
PE
72092012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7210
7211 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7212 Privately reported by Herbert J. Skuhra.
7213 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7214 All uses changed.
7215 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7216 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7217
0bd8297f
EZ
72182012-06-23 Eli Zaretskii <eliz@gnu.org>
7219
96512555
EZ
7220 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7221 last argument of make_unibyte_string.
7222
0bd8297f
EZ
7223 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7224 language ID in the event parameters.
7225
7226 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7227 event.code, not the obscure "character set ID".
7228
63def6b6
CY
72292012-06-23 Chong Yidong <cyd@gnu.org>
7230
7231 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7232
e8a02204
EZ
72332012-06-23 Eli Zaretskii <eliz@gnu.org>
7234
388cdec0
EZ
7235 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7236 * w32.c (fdutimens): New function.
7237
7238 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7239
7240 * s/ms-w32.h (pselect): Redirect to sys_select.
7241
7242 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7243
e8a02204
EZ
7244 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7245 in the logic of incrementing and decrementing the value of
7246 use_relocatable_buffers.
7247
d054f3fb
PE
72482012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7249
7250 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7251 Privately reported by Herbert J. Skuhra.
7252 [__FreeBSD__]: Remove "*/" typo after "#include".
7253 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7254 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7255 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7256 Don't assume EMACS_TIME and struct timeval are the same type.
7257
d35af63c
PE
72582012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7259
7260 Support higher-resolution time stamps (Bug#9000).
7261 The time stamps are only nanosecond-resolution at the C level,
7262 since that's the best that any real-world system supports now.
7263 But they are picosecond-resolution at the Lisp level, as that's
7264 easy, and leaves room for future OS improvements.
7265
7266 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7267 (LIBES): Use it.
7268
7269 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7270 Don't get current time unless it's needed.
7271
7272 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7273 now provides it if it's absent.
7274 (start_atimer): Port to higher-res time stamps.
7275 Check for time stamp overflow. Don't get current time more
7276 often than is needed.
7277
7278 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7279 Include systime.h, not time.h.
7280 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7281
7282 * dired.c: Include stat-time.h.
7283 (Ffile-attributes): File times now have higher resolution.
7284
7285 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7286 (struct image): Timestamp now has higher resolution.
7287
7288 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7289 has at least microseconds now. All uses removed.
7290 (update_frame, update_single_window, update_window, update_frame_1)
7291 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 7292 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
7293
7294 * editfns.c (time_overflow): Now extern.
7295 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7296 (float-time, Fformat_time_string, Fcurrent_time_string)
7297 (Fcurrent_time_zone): Accept and generate higher-resolution
7298 time stamps.
7299 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7300 (decode_time_components, lisp_seconds_argument): New functions.
7301 (make_time): Now static.
7302 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7303 Report an error if the time is invalid, rather than having the caller
7304 do that.
7305
7306 * fileio.c: Include <stat-time.h>
7307 (Fcopy_file): Copy higher-resolution time stamps.
7308 Prefer to set the time stamp via a file descriptor if that works.
7309 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7310 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7311 (Fvisited_file_modtime, Fset_visited_file_modtime):
7312 Support higher-resolution time stamps.
7313
7314 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7315
7316 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7317
7318 * image.c (prepare_image_for_display, clear_image_cache)
7319 (lookup_image): Port to higer-resolution time stamps.
7320
7321 * keyboard.c (start_polling, bind_polling_period):
7322 Check for time stamp overflow.
7323 (read_char, kbd_buffer_get_event, timer_start_idle)
7324 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7325 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7326 Port to higher-resolution time stamps. Do not assume time_t is signed.
7327 (decode_timer): New function. Timers are now vectors of length 9,
7328 not 8, to accommodate the picosecond component.
7329 (timer_check_2): Use it.
7330
7331 * nsterm.m (select_timeout, timeval_subtract): Remove.
7332 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7333 as they're a bit more accurate and handle overflow better.
7334 (ns_select): Change prototype to be compatible with pselect.
7335 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7336 * nsterm.h (ns_select): Adjust prototype.
7337
7338 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7339 us-resolution time stamps.
7340 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7341
7342 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7343
7344 * lisp.h (time_overflow): New decl.
7345 (wait_reading_process_output): First arg is now intmax_t, not int,
7346 to accommodate larger waits.
7347
7348 * process.h (struct Lisp_Process.read_output_delay):
7349 Now counts nanoseconds, not microseconds.
7350 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7351 EMACS_HAS_USECS.
7352 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7353 (wait_reading_process_output):
7354 Port to ns-resolution time stamps.
7355 (Faccept_process_output, wait_reading_process_output):
7356 Check for time stamp overflow. Do not assume time_t is signed.
7357 (select_wrapper): Remove; we now use pselect.
7358 (Fprocess_attributes): Now generates ns-resolution time stamps.
7359
7360 * sysdep.c: Include utimens.h. Don't include utime.h
7361 or worry about struct utimbuf; gnulib does that for us now.
7362 (gettimeofday): Remove; gnulib provides a substitute.
7363 (make_timeval): New function.
7364 (set_file_times): Now sets ns-resolution time stamps.
7365 New arg FD; all uses changed.
7366 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7367 (system_process_attributes):
7368 Now returns ns-resolution time stamp. All uses changed.
7369 Check for time stamp overflow.
7370
7371 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7372 provides a substitute now.
7373
7374 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7375 since it guarantees struct timespec.
7376 (EMACS_TIME): Now struct timespec, so that we can support
7377 ns-resolution time stamps.
7378 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7379 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7380 (EMACS_USECS): Remove.
7381 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7382 so multiply the arg by 1000 before storing it.
7383 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7384 New macros.
7385 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7386 Port to ns-resolution time stamps.
7387 (EMACS_TIME_NEG_P): Remove; replaced by....
7388 (EMACS_TIME_SIGN): New macro.
7389 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7390 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7391 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7392 (make_timeval, make_lisp_time, decode_time_components): New decls.
7393 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7394 that it mishandled time_t overflow. You can't compare by subtracting!
7395 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7396 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7397
7398 * term.c: Include <sys/time.h>.
7399 (timeval_to_Time): New function, for proper overflow wraparound.
7400 (term_mouse_position, term_mouse_click): Use it.
7401
7402 * undo.c (record_first_change): Support higher-resolution time stamps
7403 in the undo buffer.
7404 (Fprimitive_undo): Use them when restoring time stamps.
7405
7406 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7407 (w32_get_internal_run_time):
7408 Port to higher-resolution Emacs time stamps.
7409 (ltime): Now accepts single 64-bit integer, as that's more convenient
7410 for callers.
7411
7412 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7413
7414 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7415 for compatibility with pselect. Support ns-resolution time stamps.
7416
7417 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7418
7419 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7420 Check for time stamp overflow, and support ns-resolution time stamps.
7421
7422 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7423 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7424 (timeval_subtract): Remove; no longer needed.
7425 (XTflash, XTring_bell, x_wait_for_event):
7426 Port to ns-resolution time stamps. Don't assume time_t is signed.
7427
b6a92dfe
CY
74282012-06-22 Chong Yidong <cyd@gnu.org>
7429
7430 * xdisp.c (x_consider_frame_title): Revert last change.
7431
d251c37c
EZ
74322012-06-22 Eli Zaretskii <eliz@gnu.org>
7433
7434 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7435 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7436 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7437 staticidx goes up to 1597 out of 1600 = 0x640.)
7438
f10deafb
PE
74392012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7440
7441 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7442 Otherwise, the umask might be mistakenly 0 while handling input signals.
7443
ec6de1e2
SM
74442012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7445
7446 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7447
28be1ada
DA
74482012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7449
7450 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7451 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7452 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7453 access to `contents' member of Lisp_Vector objects with AREF and ASET
7454 where appropriate.
7455
c6bf3022
CY
74562012-06-19 Chong Yidong <cyd@gnu.org>
7457
7458 * frame.c (delete_frame): When selecting a frame on a different
7459 text terminal, do not alter the terminal's top-frame.
7460
7461 * xdisp.c (format_mode_line_unwind_data): Record the target
7462 frame's selected window and its terminal's top-frame.
7463 (unwind_format_mode_line): Restore them.
7464 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7465 Callers changed.
7466 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7467 since tty frames can be explicitly named.
7468 (prepare_menu_bars): Likewise.
7469
7470 * term.c (Ftty_top_frame): New function.
7471
defd4196
PE
74722012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7473
7474 Port byte-code-meter to modern targets.
7475 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7476 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 7477 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
7478 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7479 (METER_1, METER_2): Simplify.
7480
1053a871
SM
74812012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7482
7483 * data.c (Fdefalias): Return `symbol' (bug#11686).
7484
b7e8d081
MR
74852012-06-18 Martin Rudalics <rudalics@gmx.at>
7486
7487 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
7488 gets killed during executing of this function (Bug#11665).
7489 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
7490 (Vkill_buffer_query_functions): In doc-string say that functions
7491 run by this hook should not change the current buffer.
7492
7ea2b339
PE
74932012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7494
7495 Fix recently-introduced process.c problems found by static checking.
7496 * process.c (write_queue_push, write_queue_pop, send_process):
7497 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7498 (write_queue_pop): Fix pointer signedness problem.
7499 (send_process): Remove unused local.
7500
96a313a1
CY
75012012-06-17 Chong Yidong <cyd@gnu.org>
7502
7503 * xdisp.c (redisplay_internal): No need to redisplay terminal
7504 frames that are not on top.
7505
20ca2e94
TN
75062012-06-17 Troels Nielsen <bn.troels@gmail.com>
7507
7508 * process.c (make_process): Initialize write_queue.
7509 (write_queue_push, write_queue_pop): New functions.
7510 (send_process): Use them to maintain correct ordering of process
7511 writes (Bug#10815).
7512
9a900ca9
PE
75132012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7514
310fbfa8
PE
7515 * lisp.h (eassert): Assume C89 or later.
7516 This removes the need for CHECK.
7517 (CHECK): Remove. Its comments about always evaluating its
7518 argument were confusing, as 'eassert' typically does not evaluate
7519 its argument.
7520
27bb1ca4
PE
7521 * coding.c (produce_chars): Use ptrdiff_t, not int.
7522
9a900ca9
PE
7523 * xterm.c (x_draw_underwave): Check for integer overflow.
7524 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7525
41b7f8bc 75262012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
7527
7528 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7529 referenced (Bug#11583).
7530
9b0e3eba
AA
75312012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7532
7533 Implement wave-style variant of underlining.
7534 * dispextern.h (face_underline_type): New enum.
7535 (face): Add field for underline type.
7536 * nsterm.m (ns_draw_underwave): New function.
7537 (ns_draw_text_decoration): Use it.
7538 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7539 New functions.
7540 (x_draw_glyph_string): Use them.
7541 * xfaces.c (Qline, Qwave): New Lisp objects.
7542 (check_lface_attrs, merge_face_ref)
1053a871
SM
7543 (Finternal_set_lisp_face_attribute, realize_x_face):
7544 Handle wave-style underline face attributes.
9b0e3eba
AA
7545 * xterm.c (x_draw_underwave): New function.
7546 (x_draw_glyph_string): Use it.
7547
0fb52f11
JB
75482012-06-16 Juanma Barranquero <lekktu@gmail.com>
7549
7550 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7551 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7552 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7553 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7554 ($(BLD)/w32select.$(O)): Update dependencies.
7555
e5560ff7
AS
75562012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7557
7558 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7559 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7560 * character.c (_fetch_multibyte_char_p): Remove.
7561 * alloc.c: Include "character.h" before "buffer.h".
7562 * bidi.c: Likewise.
7563 * buffer.c: Likewise.
7564 * bytecode.c: Likewise.
7565 * callint.c: Likewise.
7566 * callproc.c: Likewise.
7567 * casefiddle.c: Likewise.
7568 * casetab.c: Likewise.
7569 * category.c: Likewise.
7570 * cmds.c: Likewise.
7571 * coding.c: Likewise.
7572 * composite.c: Likewise.
7573 * dired.c: Likewise.
7574 * dispnew.c: Likewise.
7575 * doc.c: Likewise.
7576 * dosfns.c: Likewise.
7577 * editfns.c: Likewise.
7578 * emacs.c: Likewise.
7579 * fileio.c: Likewise.
7580 * filelock.c: Likewise.
7581 * font.c: Likewise.
7582 * fontset.c: Likewise.
7583 * fringe.c: Likewise.
7584 * indent.c: Likewise.
7585 * insdel.c: Likewise.
7586 * intervals.c: Likewise.
7587 * keyboard.c: Likewise.
7588 * keymap.c: Likewise.
7589 * lread.c: Likewise.
7590 * macros.c: Likewise.
7591 * marker.c: Likewise.
7592 * minibuf.c: Likewise.
7593 * nsfns.m: Likewise.
7594 * nsmenu.m: Likewise.
7595 * print.c: Likewise.
7596 * process.c: Likewise.
7597 * regex.c: Likewise.
7598 * region-cache.c: Likewise.
7599 * search.c: Likewise.
7600 * syntax.c: Likewise.
7601 * term.c: Likewise.
7602 * textprop.c: Likewise.
7603 * undo.c: Likewise.
7604 * unexsol.c: Likewise.
7605 * w16select.c: Likewise.
7606 * w32fns.c: Likewise.
7607 * w32menu.c: Likewise.
7608 * window.c: Likewise.
7609 * xdisp.c: Likewise.
7610 * xfns.c: Likewise.
7611 * xmenu.c: Likewise.
7612 * xml.c: Likewise.
7613 * xselect.c: Likewise.
7614
2f07e6af
EZ
76152012-06-16 Eli Zaretskii <eliz@gnu.org>
7616
1053a871
SM
7617 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7618 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 7619 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
7620 row.
7621 (handle_face_prop): Use chunk-relative overlay string index when
7622 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
7623 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7624 the rightmost. (Bug#11720)
2f07e6af 7625
29b83cec
AS
76262012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7627
7628 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7629 (CATEGORY_MEMBER): Enforce 1/0 value.
7630 * category.c (_temp_category_set): Remove.
7631
4c5501e9
EZ
76322012-06-16 Eli Zaretskii <eliz@gnu.org>
7633
7634 * window.c (Fdelete_other_windows_internal)
7635 (Fdelete_window_internal): Don't access frame's mouse highlight
7636 info of the initial frame. (Bug#11677)
7637
2b570124
PE
76382012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7639
e93864f9
PE
7640 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7641 Assume USE_2_TAGS_FOR_INTS.
7642 (xreload): Adjust $tagmask width to match recent lisp.h change.
7643
2b570124
PE
7644 Simplify lisp.h in minor ways that should not affect code.
7645 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7646 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7647 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7648 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7649 (INTTYPEBITS): New macro, for clarity.
7650 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
7651 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7652 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
7653 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7654 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7655
81755f69
JB
76562012-06-13 Juanma Barranquero <lekktu@gmail.com>
7657
7658 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7659
16192a57
GM
76602012-06-13 Glenn Morris <rgm@gnu.org>
7661
7662 * s/bsd-common.h (BSD4_3):
7663 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7664
646b5f55
AS
76652012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7666
7667 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7668 instead of union.
7669 (XLI, XIL): Define.
1053a871
SM
7670 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7671 Use them.
7672 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 7673 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 7674 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
7675 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7676 * frame.c (delete_frame): Remove outdated comment.
7677 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7678 USE_LISP_UNION_TYPE.
7679 (Fw32_unregister_hot_key): Likewise.
7680 (Fw32_toggle_lock_key): Likewise.
7681 * w32menu.c (add_menu_item): Likewise.
7682 (w32_menu_display_help): Use XIL instead of checking
7683 USE_LISP_UNION_TYPE.
7684 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7685 (init_heap): Likewise.
7686 * w32term.c (w32_read_socket): Update comment.
7687
1d3823c9
GM
76882012-06-13 Glenn Morris <rgm@gnu.org>
7689
c62ff706
GM
7690 * s/usg5-4-common.h, src/s/unixware.h:
7691 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7692
1d3823c9
GM
7693 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7694
bfe3e0a2
PE
76952012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7696
7697 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7698 * alloc.c (make_number) [!defined make_number]:
7699 Remove, as lisp.h always defines this now.
7700 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7701 (roundup_size): Verify that it is a power of 2.
7702 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7703 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7704 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7705 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7706 USE_LSB_TAG now is always defined to be either 0 or 1.
7707 All uses changed.
7708 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7709 code works fine either way, and efficiency is not a concern here,
7710 as the union type is for debugging, not for production.
7711 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7712 Use an inline function on all platforms when using the union type,
7713 since this is simpler and 'static inline' can be used portably
7714 within Emacs now.
7715 (LISP_INITIALLY_ZERO): New macro.
7716 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7717 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7718
45fa9c0f
GM
77192012-06-12 Glenn Morris <rgm@gnu.org>
7720
b4492cba
GM
7721 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7722
7723 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 7724
45fa9c0f
GM
7725 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7726 Move BROKEN_SIGIO to configure.
7727
7728 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7729 Move NO_TERMIO to configure.
7730
0e25d334
CY
77312012-06-12 Chong Yidong <cyd@gnu.org>
7732
7733 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7734 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7735 MagickExportImagePixels is undefined.
7736
43682bb6
PE
77372012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7738
7739 * image.c (imagemagick_load_image): Remove unused label.
7740
a9be7d2b
GM
77412012-06-11 Glenn Morris <rgm@gnu.org>
7742
7743 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7744 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7745 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7746 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7747
3017f87f
SM
77482012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7749
7750 * alloc.c (make_byte_code): New function.
7751 (Fmake_byte_code): Use it. Don't purify here.
7752 * lread.c (read1): Use it as well to avoid extra allocation.
7753
1b9b4cf4
CY
77542012-06-11 Chong Yidong <cyd@gnu.org>
7755
7756 * image.c (imagemagick_load_image): Implement transparency.
7757
95988fcf
AS
77582012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7759
7760 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7761 account for preceding backslashes. (Bug#11663)
7762
cd4eb164
CY
77632012-06-09 Chong Yidong <cyd@gnu.org>
7764
7765 * term.c: Support italics in capable terminals (Bug#9652).
7766 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7767 (turn_on_face): Output using TS_enter_italic_mode if available.
7768 Don't handle unused blinking and alt-charset cases.
7769 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7770 and tty_alt_charset_p cases.
7771 (tty_capable_p, init_tty): Support italics.
7772
7773 * termchar.h (struct tty_display_info): Add field for italics.
7774 Remove unused blink field.
7775
7776 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7777 Handle slant.
7778
7779 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7780 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7781 tty_alt_charset_p. Add tty_italic_p.
7782
ff88beb8
MA
77832012-06-09 Michael Albinus <michael.albinus@gmx.de>
7784
7785 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7786 dbus_type_is_basic if available.
7787 (xd_extract_signed, xd_extract_unsigned): Rename from
7788 extract_signed and extract_unsigned, respectively. Adapt callers.
7789
44286096
CY
77902012-06-09 Chong Yidong <cyd@gnu.org>
7791
1682701f
CY
7792 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7793
44286096
CY
7794 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7795 case (Bug#9752).
7796
d86feb17
PE
77972012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7798
7799 * xdisp.c (vmessage): Treat frame message as multibyte.
7800 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7801 would generate the diagnostic "Making \302\247 buffer-local while
7802 let-bound!".
7803
d5c20fe8
EZ
78042012-06-08 Eli Zaretskii <eliz@gnu.org>
7805
7806 * dispnew.c (showing_window_margins_p): Undo last change, which
7807 was done due to an inadvertent commit.
7808 (adjust_frame_glyphs_for_frame_redisplay): Do call
7809 showing_window_margins_p.
7810
513749ee
SM
78112012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7812
7813 * eval.c (Fmake_var_non_special): New primitive.
7814 (syms_of_eval): Defsubr it.
7815 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7816
d4a8f5c1
JB
78172012-06-08 Juanma Barranquero <lekktu@gmail.com>
7818
7819 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7820 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7821
8bbbc977
EZ
78222012-06-08 Eli Zaretskii <eliz@gnu.org>
7823
7824 * alloc.c (allocate_vectorlike): Fix last change.
7825
f3372c87
DA
78262012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7827
7828 Block-based vector allocation of small vectors.
7829 * lisp.h (struct vectorlike_header): New field `nbytes',
7830 adjust comment accordingly.
7831 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 7832 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
7833 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7834 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7835 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7836 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7837 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7838 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7839 (roundup_size): New constant.
7840 (struct vector_block): New data type.
7841 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 7842 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
7843 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7844 (sweep_vectors): New functions.
7845 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 7846 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
7847 or equal to VBLOCK_BYTES_MAX.
7848 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7849 (init_alloc_once): Add call to init_vectors.
7850
4f18a4ed
SM
78512012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7852
7853 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7854
86f158bc
PE
78552012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7856
7857 * doprnt.c (doprnt): Truncate multibyte char correctly.
7858 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7859 would mishandle a string argument "Xc" if X was a multibyte
7860 character of length 2: it would truncate after X's first byte
7861 rather than including all of X.
7862
c5cfcbe0
CY
78632012-06-06 Chong Yidong <cyd@gnu.org>
7864
7865 * buffer.c (word_wrap): Doc fix.
7866
c05cf390
PE
78672012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7868
7869 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7870
0c3461de
GM
78712012-06-03 Glenn Morris <rgm@gnu.org>
7872
7873 * xdisp.c (tool-bar-style): Doc fix.
7874
c71232db
UM
78752012-06-03 Ulrich Müller <ulm@gentoo.org>
7876
7877 * Makefile.in (PAXCTL): Define.
7878 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7879 binary via PaX flags if the paxctl utility is available.
7880 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7881 Restore PaX flags to their default. (Bug#11398)
7882
383f7350
CY
78832012-06-03 Chong Yidong <cyd@gnu.org>
7884
7885 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7886 buffer (Bug#11226).
7887
5f2c76c6
CY
78882012-06-03 Chong Yidong <cyd@gnu.org>
7889
7890 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7891 (note_mode_line_or_margin_highlight): If there is no help echo,
7892 use mode-line-default-help-echo. Handle the case where the mouse
7893 position is past the end of the mode line string.
7894
7895 * buffer.c (buffer_local_value_1): New function, split from
7896 Fbuffer_local_value; can return Qunbound.
7897 (Fbuffer_local_value): Use it.
7898 (Vmode_line_format): Docstring tweaks.
7899
773d47f6
PE
79002012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7901
7902 * sysdep.c (system_process_attributes): Improve comment.
7903
f2d6a3df
SM
79042012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7905
7906 * keyboard.c: Export real-this-command to Elisp.
7907 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7908 and DEFVAR it. Update all users.
7909
63810350
PE
79102012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7911
7bd5c1f4
PE
7912 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7913
63810350
PE
7914 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7915 Convert pctcpu and pctmem to Lisp float properly.
7916 Let the compiler fold better, as 100.0/0x8000 is exact.
7917
a2821611
AS
79182012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7919
7920 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7921 cons_block.
7922
5fceba1d
PE
79232012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7924
7925 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7926
c98ff5dd
DA
79272012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7928
7929 For a 'struct window', replace some Lisp_Object fields to
7930 bitfields where appropriate, remove unused fields.
7931 * window.h (struct window): Remove unused 'last_mark_x' and
7932 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 7933 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
7934 Change type of 'force_start', 'optional_new_start',
7935 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 7936 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 7937
ca34e0be
PE
79382012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7939
7940 Pacify gcc -Wdouble-precision when using Xaw.
7941 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7942 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7943 Use 'float' consistently, rather than 'float' in most places
7944 and 'double' in a couple of places.
7945
efc00ab1 79462012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
7947
7948 * xdisp.c (handle_stop): Detect whether we have overlay strings
7949 loaded by testing it->current.overlay_string_index to be
7950 non-negative, instead of checking whether n_overlay_strings is
7951 positive. (Bug#11587)
7952
efc00ab1 79532012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
7954
7955 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7956
7957 * doc.c (Fsubstitute_command_keys): Doc fix.
7958
efc00ab1 79592012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
7960
7961 * search.c (search_buffer): Remove calls to
7962 r_alloc_inhibit_buffer_relocation, as it is now called by
7963 maybe_unify_char, which was the cause of relocation of buffer text
7964 in bug#11519.
7965
efc00ab1 79662012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
7967
7968 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7969 for the duration of call to load_charset, to avoid problems with
7970 callers of maybe_unify_char that access buffer text through C
7971 pointers.
7972
7973 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7974 decrement the inhibition flag, instead of just setting or
7975 resetting it.
7976
ba93a187
PE
79772012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 Remove obsolete '#define static' cruft.
7980 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7981 This #undef was "temporary" in 2000; it is no longer needed
7982 now that '#define static' has gone away.
7983 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7984 (gray_bitmap_bits): Remove; no longer needed.
7985 All uses replaced with definiens.
7986 * xterm.c: Include "bitmaps/gray.xbm".
7987
9e4bf381
PE
79882012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7989
7990 Clean up __executable_start, monstartup when --enable-profiling.
7991 The following changes affect the code only when profiling.
7992 * dispnew.c (__executable_start): Rename from safe_bcopy.
7993 Define only on platforms that need it.
7994 * emacs.c: Include <sys/gmon.h> when profiling.
7995 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7996 (__executable_start): Remove decl, since lisp.h does it now.
7997 (safe_bcopy): Remove decl; no longer has that name.
7998 (main): Coalesce #if into single bit of code, for simplicity.
7999 Cast pointers to uintptr_t, since standard libraries want integers
8000 and not pointers.
8001 * lisp.h (__executable_start): New decl.
8002
32d72c2f
GM
80032012-05-31 Glenn Morris <rgm@gnu.org>
8004
8005 * image.c (Fimagemagick_types): Doc fix.
8006
baac5bc7
JM
80072012-05-30 Jim Meyering <meyering@redhat.com>
8008
8009 * callproc.c (Fcall_process_region): Include directory component
8010 in mkstemp error message (Bug#11586).
8011
72cb32cf
PE
80122012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8013
8014 * alloc.c, lisp.h (make_pure_vector): Now static.
8015
61b108cc
SM
80162012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8017
8018 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8019 Move to byte-run.el.
8020 (Fautoload): Do the hash-doc more carefully.
8021 * data.c (Fdefalias): Purify definition, except for keymaps.
8022 (Qdefun): Move from eval.c.
8023 * lisp.h (Qdefun): Remove.
8024 * lread.c (read1): Tiny simplification.
8025
471fe23d
TN
80262012-05-29 Troels Nielsen <bn.troels@gmail.com>
8027
934f3f58 8028 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
8029 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8030 Bug#9642, but explicitly check that the buffer the overlay would
8031 be moved to is live and rearrange lines to make sure that errors
8032 will not put the overlay in an inconsistent state.
8033 (Fdelete_overlay): Cosmetics.
8034
85d0efd1
EZ
80352012-05-28 Eli Zaretskii <eliz@gnu.org>
8036
8037 * w32term.c (my_bring_window_to_top): New function.
8038 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
8039 could be different from the original one.
8040 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
8041 (Bug#11513)
8042
8043 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8044 by calling BringWindowToTop.
8045
8046 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8047 (WM_EMACS_END): Increase by one.
8048
da92a98c
PE
80492012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8050
8051 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8052 This avoids undefined behavior that might cause the eassert
8053 to not catch an out-of-range value.
8054
74d1f848
JB
80552012-05-28 Juanma Barranquero <lekktu@gmail.com>
8056
8057 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8058 Update dependencies.
8059
9e1a06fc
EZ
80602012-05-27 Eli Zaretskii <eliz@gnu.org>
8061
8062 * bidi.c (bidi_mirror_char): Fix last change.
8063
f3dd7312
AS
80642012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8065
8066 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8067 when referring to sectname field in printf format.
8068
81899c91
PE
80692012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8070
57b81a9f
PE
8071 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8072 Only r_alloc_inhibit_buffer_relocation needed to be added;
8073 the others were already declared.
8074
81899c91
PE
8075 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8076 before checking whether it's out of range. Put the check inside
8077 eassert. See
8078 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8079
33017faf 80802012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
8081
8082 * callproc.c (Fcall_process): Restore a line that was accidentally
8083 commented out in the 2011-02-13 change (bug#11547).
8084
33017faf 80852012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
8086
8087 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8088 defined on ralloc.c.
8089
8090 * buffer.c [REL_ALLOC]: Remove prototypes of
8091 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8092 they are now on lisp.h.
8093
8094 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8095
8096 * search.c (search_buffer): Use it to inhibit relocation of buffer
8097 text while re_search_2 is doing its job, because re_search_2 is
8098 passed C pointers to buffer text. (Bug#11519)
8099
23415acf
EZ
8100 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8101 Update value to 24.
8102
44e27368
EZ
8103 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8104 state after an additional call to move_it_in_display_line_to, keep
8105 the values of it->max_ascent and it->max_descent found for the
8106 entire line.
8107 (pos_visible_p): Revert the comparison against bottom_y to what it
8108 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8109 (Bug#11464)
8110
c1892f11
PE
81112012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8112
8113 Fix coding-related core dumps with gcc -ftrapv.
8114 The code was computing A - B, where A and B are pointers, and B is
8115 random garbage. This can lead to core dumps on platforms that
8116 have special pointer registers, and it also leads to core dumps on
8117 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8118 A - B only when B is initialized properly.
8119 * coding.c (coding_set_source, coding_set_destination): Return void.
8120 (coding_change_source, coding_change_destinations): New functions,
8121 with the old behaviors of coding_set_source and coding_set_destination.
8122 All callers that need an offset changed to use these new functions.
8123
eb7afdad
GM
81242012-05-26 Glenn Morris <rgm@gnu.org>
8125
8126 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8127
f12fdf02
EZ
81282012-05-26 Eli Zaretskii <eliz@gnu.org>
8129
53a63be6 8130 Extend mouse support on W32 text-mode console.
61b108cc
SM
8131 * xdisp.c (draw_row_with_mouse_face):
8132 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 8133
eb3f6f01 8134 * w32console.c: Include window.h.
61b108cc
SM
8135 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8136 New functions.
eb3f6f01
EZ
8137 (initialize_w32_display): Initialize mouse-highlight data.
8138
53a63be6
EZ
8139 * w32inevt.c: Include termchar.h and window.h.
8140 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8141 moves, call note_mouse_highlight. If help_echo changed, call
8142 gen_help_event to produce help-echo message in the echo area.
8143 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8144 highlight info.
8145
4cfd81f6
PE
81462012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8147
8148 * lread.c (read1): Simplify slightly to avoid an overflow warning
8149 with GCC 4.7.0 on x86-64.
8150
4446092a
EZ
81512012-05-26 Eli Zaretskii <eliz@gnu.org>
8152
8153 * bidi.c (bidi_mirror_char): Revert last change: an int is
8154 definitely wide enough here.
8155
42b2a986 81562012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 8157
42b2a986 8158 Fix integer width and related bugs (Bug#9874).
eb106a49 8159 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
8160 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8161 (string_bytes, check_sblock, allocate_string_data):
8162 (compact_small_strings, Fmake_bool_vector, make_string)
8163 (make_unibyte_string, make_multibyte_string)
8164 (make_string_from_bytes, make_specified_string)
8165 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8166 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8167 (mark_vectorlike):
8168 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8169 (allocate_pseudovector):
8170 Use int, not EMACS_INT, where int is wide enough.
8171 (inhibit_garbage_collection, Fgarbage_collect):
8172 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8173 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8174 int might not be wide enough.
8175 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8176 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8177 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8178 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8179 (bidi_level_of_next_char, bidi_move_to_visually_next):
8180 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8181 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8182 (Fkill_buffer, Fset_buffer_major_mode)
8183 (advance_to_char_boundary, Fbuffer_swap_text)
8184 (Fset_buffer_multibyte, overlays_at, overlays_in)
8185 (overlay_touches_p, struct sortvec, record_overlay_string)
8186 (overlay_strings, recenter_overlay_lists)
8187 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8188 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8189 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8190 (Foverlay_recenter, last_overlay_modification_hooks_used)
8191 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
8193 (validate_region): Omit unnecessary test for b <= e,
8194 since that's guaranteed by the previous test.
d311d28c
PE
8195 (adjust_overlays_for_delete): Avoid pos + length overflow.
8196 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8197 (report_overlay_modification):
8198 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8199 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8200 Omit pointer cast, which isn't needed anyway, and doesn't work
8201 after the EMACS_INT -> ptrdiff_t change.
02481186 8202 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
8203 * buffer.h: Adjust decls to match defn changes elsewhere.
8204 (struct buffer_text, struct buffer):
8205 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8206 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
8207 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8208 not int, to avoid needless 32-bit limit on 64-bit hosts.
8209 (exec_byte_code): Use tighter memory-full test, one that checks
8210 for alloca overflow. Don't compute the address of the object just
8211 before an array, as that's not portable. Use EMACS_INT, not
8212 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
8213 * callint.c (Fcall_interactively):
8214 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8215 * callproc.c (call_process_kill, Fcall_process):
8216 Don't assume pid_t fits into an Emacs fixnum.
8217 (call_process_cleanup, Fcall_process, child_setup):
8218 Don't assume pid_t fits into int.
8219 (call_process_cleanup, Fcall_process, delete_temp_file)
8220 (Fcall_process_region):
8221 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8222 (Fcall_process): Simplify handling of volatile integers.
8223 Use int, not EMACS_INT, where int will do.
8224 * casefiddle.c (casify_object, casify_region, operate_on_word)
8225 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8226 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8227 (casify_object): Avoid integer overflow when overallocating buffer.
8228 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 8229 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
8230 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8231 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8232 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8233 integers are now checked earlier. All uses replaced with XINT.
8234 (ccl_driver):
8235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8236 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
8237 (ccl_driver, Fregister_code_conversion_map):
8238 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
8239 (resolve_symbol_ccl_program): Check that vector header is in range.
8240 Always copy the vector, so that we can check its contents reliably
8241 now rather than having to recheck each instruction as it's being
8242 executed. Check that vector words fit in 'int'.
8243 (ccl_get_compiled_code, Fregister_ccl_program)
8244 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8245 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8246 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8247 contents are in range.
8248 (Fccl_execute_on_string): Check that status is in range.
8249 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8250 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8251 Accept and return EMACS_INT, not int, because callers can pass values
8252 out of 'int' range.
8253 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8254 (multibyte_chars_in_text, parse_str_as_multibyte)
8255 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8256 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8257 (string_escape_byte8, Fget_byte):
8258 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 8259 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
8260 avoid mishandling large integers.
8261 * character.h: Adjust decls to match defn changes elsewhere.
8262 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8263 (Ffind_charset_region):
8264 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8265 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8266 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 8267 Don't assume fixnum fits in int.
d311d28c
PE
8268 (load_charset_map_from_vector, Fmap_charset_chars):
8269 Remove now-unnecessary CHECK_NATNUMs.
8270 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
8271 Don't rely on undefined behavior with signed left shift overflow.
8272 Don't assume unsigned int fits into fixnum, or that fixnum fits
8273 into unsigned int. Don't require max_code to be a valid fixnum;
8274 that's not true for gb10830 4-byte on a 32-bit host. Allow
8275 invalid_code to be a cons, for the same reason. Require code_offset
8276 to be a character. Avoid int overflow if max_char is close
8277 to INT_MAX.
8278 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8279 this is intended anyway and avoids some undefined behavior.
8280 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8281 INDEX_TO_CODE_POINT, as that's what it expects.
8282 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
8283 * charset.h (DECODE_CHAR): Return int, not unsigned;
8284 this is what was intended anyway, and it avoids undefined behavior.
8285 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8286 integer-overflow issues.
8287 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8288 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8289 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
8290 * chartab.c (Fmake_char_table, Fset_char_table_range)
8291 (uniprop_get_decoder, uniprop_get_encoder):
8292 Don't assume fixnum fits in int.
8293 * cmds.c (move_point): New function, that does the gist of
8294 Fforward_char and Fbackward_char, but does so while checking
8295 for integer overflow more accurately.
c96e5d6a 8296 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
8297 (Fforward_line, Fend_of_line, internal_self_insert)
8298 (internal_self_insert):
8299 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8300 Fix a FIXME, by checking for integer overflow when calculating
8301 target_clm and actual_clm.
8302 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 8303 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
8304 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8305 (coding_alloc_by_making_gap, alloc_destination)
8306 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8307 (encode_coding_utf_16, detect_coding_emacs_mule)
8308 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8309 (detect_coding_iso_2022, decode_coding_iso_2022)
8310 (encode_invocation_designation, encode_designation_at_bol)
8311 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8312 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8313 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8314 (encode_coding_ccl, encode_coding_raw_text)
8315 (detect_coding_charset, decode_coding_charset)
8316 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8317 (produce_composition, produce_charset, produce_annotation)
8318 (decode_coding, handle_composition_annotation)
8319 (handle_charset_annotation, consume_chars, decode_coding_gap)
8320 (decode_coding_object, encode_coding_object, detect_coding_system)
8321 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8322 (code_convert_region, code_convert_string)
8f50130c
PE
8323 (Fdefine_coding_system_internal)
8324 (coding_set_source, coding_set_destination):
d311d28c
PE
8325 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8326 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8327 (Fdefine_coding_system_internal):
8328 Don't assume fixnums fit in int.
8329 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 8330 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
8331 (Funencodable_char_position, Fcheck_coding_systems_region)
8332 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 8333 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 8334 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 8335 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 8336 Don't access memory outside of the args array.
d311d28c 8337 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
8338 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8339 result of ENCODE_CHAR.
d311d28c
PE
8340 * coding.h: Adjust decls to match defn changes elsewhere.
8341 (struct coding_system):
8342 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8343 * composite.c (get_composition_id, find_composition)
8344 (run_composition_function, update_compositions)
8345 (compose_text, composition_gstring_put_cache)
8346 (composition_gstring_p, composition_gstring_width)
8347 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8348 (composition_compute_stop_pos, composition_reseat_it)
8349 (composition_update_it, struct position_record)
8350 (find_automatic_composition, composition_adjust_point)
8351 (Fcomposition_get_gstring, Ffind_composition_internal):
8352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8353 (update_compositions):
8354 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8355 * composite.h: Adjust decls to match defn changes elsewhere.
8356 (struct composition):
8357 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8358 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8359 Do not attempt to compute the address of the object just before a
8360 buffer; this is not portable.
8361 (Faref, Faset):
8362 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8363 (Faset): Use int, not EMACS_INT, where int is wide enough.
8364 (Fstring_to_number): Don't assume fixnums fit in int.
8365 (Frem): Don't assume arg is nonnegative.
8366 * dbusbind.c (xd_append_arg): Check for integers out of range.
8367 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 8368 (extract_signed, extract_unsigned): New functions.
243e0530
PE
8369 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8370 (xd_get_connection_references): Return ptrdiff_t, not int.
8371 All uses changed.
8372 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8373 (xd_read_message_1):
8374 Use int, not unsigned, where the dbus API uses int.
8375 (Fdbus_message_internal): Don't overflow mtype.
8376 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
8377 * dired.c (directory_files_internal, file_name_completion, scmp)
8378 (file_name_completion_stat):
8379 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8380 (file_name_completion): Don't overflow matchcount.
8381 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8382 * dispextern.h: Adjust decls to match defn changes elsewhere.
8383 (struct text_pos, struct glyph, struct bidi_saved_info)
8384 (struct bidi_string_data, struct bidi_it, struct composition_it)
8385 (struct it):
8386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8387 (struct display_pos, struct composition_it, struct it):
8388 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8389 * dispnew.c (increment_matrix_positions)
8390 (increment_row_positions, mode_line_string)
8391 (marginal_area_string):
8392 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 8393 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
8394 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8395 (duration_to_sec_usec): New function, to check for overflow better.
8396 (Fsleep_for, sit_for): Use it.
8397 * doc.c (get_doc_string, store_function_docstring):
8398 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8399 (get_doc_string, Fsnarf_documentation):
8400 Use int, not EMACS_INT, where int is wide enough.
8401 (get_doc_string):
8402 Use SAFE_ALLOCA, not alloca.
8403 Check for overflow when converting EMACS_INT to off_t.
8404 * doprnt.c (doprnt):
8405 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8406 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8407 Don't assume uid_t fits into fixnum.
8408 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8409 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8410 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8411 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8412 (general_insert_function)
8413 (Finsert_char, make_buffer_string, make_buffer_string_both)
8414 (update_buffer_properties, Fbuffer_substring)
8415 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8416 (Fsubst_char_in_region, check_translation)
8417 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8418 (transpose_markers, Ftranspose_regions):
8419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8420 (clip_to_bounds): Move to lisp.h as an inline function).
8421 (Fconstrain_to_field): Don't assume integers are nonnegative.
8422 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8423 (Fsubst_char_in_region, Fsave_restriction):
8424 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8425 (Femacs_pid): Don't assume pid_t fits into fixnum.
8426 (lo_time): Use int, not EMACS_INT, when int suffices.
8427 (lisp_time_argument): Check for usec out of range.
8428 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
8429 (Fuser_login_name, Fuser_full_name): Signal an error
8430 if a uid argument is out of range, rather than relying on
8431 undefined behavior.
c8d5c857
PE
8432 (Fformat_time_string): Remove now-unnecessary check.
8433 lisp_time_argument checks for out-of-range usec now.
243e0530 8434 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
8435 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8436 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8437 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8438 (init_cmdargs, Fdump_emacs):
8439 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8440 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8441 the bottom (typically) 32 bits of the fixnum.
8442 * eval.c (specpdl_size, call_debugger):
8443 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8444 (when_entered_debugger, Fbacktrace_debug):
8445 Don't assume fixnum can fit in int.
8446 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8447 the object just before a buffer; this is not portable.
8448 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8449 (grow_specpdl, unbind_to):
8450 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8451 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8452 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 8453 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
8454 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8455 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8456 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8457 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8458 (a_write, e_write):
8459 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8460 (Fcopy_file, non_regular_nbytes, read_non_regular)
8461 (Finsert_file_contents):
8462 Use int, not EMACS_INT, where int is wide enough.
8463 (READ_BUF_SIZE): Verify that it fits in int.
8464 (Finsert_file_contents): Check that counts are in proper range,
8465 rather than assuming fixnums fit into ptrdiff_t etc.
8466 Don't assume fixnums fit into int.
125b3835 8467 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
8468 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8469 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
8470 (string_char_to_byte, string_byte_to_char)
8471 (string_make_multibyte, string_to_multibyte)
8472 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8473 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8474 (substring_both, Fdelete, internal_equal, Ffillarray)
8475 (Fclear_string, mapcar1)
8476 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8477 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8478 (larger_vector, make_hash_table, maybe_resize_hash_table)
8479 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8480 (Fmaphash, secure_hash):
8481 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8482 (concat): Check for string index and length overflow.
8483 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8484 (Frequire):
8485 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8486 (larger_vector): New API (vec, incr_min, size_max) replaces old
8487 one (vec, new_size, init). This catches size overflow.
8488 INIT was removed because it was always Qnil.
8489 All callers changed.
8490 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8491 the upper bound on a hash table index size.
8492 (make_hash_table, maybe_resize_hash_table): Use it.
8493 (secure_hash): Computer start_byte and end_byte only after
8494 they're known to be in ptrdiff_t range.
8495 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8496 (Ffont_get_glyphs, Ffont_at):
8497 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8498 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8499 (Flist_fonts, Fopen_font):
8500 Don't assume fixnum can fit in int.
8501 (check_gstring): Don't assume index can fit in int.
8502 (font_match_p): Check that fixnum is a character, not a nonnegative
8503 fixnum, since the later code needs to stuff it into an int.
8504 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8505 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8506 conversion overflow issues.
8507 (Fopen_font): Check for integer out of range.
8508 (Ffont_get_glyphs): Don't assume index can fit in int.
8509 * font.h: Adjust decls to match defn changes elsewhere.
8510 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8511 integer overflow.
8512 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8513 printmax_t, where ptrdiff_t is wide enough.
8514 (Finternal_char_font):
8515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8516 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8517 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8518 (Fset_frame_position, x_set_frame_parameters)
8519 (x_set_line_spacing, x_set_border_width)
8520 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8521 Check that fixnums are in proper range for system types.
8522 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8523 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8524 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8525 Use SAFE_ALLOCA_LISP, not alloca.
8526 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8527 intptr_t is wide enough.
8528 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8529 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8530 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8531 Check for fixnum out of range.
8532 * ftfont.c (ftfont_list): Don't assume index fits in int.
8533 Check that fixnums are in proper range for system types.
8534 (ftfont_shape_by_flt):
8535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
8536 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8537 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8538 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8539 Check that fixnums are in proper range for system types.
8540 * gnutls.h: Adjust decls to match defn changes elsewhere.
8541 * gtkutil.c (xg_dialog_run):
8542 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8543 (update_frame_tool_bar):
8544 Check that fixnums are in proper range for system types.
8545 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 8546 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
8547 * indent.c (last_known_column, last_known_column_point):
8548 (current_column_bol_cache):
8549 (skip_invisible, current_column, check_display_width):
8550 (check_display_width, scan_for_column, current_column_1)
8551 (Findent_to, Fcurrent_indentation, position_indentation)
8552 (indented_beyond_p, Fmove_to_column, compute_motion):
8553 (Fcompute_motion, Fvertical_motion):
8554 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8555 (last_known_column_modified): Use EMACS_INT, not int.
8556 (check_display_width):
8557 (Fcompute_motion):
8558 Check that fixnums and floats are in proper range for system types.
8559 (compute_motion): Don't assume index or fixnum fits in int.
8560 (compute_motion, Fcompute_motion):
8561 Use int, not EMACS_INT, when it is wide enough.
8562 (vmotion): Omit local var start_hpos that is always 0; that way
8563 we don't need to worry about overflow in expressions involving it.
8564 * indent.h: Adjust decls to match defn changes elsewhere.
8565 (struct position):
8566 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8567 Use int, not EMACS_INT, where int is wide enough.
8568 Remove unused members ovstring_chars_done and tab_offset;
8569 all uses removed.
8570 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8571 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8572 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8573 (make_gap, copy_text, insert, insert_and_inherit)
8574 (insert_before_markers, insert_before_markers_and_inherit)
8575 (insert_1, count_combining_before, count_combining_after)
8576 (insert_1_both, insert_from_string)
8577 (insert_from_string_before_markers, insert_from_string_1)
8578 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8579 (adjust_after_replace, adjust_after_insert, replace_range)
8580 (replace_range_2, del_range, del_range_1, del_range_byte)
8581 (del_range_both, del_range_2, modify_region)
8582 (prepare_to_modify_buffer, signal_before_change)
8583 (signal_after_change, Fcombine_after_change_execute):
8584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8585 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8586 (balance_an_interval, split_interval_right, split_interval_left)
8587 (find_interval, next_interval, update_interval)
8588 (adjust_intervals_for_insertion, delete_node, delete_interval)
8589 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8590 (static_offset_intervals, offset_intervals)
8591 (merge_interval_right, merge_interval_left, make_new_interval)
8592 (graft_intervals_into_buffer, temp_set_point_both)
8593 (temp_set_point, set_point, adjust_for_invis_intang)
8594 (set_point_both, move_if_not_intangible, get_property_and_range)
8595 (get_local_map, copy_intervals, copy_intervals_to_string)
8596 (compare_string_intervals, set_intervals_multibyte_1):
8597 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8598 * intervals.h: Adjust decls to match defn changes elsewhere.
8599 (struct interval):
8600 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8601 * keyboard.c (this_command_key_count, this_single_command_key_start)
8602 (before_command_key_count, before_command_echo_length, echo_now)
8603 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8604 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8605 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8606 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8607 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8608 (last_non_minibuf_size, last_point_position, echo_truncate)
8609 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8610 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8611 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8612 (stuff_buffered_input):
8613 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8614 (last_auto_save, command_loop_1, read_char):
8615 Use EMACS_INT, not int, to avoid integer overflow.
8616 (record_char): Avoid overflow in total_keys computation.
8617 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8618 * keyboard.h: Adjust decls to match defn changes elsewhere.
8619 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8620 (Fkey_description, Fdescribe_vector, Flookup_key):
8621 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8622 (click_position): New function, to check that positions are in range.
8623 (Fcurrent_active_maps):
8624 (describe_command):
8625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8626 (Faccessible_keymaps, Fkey_description):
8627 (preferred_sequence_p):
8628 Don't assume fixnum can fit into int.
8629 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8630 Check for integer overflow in size calculations.
8631 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8632 avoid mishandling large integers.
8633 * lisp.h: Adjust decls to match defn changes elsewhere.
8634 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8635 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8636 (struct Lisp_Marker):
8637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8638 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
8639 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8640 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8641 All callers changed.
8642 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8643 Assume the arg has valid form, since it always does.
8644 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8645 unsigned integer system type.
8646 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8647 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8649 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8650 (duration_to_sec_usec): New decl.
8651 * lread.c (read_from_string_index, read_from_string_index_byte)
8652 (read_from_string_limit, readchar, unreadchar, openp)
8653 (read_internal_start, read1, oblookup):
8654 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8655 (Fload, readevalloop, Feval_buffer, Feval_region):
8656 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8657 (openp): Check for out-of-range argument to 'access'.
8658 (read1): Use int, not EMACS_INT, where int is wide enough.
8659 Don't assume fixnum fits into int.
6efdadfd 8660 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
8661 (read_filtered_event): Use duration_to_sec_usec
8662 to do proper overflow checking on durations.
d311d28c
PE
8663 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8664 in size calculation.
8665 (Fexecute_kbd_macro):
8666 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8667 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8668 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8669 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8670 (set_marker_both, set_marker_restricted_both, marker_position)
8671 (marker_byte_position, Fbuffer_has_markers_at):
8672 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8673 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 8674 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
8675 It now merely ensures that the menu is large enough, without
8676 necessarily growing it, as this avoids some integer overflow issues.
8677 All callers changed.
8678 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8679 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8680 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8681 Use SAFE_ALLOCA_LISP, not alloca.
8682 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8683 to EMACS_INT. Check that fixnums are in proper range for system types.
8684 * minibuf.c (minibuf_prompt_width, string_to_object)
8685 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8686 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8687 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8688 (get_minibuffer, read_minibuf_unwind):
8689 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8690 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8691 this simplifies overflow checking. All callers changed.
8692 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8693 (Ftest_completion):
8694 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8695 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8696 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8697 Check that fixnums are in proper range for system types.
8698 (Fx_create_frame, Fx_show_tip):
8699 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8700 * nsfont.m (ns_findfonts, nsfont_list_family):
8701 Don't assume fixnum fits in long.
8702 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8703 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8704 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8705 wide enough.
17fdb222 8706 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
8707 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8708 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8709 (PRINTDECLARE, PRINTPREPARE):
8710 (strout, print_string):
8711 (print, print_preprocess, print_check_string_charset_prop)
8712 (print_object):
8713 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8714 (PRINTDECLARE):
8715 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8716 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8717 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 8718 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 8719 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
8720 (print_error_message): Use SAFE_ALLOCA, not alloca.
8721 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
8722 (print_depth, new_backquote_output, print_number_index):
8723 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
8724 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8725 (Fset_process_window_size, Fformat_network_address)
8726 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 8727 (sigchld_handler):
d311d28c 8728 Check that fixnums are in proper range for system types.
d44287d4 8729 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
8730 Check for process-ids out of pid_t range rather than relying on
8731 undefined behavior.
e4d81efc 8732 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
8733 (Fformat_network_address, read_process_output, send_process)
8734 (Fprocess_send_region, status_notify):
8735 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8736 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8737 (wait_reading_process_output, read_process_output, exec_sentinel):
8738 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8739 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8740 (Faccept_process_output): Use duration_to_sec_usec to do proper
8741 overflow checking on durations.
dde14581
PE
8742 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8743 Don't assume pid_t fits in int.
02481186
PE
8744 * process.h (struct Lisp_Process): Members tick and update_tick
8745 are now of type EMACS_INT, not int.
b62b53e8
PE
8746 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8747 configured --with-wide-int.
d311d28c
PE
8748 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8749 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8750 * search.c (looking_at_1, string_match_1):
8751 (fast_string_match, fast_c_string_match_ignore_case)
8752 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8753 (scan_newline, find_before_next_newline, search_command)
8754 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8755 (set_search_regs, wordify):
8756 (Freplace_match):
8757 (Fmatch_data):
8758 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8759 (string_match_1, search_buffer, set_search_regs):
8760 (Fmatch_data):
8761 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8762 (wordify): Check for overflow in size calculation.
8763 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8764 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8765 Check that fixnums are in proper range for system types.
8766 * sound.c (struct sound_device)
8767 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8769 (Fplay_sound_internal):
8770 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 8771 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
8772 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8773 (Fparse_partial_sexp):
8774 Don't assume fixnums can fit in int.
8775 (struct lisp_parse_state, find_start_pos, find_start_value)
8776 (find_start_value_byte, find_start_begv)
8777 (update_syntax_table, char_quoted, dec_bytepos)
8778 (find_defun_start, prev_char_comend_first, back_comment):
8779 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8780 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8782 (Finternal_describe_syntax_value): Check that match_lisp is a
8783 character, not an integer, since the code stuffs it into int.
8784 (scan_words, scan_sexps_forward):
8785 Check that fixnums are in proper range for system types.
8786 (Fforward_word):
8787 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8788 (scan_sexps_forward):
8789 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8790 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8791 * syntax.h: Adjust decls to match defn changes elsewhere.
8792 (struct gl_state_s):
8793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
8794 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8795 MOST_POSITIVE_FIXNUM.
d311d28c
PE
8796 * sysdep.c (wait_for_termination_1, wait_for_termination)
8797 (interruptible_wait_for_termination, mkdir):
8798 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8799 (emacs_read, emacs_write):
8800 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
8801 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8802 and double all fit in int.
d311d28c
PE
8803 * term.c (set_tty_color_mode):
8804 Check that fixnums are in proper range for system types.
8805 * termhooks.h (struct input_event):
8806 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8807 * textprop.c (validate_interval_range, interval_of)
8808 (Fadd_text_properties, set_text_properties_1)
8809 (Fremove_text_properties, Fremove_list_of_text_properties)
8810 (Ftext_property_any, Ftext_property_not_all)
8811 (copy_text_properties, text_property_list, extend_property_ranges)
8812 (verify_interval_modification):
8813 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8814 (Fnext_single_char_property_change)
8815 (Fprevious_single_char_property_change):
8816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
8817 (copy_text_properties):
8818 Check for integer overflow in index calculation.
d311d28c
PE
8819 * undo.c (last_boundary_position, record_point, record_insert)
8820 (record_delete, record_marker_adjustment, record_change)
8821 (record_property_change):
8822 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8823 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8824 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8825 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8826 (Fx_hide_tip, Fx_file_dialog):
8827 * w32menu.c (set_frame_menubar):
8828 Use ptrdiff_t, not int, for consistency with rest of code.
8829 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8830 (select_window, Fdelete_other_windows_internal)
8831 (window_scroll_pixel_based, window_scroll_line_based)
8832 (Frecenter, Fset_window_configuration):
8833 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8834 (Fset_window_hscroll, run_window_configuration_change_hook)
8835 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 8836 (Fscroll_other_window, Frecenter):
d311d28c
PE
8837 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8838 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8839 Don't assume fixnum fits in int.
8840 (Fset_window_scroll_bars):
8841 Check that fixnums are in proper range for system types.
8842 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8843 (string_pos, c_string_pos, number_of_chars, init_iterator)
8844 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8845 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8846 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
8847 (face_before_or_after_it_pos, handle_invisible_prop)
8848 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
8849 (display_prop_intangible_p, string_buffer_position_lim)
8850 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8851 (get_overlay_strings_1, get_overlay_strings)
8852 (iterate_out_of_display_property, forward_to_next_line_start)
8853 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8854 (get_next_display_element, set_iterator_to_next)
8855 (get_visually_first_element, compute_stop_pos_backwards)
8856 (handle_stop_backwards, next_element_from_buffer)
8857 (move_it_in_display_line_to, move_it_in_display_line)
8858 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8859 (add_to_log, message_dolog, message_log_check_duplicate)
8860 (message2, message2_nolog, message3, message3_nolog
8861 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8862 (current_message_1, truncate_echo_area, truncate_message_1)
8863 (set_message, set_message_1, store_mode_line_noprop)
8864 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8865 (text_outside_line_unchanged_p, check_point_in_composition)
8866 (reconsider_clip_changes)
8867 (redisplay_internal, set_cursor_from_row, try_scrolling)
8868 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8869 (redisplay_window, find_last_unchanged_at_beg_row)
8870 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8871 (trailing_whitespace_p, find_row_edges, display_line)
8872 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8873 (display_mode_element, store_mode_line_string)
8874 (pint2str, pint2hrstr, decode_mode_spec)
8875 (display_count_lines, display_string, draw_glyphs)
8876 (x_produce_glyphs, x_insert_glyphs)
8877 (rows_from_pos_range, mouse_face_from_buffer_pos)
8878 (fast_find_string_pos, mouse_face_from_string_pos)
8879 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8880 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8881 (safe_call, init_from_display_pos, handle_fontified_prop)
8882 (handle_single_display_spec, load_overlay_strings)
8883 (with_echo_area_buffer, setup_echo_area_for_printing)
8884 (display_echo_area, echo_area_display)
8885 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8886 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
8887 (redisplay_window, dump_glyph_row, display_mode_line)
8888 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 8889 (handle_display_spec, display_prop_string_p):
d311d28c
PE
8890 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8891 (handle_single_display_spec, build_desired_tool_bar_string)
8892 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8893 (get_specified_cursor_type):
8894 Check that fixnums are in proper range for system types.
8895 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8896 (Flookup_image_map):
8897 Don't assume fixnums fit in int.
8898 (compare_overlay_entries):
8899 Avoid mishandling comparisons due to subtraction overflow.
8900 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8901 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8902 (handle_tool_bar_click):
8903 Use int, not unsigned, since we prefer signed and the signedness
8904 doesn't matter here.
8905 (get_next_display_element, next_element_from_display_vector):
8906 Use int, not EMACS_INT, when int is wide enough.
8907 (start_hourglass): Use duration_to_sec_usec to do proper
8908 overflow checking on durations.
8909 * xfaces.c (Fbitmap_spec_p):
8910 Check that fixnums are in proper range for system types.
8911 (compare_fonts_by_sort_order):
8912 Avoid mishandling comparisons due to subtraction overflow.
8913 (Fx_family_fonts, realize_basic_faces):
8914 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8915 (Fx_family_fonts):
8916 Don't assume fixnum fits in int.
8917 Use SAFE_ALLOCA_LISP, not alloca.
8918 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8919 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8920 (face_at_buffer_position, face_for_overlay_string)
8921 (face_at_string_position):
8922 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8923 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8924 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8925 (Fx_show_tip):
8926 Check that fixnums are in proper range for system types.
8927 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8928 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8929 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8930 (Fx_change_window_property): Don't assume fixnums fit in int.
8931 * xfont.c (xfont_chars_supported):
8932 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8933 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8934 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8935 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8936 * xml.c (parse_region):
8937 * xrdb.c (magic_file_p):
8938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8939 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8940 (x_get_local_selection, x_reply_selection_request)
8941 (x_handle_selection_request, wait_for_property_change):
8942 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8943 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8944 short is wide enough.
8945 (x_send_client_event): Don't assume fixnum fits in int.
8946 * xterm.c (x_x_to_emacs_modifiers):
8947 Don't assume EMACS_INT overflows nicely into int.
8948 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8949 may come from Lisp.
8950 (handle_one_xevent): NATNUMP can eval its arg twice.
8951 (x_connection_closed):
8952 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8953 * xterm.h: Adjust decls to match defn changes elsewhere.
8954 (struct scroll_bar): Use struct vectorlike_header
8955 rather than rolling our own approximation.
8956 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8957
c6574eb5
GM
89582012-05-25 Glenn Morris <rgm@gnu.org>
8959
8960 * lisp.mk (lisp): Update for more files being compiled now.
8961
e8d32c7e
SM
89622012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8963
48def666
SM
8964 * lread.c: Remove `read_pure' which makes no difference.
8965 (read_pure): Remove var.
8966 (unreadpure): Remove function.
8967 (readevalloop): Don't call read_list with -1 flag.
8968 (read1, read_vector): Don't test read_pure any more.
8969 (read_list): Simplify.
8970
e8d32c7e
SM
8971 * fileio.c, character.h: Minor style tweaks.
8972
4b2addb7
DA
89732012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8974
8975 * window.h (clip_changed): Remove useless declaration.
8976
584461b2
JB
89772012-05-22 Juanma Barranquero <lekktu@gmail.com>
8978
8979 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8980 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8981
34374650
PE
89822012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8983
8984 Remove src/m/*.
8985 This directory predates autoconf and is no longer needed nowadays.
8986 Move its few remaining bits of functionality to where they're needed.
8987 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8988 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8989 * m/template.h: Remove.
8990 * Makefile.in (M_FILE): Remove. All uses removed.
8991 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8992 * lisp.h (USE_LSB_TAG):
8993 * mem-limits.h (EXCEEDS_LISP_PTR):
8994 Use VAL_MAX, not VALBITS, in #if.
8995 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8996 (EMACS_UINT): Define unconditionally now.
8997 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8998 (BITS_PER_EMACS_INT): New constants, replacing
8999 what used to be in config.h, but not useful in #if.
9000 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9001 define them any more.
9002 (VAL_MAX): New macro.
9003 (VALMASK): Use it.
9004 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9005 BITS_PER_EMACS_INT, in #if.
9006 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9007 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9008 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9009 * s/ms-w32.h (DATA_START):
9010 Move here from removed file m/intel386.h.
9011 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9012 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9013
261cb4bb
PE
90142012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9015
9016 Assume C89 or later.
9017 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9018 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9019 (xrealloc):
9020 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9021 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9022 * textprop.c, tparam.c (NULL): Remove.
9023 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9024 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9025 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9026 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9027 * xterm.c (input_signal_count): Assume volatile works.
9028
ff23cd9f
KB
90292012-05-21 Ken Brown <kbrown@cornell.edu>
9030
9031 * xgselect.c (xg_select): Fix first argument in call to 'select'
9032 (bug#11508).
9033
1b170bc6
KB
90342012-05-20 Ken Brown <kbrown@cornell.edu>
9035
9036 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 9037 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 9038
b2f4d39f
KB
90392012-05-19 Ken Brown <kbrown@cornell.edu>
9040
9041 * xfns.c (x_in_use): Remove `static' qualifier.
9042 * xterm.h (x_in_use): Declare.
9043 * xgselect.c: Include xterm.h.
9044 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9045 and `display_arg' (bug#9754).
9046
003fdae2
PE
90472012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9048
9232a6d9
PE
9049 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9050
003fdae2
PE
9051 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9052 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9053
784b56e2
EZ
90542012-05-18 Eli Zaretskii <eliz@gnu.org>
9055
9056 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9057
9058 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 9059 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
9060
9061 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9062 reference to image_cache->refcount.
9063 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9064
a0a79cde
JL
90652012-05-17 Juri Linkov <juri@jurta.org>
9066
9067 * search.c (Fword_search_regexp, Fword_search_backward)
9068 (Fword_search_forward, Fword_search_backward_lax)
9069 (Fword_search_forward_lax): Move functions to isearch.el
9070 (bug#10145, bug#11381).
9071
b0572523
PE
90722012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9073
9074 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9075
9660f5fc
SM
90762012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9077
9078 * lread.c (init_obarray): Declare Qt and Qnil as special.
9079
4374de83
GM
90802012-05-14 Glenn Morris <rgm@gnu.org>
9081
9082 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 9083 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 9084
dc44c39a
PE
90852012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9086
078c97cb
PE
9087 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9088
dc44c39a
PE
9089 * unexaix.c: Port to more-recent AIX compilers.
9090 (report_error, report_error_1, make_hdr, copy_sym)
9091 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9092 Make arguments const char *, not char *, to avoid violations of C
9093 standard and to fix some AIX warnings reported by Gilles Pion.
9094
e18afed7 90952012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
9096
9097 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9098 already have overlays loaded.
9099 (handle_single_display_spec): Before returning without displaying
9100 fringe bitmap, synchronize the bidi iterator with the main display
9101 iterator, by calling iterate_out_of_display_property.
9102 (iterate_out_of_display_property): Detect buffer iteration by
9103 testing that it->string is a Lisp string.
9104 (get_next_display_element): When the current object is exhausted,
9105 and there's something on it->stack, call set_iterator_to_next to
9106 proceed with what's on the stack, instead of returning zero.
9107 (set_iterator_to_next): If called at the end of a Lisp string,
9108 proceed to consider_string_end without incrementing string
9109 position. Don't increment display vector index past the end of
9110 the display vector. (Bug#11417)
c8fb9dc6
EZ
9111 (pos_visible_p): Don't report a position visible when move_it_to
9112 stopped at the last line of window, which happens to be scanned
9113 backwards by the bidi iteration. (Bug#11464)
ac268e67 9114
e18afed7 91152012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
9116
9117 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9118 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
9119 are on a TTY, and thus unable to display on the fringes.
9120 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
9121 so we need to signal to the caller that this is a "replacing"
9122 display spec. This fixes display when the spec is invalid or we
9123 are on a TTY.
9124
e18afed7 91252012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
9126
9127 * unexaix.c (make_hdr): Fix typo in prototype.
9128 This bug broke the build on AIX. Problem reported by Gilles Pion.
9129
9d0a235a
MA
91302012-05-14 Michael Albinus <michael.albinus@gmx.de>
9131
9132 * keyboard.c (kbd_buffer_get_event): Read special events also in
9133 batch mode. (Bug#11415)
9134
9e6b06ed
GM
91352012-05-12 Glenn Morris <rgm@gnu.org>
9136
9137 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9138
c1a1d7a3
EZ
91392012-05-12 Eli Zaretskii <eliz@gnu.org>
9140
9141 * lisp.mk (lisp): Add newcomment.elc.
9142
3fe7cdc8
GM
91432012-05-12 Glenn Morris <rgm@gnu.org>
9144
9145 * Makefile.in (MKDIR_P): New, set by configure.
9146 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9147
53f7d2c0
PE
91482012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9149
9150 Remove unused function hourglass_started.
9151 * dispextern.h (hourglass_started):
9152 * w32fns.c (hourglass_started):
9153 * xdisp.c (hourglass_started): Remove.
9154
75aafb17
JB
91552012-05-10 Juanma Barranquero <lekktu@gmail.com>
9156
9157 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9158 Update dependencies.
9159
12959e8e
PE
91602012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9161
97107e2e
PE
9162 * xgselect.c (xg_select): Put maxfds+1 into a var.
9163 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9164
12959e8e
PE
9165 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9166
836d29b3
DA
91672012-05-10 Dave Abrahams <dave@boostpro.com>
9168
9169 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9170 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9171
5cb67954
MA
91722012-05-09 Michael Albinus <michael.albinus@gmx.de>
9173
9174 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9175 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9176 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9177 Initialize xd_registered_buses.
9178
3478ec45
PE
91792012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9180
b263a6b0
PE
9181 Untag more efficiently if USE_LSB_TAG.
9182 This is based on a proposal by YAMAMOTO Mitsuharu in
9183 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9184 For an admittedly artificial (nth 8000 longlist) benchmark on
9185 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9186 Emacs's overall text size by 1%.
9187 * lisp.h (XUNTAG): New macro.
9188 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9189 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9190 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9191 * eval.c (Fautoload):
9192 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9193 * frame.h (XFRAME): Use XUNTAG.
9194
3478ec45
PE
9195 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9196 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9197 Remove unportable assumptions about print widths of types like
9198 dbus_uint32_t.
9199 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9200 intptr_t when converting between pointer and integer, to avoid GCC
9201 warnings about wrong width.
9202
666b903b 92032012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
9204
9205 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9206 stack for each reader_thread, instead of defaulting to 8MB
9207 determined by the linker. This avoids failures in creating
9208 subprocesses on Windows 7, see the discussion in this thread:
9209 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9210
b120cc17
JC
92112012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9212
9213 Fix up display of the *Minibuf-0* buffer in the mini window.
9214 * keyboard.c (read_char): Don't clear the echo area if there's no
9215 message to clear.
9216 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 9217 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 9218
9a4b36f8
MA
92192012-05-07 Michael Albinus <michael.albinus@gmx.de>
9220
9221 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9222 batch mode.
9223
e5f9458f
CY
92242012-05-06 Chong Yidong <cyd@gnu.org>
9225
9226 * lisp.mk (lisp): Update.
9227
eceeb5fc 92282012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
9229
9230 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9231
71873e2b
SM
92322012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9233
9234 * data.c (PUT_ERROR): New macro.
9235 (syms_of_data): Use it. Add new error type `user-error'.
9236 * undo.c (user_error): New function.
9237 (Fprimitive_undo): Use it.
9238 * print.c (print_error_message): Adjust print style for `user-error'.
9239 * keyboard.c (user_error): New function.
9240 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9241
ab0fa4e4
PE
92422012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9243
9244 Do not limit current-time-string to years 1000..9999.
9245 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9246 (Fcurrent_time_string): Support any year that is supported by the
9247 underlying localtime representation. Don't use asctime, as it
9248 has undefined behavior for years outside the range -999..9999.
9249
7ed806a7
PE
92502012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9251
9252 Fix race conditions involving setenv, gmtime, localtime, asctime.
9253 Without this fix, interrupts could mess up code that uses these
9254 nonreentrant functions, since setting TZ invalidates existing
9255 tm_zone or tzname values, and since most of these functions return
9256 pointers to static storage.
9257 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9258 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9259 Grow the critical sections to include not just invoking
9260 localtime/gmtime, but also accessing these functions' results
9261 including their tm_zone values if any, and any related TZ setting.
9262 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
9263 so that the struct tm is saved in the critical section.
9264 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
9265 motivated by the fact that memory allocation needs to be outside
9266 the critical section.
9267
0c16dfed
DA
92682012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9269
9270 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9271 with RESET_INTERVAL.
9272
9273 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9274 Remove duplicated buffer name initialization.
9275
3f83ace8
JM
92762012-05-02 Jim Meyering <jim@meyering.net>
9277
9278 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9279
c7b8541e
JM
9280 * xfns.c (x_window): Use xstrdup (Bug#11375).
9281
90207a15 92822012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
9283
9284 * xdisp.c (pos_visible_p): If already at a newline from the
9285 display string before the 'while' loop, don't walk back the glyphs
9286 from it3.glyph_row. Solves assertion violation when the display
9287 string begins with a newline (egg.el). (Bug#11367)
9288
b593d6a9
AH
92892012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9290
9291 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9292 Move to simple.el.
9293
4737362e
GM
92942012-05-01 Glenn Morris <rgm@gnu.org>
9295
99cf43f9
GM
9296 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9297 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9298 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9299 All were removed before 23.1.
9300
9311dcff
GM
9301 * dispnew.c: Remove HAVE_LIBNCURSES test;
9302 it is always true on relevant platforms.
9303
4d5c6349
GM
9304 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9305 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9306
4737362e
GM
9307 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9308
74dd3a6b
AS
93092012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9310
9311 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9312 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9313 Remove.
9314
13c379ee
PE
93152012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9316
9317 Do not avoid creating empty evaporating overlays (Bug#9642).
9318 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9319 That is, do not delete an evaporating overlay if it becomes
9320 empty after its bounds are adjusted to fit within its buffer.
9321 This fix caused other problems, and I'm reverting it until we get
9322 to the bottom of them.
9323
a8e7d6d7 93242012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
9325
9326 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9327
a8e7d6d7 93282012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
9329
9330 * xdisp.c (pos_visible_p): If the window start position is beyond
9331 ZV, start the display from buffer beginning. Prevents assertion
9332 violation in init_iterator when the minibuffer window is scrolled
9333 via the scroll bar.
9334
9335 * window.c (window_scroll_pixel_based): Likewise.
9336
a8e7d6d7 93372012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
9338
9339 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9340
a8e7d6d7 93412012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
9342
9343 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9344 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9345
a8e7d6d7 93462012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 9347
b593d6a9
AH
9348 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9349 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 9350
1c6900d9
EZ
93512012-04-26 Eli Zaretskii <eliz@gnu.org>
9352
4c3fa1d9
EZ
9353 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9354 display element, check also the underlying string or buffer
9355 character. (Bug#11341)
9356
1c6900d9
EZ
9357 * w32menu.c: Include w32heap.h.
9358 (add_menu_item): If the call to AppendMenuW (via
9359 unicode_append_menu) fails, disable Unicode menus only if we are
9360 running on Windows 9X/Me.
9361
42bf8205
AS
93622012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9363
9364 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9365 (xgetint): Add missing shift for LSB tags.
9366
b1bac16e
MR
93672012-04-24 Martin Rudalics <rudalics@gmx.at>
9368
9369 * keyboard.c (read_char): Don't wipe echo area for select window
9370 events: These might get delayed via `mouse-autoselect-window'
9371 (Bug#11304).
9372
d69621cc
JB
93732012-04-24 Juanma Barranquero <lekktu@gmail.com>
9374
9375 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9376 manipulation of :loaded-from data.
9377
02fd101b
JB
93782012-04-23 Juanma Barranquero <lekktu@gmail.com>
9379
9380 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9381 now a cons (bug#11311).
9382
888bec30
PE
93832012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9384
89a438bd
PE
9385 Do not create empty overlays with the evaporate property (Bug#9642).
9386 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9387 if it becomes empty after its bounds are adjusted to fit within
9388 its buffer. Without this fix, in a nonempty buffer (let ((o
9389 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9390 yields an empty overlay that has the evaporate property, which is
9391 not supposed to happen.
9392
1068fe4d
PE
9393 Fix minor GTK3 problems found by static checking.
9394 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9395 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9396 (struct _EmacsFixedClass, emacs_fixed_get_type):
9397 Move decls here from emacsgtkfixed.h, since they needn't be public.
9398 (emacs_fixed_get_type): Now static.
9399 (emacs_fixed_class_init): Omit unused local.
9400 (emacs_fixed_child_type): Remove; unused.
9401 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9402 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9403 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9404 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9405 (EMACS_FIXED_GET_CLASS): Remove; unused.
9406 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9407
888bec30
PE
9408 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9409 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9410
de85e130
PE
94112012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9412
d0baac98 9413 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 9414 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
9415 (__malloc_size_t, __malloc_ptrdiff_t):
9416 Remove. All uses removed, replaced by the definiens if needed,
9417 since we can assume C89 or better now.
9418 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9419 (protect_malloc_state, align, get_contiguous_space)
9420 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9421 (malloc_atfork_handler_child, malloc_enable_thread)
9422 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9423 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9424 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9425 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9426 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9427 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9428 Define using prototypes, not old style.
9429 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9430 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9431 (align): Don't assume that signed integer overflow wraps around.
9432 Omit unused local var.
9433 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9434 (_free_internal_nolock, memalign, mallochook, reallochook):
9435 Omit no-longer-needed casts.
9436 (valloc): Use getpagesize, not __getpagesize.
9437 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9438 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9439
de85e130
PE
9440 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9441
dcbf5805
MA
94422012-04-22 Michael Albinus <michael.albinus@gmx.de>
9443
9444 Move functions from C to Lisp. Make non-blocking method calls
9445 the default. Implement further D-Bus standard interfaces.
9446
9447 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9448 (QCdbus_request_name_allow_replacement)
9449 (QCdbus_request_name_replace_existing)
9450 (QCdbus_request_name_do_not_queue)
9451 (QCdbus_request_name_reply_primary_owner)
9452 (QCdbus_request_name_reply_in_queue)
9453 (QCdbus_request_name_reply_exists)
9454 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9455 (QCdbus_registered_serial, QCdbus_registered_method)
9456 (QCdbus_registered_signal): New Lisp objects.
9457 (XD_DEBUG_MESSAGE): Use sizeof.
9458 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9459 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9460 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9461 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9462 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9463 (xd_signature, xd_append_arg): Allow float for integer types.
9464 (xd_get_connection_references): New function.
b593d6a9
AH
9465 (xd_get_connection_address): Rename from xd_initialize.
9466 Return cached address.
dcbf5805
MA
9467 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9468 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9469 level.
9470 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 9471 Return number of refcounts.
dcbf5805
MA
9472 (Fdbus_get_unique_name): Make stronger parameter check.
9473 (Fdbus_message_internal): New defun.
9474 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9475 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9476 (Fdbus_send_signal, Fdbus_register_service)
9477 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9478 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9479 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9480 (Vdbus_compiled_version, Vdbus_runtime_version)
9481 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9482 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9483 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
9484 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9485 Adapt docstring.
dcbf5805 9486
52828e02
PE
94872012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9488
da05bc4c
PE
9489 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9490 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9491 Do not assume ptrdiff_t is the same width as 'int'.
9492
52828e02
PE
9493 * alloc.c: Handle unusual debugging option combinations.
9494 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9495 since the two debugging options are incompatible.
9496 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9497 is defined.
9498 (mem_init, mem_insert, mem_insert_fixup):
9499 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9500 (NEED_MEM_INSERT): Remove; no longer needed.
9501
f01769f9
LL
95022012-04-22 Leo Liu <sdl.web@gmail.com>
9503
9504 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9505
5790543d
PE
95062012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9507
9508 * sysdep.c [__FreeBSD__]: Minor cleanups.
9509 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9510 Use Emacs indenting style more consistently. Avoid some casts.
9511 Use 'double' consistently rather than mixing 'float' and 'double'.
9512
b91b7e4d
EW
95132012-04-21 Eduard Wiebe <usenet@pusto.de>
9514
b593d6a9
AH
9515 * sysdep.c (list_system_processes, system_process_attributes):
9516 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 9517
6114eb15
AS
95182012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9519
9520 * lisp.mk (lisp): Update.
9521
2f38dff7
PE
95222012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9523
9524 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9525 It is never used otherwise.
9526
4ae29f89
SM
95272012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9528
9529 * print.c (print_preprocess): Only check print_depth if print-circle
9530 is nil.
9531 (print_object): Check for cycles even when print-circle is nil and
9532 print-gensym is t, but only check print_depth if print-circle is nil.
9533
f30d612a
CY
95342012-04-20 Chong Yidong <cyd@gnu.org>
9535
9536 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9537 set the status to "failed" and ensure that sentinel is run.
9538
c07a4c0b 95392012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
9540
9541 * process.c (Fset_process_inherit_coding_system_flag)
9542 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 9543 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 9544
c07a4c0b 95452012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
9546
9547 * xdisp.c (string_buffer_position_lim): Limit starting position to
9548 BEGV.
9549 (set_cursor_from_row): If called for a mode-line or header-line
9550 row, return zero immediately.
9551 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
9552 farther than the first row after the header line, if any.
9553 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
9554 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9555
c07a4c0b 95562012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9557
4ae29f89
SM
9558 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9559 (bug#11238).
ad3a2b41 9560
c07a4c0b 95612012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 95622012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
9563
9564 configure: new option --enable-gcc-warnings (Bug#11207)
9565 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9566 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9567 (ALL_CFLAGS): Use new macros rather than old.
9568 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9569 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9570 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9571 -Wunused-result, -Wunused-variable. This should go away once
9572 the Emacs and Gnulib regex code is merged.
9573 (xmalloc, xrealloc): Now static.
9574
aba027e8
PE
95752012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9576
9577 * dired.c (Fsystem_groups): Remove unused local.
9578
e5a36063
GM
95792012-04-17 Glenn Morris <rgm@gnu.org>
9580
9581 * dired.c (Fsystem_users): Doc fix.
9582
316411f0
DA
95832012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9584
9585 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9586 (syms_of_dired): Add them.
9587
9426aba4
PE
95882012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9589
b62a57be
PE
9590 Fix minor alloc.c problems found by static checking.
9591 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9592 New extern decls, to avoid calling undeclared functions.
9593 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9594 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9595 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9596 (NEED_MEM_INSERT): New macro.
9597 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 9598 Remove one incorrect comment and fix another.
b62a57be 9599
3539f31f
PE
9600 Fix minor ralloc.c problems found by static checking.
9601 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9602 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9603 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9604 (r_alloc_sbrk): Now static.
9605
a041960a
PE
9606 Improve ralloc.c interface checking.
9607 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9608 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9609 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9610 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9611 [REL_ALLOC]: ... to here, to check interface.
9612 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9613 Remove decls. This fixes an "It stinks!".
9614
9426aba4
PE
9615 * alloc.c (which_symbols): Fix alignment issue / type clash.
9616
d55c12ed
AS
96172012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9618
9619 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9620 (struct Lisp_Misc_Any): Likewise.
9621 (struct Lisp_Free): Likewise.
9622 * alloc.c (union aligned_Lisp_Symbol): Define.
9623 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9624 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9625 (union aligned_Lisp_Misc): Define.
9626 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9627 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 9628 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 9629
b948ce8b
PE
96302012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9631
9632 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9633 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9634 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9635 * s/netbsd.h, s/sol2-6.h:
9636 Remove definition of GC_MARK_STACK, since the default now works.
9637 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9638 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9639 no longer the default.
9640 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9641
35dc09a1 96422012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9643
35dc09a1
GM
9644 * lread.c (lisp_file_lexically_bound_p):
9645 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 9646
35dc09a1
GM
96472012-04-14 Eli Zaretskii <eliz@gnu.org>
9648
9649 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9650 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9651
96522012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9653
9654 * nsterm.m (constrainFrameRect): Always constrain when there is only
9655 one screen (Bug#10962).
9656
bcd86815
KB
96572012-04-13 Ken Brown <kbrown@cornell.edu>
9658
9659 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9660
c25df26e
RT
96612012-04-13 Reuben Thomas <rrt@sc3d.org>
9662
9663 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9664
0fc59f1e
DC
96652012-04-11 Daniel Colascione <dancol@dancol.org>
9666
9667 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9668 against is gone. It's better to use vfork now so that when Cygwin
9669 gains a new, working vfork, we use it automatically (bug#10398).
9670
de8c03dc
SM
96712012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9672
9673 * window.c (save_window_save): Obey window-point-insertion-type.
9674
2f097256
GM
96752012-04-11 Glenn Morris <rgm@gnu.org>
9676
9677 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9678
453b951e
SM
96792012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9680
9681 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9682
75f1671a 96832012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
9684
9685 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9686 (force_quit_count): New var.
9687 (handle_interrupt): Use it.
9688
2a8ce227
JB
96892012-04-10 Juanma Barranquero <lekktu@gmail.com>
9690
9691 * w32.c (w32_delayed_load): Record the full path of the library
9692 being loaded (bug#10424).
9693
935396c0
GM
96942012-04-09 Glenn Morris <rgm@gnu.org>
9695
05920a43
GM
9696 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9697 not just in the obarray, before snarfing them. (Bug#11036)
9698
935396c0
GM
9699 * Makefile.in ($(leimdir)/leim-list.el):
9700 Pass EMACS rather than BUILT_EMACS.
9701
a18ecafa
TZ
97022012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9703
9704 * process.c (make_process):
9705 * process.h: Add integer `gnutls_handshakes_tried' member to
9706 process struct.
9707
6bbef4e5
JC
9708 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9709 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
9710
9711 * gnutls.c (gnutls_log_function2i): Convenience log function.
9712 (emacs_gnutls_read): Use new log functions,
9713 `gnutls_handshakes_tried' process member, and
9714 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9715 attempts per process (connection).
9716
b4d3bc10
CY
97172012-04-09 Chong Yidong <cyd@gnu.org>
9718
9719 * eval.c (Fuser_variable_p, user_variable_p_eh)
9720 (lisp_indirect_variable): Functions deleted.
9721 (Fdefvar): Caller changed.
9722
9723 * callint.c (Finteractive, Fcall_interactively):
9724 * minibuf.c (Fread_variable): Callers changed.
9725
70f4d973
EZ
97262012-04-09 Eli Zaretskii <eliz@gnu.org>
9727
9728 * xdisp.c (set_cursor_from_row): If the display string appears in
9729 the buffer at position that is closer to point than the position
9730 after the display string, display the cursor on the first glyph of
9731 the display string. Fixes cursor display when a 'display' text
9732 property immediately follows invisible text. (Bug#11094)
9733
cb3c2e3e
PE
97342012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9735
9736 composite.c: use 'double' consistently
9737 * composite.c (get_composition_id): Use 'double' consistently
9738 instead of converting 'float' to 'double' and vice versa; this is
9739 easier to understand and avoids a GCC warning.
9740
fd06db5d
GM
97412012-04-09 Glenn Morris <rgm@gnu.org>
9742
50fe702a
GM
9743 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9744 preparation for dumping it with emacs. (Bug#4789)
9745 (leimdir): New variable.
9746 ($(leimdir)/leim-list.el): New rule.
9747 (emacs$(EXEEXT)): Depend on leim-list.el.
9748
fd06db5d
GM
9749 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9750 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9751 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9752
55c131ee
AS
97532012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9754
9755 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9756 proper alignment.
9757
9209588f
JB
97582012-04-07 Juanma Barranquero <lekktu@gmail.com>
9759
9760 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9761 Remove unused local variable.
9762
e3fb2efb
PE
97632012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9764
9765 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9766 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9767 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9768 objects, as mark_maybe_pointer will catch them otherwise.
9769 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9770 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9771
b5385551
PE
97722012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9773
9774 Fix typo that broke non-Windows builds.
9775 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9776
9078ead6
EZ
97772012-04-07 Eli Zaretskii <eliz@gnu.org>
9778
9779 Support building on MS-Windows with libxml2.
9780
9781 * makefile.w32-in (OBJ2): Add xml.$(O).
9782 (GLOBAL_SOURCES): Add xml.c.
9783 ($(BLD)/xml.$(O)): New dependency list.
9784
9785 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9786 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9787 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9788 [!WINDOWSNT]: New macros.
9789 (init_libxml2_functions, libxml2_loaded_p): New functions.
9790 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9791 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9792 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9793 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9794 linked in).
6bbef4e5
JC
9795 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9796 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
9797 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9798
9799 * emacs.c: Don't include libxml/parser.h.
9800 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9801 xmlCleanupParser directly.
9802
9803 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9804
3811fdf3
EZ
98052012-04-07 Eli Zaretskii <eliz@gnu.org>
9806
9807 * indent.c (Fvertical_motion): If there is a display string at
9808 point, use it.vpos to compute how many lines to backtrack after
9809 move_it_to point. (Bug#11133)
9810
2f8e16b2
EZ
98112012-04-06 Eli Zaretskii <eliz@gnu.org>
9812
9813 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9814 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9815 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9816 macros related to unification of CJK characters. For the details,
9817 see the discussion following the message here:
9818 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9819
3d439cd1
CY
98202012-04-04 Chong Yidong <cyd@gnu.org>
9821
9822 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9823
8bc53d00
EZ
98242012-04-01 Eli Zaretskii <eliz@gnu.org>
9825
9826 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9827 instead of alloca. (Bug#11138)
9828
3b0512a3
AS
98292012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9830
9831 * w32menu.c (is_simple_dialog): Properly check lisp types.
9832 (Bug#11141)
9833
8427ddd2
EZ
98342012-03-31 Eli Zaretskii <eliz@gnu.org>
9835
979022ef
EZ
9836 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9837 position we get to after a call to move_it_to fails the
9838 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9839 only if we wind up in a string from display property. (Bug#11063)
9840
a6b1c7cc
EZ
9841 * window.c (Fdelete_other_windows_internal): Invalidate the row
9842 and column information about mouse highlight, so that redisplay
9843 restores it after reallocating the glyph matrices. (Bug#7464)
9844
8427ddd2
EZ
9845 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9846 string comes from a `display' text property, use the buffer
9847 position of that property as if we actually saw that position in
9848 the row's glyphs.
697ba24b
EZ
9849 (move_it_by_lines): Remove the assertion that
9850 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9851 violated when there's a before-string at the beginning of a line.
9852 (Bug#11063)
8427ddd2 9853
65a0a738
EZ
98542012-03-30 Eli Zaretskii <eliz@gnu.org>
9855
9856 * xdisp.c (append_space_for_newline): If the default face was
9857 remapped, use the remapped face for the appended newline.
9858 (extend_face_to_end_of_line): Use the remapped default face for
9859 extending the face to the end of the line.
9860 (display_line): Call extend_face_to_end_of_line when the default
9861 face was remapped. (Bug#11068)
9862
581355cc
EZ
98632012-03-29 Eli Zaretskii <eliz@gnu.org>
9864
9865 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9866
e8fc049f
SM
98672012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9868
9869 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9870
4fb9a543
GM
98712012-03-27 Glenn Morris <rgm@gnu.org>
9872
9873 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9874 Doc fixes.
9875
679910f1
KH
98762012-03-26 Kenichi Handa <handa@m17n.org>
9877
9878 * dispextern.h (struct glyph): Fix previous change. Change the
9879 bit length of glyphless.ch to 25 (Bug#11082).
9880
90d49b7f
CY
98812012-03-26 Chong Yidong <cyd@gnu.org>
9882
9883 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9884 (command_loop_1): Use it; inhibit selection update for
9885 handle-select-window too (Bug#8996).
9886
f514f6f0
FP
98872012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9888
e8fc049f 9889 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 9890
bf43fa51
KH
98912012-03-25 Kenichi Handa <handa@m17n.org>
9892
9893 * dispextern.h (struct glyph): Change the bit length of
9894 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9895
8a0c01dd
EZ
98962012-03-24 Eli Zaretskii <eliz@gnu.org>
9897
9898 * s/ms-w32.h (tzname): Include time.h before redirecting to
9899 _tzname. Fixes the MSVC build. (Bug#9960)
9900
7d1c3a76
AS
99012012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9902
8ed79523
AS
9903 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9904 characters.
9905
7d1c3a76
AS
9906 * xterm.c (XTread_socket): Only modify handling_signal if
9907 !SYNC_INPUT. (Bug#11080)
9908
e99a9b8b
EZ
99092012-03-23 Eli Zaretskii <eliz@gnu.org>
9910
9911 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9912 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9913 when fetching a multibyte character consumes more bytes than
9914 CHAR_BYTES returns, due to unification of CJK characters in
9915 string_char. (Bug#11073)
9916
5063c0e1
TN
99172012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9918
9919 * process.c (wait_reading_process_output): Handle pty disconnect
9920 by refraining from sending oneself a SIGCHLD (bug#10933).
9921
9f851fbd
CY
99222012-03-22 Chong Yidong <cyd@gnu.org>
9923
9924 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9925
5063c0e1 9926 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
9927 Mark string as coming from a prefix property.
9928 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9929 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9930
fb5b8aca
CY
99312012-03-21 Chong Yidong <cyd@gnu.org>
9932
9933 * xfaces.c (Vface_remapping_alist): Doc fix.
9934
62356a1b
EZ
99352012-03-20 Eli Zaretskii <eliz@gnu.org>
9936
9937 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
9938 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9939 Doc fixes.
62356a1b 9940
025de85b
CY
99412012-03-20 Chong Yidong <cyd@gnu.org>
9942
9943 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9944 to reflect default non-nil value of redisplay-dont-pause.
9945
4827f94e
KH
99462012-03-19 Kenichi Handa <handa@m17n.org>
9947
9948 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9949 it fit in a valid range (Bug#11003).
9950
e50a24a2
EZ
99512012-03-18 Eli Zaretskii <eliz@gnu.org>
9952
9953 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9954 that is not from display property, accept the row as a "cursor
9955 row" if one of the string's character has a non-nil `cursor'
9956 property. Fixes cursor positioning when there are newlines in
9957 overlay strings, e.g. in icomplete.el. (Bug#11035)
9958
9af5ed87
PE
99592012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9960
9961 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9962
d1f55f16
CY
99632012-03-12 Chong Yidong <cyd@gnu.org>
9964
9965 * eval.c (inhibit_lisp_code): Rename from
9966 inhibit_window_configuration_change_hook; move from window.c.
9967
9968 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9969 * window.c (run_window_configuration_change_hook)
9970 (syms_of_window): Callers changed.
9971
66c5eebd
CY
99722012-03-11 Chong Yidong <cyd@gnu.org>
9973
413df973
CY
9974 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9975
66c5eebd
CY
9976 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9977
1de11f56
CY
99782012-03-10 Chong Yidong <cyd@gnu.org>
9979
9980 * frame.c (other_visible_frames): Don't assume the selected frame
9981 is visible (Bug#10955).
9982
cae07000
SM
99832012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9984
9985 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9986
89c94350
JD
99872012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9988
9989 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9990 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9991 zero (Bug#10954).
9992
999dd333
GM
99932012-03-03 Glenn Morris <rgm@gnu.org>
9994
01a6dcc8 9995 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 9996
de0100f2
EZ
99972012-03-02 Eli Zaretskii <eliz@gnu.org>
9998
9999 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10000 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
10001 (redisplay_window, next_element_from_string): Fix typos in
10002 comments.
3e441275
EZ
10003 (redisplay_window): Pass to move_it_vertically the margin in
10004 pixels, not in screen lines.
de0100f2 10005
96a72ee9
GM
100062012-03-02 Glenn Morris <rgm@gnu.org>
10007
10008 * buffer.c (buffer-list-update-hook): Doc fix.
10009
312508d7
EZ
100102012-02-29 Eli Zaretskii <eliz@gnu.org>
10011
10012 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10013 push_it before setting up the iterator for the first overlay
10014 string, even if we have an empty string loaded.
10015 (next_overlay_string): If there's an empty string on the iterator
10016 stack, pop the stack. (Bug#10903)
10017
27f3c637
PE
100182012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10019
10020 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10021 Suggested by Stefan Monnier in
10022 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10023 * alloc.c (widen_to_Lisp_Object): New static function.
10024 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10025 and widening them to Lisp_Objects. This would work even if
10026 USE_LSB_TAG is defined and wide integers are used, which might
10027 happen in a future version of Emacs.
10028
3c9dfce6
CY
100292012-02-25 Chong Yidong <cyd@gnu.org>
10030
fa74b241
CY
10031 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10032 Doc fix.
10033
3c9dfce6
CY
10034 * xselect.c (Fx_selection_exists_p): Doc fix.
10035 (x_clipboard_manager_save_all): Print an informative message
10036 before saving to clipboard manager.
10037
9486df08
CY
100382012-02-24 Chong Yidong <cyd@gnu.org>
10039
10040 * keyboard.c (process_special_events): Handle all X selection
10041 requests in kbd_buffer, not just the next one (Bug#8869).
10042
f01d3321
CY
100432012-02-23 Chong Yidong <cyd@gnu.org>
10044
10045 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10046 call when setting menu-bar-lines and tool-bar-lines parameters.
10047 (unwind_create_frame_1): New helper function.
10048
10049 * window.c (inhibit_window_configuration_change_hook): New var.
10050 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 10051 (syms_of_window): Initialize it.
f01d3321 10052
86b847b6
CY
100532012-02-22 Chong Yidong <cyd@gnu.org>
10054
10055 * xterm.c (x_draw_image_relief): Add missing type check for
10056 Vtool_bar_button_margin (Bug#10743).
10057
a59225b1
CY
100582012-02-21 Chong Yidong <cyd@gnu.org>
10059
10060 * fileio.c (Vfile_name_handler_alist): Doc fix.
10061
10062 * buffer.c (Fget_file_buffer): Protect against invalid file
10063 handler return value.
10064
310f5bd4
PE
100652012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10066
cb3a28cc
PE
10067 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10068 when computing $valmask.
10069
310f5bd4
PE
10070 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10071 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10072 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10073 It's useless in that case, and it can cause problems on hosts
10074 that allocate halves of EMACS_INT values separately.
10075 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10076 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10077 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10078 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10079 it avoids undefined behavior on hosts where shifting right by more
10080 than the word width has undefined behavior.
10081
2375c96a
CY
100822012-02-19 Chong Yidong <cyd@gnu.org>
10083
10084 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10085 (Funhandled_file_name_directory, Ffile_name_as_directory)
10086 (Fdirectory_file_name, Fexpand_file_name)
10087 (Fsubstitute_in_file_name): Protect against invalid file handler
10088 return values (Bug#10845).
10089
3eb49e71
EZ
100902012-02-18 Eli Zaretskii <eliz@gnu.org>
10091
10092 * .gdbinit (pitx): Fix incorrect references to fields of the
10093 iterator stack.
10094
7b926f3f
CY
100952012-02-17 Chong Yidong <cyd@gnu.org>
10096
10097 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10098
11273115
PE
100992012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10100
10101 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10102 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10103
c3a70e2b
CY
101042012-02-15 Chong Yidong <cyd@gnu.org>
10105
10106 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10107 marked as special. Also, starting docstrings with * is obsolete.
10108
0ca43699
AS
101092012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10110
10111 * gnutls.c (emacs_gnutls_write): Fix last change.
10112
2e8f3c56
LI
101132012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10114
10115 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10116 send_process.
10117
af70074f
SM
101182012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10119
10120 * keymap.c (Fsingle_key_description): Handle char ranges.
10121
95986d52
CY
101222012-02-12 Chong Yidong <cyd@gnu.org>
10123
afd83bd1
CY
10124 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10125 as that creates a dangerous corner case.
10126
95986d52
CY
10127 * window.c (Fdelete_window_internal): Invalidate the mouse
10128 highlight (Bug#9904).
10129
bd7da63e
GM
101302012-02-12 Glenn Morris <rgm@gnu.org>
10131
10132 * xselect.c (Fx_own_selection_internal)
10133 (Fx_get_selection_internal, Fx_disown_selection_internal)
10134 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10135 * nsselect.m (Fx_own_selection_internal)
10136 (Fx_disown_selection_internal, Fx_selection_exists_p)
10137 (Fx_selection_owner_p, Fx_get_selection_internal):
10138 Sync docs and argument specs with the xselect.c versions.
10139
77abcbc2
LI
101402012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10141
10142 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10143
90b671e2
EZ
101442012-02-11 Eli Zaretskii <eliz@gnu.org>
10145
1c0ca0b7
EZ
10146 * w32select.c (Fx_selection_exists_p): Sync doc string and
10147 argument list with xselect.c. (Bug#10783)
10148
10149 * w16select.c (Fx_selection_exists_p): Sync doc string and
10150 argument list with xselect.c. (Bug#10783)
90b671e2 10151
49241268
GM
101522012-02-10 Glenn Morris <rgm@gnu.org>
10153
10154 * fns.c (Fsecure_hash): Doc fix.
10155
f998bbe7 101562012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
10157
10158 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10159
0992bd9c
CY
101602012-02-07 Chong Yidong <cyd@gnu.org>
10161
10162 * buffer.c (Fbuffer_local_variables)
10163 (buffer_lisp_local_variables): Handle unbound vars correctly;
10164 don't let Qunbound leak into Lisp.
10165
af008560
GM
101662012-02-07 Glenn Morris <rgm@gnu.org>
10167
dd605cc4
GM
10168 * image.c (Fimagemagick_types): Doc fix.
10169
af008560
GM
10170 * image.c (imagemagick-render-type): Change it from a lisp object
10171 to an integer. Move the doc here from the lisp manual.
10172 Treat all values not equal to 0 the same.
10173
1449fa1d
CY
101742012-02-06 Chong Yidong <cyd@gnu.org>
10175
10176 * doc.c (store_function_docstring): Avoid applying docstring of
10177 alias to base function (Bug#2603).
10178
3723ec07
AS
101792012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10180
10181 * .gdbinit (pp1, pv1): Remove redundant defines.
10182 (pr): Use pp.
10183
79c1cc1e
CY
101842012-02-04 Chong Yidong <cyd@gnu.org>
10185
10186 * nsterm.m: Declare a global (Bug#10694).
10187
d7f29f8e
EZ
101882012-02-04 Eli Zaretskii <eliz@gnu.org>
10189
cae07000
SM
10190 * w32.c (get_emacs_configuration_options):
10191 Include --enable-checking, if specified, in the return value.
d7f29f8e 10192
3b95a6f9
MR
101932012-02-04 Martin Rudalics <rudalics@gmx.at>
10194
10195 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10196 after rounding frame sizes. (Bug#9723)
10197
d6fa96a6
EZ
101982012-02-04 Eli Zaretskii <eliz@gnu.org>
10199
10200 * keyboard.c (adjust_point_for_property): Don't position point
10201 before BEGV. (Bug#10696)
10202
df0b2940
PE
102032012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10204
10205 Handle overflow when computing char display width (Bug#9496).
10206 * character.c (char_width): Return EMACS_INT, not int.
10207 (char_width, c_string_width): Check for overflow when
10208 computing the width; this is possible now that individual
10209 characters can have unbounded width. Problem introduced
10210 by merge from Emacs 23 on 2012-01-19.
10211
6bee44d6
MA
102122012-02-02 Michael Albinus <michael.albinus@gmx.de>
10213
10214 * dbusbind.c (Fdbus_register_method): Mention the return value
10215 :ignore in the docstring.
10216
44f92739
GM
102172012-02-02 Glenn Morris <rgm@gnu.org>
10218
1b9f60cc
GM
10219 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10220
44f92739
GM
10221 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10222 Unconditionally set to t. (Bug#10673)
10223 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10224 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10225 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10226
c5d3843c
KH
102272012-02-02 Kenichi Handa <handa@m17n.org>
10228
10229 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10230 0, do not call append_composite_glyph.
10231
159462d4 102322012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
10233
10234 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10235 NULL (Bug#6988).
10236 (x_produce_glyphs): If the component of a composition is a null
10237 string, set it->pixel_width to 1 to avoid zero-width glyph.
10238
78cef877
EZ
102392012-02-01 Eli Zaretskii <eliz@gnu.org>
10240
10241 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10242 first 2 arguments are identical. This makes inserting large
10243 output from a subprocess an order of magnitude faster on
10244 MS-Windows, where all sbrk'ed memory is always contiguous.
10245
97897668
GM
102462012-01-31 Glenn Morris <rgm@gnu.org>
10247
10248 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 10249 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
10250 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10251
31fd3586
GM
102522012-01-29 Glenn Morris <rgm@gnu.org>
10253
10254 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10255
0e24a8b2
CY
102562012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10257
10258 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10259
cc0adcb0
CY
102602012-01-28 Chong Yidong <cyd@gnu.org>
10261
10262 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10263
acc28cb9
CY
102642012-01-26 Chong Yidong <cyd@gnu.org>
10265
9c69cfb7
CY
10266 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10267
acc28cb9
CY
10268 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10269 repeat counts (Bug#10507).
10270
48da7392
GM
102712012-01-26 Glenn Morris <rgm@gnu.org>
10272
10273 * lread.c (syms_of_lread): Doc fix.
10274
14af5f7f
CY
102752012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10276
10277 * coding.c (encode_designation_at_bol): Change return value to
10278 EMACS_INT.
10279
0b21c100
CY
102802012-01-25 Chong Yidong <cyd@gnu.org>
10281
10282 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10283
3c2907f7
CY
102842012-01-21 Chong Yidong <cyd@gnu.org>
10285
10286 * floatfns.c (Fcopysign): Make the second argument non-optional,
10287 since nil is not allowed anyway.
10288
959ad23f
AS
102892012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10290
10291 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10292 (send_process): Likewise.
10293
34a02f46
MR
102942012-01-19 Martin Rudalics <rudalics@gmx.at>
10295
10296 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
10297 (Vwindow_persistent_parameters): Do not use Qstate.
10298 Rewrite doc-strings.
34a02f46 10299
1259009a 103002012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
10301
10302 * character.c (char_width): New function.
70d4fdf6
GM
10303 (Fchar_width, c_string_width, lisp_string_width):
10304 Use char_width (Bug#9496).
25ed9e61 10305
6a6ee00d
MR
103062012-01-16 Martin Rudalics <rudalics@gmx.at>
10307
10308 * window.c (Vwindow_persistent_parameters): New variable.
10309 (Fset_window_configuration, save_window_save): Handle persistent
10310 window parameters.
10311
c85efaf7
EZ
103122012-01-14 Eli Zaretskii <eliz@gnu.org>
10313
10314 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10315 thrashing the stack of the thread. (Bug#9087)
10316
5944709e
PE
103172012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10318
10319 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10320
e71f5d99
EZ
103212012-01-11 Eli Zaretskii <eliz@gnu.org>
10322
10323 * xdisp.c (rows_from_pos_range): Handle the case where the
10324 highlight ends on a newline. (Bug#10464)
10325 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10326 he end column for display of highlight that ends on a newline
10327 before a R2L line.
10328
ce316182
GM
103292012-01-11 Glenn Morris <rgm@gnu.org>
10330
10331 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10332 from load-path also when installation-directory is nil. (Bug#10208)
10333
5b43da69
GM
103342012-01-10 Glenn Morris <rgm@gnu.org>
10335
74cc8ff9
GM
10336 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10337
7d8d6e4e
GM
10338 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10339 Update template values to be closer to their typical values these days.
5b43da69 10340
a0db8d43
EZ
103412012-01-09 Eli Zaretskii <eliz@gnu.org>
10342
10343 * xdisp.c (rows_from_pos_range): Accept additional argument
10344 DISP_STRING, and accept any glyph in a row whose object is that
10345 string as eligible for mouse highlight. Fixes mouse highlight of
10346 display strings from overlays. (Bug#10464)
10347
9a0115ab 103482012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 10349
b9110d6a 10350 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
10351 * fileio.c (auto_saving_dir_umask): New static var.
10352 (Fmake_directory_internal): Use it.
10353 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10354 creating the directory. The old code temporarily assigns
10355 too-generous permissions to the directory.
10356 (do_auto_save_eh): Clear it.
b9110d6a 10357 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
10358 that the var is always cleared.
10359
6c1bd3f3
EZ
103602012-01-07 Eli Zaretskii <eliz@gnu.org>
10361
10362 * search.c (scan_buffer): Pass character positions to
10363 know_region_cache, not byte positions. (Bug#6540)
10364
069d2b50
L
103652012-01-07 LynX <_LynX@bk.ru> (tiny change)
10366
10367 * w32.c (sys_rename): Report EXDEV when rename of a directory
10368 fails because the target is on another logical disk. (Bug#10284)
10369
75bf0d33
DB
103702012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10371
10372 * xterm.c (x_embed_request_focus): New function.
10373
10374 * xterm.h: Add prototype.
10375
10376 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10377
1c6e5a32
GM
103782012-01-05 Glenn Morris <rgm@gnu.org>
10379
10380 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10381
651e947e
EZ
103822012-01-01 Eli Zaretskii <eliz@gnu.org>
10383
10384 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10385 Load gnutls_transport_set_lowat only if GnuTLS version is below
10386 2.11.1.
10387 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10388 GnuTLS versions below 2.11.1.
10389
3778cdd8
AL
103902011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10391
10392 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10393 to the doc string advising against its use for altering the way
10394 windows are scrolled.
10395
0e5317f7
KH
103962011-12-28 Kenichi Handa <handa@m17n.org>
10397
10398 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10399 coding-system ASCII compatible only when it does not produce BOM
10400 on encoding (Bug#10383).
10401
93d5ca1f
JD
104022011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10403
10404 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10405 can scroll.
10406 (create_and_show_popup_menu): Always use menu_position_func for
10407 Gtk3 (Bug#10361).
10408
ca22b785
AS
104092011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10410
10411 * callint.c (Fcall_interactively): Don't truncate prompt string.
10412
d048e1e6
EZ
104132011-12-23 Eli Zaretskii <eliz@gnu.org>
10414
10415 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10416 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 10417 resumed from there (after widening). (Bug#10360)
d048e1e6 10418
5ccaba1f
JD
104192011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10420
10421 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10422
204ee57f
JD
104232011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10424
b81d40f0
JB
10425 * nsterm.m (x_free_frame_resources):
10426 Release f->output_data.ns->miniimage.
204ee57f
JD
10427 (ns_index_color): Fix indentation. Do not retain
10428 color_table->colors[i].
10429
10430 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10431 before returning.
10432
10433 * nsfns.m (x_set_background_color): Assign return value from
10434 ns_index_color to face-background instead of NSColor*.
10435 (ns_implicitly_set_icon_type): Fix indentation.
10436 Change assignment in for loop to comparison.
10437
10438 * emacs.c (ns_pool): New variable.
10439 (main): Assign ns_pool.
10440 (Fkill_emacs): Call ns_release_autorelease_pool.
10441
10442 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10443 autorelease fdesc, release fdAttrs and tdict.
10444 (ns_get_covering_families): Release charset.
10445 (ns_findfonts): Release NSFontDescriptor created with new.
10446 (ns_uni_to_glyphs): Fix indentation.
10447 (setString): Release attrStr before assigning new value.
10448
c803b2b7
JD
104492011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10450
678f4426
JD
10451 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10452 and NS_IMPL_COCOA.
10453 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10454 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10455
cd394be1 104562011-12-18 David Reitter <reitter@cmu.edu>
678f4426 10457
5fecd5fc
JD
10458 * nsterm.m (ns_term_init): Subscribe for notifications
10459 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10460 to method trackingNotification in EmacsMenu.
10461
10462 * nsmenu.m (trackingMenu): New variable.
3771cb17 10463 (trackingNotification): New method (from Aquamacs).
5fecd5fc 10464 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 10465 from Aquamacs (Bug#7030).
678f4426
JD
10466
104672011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 10468
c803b2b7
JD
10469 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10470 (symbol_to_nsstring): Fix indentation.
10471 (ns_symbol_to_pb): New function.
cae07000
SM
10472 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10473 (Fns_rotate_cut_buffers_internal): Remove.
10474 (Fns_store_selection_internal): Rename from
c803b2b7
JD
10475 Fns_store_cut_buffer_internal.
10476 (ns_get_foreign_selection, Fx_own_selection_internal)
10477 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
10478 (Fns_get_selection_internal, Fns_store_selection_internal):
10479 Use ns_symbol_to_pb and check if return value is nil.
10480 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10481 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
10482 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10483 renamed to Sns_store_selection_internal.
10484 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10485 and remove this function.
10486 (ns_handle_selection_clear): Remove, never used.
10487 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10488 here.
10489
e1b01a3a
KB
104902011-12-17 Ken Brown <kbrown@cornell.edu>
10491
10492 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10493 GID is unknown (Bug#10257).
10494
2adb6e85
PE
104952011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10496
10497 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10498 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10499 which caused a build failure on GNU/Linux IA-64. This problem was
10500 introduced by my 2011-10-07 patch.
10501
d1d7b339
JL
105022011-12-15 Juri Linkov <juri@jurta.org>
10503
10504 * image.c (imagemagick_error): New function. (Bug#10112)
10505 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10506 Use `imagemagick_error' where ImageMagick functions return
10507 `MagickFalse'.
10508 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10509 proper order.
10510
100d5755
KH
105112011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10512
10513 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10514 fill background (Bug#8992).
10515
454592a6
MR
105162011-12-13 Martin Rudalics <rudalics@gmx.at>
10517
10518 * window.c (Vwindow_combination_resize)
10519 (Vwindow_combination_limit): Use t instead of non-nil in
10520 doc-strings.
61d4b438
MR
10521 (Vrecenter_redisplay): Add first sentence of doc-string on
10522 separate line.
53524d93 10523 (Frecenter): Fix doc-string typo.
454592a6 10524
3633e3aa
KH
105252011-12-11 Kenichi Handa <handa@m17n.org>
10526
10527 * coding.c (Funencodable_char_position): Pay attention to the
10528 buffer text relocation (Bug#9389).
10529
7b9d523a 105302011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 10531
7b9d523a
JD
10532 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10533 gtk_init (Bug#10100).
10534
b73189c6
EZ
105352011-12-10 Eli Zaretskii <eliz@gnu.org>
10536
10537 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10538 IT->string is nil. (Bug#10263)
10539
f7dfe5d6
JD
105402011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10541
83faebb4
JD
10542 * nsterm.h (x_free_frame_resources): Declare.
10543
f7dfe5d6
JD
10544 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10545 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10546
10547 * nsterm.h (ns_get_defaults_value): Declare.
10548
10549 * nsterm.m (ns_default): Call ns_get_defaults_value.
10550
7cd4e72c
EZ
105512011-12-09 Eli Zaretskii <eliz@gnu.org>
10552
10553 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10554 (Bug#10170)
10555
b34d7317
YM
105562011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10557
10558 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10559 that where the value of an _OBJC_* symbol points to is in the .bss
10560 section (Bug#10240).
10561
76470ad1
KH
105622011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10563
10564 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 10565 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 10566
745fff94
KH
105672011-12-08 Kenichi Handa <handa@m17n.org>
10568
10569 * ftfont.c (get_adstyle_property): Fix previous change
10570 (Bug#10233).
10571
6e44397c
JB
105722011-12-07 Juanma Barranquero <lekktu@gmail.com>
10573
10574 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10575 dirs from the default value of EMACSLOADPATH (bug#10208).
10576
7efa6272
GM
105772011-12-07 Glenn Morris <rgm@gnu.org>
10578
10579 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10580 installation and source directories as well. (Bug#10208)
10581
f6fc4d87
CY
105822011-12-06 Chong Yidong <cyd@gnu.org>
10583
10584 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10585
2bf26180
GM
105862011-12-06 Glenn Morris <rgm@gnu.org>
10587
10588 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10589 as an error, not just -1. (Bug#10217)
10590
3a6ad4f0
CY
105912011-12-05 Chong Yidong <cyd@gnu.org>
10592
10593 * keyboard.c (process_special_events): New function.
10594 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10595
75a3b399
PE
105962011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10597
10598 * coding.c (encode_designation_at_bol): Don't use uninitialized
10599 local variable (Bug#9318).
10600
c3c9e25e
KH
106012011-12-05 Kenichi Handa <handa@m17n.org>
10602
10603 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10604 return Qnil (Bug#8046, Bug#10193).
10605
5eb05ea3
KH
106062011-12-05 Kenichi Handa <handa@m17n.org>
10607
10608 * coding.c (encode_designation_at_bol): New args charbuf_end and
10609 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
10610 (coding_set_source): Return how many bytes coding->source was
10611 relocated.
10612 (coding_set_destination): Return how many bytes
10613 coding->destination was relocated.
10614 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 10615 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
10616
106172011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10618
10619 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10620 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10621 macro (Bug#9318).
10622
106232011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10624
10625 The following changes are to fix Bug#9318.
10626
a79703f5 10627 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
10628 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10629 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 10630 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 10631
7dbda6df
JB
106322011-12-05 Juanma Barranquero <lekktu@gmail.com>
10633
10634 * lisp.h (process_quit_flag): Fix external declaration.
10635
6d5eb5b0
SM
106362011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10637
10638 Don't macro-inline non-performance-critical code.
10639 * eval.c (process_quit_flag): New function.
10640 * lisp.h (QUIT): Use it.
10641
a0c3fad0
JD
106422011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10643
10644 * nsfns.m (get_geometry_from_preferences): New function.
10645 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10646
6c07aac2
AS
106472011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10648
10649 * emacs.c (Qkill_emacs): Define.
10650 (syms_of_emacs): Initialize it.
10651 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10652 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
10653 (quit_throw_to_read_char): Add parameter `from_signal'.
10654 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
10655 * lisp.h (QUIT): Call Fkill_emacs if requested.
10656
c052ead4
JD
106572011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10658
10659 * widget.c (update_wm_hints): Return if wmshell is null.
10660 (widget_update_wm_size_hints): New function.
10661
10662 * widget.h (widget_update_wm_size_hints): Declare.
10663
10664 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10665 widget_update_wm_size_hints (Bug#10104).
10666
9e49252b
EZ
106672011-12-03 Eli Zaretskii <eliz@gnu.org>
10668
10669 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10670 before a newline, prepare the bidi iterator for consuming the
10671 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 10672 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 10673
02b16839
JL
106742011-12-02 Juri Linkov <juri@jurta.org>
10675
10676 * search.c (Fword_search_regexp): New Lisp function created from
10677 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10678 (Fword_search_backward, Fword_search_forward)
10679 (Fword_search_backward_lax, Fword_search_forward_lax):
10680 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10681 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10682
0068070e
SM
106832011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10684
10685 * fileio.c (Finsert_file_contents): Move after-change-function call
10686 to before the "handled:" label, since all "goto handled" appear in
10687 cases where the *-change-functions have already been properly called
10688 (bug#10117).
10689
3360a3fc
AS
106902011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10691
10692 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10693 waiting for input. (Bug#10169)
10694
73d6c093
EZ
106952011-11-30 Eli Zaretskii <eliz@gnu.org>
10696
10697 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10698 verifies glyph row's hash code--we have just reallocated the
10699 glyphs, so their contents can be complete garbage. (Bug#10164)
10700
febe6bea
JB
107012011-11-30 Juanma Barranquero <lekktu@gmail.com>
10702
10703 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10704
801a4313
EZ
107052011-11-30 Eli Zaretskii <eliz@gnu.org>
10706
10707 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10708 attributes are tested _before_ calling verify_row_hash, to protect
10709 against GCC re-ordering of the tests. (Bug#10164)
10710
2b56b87e
JD
107112011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10712
10713 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10714
10715 * xterm.c (handle_one_xevent): Only set async_visible and friends
10716 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 10717 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
10718 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10719
dbf31225
PE
107202011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10721
10722 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10723 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10724 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10725 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10726 All uses changed to use GCPRO1 etc.
10727 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10728 Revert to old implementation (i.e., before 2011-03-11).
10729
1305621b
YM
107302011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10731
10732 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10733 of scroll runs so as to avoid assigning disabled bogus rows and
10734 unnecessary graphics copy operations.
10735
8c9afb46
EZ
107362011-11-27 Eli Zaretskii <eliz@gnu.org>
10737
10738 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10739 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10740 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10741 (malloc, free, realloc, calloc): Redirect to e_* only when
10742 compiling Emacs.
10743
10744 * lisp.h (GCTYPEBITS): Move before first use.
10745 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10746 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10747 this macro definition.
10748
10749 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10750 _MSC_VER.
10751
54e9e3bf
JD
107522011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10753
6d5eb5b0
SM
10754 * gtkutil.c (xg_create_frame_widgets):
10755 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
10756 present with Gtk+ 2.0.
10757
83aca1cb
PE
107582011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10759
10760 * fileio.c (Finsert_file_contents): Undo previous change; see
10761 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10762
5b76caa4
PE
107632011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10764
10765 Rename locals to avoid shadowing.
10766 * fileio.c (Finsert_file_contents):
10767 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10768 * process.c (wait_reading_process_output):
10769 Rename inner 'proc' to 'p' to avoid shadowing.
10770 Indent for consistency with usual Emacs style.
10771
8c535114
EZ
107722011-11-25 Eli Zaretskii <eliz@gnu.org>
10773
10774 * xdisp.c (redisplay_window): If cursor row is not fully visible
10775 after recentering, and scroll-conservatively is set to a large
10776 number, scroll window by a few more lines to make the cursor fully
10777 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
10778 (start_display): Don't move to the next line if the display should
10779 start at a newline that is part of a display vector or an overlay
10780 string. (Bug#10119)
8c535114 10781
fa4fdb5c
JL
107822011-11-24 Juri Linkov <juri@jurta.org>
10783
10784 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10785 after the `MagickPingImage' call. (Bug#10112)
10786
90ec88df
CY
107872011-11-23 Chong Yidong <cyd@gnu.org>
10788
10789 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10790
56e2e794
MR
107912011-11-23 Martin Rudalics <rudalics@gmx.at>
10792
10793 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10794 making another buffer current. (Bug#10114)
10795
b6e64c41
GM
107962011-11-23 Glenn Morris <rgm@gnu.org>
10797
10798 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10799
6b21de18
CY
108002011-11-23 Chong Yidong <cyd@gnu.org>
10801
10802 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10803 using it (Bug#5984).
10804
b12cd789
EZ
108052011-11-22 Eli Zaretskii <eliz@gnu.org>
10806
10807 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10808 and header-lines, as they don't have one computed for them.
10809 (Bug#10098)
10810
10811 * .gdbinit (prow): Make displayed values more self-explaining.
10812 Add row's hash code.
10813
261b6fd4
LMI
108142011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10815
10816 * process.c (wait_reading_process_output): Fix asynchrounous
10817 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 10818 (wait_reading_process_output): Add comment and URL.
261b6fd4 10819
e7cfd277
JD
108202011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10821
10822 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10823
a9b9b7f5
CY
108242011-11-21 Chong Yidong <cyd@gnu.org>
10825
10826 * window.c (Fnext_window, Fprevious_window): Doc fix.
10827
b0d15b4f
SM
108282011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10829
10830 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10831
fe7a3057
JB
108322011-11-20 Juanma Barranquero <lekktu@gmail.com>
10833
10834 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10835
d2999b1a
MR
108362011-11-20 Martin Rudalics <rudalics@gmx.at>
10837
10838 * window.c (Fset_window_combination_limit): Rename argument
10839 STATUS to LIMIT.
10840 (Vwindow_combination_limit): Remove "status" from doc-string.
10841
d5ff9cd0
AS
108422011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10843
10844 * m/ibms390.h: Remove.
10845 * m/ibms390x.h: Don't include "ibms390.h".
10846
a5bb9bd3
SM
108472011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10848
10849 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10850 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10851
cd1181db
JB
108522011-11-20 Juanma Barranquero <lekktu@gmail.com>
10853
10854 * casetab.c (Fset_case_table):
10855 * charset.c (Fcharset_after): Fix typos.
10856
615a3b8d 108572011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 10858
17e845af
PE
10859 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10860 Otherwise, valgrind does not work on some platforms.
10861 Problem reported by Andreas Schwab in
6a0bf43d
PE
10862 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10863 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10864 is set, removing the need for VIRT_ADDRESS_VARIES.
10865 (PURE_P): Use a more-efficient implementation that needs just one
10866 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10867 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10868 to 4 (xorl, subq, cmpq, setbe).
10869 * alloc.c (pure): Always extern now, since that's the
10870 VIRT_ADDR_VARIES behavior.
10871 (PURE_POINTER_P): Use a single comparison, not two, for
10872 consistency with the new puresize.h.
10873 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10874 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10875 Remove VIRT_ADDR_VARIES no longer needed.
10876
f8fe6f96
EZ
108772011-11-19 Eli Zaretskii <eliz@gnu.org>
10878
10879 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10880 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10881 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10882 behave as if the cursor position were at the window margin.
10883
10884 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10885 and the cursor position is out of bounds, behave as if the cursor
10886 position were at the window margin. (Bug#10075)
10887
df05a53c
CY
108882011-11-18 Chong Yidong <cyd@gnu.org>
10889
10890 * window.c (Fwindow_combination_limit): Make first argument
10891 non-optional, since it is meaningless for live windows like the
10892 selected window.
61ccba97 10893
2071918e
DA
108942011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10895
10896 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10897
b50a28de
SM
108982011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10899
10900 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10901 (graft_intervals_into_buffer): Simplify.
10902
015137db
EZ
109032011-11-18 Eli Zaretskii <eliz@gnu.org>
10904
10905 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10906 hash values of the two rows.
10907 (copy_row_except_pointers): Preserve the used[] arrays and the
10908 hash values of the two rows. (Bug#10035)
68c95424 10909 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
10910
10911 * xdisp.c (row_hash): New function, body extracted from
10912 compute_line_metrics.
10913 (compute_line_metrics): Call row_hash, instead of computing the
10914 hash code inline.
10915
10916 * dispnew.c (verify_row_hash): Call row_hash for computing the
10917 hash code of a row, instead of duplicating code from xdisp.c.
10918
10919 * dispextern.h (row_hash): Add prototype.
10920
a2addb04
TH
109212011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10922
10923 * frame.c (delete_frame): Don't delete the terminal when the last
10924 X frame is closed if emacs is built with GTK toolkit.
10925
df85d315
JB
109262011-11-17 Juanma Barranquero <lekktu@gmail.com>
10927
10928 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10929
a0c2d0ae
MR
109302011-11-17 Martin Rudalics <rudalics@gmx.at>
10931
10932 * window.c (Vwindow_splits): Rename to
10933 Vwindow_combination_resize. Suggested by Juri Linkov.
10934 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10935 of Vwindow_splits.
10936
58179cce
JB
109372011-11-16 Juanma Barranquero <lekktu@gmail.com>
10938
7877f373
JB
10939 * nsfns.m (Fns_font_name):
10940 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 10941
b6f67890
MR
109422011-11-16 Martin Rudalics <rudalics@gmx.at>
10943
10944 * window.h (window): Rename slot "nest" to "combination_limit".
10945 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10946 (Fset_window_nest): Rename to Fset_window_combination_limit.
10947 (Vwindow_nest): Rename to Vwindow_combination_limit.
10948 (recombine_windows, make_parent_window, make_window)
10949 (Fsplit_window_internal, saved_window)
10950 (Fset_window_configuration, save_window_save): Rename all
10951 occurrences of window_nest to window_combination_limit.
10952
c7015153
JB
109532011-11-15 Juanma Barranquero <lekktu@gmail.com>
10954
10955 * image.c (imagemagick_load_image): Fix typo.
10956
322ad6ec
EZ
109572011-11-14 Eli Zaretskii <eliz@gnu.org>
10958
10959 * xdisp.c (display_line): Move the call to
10960 highlight_trailing_whitespace before the call to
10961 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
10962 faces of all the glyphs to compute ROW's hash value.
10963 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 10964
f067b8ec
JB
109652011-11-14 Juanma Barranquero <lekktu@gmail.com>
10966
10967 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10968 just return (bug#10044).
10969
1e5b2111
EZ
109702011-11-12 Eli Zaretskii <eliz@gnu.org>
10971
7ef3cbd5
EZ
10972 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10973 with user-defined heap size. Bump the default size of the temacs
10974 heap to 27MB, to avoid memory warning when running temacs.
10975 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10976
1e5b2111
EZ
10977 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10978 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
10979 (verify_row_hash) [XASSERTS]: New function.
10980 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10981 that the hash value of glyph rows is correct.
1e5b2111 10982
89d61221
MR
109832011-11-12 Martin Rudalics <rudalics@gmx.at>
10984
10985 * window.h (window): Remove splits slot.
10986 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10987 (Fdelete_other_windows_internal, make_parent_window)
10988 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10989 (Fset_window_configuration, save_window_save): Don't deal with
10990 split status of windows.
10991 (saved_window): Remove splits slot.
10992 (Vwindow_splits): Rewrite doc-string.
10993
97f18cc8
JD
109942011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10995
10996 * xfns.c (unwind_create_frame):
10997 * nsfns.m (unwind_create_frame):
10998 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10999 Vframe_list (Bug#9999).
11000
22a648b4
DA
110012011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11002
0b381c7e 11003 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 11004
659afede
KH
110052011-11-11 Kenichi Handa <handa@m17n.org>
11006
11007 * callproc.c (Fcall_process): Set the member dst_multibyte of
11008 process_coding.
11009
9ac0394b
KH
110102011-11-11 Johan Bockgård <bojohan@gnu.org>
11011
11012 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11013 avoid a crash (bug#9496).
11014
2fbdc249
CY
110152011-11-09 Chong Yidong <cyd@gnu.org>
11016
11017 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11018 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11019
ac6b1f81
PE
110202011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11021
11022 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11023
09db192c
PE
110242011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11025
11026 Avoid some portability problems by eschewing 'extern inline' functions.
11027 The trivial performance wins aren't worth the portability hassles; see
11028 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11029 et seq.
11030 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11031 (window_box_width, window_box_left, window_box_left_offset)
11032 (window_box_right, window_box_right_offset): Undo previous change,
11033 by removing the "extern"s.
11034 * intervals.c (adjust_intervals_for_insertion)
11035 (adjust_intervals_for_deletion): Undo previous change,
11036 making these static again.
11037 (offset_intervals, temp_set_point_both, temp_set_point)
11038 (copy_intervals_to_string): No longer inline.
11039 * xdisp.c (window_text_bottom_y, window_box_width)
11040 (window_box_height, window_box_left_offset)
11041 (window_box_right_offset, window_box_left, window_box_right)
11042 (window_box): No longer inline.
11043
105216ed
CY
110442011-11-08 Chong Yidong <cyd@gnu.org>
11045
11046 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
11047 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11048 Signal an error if not a live window.
105216ed
CY
11049 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11050 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11051
ae9e237f
JB
110522011-11-07 Juanma Barranquero <lekktu@gmail.com>
11053
11054 * lisp.h (syms_of_abbrev): Remove declaration.
11055 Reported by CHENG Gao <chenggao@royau.me>.
11056
c7aa8333
EZ
110572011-11-07 Eli Zaretskii <eliz@gnu.org>
11058
11059 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11060 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11061 of temacs in GUI mode.
11062
be7f5545
MR
110632011-11-07 Martin Rudalics <rudalics@gmx.at>
11064
11065 * window.h: Declare delete_all_child_windows instead of
11066 delete_all_subwindows.
11067 * window.c (Fwindow_nest, Fset_window_nest)
11068 (Fset_window_new_total, Fset_window_new_normal)
11069 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11070 (delete_all_subwindows): Rename to delete_all_child_windows.
11071 (Fdelete_other_windows_internal, Fset_window_configuration):
11072 Call delete_all_child_windows instead of delete_all_subwindows.
11073 * frame.c (delete_frame): Call delete_all_child_windows instead
11074 of delete_all_subwindows.
11075
ca78dc43
PE
110762011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11077
11078 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11079 This is also needed for porting to any host where GC_MARK_STACK is
11080 not GC_MAKE_GCPROS_NOOPS.
11081 (which_symbols): Use it.
11082
a0241d01
KH
110832011-11-07 Kenichi Handa <handa@m17n.org>
11084
11085 * coding.c (coding_set_destination): Check coding->src_pos only
11086 when coding->src_object is a buffer (bug#9910).
11087
11088 * process.c (send_process): Set the member src_multibyte of coding
11089 to 0 (bug#9911) when sending a unibyte text.
11090
11091 * callproc.c (Fcall_process): Set the member src_multibyte of
11092 process_coding to 0 (bug#9912).
11093
a64bfdfa 110942011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
11095
11096 * xmenu.c (cleanup_widget_value_tree): New function.
11097 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11098 calling free_menubar_widget_value_tree directly (Bug#9830).
11099
cb41b32a
PE
111002011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11101
11102 Fix some portability problems with 'inline'.
11103 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11104 (window_box_width, window_box_left, window_box_left_offset)
11105 (window_box_right, window_box_right_offset): Declare extern.
11106 Otherwise, these inline functions do not conform to C99 and
11107 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11108 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11109 * intervals.c (adjust_intervals_for_insertion)
11110 (adjust_intervals_for_deletion): Now extern, because otherwise the
11111 extern inline functions 'offset_intervals' couldn't refer to it.
11112 (static_offset_intervals): Remove.
11113 (offset_intervals): Rewrite using the old contents of
11114 static_offset_intervals. The old version didn't conform to C99
11115 because an extern inline function contained a reference to an
11116 identifier with static linkage.
11117
b7041366
AS
111182011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11119
11120 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11121 GC.
11122
88a37c4d
EZ
111232011-11-06 Eli Zaretskii <eliz@gnu.org>
11124
11125 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11126 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11127 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11128 return Qleft_to_right.
11129
49745b39
CY
111302011-11-06 Chong Yidong <cyd@gnu.org>
11131
11132 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11133 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11134 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11135 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11136 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11137 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11138 (Fwindow_vscroll): Doc fix.
11139 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11140 argument, since it makes no sense to pass a live window and for
11141 consistency with window-child.
11142
1f05cd82
CS
111432011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11144
11145 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11146 support MSVC.
11147
22610910
JR
111482011-11-05 Jason Rumney <jasonr@gnu.org>
11149
11150 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11151 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11152 fonts (Bug#6029).
11153 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11154 bitwise arithmetic preventing use of unicode-sip and non-truetype
11155 opentype fonts.
11156
a06776b2
EZ
111572011-11-05 Eli Zaretskii <eliz@gnu.org>
11158
3ad924ba
EZ
11159 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11160 "emacs"-only part.
11161
a06776b2
EZ
11162 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11163 initialization code to keep similarity to xfns.c after changes
11164 from 2011-11-05.
11165
c9e7db78
JD
111662011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11167
a97f8f3f
JD
11168 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11169 (unwind_create_frame): New function (Bug#9943).
11170 (Fx_create_frame): Restructure code to be more similar to the one in
11171 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11172 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11173 Move terminal->reference_count++ just before making the frame official
11174 (Bug#9943).
11175
11176 * nsterm.m (x_free_frame_resources): New function.
11177 (x_destroy_window): Move code to x_free_frame_resources.
11178
c9e7db78 11179 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
11180 (Fx_create_frame, x_create_tip_frame):
11181 Move terminal->reference_count++ just before making the frame
75f1671a 11182 official. Move initialization of image_cache_refcount and
c9e7db78
JD
11183 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11184
a6fc3b5c
EZ
111852011-11-05 Eli Zaretskii <eliz@gnu.org>
11186
11187 Support MSVC build with newer versions of Visual Studio.
11188 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11189 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11190 nt/gmake.defs.
11191
11192 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11193 which are not supported by MSVC.
11194 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11195 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11196 bitfields.
11197 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11198 types in bitfields.
11199 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11200
11201 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11202
58179cce 112032011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
11204
11205 Support MSVC build with newer versions of Visual Studio.
11206 * w32.c: Don't include w32api.h for MSVC.
11207 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11208
11209 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11210 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11211 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11212 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11213 e_* cousins.
11214 (alloca) [_MSC_VER]: Define to _alloca.
11215
11216 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11217
11218 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11219
a58c13ed
EZ
112202011-11-04 Eli Zaretskii <eliz@gnu.org>
11221
11222 * xdisp.c (note_mouse_highlight): If either of
11223 previous/next-single-property-change returns nil, treat that as
11224 the beginning or the end of the buffer. (Bug#9955)
11225
fe0b6370
JD
112262011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11227
a58c13ed 11228 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
11229 label is not null (Bug#9951).
11230 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11231 may be NULL.
11232
89bd5ee1
EZ
112332011-11-04 Eli Zaretskii <eliz@gnu.org>
11234
11235 * window.c (Fwindow_body_size): Mention in the doc string that the
11236 return value is in frame's canonical units. (Bug#9949)
11237
84c3edb9
EZ
112382011-11-03 Eli Zaretskii <eliz@gnu.org>
11239
4e2fb5c7
EZ
11240 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11241
84c3edb9 11242 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 11243 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 11244 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 11245
bc17a887
EZ
112462011-11-01 Eli Zaretskii <eliz@gnu.org>
11247
11248 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11249 Don't stop backward scan on the continuation glyph, even though
11250 its CHARPOS is positive.
6d5eb5b0
SM
11251 (mouse_face_from_buffer_pos, note_mouse_highlight):
11252 Rename cover_string to disp_string.
bc17a887 11253
4ee88440
MR
112542011-11-01 Martin Rudalics <rudalics@gmx.at>
11255
11256 * window.c (temp_output_buffer_show): Don't use
11257 Vtemp_buffer_show_specifiers.
11258 (Vtemp_buffer_show_specifiers): Remove unused variable.
11259
c2ff3c02
EZ
112602011-10-30 Eli Zaretskii <eliz@gnu.org>
11261
11262 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11263 past the beginning of the current glyph matrix.
11264
58179cce 112652011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
11266
11267 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11268 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11269 HAVE_GTK3 (Bug#9869).
b77a6a7f 11270
3b574623
JD
11271 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11272 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11273
b77a6a7f
JD
11274 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11275
11276 * xterm.c: Declare x_handle_net_wm_state to return int.
11277 (handle_one_xevent): Check if we are iconified but don't have
11278 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11279 (get_current_wm_state): Return non-zero if not hidden,
11280 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11281 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11282 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11283 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11284
196e41e4
PE
112852011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11286
11287 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11288 so that this new function doesn't get optimized away by a
11289 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11290
021f2e1a
AS
112912011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11292
11293 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11294
8b058d44
EZ
112952011-10-29 Eli Zaretskii <eliz@gnu.org>
11296
11297 Fix the `xbytecode' command.
11298 * .gdbinit (xprintbytestr): New command.
b50a28de 11299 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
11300 (xbytecode): Print the byte-code string as well.
11301
4452fb80
EZ
113022011-10-29 Kim Storm <storm@cua.dk>
11303
8b058d44
EZ
11304 * alloc.c (which_symbols): New function.
11305
21b72067
AS
113062011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11307
11308 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11309 line. (Bug#9903)
11310
83ed7b5c
GM
113112011-10-29 Glenn Morris <rgm@gnu.org>
11312
11313 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11314 Not clear what it was for, and it causes various bugs. (Bug#9839)
11315
5a7a728b
EZ
113162011-10-28 Eli Zaretskii <eliz@gnu.org>
11317
11318 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11319 possible random value that matches one of those tested as
11320 condition to clear the mouse face.
11321
d3d0842f
CY
113222011-10-28 Chong Yidong <cyd@gnu.org>
11323
11324 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11325
31b39d13
DN
113262011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11327
11328 * window.c (make_window): Initialize phys_cursor_on_p.
11329
9aba6043
SM
113302011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11331
11332 * lisp.h (struct Lisp_Symbol): Update comments.
11333
c20992f4
JB
113342011-10-28 Juanma Barranquero <lekktu@gmail.com>
11335
11336 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11337
db4f02f2
EZ
113382011-10-28 Eli Zaretskii <eliz@gnu.org>
11339
11340 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11341 <oslsachem@gmail.com> for helping to debug this.
11342
11343 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11344 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11345 (g_b_init_get_glyph_outline_w): New static variables.
11346 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11347 (GetGlyphOutlineW_Proc): New typedefs.
11348 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
11349 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11350 New functions.
11351 (w32font_open_internal, compute_metrics):
11352 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
11353 instead of calling the "wide" APIs directly.
11354
11355 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11356
11357 * w32.h (syms_of_w32font): Add prototype.
11358
87e68db4
JB
113592011-10-27 Juanma Barranquero <lekktu@gmail.com>
11360
11361 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11362 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11363 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11364 (Fmove_to_window_line): Doc fix.
11365
435c1d67
CY
113662011-10-27 Chong Yidong <cyd@gnu.org>
11367
11368 * process.c (make_process): Set gnutls_state to NULL.
11369
11370 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11371 non-NULL, regardless of GNUTLS_INITSTAGE.
11372 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11373 an error. Set process slots as soon as we allocate them.
11374
11375 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11376
9c6c6f49
CY
113772011-10-27 Chong Yidong <cyd@gnu.org>
11378
9aba6043
SM
11379 * gnutls.c (emacs_gnutls_deinit): New function.
11380 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
11381 (Fgnutls_deinit, Fgnutls_boot): Use it.
11382
11383 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11384 (deactivate_process): Call emacs_gnutls_deinit.
11385
657d08d3
JB
113862011-10-27 Juanma Barranquero <lekktu@gmail.com>
11387
11388 * image.c (x_create_x_image_and_pixmap):
11389 * w32.c (sys_rename, w32_delayed_load):
11390 * w32font.c (fill_in_logfont):
11391 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11392
5430d399
JB
113932011-10-26 Juanma Barranquero <lekktu@gmail.com>
11394
11395 * w32fns.c (w32_default_color_map): New function,
11396 extracted from Fw32_default_color_map.
a7ef684b 11397 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 11398
fe0055fa
PE
113992011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11400
11401 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11402
e6346438
SM
114032011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11404
11405 * keyboard.c (test_undefined): New function (bug#9751).
11406 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11407
e112cc37
ET
114082011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11409
11410 * sysdep.c (init_sys_modes): Fix the check for the controlling
11411 terminal (Bug#6649).
11412
7b5d6677
EZ
114132011-10-20 Eli Zaretskii <eliz@gnu.org>
11414
11415 * dispextern.h (struct bidi_it): New member next_en_type.
11416
11417 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11418 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11419 current character, check also for next_en_type being WEAK_EN.
11420 (bidi_resolve_weak): Don't enter the expensive loop if the current
11421 position is before next_en_pos. Record the bidi type of the first
11422 non-ET, non-BN character we find, in addition to its position.
11423 (bidi_level_of_next_char): Invalidate next_en_type when
11424 next_en_pos is over-stepped.
11425
7da0b018
PE
114262011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11427
11428 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11429 * editfns.c: Rewrite current-time-zone so that it invokes
11430 the equivalent of (format-time-string "%Z") to get the time zone name.
11431 This fixes a bug when the time zone name contains characters that
11432 need converting from the system time locale to Emacs internal format.
11433 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11434 that patch fixed format-time-string to do the conversion, but
11435 I forgot to fix current-time-zone.
11436 (format_time_string): New function, containing most of
11437 what Fformat_time_string used to contain.
11438 (Fformat_time_string): Rewrite in terms of format_time_string.
11439 This doesn't change this function's behavior.
11440 (current-time-zone): Rewrite to use format_time_string.
11441 This fixes the bug reported by Michael Schierl in
11442 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11443 Jason Rumney's 2007-06-07 change worked around this bug, but
11444 didn't fix it.
11445 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11446
8547b010
EZ
114472011-10-19 Eli Zaretskii <eliz@gnu.org>
11448
11449 * xdisp.c (start_display): If the character at POS is displayed
11450 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
11451 (try_window_reusing_current_matrix): If a line ends in a display
11452 vector or the next line starts in a display vector, continue
11453 redrawing the window even though the character position of
11454 start_row was reached.
8547b010
EZ
11455 (Bug#9771, part 2)
11456
4e948d15
CY
114572011-10-18 Chong Yidong <cyd@gnu.org>
11458
11459 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11460 with nobreak-char-display too.
11461
4787455f
EZ
114622011-10-18 Eli Zaretskii <eliz@gnu.org>
11463
11464 Fix part 3 of bug#9771.
11465 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11466 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11467 non-neutral characters if the current character is a paragraph
11468 separator (a.k.a. Newline). This avoids running the same
11469 expensive loop twice, once when we consume the preceding newline
11470 and the other time when the line actually needs to be displayed.
11471 Avoid the loop when we see neutrals on the base embedding level
11472 following a character whose directionality is the same as the
11473 paragraph's. This avoids running the expensive loop when a line
11474 ends in a long sequence of neutrals, like control characters.
11475 Add assertion against STRONG_AL type. Slightly rearrange code
11476 that determines the type of a neutral given the first non-neutral
11477 that follows it.
11478 (bidi_level_of_next_char): Set next_en_pos to zero when
11479 invalidating its info.
11480
2c91f553
EZ
114812011-10-17 Eli Zaretskii <eliz@gnu.org>
11482
11483 * xdisp.c (push_display_prop): Determine whether to record string
11484 or buffer position by IT->string, not by IT->method. Allow
11485 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
11486 (move_it_vertically_backward): Don't look for character position
11487 immediately after the newline when in a continuation line.
11488 (Bug#9771, part 1)
2c91f553 11489
c7b08b0d
MR
114902011-10-15 Martin Rudalics <rudalics@gmx.at>
11491
11492 * window.c (coordinates_in_window): Rewrite and delabelize
11493 vertical border check. (Bug#5357) (Bug#9618)
11494
6b02f655
SM
114952011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11496
11497 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11498 errors in XSetWindowBorder (bug#9310).
11499
81d40c92
DA
115002011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11501
11502 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11503 avoid crash when xmalloc overrun checking is enabled.
11504
d4172c3b
EZ
115052011-10-13 Eli Zaretskii <eliz@gnu.org>
11506
11507 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11508 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11509 cursor motion with <left> and <right> arrow keys.
11510
11511 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11512 some callers set that themselves.
11513
b00eea75
EZ
115142011-10-12 Eli Zaretskii <eliz@gnu.org>
11515
11516 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11517 display string and the previous row comes from the same string and
11518 is empty. (Bug#9739) (Bug#9738)
11519
8fe012c4
SM
115202011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11521
11522 * doc.c (get_doc_string): Encode file name (bug#9735).
11523
0074aef2
EZ
115242011-10-12 Eli Zaretskii <eliz@gnu.org>
11525
79beb178
EZ
11526 * bidi.c (bidi_level_of_next_char):
11527 * xdisp.c (get_visually_first_element): Remove old incorrect
11528 comments regarding the Unicode Line Separator character.
11529
0074aef2
EZ
11530 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11531
6e4b3fbe
DA
115322011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11533
11534 * alloc.c (Fgc_status): Do not access beyond zombies array
11535 boundary if nzombies > MAX_ZOMBIES.
11536 * alloc.c (dump_zombies): Add missing format specifier.
11537
0324f3af
PE
115382011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11539
b5525cac
PE
11540 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11541 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11542
0324f3af
PE
11543 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11544 Some packages use them to denote characters with modifiers.
11545
e9b5f888
AS
115462011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11547
11548 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11549 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11550 matching a pp-number. Rename parameter var to var1.
11551
127827c0
SM
115522011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11553
11554 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11555
c8fd3bd0
GM
115562011-10-08 Glenn Morris <rgm@gnu.org>
11557
11558 * callint.c (Fcall_interactively): Give a more explicit error for the
11559 'c' case with a non-character input. (Bug#8479)
11560
352ec8ff
EZ
115612011-10-08 Eli Zaretskii <eliz@gnu.org>
11562
03669ccb
EZ
11563 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11564 lines.
7061c986
EZ
11565 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11566 lines that are hscrolled on the left.
03669ccb 11567
352ec8ff
EZ
11568 * dispnew.c (buffer_posn_from_coords): Account for a possible
11569 presence of header-line. (Bug#4426)
11570
a66cfb1c
SM
115712011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11572
6b02f655
SM
11573 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11574 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 11575
7c5ee88e
PE
115762011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11577
11578 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11579 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11580 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11581 this makes Emacs dump core during garbage collection on rare
11582 occasions. sizeof is obviously inferior to offsetof here, so
11583 stick with offsetof.
11584 (GC_POINTER_ALIGNMENT): New macro.
11585 (mark_memory): Omit 3rd (offset) arg; caller changed.
11586 Don't assume EMACS_INT alignment is the same as pointer alignment.
11587
df1bbe5b
SM
115882011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11589
11590 * keyboard.c (read_key_sequence_remapped): New var.
11591 (read_key_sequence): Compute remapping in the right buffer.
11592 (command_loop_1): Use read_key_sequence's remapping directly.
11593
51553db6
SM
115942011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11595
32c1fffd
SM
11596 * dired.c (file_name_completion): Don't expand file name.
11597 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11598 before checking file name handler.
11599
51553db6
SM
11600 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11601 they've been requested explicitly (bug#9591).
11602
b6bd1599 116032011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
11604
11605 * keymap.c (Fsingle_key_description): Use make_specified_string
11606 instead of build_string to build string from push_key_description.
11607 (Bug#5193)
11608
f701dc2a
PE
116092011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11610
4222c55d
PE
11611 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11612 This fixes a Y2038 bug on 64-bit hosts.
11613 * buffer.c (reset_buffer):
11614 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11615 (Fclear_buffer_auto_save_failure):
11616 Use 0, not -1, to represent an unset failure time, since time_t
11617 might not be signed.
11618
f701dc2a
PE
11619 Remove dependency on glibc malloc internals.
11620 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11621 Move back here from lisp.h, but with their new implementations.
11622 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11623 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11624 * charset.c (charset_table_init): New static var.
11625 (syms_of_charset): Use it instead of xmalloc. This removes a
11626 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11627 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11628 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11629 Move back to alloc.c.
11630 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11631 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11632
9ceebf39
JD
116332011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11634
11635 * nsterm.m (windowDidResize): Call x_set_window_size only when
11636 ns_in_resize is true. Otherwise set pixelwidth/height and
11637 call change_frame_size (Bug#9628).
11638
cb993c58
PE
116392011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11640
3930c88b
PE
11641 Port --enable-checking=all to Fedora 14 x86-64.
11642 * charset.c (syms_of_charset): Also account for glibc malloc's
11643 internal overhead when calculating the initial malloc maximum.
11644
cb993c58
PE
11645 Port --enable-checking=all to Fedora 14 x86.
11646 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11647 Move to lisp.h.
11648 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11649 (overrun_check_realloc, overrun_check_free):
11650 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11651 That way, xmalloc returns a properly-aligned pointer even if
11652 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11653 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11654 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11655 into account when calculating the initial malloc maximum.
11656 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11657 Move here from alloc.c, so that charset.c can use it too.
11658 Properly align; the old code wasn't right for common 32-bit hosts
11659 when configured with --enable-checking=all.
11660 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11661 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11662
31bed486
EZ
116632011-09-29 Eli Zaretskii <eliz@gnu.org>
11664
04c70788 11665 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
11666 use EDOM.
11667
fbcaa2f3
EZ
116682011-09-28 Eli Zaretskii <eliz@gnu.org>
11669
11670 * xdisp.c (compute_display_string_end): If there's no display
11671 string at CHARPOS, return -1.
11672
11673 * bidi.c (bidi_fetch_char): When compute_display_string_end
11674 returns a negative value, treat the character as a normal
11675 character not covered by a display string. (Bug#9624)
11676
a239d4e9
JB
116772011-09-28 Juanma Barranquero <lekktu@gmail.com>
11678
11679 * lread.c (Fread_from_string): Fix typo in docstring.
11680
88652fd5
EZ
116812011-09-27 Eli Zaretskii <eliz@gnu.org>
11682
11683 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11684 newline, reseat the iterator instead of bidi-iterating there one
11685 character at a time. (Bug#9610)
32c1fffd
SM
11686 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11687 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 11688
ed497dd4
AS
116892011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11690
11691 * lread.c (readevalloop): Use correct code for NBSP.
11692 (read1): Likewise. (Bug#9608)
11693
b2bf61aa
MA
116942011-09-25 Michael Albinus <michael.albinus@gmx.de>
11695
11696 * dbusbind.c (Fdbus_register_signal): When service is not
11697 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11698
32bbb17c
GM
116992011-09-25 Glenn Morris <rgm@gnu.org>
11700
11701 * buffer.c (truncate-lines): Doc fix.
11702
94e0933e
CY
117032011-09-24 Chong Yidong <cyd@stupidchicken.com>
11704
11705 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11706 (Fset_window_next_buffers): Doc fix.
11707
cddde921
GM
117082011-09-24 Glenn Morris <rgm@gnu.org>
11709
11710 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11711
1260aef1
PE
117122011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11713
25b4bfa0
PE
11714 Fix minor problems found by static checking.
11715 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
11716 * indent.c (Fvertical_motion): Fix == vs = typo.
11717
e3cbd34b
EZ
117182011-09-24 Eli Zaretskii <eliz@gnu.org>
11719
a66cfb1c
SM
11720 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11721 Default value is now t. Doc fix.
6bf7006f 11722
e3cbd34b 11723 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 11724 logic when moving up, not only when moving down. Fix the
e3cbd34b 11725 confusing name and values of the it_overshoot_expected variable;
32c1fffd 11726 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
11727
11728 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11729 CHARPOS is covered by a display string which includes newlines.
11730 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11731 is covered by a display string with embedded newlines.
11732
a3de0cbd
MA
117332011-09-24 Michael Albinus <michael.albinus@gmx.de>
11734
11735 * dbusbind.c (Fdbus_register_signal): Add match rule to
11736 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
11737 (Fdbus_register_method, Vdbus_registered_objects_table):
11738 Fix docstring.
a3de0cbd 11739
b260039d
JM
117402011-09-24 Jim Meyering <meyering@redhat.com>
11741
32c1fffd 11742 do not ignore write error for any output size
b260039d
JM
11743 The previous change was incomplete.
11744 While it makes emacs --batch detect the vast majority of stdout
11745 write failures, errors were still ignored whenever the output size is
11746 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11747 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11748 && echo FAIL: ignored write error
11749 FAIL: ignored write error
11750 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11751 && echo FAIL: ignored write error
11752 FAIL: ignored write error
11753 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11754
8eca8a7c
AS
117552011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11756
11757 * emacs.c (Fkill_emacs): In noninteractive mode exit
11758 non-successfully if a write error occurred on stdout. (Bug#9574)
11759
3341db62
EZ
117602011-09-21 Eli Zaretskii <eliz@gnu.org>
11761
11762 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11763 the xassert test.
11764
11765 * dispextern.h (struct it): Update the comment documenting what
11766 can it->OBJECT be.
11767
8c203dbf
EZ
117682011-09-20 Eli Zaretskii <eliz@gnu.org>
11769
11770 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11771 a display string, extend search for cursor position to end of row.
11772 (find_row_edges): If the row ends in a newline from a display
11773 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11774 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
11775 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11776 non-empty line. Fixes confusing cursor motion with arrow keys at
11777 the beginning of a line that starts with whitespace.
8c203dbf 11778
a4824228
LMI
117792011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11780
11781 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11782 (bug#9493).
11783
33ed493b
CY
117842011-09-18 Chong Yidong <cyd@stupidchicken.com>
11785
11786 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11787 boolean (Bug#9154).
11788
56cd55c8
EZ
117892011-09-18 Eli Zaretskii <eliz@gnu.org>
11790
11791 * xdisp.c (display_line): Record maximum and minimum buffer
11792 positions even if no glyphs were produced (e.g., by a zero-width
11793 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11794 buffer positions that will be removed from the glyph row because
11795 they don't fit.
c02dcedf
EZ
11796 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11797 column is beyond frame width: don't subtract 1 "pixel" when
11798 computing width of the stretch.
3e62b7e0
EZ
11799 (reseat_at_next_visible_line_start): Undo the change made on
11800 2011-09-17 that saved paragraph information and restored it after
11801 the call to `reseat'. (Bug#9545)
56cd55c8 11802
5ed99d36 118032011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
11804
11805 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11806 and turn window cursor on if cleared (Bug#9415).
11807
5ed99d36 118082011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
11809
11810 * search.c (boyer_moore): Take unibyte characters from pattern
11811 literally. (Bug#9458)
11812
9bade7b2
EZ
118132011-09-18 Eli Zaretskii <eliz@gnu.org>
11814
11815 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11816
e5e9d610
PE
118172011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11818
87e4427a
PE
11819 Fix minor problem found by static checking.
11820 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11821 initialized, to pacify gcc -Wuninitialized.
11822
e5e9d610
PE
11823 * fileio.c: Report proper errno when syscall falls.
11824 (Finsert_file_contents): Save and restore errno,
11825 so that report_file_error outputs the correct diagnostic.
11826 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11827
a1674f0b
EZ
118282011-09-18 Eli Zaretskii <eliz@gnu.org>
11829
11830 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11831
fbfb6dd4
EZ
118322011-09-17 Eli Zaretskii <eliz@gnu.org>
11833
11834 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11835 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11836
bb187662
EZ
118372011-09-17 Eli Zaretskii <eliz@gnu.org>
11838
1137e8b8 11839 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 11840 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
11841
11842 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11843 (bidi_find_paragraph_start): Search back for paragraph beginning
11844 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11845 (bidi_move_to_visually_next): Only trigger paragraph-related
11846 computations when the last character is a newline or at EOB, not
11847 just any NEUTRAL_B. (Bug#9470)
11848
bb187662
EZ
11849 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11850 truncated lines if point is covered by a display string. (Bug#9524)
11851
2e621251
PE
118522011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11853
11854 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11855 (cons_to_x_long): New function.
11856 (lisp_data_to_selection_data): Use it. Correct the test for
11857 short-versus-long data; it was negated. Break out of vector
11858 loop, for efficiency, when a long datum is discovered.
11859
91a15bc6
SM
118602011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11861
11862 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11863
b41c3a35
EZ
118642011-09-16 Eli Zaretskii <eliz@gnu.org>
11865
11866 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11867 GCC PR/17406) by declaring this function with external scope.
11868
7812ba2d
PE
118692011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11870
11871 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11872 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11873
cf7edc2a
AS
118742011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11875
11876 * editfns.c (Fformat): Correctly handle text properties on "%%".
11877
bd01620e
EZ
118782011-09-15 Eli Zaretskii <eliz@gnu.org>
11879
11880 * xterm.c (x_draw_composite_glyph_string_foreground):
11881 * w32term.c (x_draw_composite_glyph_string_foreground):
11882 * term.c (encode_terminal_code):
11883 * composite.c (composition_update_it, get_composition_id):
11884 * xdisp.c (get_next_display_element)
11885 (fill_composite_glyph_string): Add comments about special meaning
11886 of TAB characters in a composition.
11887
a02719a3
PE
118882011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11889
11890 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
11891 This occurs when processing a multibyte format.
11892 Problem reported by Wolfgang Jenker.
a02719a3 11893
72589a3c
JB
118942011-09-15 Johan Bockgård <bojohan@gnu.org>
11895
11896 * xdisp.c (try_cursor_movement): Only check for exact match if
11897 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11898
1c14176c
PE
118992011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11900
11901 Remove unused external symbols.
11902 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11903 * xdisp.c (calc_pixel_width_or_height): Now static.
11904 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11905 * indent.c (check_display_width):
11906 * w32term.c: Fix comment to match code.
11907 * xterm.c, xterm.h (x_catching_errors): Remove.
11908
d2eea5b5
PE
119092011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11910
11911 * xselect.c: Use signed conversions more consistently (Bug#9498).
11912 (selection_data_to_lisp_data): Assume incoming selection data are
11913 signed integers, not unsigned. This is to be consistent with
11914 outgoing selection data, which was modified to use signed integers
11915 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11916 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11917 expects long, not unsigned long.
11918
46888499
EZ
119192011-09-14 Eli Zaretskii <eliz@gnu.org>
11920
11921 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11922 computation of loop end. Reported by Johan Bockgård
11923 <bojohan@gnu.org>.
11924
ef8ef9fb
CY
119252011-09-13 Chong Yidong <cyd@stupidchicken.com>
11926
11927 * frame.c (Fother_visible_frames_p): Function deleted.
11928
fa819fed
EZ
119292011-09-12 Eli Zaretskii <eliz@gnu.org>
11930
11931 * indent.c (compute_motion): Process display vector front to back
11932 rather than the other way around. (Bug#2496)
11933
2ba8e008
SM
119342011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11935
11936 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11937
20f53c69
CY
119382011-09-11 Chong Yidong <cyd@stupidchicken.com>
11939
11940 * minibuf.c (Fread_from_minibuffer): Doc fix.
11941
d562d7a4
EZ
119422011-09-11 Eli Zaretskii <eliz@gnu.org>
11943
11944 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11945 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11946
1c4d7f3d
LMI
119472011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11948
11949 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11950 value for non-existent files.
11951
b885bf36
EZ
119522011-09-11 Eli Zaretskii <eliz@gnu.org>
11953
11954 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11955 set its "size" to -1. This will set the modtime_size field of
11956 the corresponding buffer to -1, which is what
11957 verify-visited-file-modtime expects for files that do not exist.
11958 (Bug#9139)
11959
6612f0bf
PE
119602011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11961
11962 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11963 here ...
11964 * lisp.h: ... from here. push_key_description is no longer
11965 defined in keyboard.c, so its declaration should not be in
11966 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11967 logically belongs with push_key_description.
11968
dfb3f755
PE
119692011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11970
11971 * buffer.h: Include <sys/types.h> instead of <time.h>.
11972 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11973 Problem reported by Herbert J. Skuhra.
11974
3134906c
LMI
119752011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11976
11977 * xml.c (parse_region): Make the parsing work for
11978 non-comment-starting XML files again (bug#9144).
11979
8d903f4e
AS
119802011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11981
11982 * image.c (gif_load): Fix calculation of bottom and right corner.
11983 (Bug#9468)
11984
80ad64f4
EZ
119852011-09-10 Eli Zaretskii <eliz@gnu.org>
11986
11987 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11988 redisplay in small windows.
11989
208a048d
EZ
119902011-09-09 Eli Zaretskii <eliz@gnu.org>
11991
11992 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11993
9b1c252e
MR
119942011-09-08 Martin Rudalics <rudalics@gmx.at>
11995
11996 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11997 Operate on live windows only.
11998
2949f33b
JB
119992011-09-08 Juanma Barranquero <lekktu@gmail.com>
12000
12001 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12002
e08dcafd
EZ
120032011-09-07 Eli Zaretskii <eliz@gnu.org>
12004
12005 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12006 only under bidi iteration.
12007
115b96bd
JD
120082011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12009
12010 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12011
c8199d0f
PE
120122011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12013
12014 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12015 Without this fix, the command to link temacs failed due to an
12016 undefined symbol __builtin_isnan. This is because
12017 /usr/include/iso/math_c99.h #defines isnan(x) to
12018 __builtin_isnan(x), but the bundled gcc, which identifies itself
12019 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12020 a __builtin_isnan.
12021 * floatfns.c (isnan): #undef, and then #define to a clone of
12022 what's in data.c.
12023 (Fisnan): Always define, since it's always available now.
12024 (syms_of_floatfns): Always define isnan at the Lisp level.
12025
e39b275c 120262011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
12027
12028 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12029
b2db44d9 120302011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 12031
f4af5137 12032 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
12033 The previous code assumed that file offsets (off_t values) fit in
12034 EMACS_INT variables, which is not true on typical 32-bit hosts.
12035 The code messed up by falsely reporting buffer overflow in cases
12036 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12037 when "big" contains more than 2**29 bytes, even though this
12038 inserts just one byte and does not overflow the buffer.
12039 (Finsert_file_contents): Store file offsets as off_t
12040 values, not as EMACS_INT values. Check for overflow when
12041 converting between EMACS_INT and off_t. When checking for
12042 buffer overflow or for overlap, take the offsets into account.
12043 Don't use EMACS_INT for small values where int suffices.
12044 When checking for overlap, fix a typo: ZV was used where
12045 ZV_BYTE was intended.
12046 (Fwrite_region): Don't assume off_t fits into 'long'.
12047 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12048
ecfc0a49
MA
120492011-09-05 Michael Albinus <michael.albinus@gmx.de>
12050
12051 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12052
6511acf2 120532011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 12054
0999621a 12055 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
12056
12057 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 12058 (esprintf, exprintf, evxprintf): New functions.
62f19c19 12059 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 12060 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
12061 (modify_event_symbol): Do not assume that the length of
12062 name_alist_or_stem is safe to alloca and fits in int.
12063 (Fexecute_extended_command): Likewise for function name and binding.
12064 (Frecursion_depth): Wrap around reliably on integer overflow.
12065 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12066 since some callers pass EMACS_INT values.
12067 (Fsingle_key_description): Don't crash if symbol name contains more
12068 than MAX_ALLOCA bytes.
12069 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12070 (get_minibuffer): Arg is now EMACS_INT, not int.
12071 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 12072 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
12073 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12074
2be7d702
PE
12075 * dbusbind.c (signature_cat): New function.
12076 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
12077 Do not overrun buffer; instead, report string overflow.
12078
9d1df220
PE
12079 * dispnew.c (add_window_display_history): Don't overrun buffer.
12080 Truncate instead; this is OK since it's just a log.
12081
33ef5c64
PE
12082 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12083 even if the time zone offset is outlandishly large.
12084 Don't mishandle offset == INT_MIN.
12085
66c6fdd5
PE
12086 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12087 when creating daemon; the previous buffer-overflow check was incorrect.
12088
d749b01b
PE
12089 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12090 which has the guts of the old verror function.
12091
b5cd1905
PE
12092 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12093 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12094
6e1a67fb
PE
12095 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12096 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 12097 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 12098 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
12099 length of string rather than counting it via multiple sprintfs;
12100 that's simpler and more reliable.
c21721cc
PE
12101 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12102 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12103 sprintf, in case result does not fit in int.
12104
c57b67fc
PE
12105 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12106 (fontset_from_font): Print it.
12107
8a401434
PE
12108 * frame.c (tty_frame_count): Now printmax_t, not int.
12109 (make_terminal_frame, set_term_frame_name): Print it.
12110 (x_report_frame_params): In X, window IDs are unsigned long,
12111 not signed long, so print them as unsigned.
12112 (validate_x_resource_name): Check for implausibly long names,
12113 and don't assume name length fits in 'int'.
12114 (x_get_resource_string): Don't blindly alloca invocation name;
12115 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12116 not fit in int.
12117
6e1a67fb
PE
12118 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12119 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
12120 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12121
0df02bf3
PE
12122 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12123 Use esprintf, not sprintf, in case result does not fit in int.
12124
48e30793
PE
12125 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12126 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12127 it as a large positive number.
12128 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12129 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12130
a66ff6d8
PE
12131 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12132 in case result does not fit in int.
12133
aca216ff
PE
12134 * print.c (float_to_string): Detect width overflow more reliably.
12135 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12136 buffer overrun. Don't assume list length fits in 'int'. Treat
12137 print length of 0 as 0, not as infinity; to be consistent with other
12138 uses of print length in this function. Don't overflow print length
12139 index. Don't assume hash table size fits in 'long', or that
12140 vectorlike size fits in 'unsigned long'.
12141
31c286f7
PE
12142 * process.c (make_process): Use printmax_t, not int, to format
12143 process-name gensyms.
12144
55e5faa1
PE
12145 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12146
80f2e268
PE
12147 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12148 to avoid potential buffer overrun.
12149
670741ab
PE
12150 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12151 if X resource line is longer than 512 bytes.
12152
b7163a50
PE
12153 * xfns.c (x_window): Make sprintf buffer a bit bigger
12154 to avoid potential buffer overrun.
12155
ae58ff1f
PE
12156 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12157
c43c8a6a
PE
12158 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12159
3f8236f4
PE
121602011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12161
53e9fe90 12162 Integer overflow fixes for scrolling, etc.
6511acf2
PE
12163 Without these, Emacs silently mishandles large integers sometimes.
12164 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
12165 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12166
6511acf2
PE
12167 * xdisp.c (try_window_id): Check Emacs fixnum range before
12168 converting to 'int'.
806add1d 12169
6511acf2 12170 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
12171 Check that an Emacs fixnum is in range before assigning it to 'int'.
12172 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12173 values converted from Emacs fixnums.
12174 (Frecenter): Don't wrap around a line count if it is out of 'int'
12175 range; instead, treat it as an extreme value.
12176 (Fset_window_configuration, compare_window_configurations):
12177 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12178
6511acf2
PE
12179 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12180 that can exceed INT_MAX. Check that EMACS_INT value is in range
12181 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
12182 (match_limit): Don't assume that a fixnum can fit in 'int'.
12183
6511acf2 12184 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
12185 exceed INT_MAX.
12186
6511acf2 12187 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
12188 (Fvertical_motion): Don't wrap around LINES values that don't fit
12189 in 'int'. Instead, treat them as extreme values. This is good
12190 enough for windows, which can't have more than INT_MAX lines anyway.
12191
fcb901a7
LMI
121922011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12193
0f2f6b6d
LMI
12194 * Require libxml/parser.h to avoid compilation warning.
12195
fcb901a7
LMI
12196 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12197
12198 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12199 since this reportedly can destroy thread storage.
12200
6e20a0d4
CY
122012011-08-30 Chong Yidong <cyd@stupidchicken.com>
12202
12203 * syntax.c (find_defun_start): Update all cache variables if
12204 exiting early (Bug#9401).
12205
148ae00e
EZ
122062011-08-30 Eli Zaretskii <eliz@gnu.org>
12207
f6cfbd8f
EZ
12208 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12209
148ae00e
EZ
12210 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12211 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12212 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12213
12214 * term.c (tty_append_glyph): New function.
12215 (produce_stretch_glyph): Static function and its prototype deleted.
12216
a66cfb1c
SM
12217 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12218 Add prototypes.
148ae00e 12219
c4a07a4c
PE
122202011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12221
12222 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12223 when checking :margin (Bug#9390).
12224 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 12225 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
12226 so that the name doesn't mislead. All uses changed.
12227
6bc8cd65
JB
122282011-08-28 Johan Bockgård <bojohan@gnu.org>
12229
12230 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12231 set_tty_hooks.
12232
dca4927e
EZ
122332011-08-27 Eli Zaretskii <eliz@gnu.org>
12234
12235 * xdisp.c (move_it_to): Don't bail out early when reaching
12236 position beyond to_charpos, if we are scanning backwards.
12237 (move_it_vertically_backward): When DY == 0, make sure we get to
12238 the first character in the line after the newline.
12239
f2cad773
PE
122402011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12241
12242 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12243 (ccl_driver): Do not generate an out-of-range pointer.
12244 (Fccl_execute_on_string): Remove unnecessary check for
12245 integer overflow, noted by Stefan Monnier in
12246 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12247 Remove a FIXME that didn't need fixing.
12248 Simplify the newly-introduced buffer reallocation code.
12249
0cae2cdb
JB
122502011-08-27 Juanma Barranquero <lekktu@gmail.com>
12251
12252 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12253
5fc295a4 122542011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 12255
70c60eb2 12256 Integer and memory overflow issues (Bug#9196).
726e0ab1 12257
d31850da
PE
12258 * doc.c (get_doc_string): Rework so that
12259 get_doc_string_buffer_size is the actual buffer size, rather than
12260 being 1 less than the actual buffer size; this makes xpalloc more
12261 convenient.
12262
a69fbedb
PE
12263 * image.c (x_allocate_bitmap_record, cache_image):
12264 * xselect.c (Fx_register_dnd_atom):
12265 Simplify previous changes by using xpalloc.
12266
fe5c5d37
PE
12267 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12268 since either will do and ptrdiff_t is convenient with xpalloc.
12269
0065d054
PE
12270 * charset.c (charset_table_size)
12271 (struct charset_sort_data.priority): Now ptrdiff_t.
12272 (charset_compare): Don't overflow if priorities differ greatly.
12273 (Fsort_charsets): Don't assume list length fits in int.
12274 Check for size-calculation overflow when allocating sort data.
12275 (syms_of_charset): Allocate an initial charset table that is
12276 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12277
12278 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12279
12280 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12281 The actual value is always <= INT_MAX, and leaving it unsigned made
12282 overflow checking harder.
12283
12284 * dispextern.h (struct glyph_matrix.rows_allocated)
12285 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12286 with xpalloc. The values are still always <= INT_MAX.
12287
12288 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12289
12290 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12291 (SAFE_NALLOCA): New macro.
12292
12293 * region-cache.c (struct boundary.pos, find_cache_boundary)
12294 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12295 (set_cache_region, invalidate_region_cache)
12296 (revalidate_region_cache, know_region_cache, region_cache_forward)
12297 (region_cache_backward, pp_cache):
12298 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12299 so that ptrdiff_t * can be passed to xpalloc.
12300 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12301 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12302 (pp_cache): Don't assume cache_len fits in int.
12303 * region-cache.h: Adjust extern decls to match.
12304
12305 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12306 EMACS_INT, since either will do, for xpalloc.
12307
12308 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12309 (xnmalloc, xnrealloc, xpalloc): New functions.
12310
726e0ab1
PE
12311 * bidi.c (bidi_shelve_header_size): New constant.
12312 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12313 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12314
51f30bc5 12315 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
12316 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12317 (overlay_strings):
12318 Don't update size of array until after memory allocation succeeds,
12319 because xmalloc/xrealloc may not return.
0065d054
PE
12320 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12321 now that we have proper integer overflow checking.
12322 (record_overlay_string, overlay_strings): Catch overflows when
12323 calculating size of overlay_str_buf.
726e0ab1 12324
0065d054
PE
12325 * callproc.c (Fcall_process): Check for size overflow when
12326 calculating size of args2.
12327 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12328 Normally we prefer signed values, but sticking with ptrdiff_t would
12329 require adding more-complicated checks.
726e0ab1
PE
12330
12331 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12332 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12333 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 12334 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
12335
12336 * character.c (Fstring): Check for size-calculation overflow.
12337
12338 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12339 unnecessary integer overflow. Check for size overflow.
12340 (encode_coding_object): Don't update size until xmalloc succeeds.
12341
12342 * composite.c (get_composition_id): Check for overflow in glyph
12343 length calculations.
12344
12345 Integer and memory overflow fixes for display code.
12346 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12347 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12348 (scrolling_window): Check for overflow in size calculations.
12349 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12350 Don't assume glyph table len fits in int.
12351 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12352 (row_table_size): Now ptrdiff_t, not int.
12353 (scrolling_window): Avoid overflow in size calculations.
12354 Don't update size until allocation succeeds.
12355 * fns.c (concat): Check for overflow in size calculations.
12356 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12357 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12358 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12359
12360 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12361 (get_doc_string): Check for size calculation overflow.
12362 Don't update size until allocation succeeds.
12363 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12364 EMACS_INT, where ptrdiff_t will do.
12365 (Fsubstitute_command_keys): Check for string overflow.
12366
12367 * editfns.c (set_time_zone_rule): Don't assume environment length
12368 fits in int.
12369 (message_length): Now ptrdiff_t, not int.
12370 (Fmessage_box): Don't update size until allocation succeeds.
12371 Don't assume message length fits in int.
12372 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12373
0065d054
PE
12374 * emacs.c (main): Do not reallocate argv, since there is a null at
12375 the end that can be overwritten, and this way there's no need to
12376 worry about size-calculation overflow.
12377 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
12378
12379 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12380 alloc succeeds.
12381 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12382
12383 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12384 (x_set_scroll_bar_width, x_figure_window_size):
12385 Check for integer overflow.
12386 (x_set_alpha): Do not assume XINT fits in int.
12387
12388 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12389 This is for the members text_lines, text_cols, total_lines, total_cols,
12390 where the system imposes an 'int' limit.
12391
12392 * fringe.c (Fdefine_fringe_bitmap):
12393 Don't update size until alloc works.
12394
12395 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12396 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12397
12398 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12399 Check for size-calculation overflow.
12400 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12401 do, as we prefer signed integers.
12402 (id_to_widget.max_size, id_to_widget.used)
12403 (xg_store_widget_in_map, xg_remove_widget_from_map)
12404 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12405 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12406 Use and return ptrdiff_t, not int.
12407 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12408 * gtkutil.h: Change prototypes to match the above.
12409
12410 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12411 are duplicate now that they've been promoted to lisp.h.
12412 (x_allocate_bitmap_record, x_alloc_image_color)
12413 (make_image_cache, cache_image, xpm_load):
12414 Don't update size until alloc is done.
12415 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12416 (x_detect_edges):
3256efce 12417 Check for size calculation overflow.
726e0ab1
PE
12418 (ct_colors_allocated_max): New constant.
12419 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12420 overflow.
3256efce 12421
726e0ab1
PE
12422 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12423 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12424 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12425 Use ptrdiff_t, not int, to count maps.
12426 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
12427 calculations. Don't update size until allocation succeeds.
12428 Redo calculations to avoid overflow.
726e0ab1
PE
12429 * keyboard.h: Change prototypes to match the above.
12430
12431 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12432 to count maps.
12433 (current_minor_maps): Check for size calculation overflow.
12434 * keymap.h: Change prototypes to match the above.
12435
12436 * lread.c (read1, init_obarray): Don't update size until alloc done.
12437
12438 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12439 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12440
726e0ab1
PE
12441 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12442 Now ptrdiff_t, not int.
12443 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12444 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12445
12446 * process.c (Fnetwork_interface_list): Check for overflow
12447 in size calculation.
12448
12449 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12450
12451 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12452 overflow. Don't bother calling xmalloc when xrealloc will do.
12453
12454 * search.c (Freplace_match): Check for size calculation overflow.
12455 (Fset_match_data): Don't assume list lengths fit in 'int'.
12456
12457 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12458 for command line length. Do not attempt to address one before the
12459 beginning of an array, as that's not portable.
12460
12461 * term.c (max_frame_lines): Remove; unused.
12462 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12463 not int.
12464 (encode_terminal_code, calculate_costs): Check for size
12465 calculation overflow.
12466 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12467 table lengths and related sizes. Don't update size until alloc
12468 done. Redo calculations to avoid overflow.
12469 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12470
12471 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12472 subtracting pointers.
12473 (gobble_line): Check for overflow more carefully. Don't update size
12474 until alloc done.
12475
12476 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12477 Don't update size until alloc done.
12478 Redo size calculations to avoid overflow.
12479 Check for size calculation overflow.
0065d054 12480 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
12481
12482 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12483 Use ptrdiff_t, not int, for sizes.
12484 (store_mode_line_noprop_char): Don't update size until alloc done.
12485
0065d054
PE
12486 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12487 Use ptrdiff_t, not int, for sizes.
12488 (Finternal_make_lisp_face, cache_face):
12489 Check for size calculation overflow.
12490 (cache_face): Treat size calculation overflows as if they were
12491 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
12492
12493 * xfns.c (x_encode_text, x_set_name_internal)
12494 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12495 sizes, since they can exceed INT_MAX in size. Check for size
12496 calculation overflow.
12497
0065d054
PE
12498 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12499 (xg_select): Check for size calculation overflow.
726e0ab1
PE
12500 Don't update size until alloc done.
12501
0065d054 12502 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 12503 as sprintf is limited to int lengths.
1d526e2f 12504
252c5ee1
PE
12505 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12506 (X_LONG_MIN): New macros.
864d7ce7
PE
12507 Use them to make the following changes clearer.
12508 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12509 This change doesn't affect the value now, but it may help remind
12510 future maintainers not to raise the value too much later.
12511 (SELECTION_QUANTUM): Remove, replacing with ...
12512 (selection_quantum): ... new function, which avoids overflow.
12513 All uses changed.
12514 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12515 assumption that selection length fits in 'int'.
12516 (x_reply_selection_request, x_handle_selection_request)
12517 (x_get_window_property, receive_incremental_selection)
12518 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12519 (lisp_data_to_selection_data, clean_local_selection_data):
12520 Use ptrdiff_t, not int, to record length of selection.
12521 (x_reply_selection_request, x_get_window_property)
12522 (receive_incremental_selection, x_property_data_to_lisp):
12523 Redo calculations to avoid overflow.
12524 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 12525 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
12526 something.
12527 (x_get_window_property, receive_incremental_selection)
12528 (lisp_data_to_selection_data, x_property_data_to_lisp):
12529 Check for size-calculation overflow.
12530 (x_get_window_property, receive_incremental_selection)
12531 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12532 Don't store size until memory allocation succeeds.
12533 (x_get_window_property): Plug memory leak on memory exhaustion.
12534 Don't double-block input; malloc is safe here. Don't assume 2**34
12535 - 4 fits in unsigned long. Add an xassert to check
12536 XGetWindowProperty overflow. Be more careful about overflow
12537 calculations, and distinguish size from memory overflow better.
12538 (receive_incremental_selection): When tracing, don't assume
12539 unsigned int is less than INT_MAX.
12540 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12541 harmful) conversions of unsigned short to int.
12542 (lisp_data_to_selection_data): Don't assume that integers
12543 in the range -65535 through -1 fit in an X unsigned short.
12544 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12545 result parameters unless successful. Rely on cons_to_unsigned
12546 to report problems with elements; the old code wasn't right anyway.
12547 (x_check_property_data): Check for int overflow; we cannot use
12548 a wider type due to X limits.
12549 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12550
726e0ab1 12551 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 12552
0065d054
PE
12553 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12554 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
12555 (x_color_cells): Don't store size until memory allocation succeeds.
12556 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 12557 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
12558 (x_term_init): Don't assume length fits in int (sprintf is limited
12559 to int size).
bc18e09d 12560
ebfa62c0
PE
12561 Use ptrdiff_t for composition IDs.
12562 * character.c (lisp_string_width):
12563 * composite.c (composition_table_size, n_compositions)
12564 (get_composition_id, composition_gstring_from_id):
12565 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12566 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12567 * window.c (Frecenter):
12568 Use ptrdiff_t, not int, for composition IDs.
12569 * composite.c (get_composition_id): Check for integer overflow.
12570 * composite.h: Adjust prototypes to match the above changes.
12571
d3411f89
PE
12572 Use ptrdiff_t for hash table indexes.
12573 * category.c (hash_get_category_set):
12574 * ccl.c (ccl_driver):
12575 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12576 * coding.c (coding_system_charset_list, detect_coding_system):
12577 * coding.h (struct coding_system.id):
12578 * composite.c (get_composition_id, gstring_lookup_cache):
12579 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12580 * image.c (xpm_get_color_table_h):
12581 * lisp.h (hash_lookup, hash_put):
12582 * minibuf.c (Ftest_completion):
12583 Use ptrdiff_t for hash table indexes, not int (which is too
12584 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12585 32-bit --with-wide-int hosts).
12586
e097a6fa
PE
12587 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12588 Add a FIXME comment about memory leaks.
12589 (syms_of_charset): Don't assume xmalloc returns.
12590
5637687f
PE
12591 Don't assume that stated character widths fit in int.
12592 * character.c (Fchar_width, c_string_width, lisp_string_width):
12593 * character.h (CHAR_WIDTH):
12594 * indent.c (MULTIBYTE_BYTES_WIDTH):
12595 Use sanitize_char_width to avoid undefined and/or bad behavior
12596 with outlandish widths.
a66cfb1c 12597 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
12598 now that we have two such functions. All uses changed.
12599 (sanitize_char_width): New inline function.
12600
a2271ba2
PE
12601 Don't assume that tab-width fits in int.
12602 * character.h (sanitize_width): New inline function.
12603 (SANE_TAB_WIDTH): New macro.
12604 (ASCII_CHAR_WIDTH): Use it.
12605 * indent.c (sane_tab_width): Remove. All uses replaced by
12606 SANE_TAB_WIDTH (current_buffer).
12607 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12608
18c52557
PE
12609 * fileio.c: Integer overflow issues with file modes.
12610 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12611
caeeedc1
PE
12612 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12613 Remove unreachable code.
12614 (read_hex, load_charset_map_from_file): Check for integer overflow.
12615
6df6ae42 12616 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
12617 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12618 (x_send_scroll_bar_event): Likewise. Check that the size does not
12619 exceed limits imposed by XClientMessageEvent, as well as the usual
12620 ptrdiff_t and size_t limits.
12621
b13995db
PE
12622 * keyboard.c: Overflow, signedness and related fixes.
12623 (make_lispy_movement): Use same integer type in forward decl
12624 that is used in the definition.
12625 (read_key_sequence, keyremap_step):
12626 Change bufsize argument back to int, undoing my 2011-03-30 change.
12627 We prefer signed types, and int is wide enough here.
12628 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12629 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12630 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12631 length, not size_t. Use ptrdiff_t for index, not int.
12632 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12633 possibility of integer overflow.
12634
13464394
PE
12635 Overflow, signedness and related fixes for images.
12636
12637 * dispextern.h (struct it.stack[0].u.image.image_id)
12638 (struct_it.image_id, struct image.id, struct image_cache.size)
12639 (struct image_cache.used, struct image_cache.ref_count):
12640 * gtkutil.c (update_frame_tool_bar):
12641 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12642 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12643 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12644 * nsmenu.m (update_frame_tool_bar):
12645 * xdisp.c (calc_pixel_width_or_height):
12646 * xfns.c (image_cache_refcount):
12647 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12648 on typical 64-bit hosts.
12649
12650 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12651 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12652 Omit unnecessary casts to int.
12653 (parse_image_spec): Check that integers fall into 'int' range
12654 when the callers expect that.
12655 (image_ascent): Redo ascent calculation to avoid int overflow.
12656 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12657 (lookup_image): Remove unnecessary tests.
12658 (xbm_image_p): Locals are now of int, not EMACS_INT,
12659 since parse_image_check makes sure they fit into int.
12660 (png_load, gif_load, svg_load_image):
12661 Prefer int to unsigned where either will do.
12662 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
12663 old tiff_error_handler and tiff_warning_handler.
12664 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
12665 stack buffer overflows. It uses only the features of vsnprintf
12666 that are common to both POSIX and native Microsoft.
12667 (tiff_error_handler, tiff_warning_handler): Use it.
12668 (tiff_load, gif_load, imagemagick_load_image):
12669 Don't assume :index value fits in 'int'.
12670 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12671 (imagemagick_load_image): Check that crop parameters fit into
12672 the integer types that MagickCropImage accepts. Don't assume
12673 Vimagemagick_render_type has a nonnegative value. Don't assume
12674 size_t fits in 'long'.
12675 (gs_load): Use printmax_t to print the widest integers possible.
12676 Check for integer overflow when computing image height and width.
12677
c11821d4
EZ
126782011-08-26 Eli Zaretskii <eliz@gnu.org>
12679
12680 * xdisp.c (redisplay_window): Don't force window start if point
12681 will be invisible in the resulting window. (Bug#9324)
12682
0c95fcf7
EZ
126832011-08-25 Eli Zaretskii <eliz@gnu.org>
12684
12685 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12686 the display spec is of the form `(space ...)'.
12687 (handle_display_spec): Return the value returned by
12688 handle_single_display_spec, not just 1 or zero.
12689 (handle_single_display_spec): If the display spec is of the form
12690 `(space ...)', and specifies display in the text area, return 2
12691 rather than 1.
fee65a97 12692 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
12693 accurately, and prefer exact match for point under bidi.
12694 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
12695
12696 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12697 into disp_prop; all users changed.
12698
12699 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12700 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12701 for the text covered by the display property.
12702
e4ed06f1
CY
127032011-08-25 Chong Yidong <cyd@stupidchicken.com>
12704
12705 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12706 Change return value to nil.
12707 (Frecord_buffer): Delete unused function.
12708
f67cdd7f
EZ
127092011-08-24 Eli Zaretskii <eliz@gnu.org>
12710
5980d4c6
EZ
12711 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12712 buffers, return left-to-right.
8610fe8b
EZ
12713 (set_cursor_from_row): Consider candidate row a win if its glyph
12714 represents a newline and point is on that newline. Fixes cursor
12715 positioning on the newline at EOL of R2L text within L2R
12716 paragraph, and vice versa.
12717 (try_cursor_movement): Check continued rows, in addition to
12718 continuation rows. Fixes unwarranted scroll when point enters a
12719 continued line of R2L text within an L2R paragraph, or vice versa.
12720 (cursor_row_p): Consider the case of point being equal to
12721 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12722 from the end of a short line to the beginning of a continued line
12723 of R2L text within L2R paragraph.
12724 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12725 composed characters.
5980d4c6 12726
f67cdd7f
EZ
12727 * bidi.c (bidi_check_type): Use xassert.
12728 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12729 members.
12730
bca633fb
EZ
127312011-08-23 Eli Zaretskii <eliz@gnu.org>
12732
12733 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12734 a character.
12735
4a5885a7
CY
127362011-08-23 Chong Yidong <cyd@stupidchicken.com>
12737
12738 * nsfont.m (ns_otf_to_script): Fix typo.
12739
0902a04e
KH
127402011-08-22 Kenichi Handa <handa@m17n.org>
12741
12742 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12743 extra slot even if the purpose is char-code-property-table.
12744
1a2e6670
EZ
127452011-08-23 Eli Zaretskii <eliz@gnu.org>
12746
8ddde651
EZ
12747 * xdisp.c (redisplay_window): When computing centering_position,
12748 account for the height of the header line. (Bug#8874)
12749
425cc014
EZ
12750 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12751 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12752 candidate is selected by the mouse, and that candidate has a
12753 composed character under the mouse.
12754
1a2e6670
EZ
12755 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12756 coordinates reported by pos-visible-in-window-p for a composed
12757 character in column zero.
12758
8b76d6f8
SM
127592011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12760
12761 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12762
dac347dd
EZ
127632011-08-22 Eli Zaretskii <eliz@gnu.org>
12764
12765 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12766 consider it a hit if to_charpos is anywhere in the range of the
12767 composed buffer positions.
12768
e013fb34
CY
127692011-08-22 Chong Yidong <cyd@stupidchicken.com>
12770
12771 * image.c (gif_load): Don't assume that each subimage has the same
12772 dimensions as the base image. Handle disposal method that is
12773 "undefined" by the gif spec (Bug#9335).
12774
bd1ba3e8
CY
127752011-08-20 Chong Yidong <cyd@stupidchicken.com>
12776
12777 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 12778 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 12779
54a1215b
EZ
127802011-08-19 Eli Zaretskii <eliz@gnu.org>
12781
823564e5
EZ
12782 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12783 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12784 from an Org mode buffer to a Speedbar frame.
12785
54a1215b
EZ
12786 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12787 a composition, take its buffer position from IT->cmp_it.charpos.
12788 Fixes cursor positioning at the beginning of a line that begins
12789 with a composed character.
12790
9778ebcc
EZ
127912011-08-18 Eli Zaretskii <eliz@gnu.org>
12792
0be6ee06
EZ
12793 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12794 character bidirectional type, use STRONG_L instead. Fixes crashes
12795 in a buffer produced by `describe-categories'.
12796
9778ebcc
EZ
12797 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12798 members before the level stack, so they would be saved and
12799 restored when copying iterator state. Fixes incorrect reordering
12800 around TABs covered by display properties.
12801
156bffbe
AS
128022011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12803
6b02f655 12804 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 12805
72ad093b
CY
128062011-08-17 Chong Yidong <cyd@stupidchicken.com>
12807
12808 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
12809 (internal_condition_case_2, internal_condition_case_n):
12810 Remove unnecessary aborts (Bug#9081).
72ad093b 12811
35774242
EZ
128122011-08-17 Eli Zaretskii <eliz@gnu.org>
12813
12814 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12815 has no `load' handler, try opening the file locally. (Bug#9311)
12816
db76dd85
KB
128172011-08-16 Ken Brown <kbrown@cornell.edu>
12818
12819 * gmalloc.c: Expand comment.
12820
b215eee5
EZ
128212011-08-16 Eli Zaretskii <eliz@gnu.org>
12822
12823 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12824 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12825
a4579d33
KB
128262011-08-16 Ken Brown <kbrown@cornell.edu>
12827
12828 Fix memory allocation problems in Cygwin build (Bug#9273).
12829
12830 * unexcw.c ( __malloc_initialized): Declare external variable.
12831 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12832
8b76d6f8
SM
12833 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12834 New variables.
a4579d33
KB
12835 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12836 dumped emacs.
12837 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12838 in the static heap.
12839 [CYGWIN] (special_realloc): New function.
12840 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12841 requests to realloc storage in the static heap.
12842
3ebec551
PE
128432011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12844
12845 * bidi.c (bidi_initialize): Remove unused local.
12846
9fd8be00
EZ
128472011-08-15 Eli Zaretskii <eliz@gnu.org>
12848
6b02f655
SM
12849 * bidimirror.h:
12850 * biditype.h: Remove file.
12851 * makefile.w32-in ($(BLD)/bidi.$(O)):
12852 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
12853
12854 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12855
12856 * chartab.c: Improve commentary for the uniprop_table API.
12857
32413314
EZ
12858 * bidi.c (bidi_paragraph_init): Support zero value of
12859 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
12860 (bidi_initialize): Use uniprop_table instead of including
12861 biditype.h and bidimirror.h.
32413314 12862
9fd8be00
EZ
12863 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12864 coordinates of the iterator when restoring from ppos_it.
12865 (Bug#9296)
12866
5cf2b69b
KH
128672011-08-14 Kenichi Handa <handa@m17n.org>
12868
12869 * process.c (create_process): Call setup_process_coding_systems
72ad093b 12870 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 12871
daf17d00
EZ
128722011-08-14 Eli Zaretskii <eliz@gnu.org>
12873
12874 * xdisp.c (move_it_in_display_line_to): Don't invoke
12875 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12876 ppos_it. Fixes vertical cursor motion when line beginning is
12877 covered by an image. (Bug#9296)
12878
08e3161a
JD
128792011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12880
12881 * nsterm.h (ns_run_ascript): Declare.
12882 (NSAPP_DATA2_RUNASSCRIPT): Define.
12883
12884 * nsfns.m (as_script, as_result, as_status): New static variables.
12885 (ns_run_ascript): New function.
5e617bc2 12886 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
12887 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12888 the event loop. Get status from as_status (Bug#7276).
12889
12890 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12891 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12892 the event loop (Bug#7276).
12893
a3720aa2
AS
128942011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12895
12896 * gnutls.c (QCgnutls_bootprop_priority)
12897 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12898 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12899 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12900 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12901 (QCgnutls_bootprop_verify_hostname_error)
12902 (QCgnutls_bootprop_callbacks_verify): Rename from
12903 Qgnutls_bootprop_..., all uses changed.
12904
12905 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12906 uses changed.
12907
0a0d27fb
PE
129082011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12909
19d5c50c
PE
12910 * xfaces.c (Qframe_set_background_mode): Now static.
12911 * dispextern.h (Qframe_set_background_mode): Remove decl.
12912
0a0d27fb
PE
12913 * process.c (Fnetwork_interface_info): Declare local only if needed.
12914
377538cb
JD
129152011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12916
12917 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12918 (Fnetwork_interface_list): Allocate in increments of bytes instead
12919 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12920 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12921 sockaddr.
12922 (struct ifflag_def): notrailers is smart on OSX.
12923 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12924 Get hardware address with getifaddrs if available.
12925
08fff70c
EZ
129262011-08-12 Eli Zaretskii <eliz@gnu.org>
12927
12928 * xdisp.c (iterate_out_of_display_property): xassert that
12929 IT->position is set to within IT->object's boundaries. Break from
12930 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
12931 when IT->position is set up wrongly due to some bug.
12932 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
12933 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12934 entry. Force push_it to save on the stack the current
12935 buffer/string position, to be restored by pop_it. Fix flags in
12936 the iterator structure wrt the object coming from a display
12937 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12938 properties. (Bug#9284)
12939
7be1c708 129402011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 12941
7be1c708
CY
12942 * fontset.c (fontset_get_font_group): Add proper type checks.
12943 (Bug#9172)
aac0c6e3 12944
7be1c708 129452011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 12946
7be1c708
CY
12947 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12948 and LC_VERSION_MIN_MACOSX.
12949 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12950 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 12951
97bb72a6
EZ
129522011-08-08 Eli Zaretskii <eliz@gnu.org>
12953
12954 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
12955 no-display-properties-and-no-overlays under bidi display.
12956 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 12957 properties and overlays.
97bb72a6 12958
d5617611
CY
129592011-08-08 Chong Yidong <cyd@stupidchicken.com>
12960
37e11a63
CY
12961 * editfns.c (Fset_time_zone_rule): Document relationship with the
12962 setenv function.
12963
d5617611
CY
12964 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12965 the font entity extracted from the cache (Bug#8109).
12966
58872834
CY
129672011-08-07 Chong Yidong <cyd@stupidchicken.com>
12968
12969 * composite.c (autocmp_chars): Don't reset point. That is done by
12970 restore_point_unwind (Bug#5984).
12971
75bfc667
JL
129722011-08-07 Juri Linkov <juri@jurta.org>
12973
12974 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12975 to show the arg `TIME' instead of `TIMEVAL'.
12976
d1410150
EZ
129772011-08-06 Eli Zaretskii <eliz@gnu.org>
12978
12979 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12980 display property strides EOL and includes a newline, as in
12981 longlines-mode. (Bug#9254)
75b771e4
EZ
12982 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12983 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
12984
12985 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12986 is non-zero, even if the data buffer is NULL. Fixes a crash in
12987 vertical-motion with longlines-mode. (Bug#9254)
12988
35928349
EZ
129892011-08-05 Eli Zaretskii <eliz@gnu.org>
12990
ec7cc85b
EZ
12991 * bidi.c <bidi_cache_total_alloc>: Now static.
12992 (bidi_initialize): Initialize bidi_cache_total_alloc.
12993
8b76d6f8 12994 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
12995 cache. (Bug#9221)
12996
12997 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12998 amount allocated this far in `bidi_cache_total_alloc'.
12999 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13000 non-zero, only free the data buffer without restoring the cache
13001 contents. All callers changed.
13002
13003 * dispextern.h (bidi_unshelve_cache): Update prototype.
13004
13005 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13006 (move_it_in_display_line, move_it_to)
13007 (move_it_vertically_backward, move_it_by_lines): Replace the call
13008 to xfree to an equivalent call to bidi_unshelve_cache.
13009 (move_it_in_display_line_to): Fix logic of returning
412b6358 13010 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 13011
e2e2423b
EZ
130122011-08-05 Eli Zaretskii <eliz@gnu.org>
13013
13014 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13015 came from a string character with a `cursor' property. (Bug#9229)
13016
ae9e757a
JD
130172011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13018
13019 * Makefile.in (LIB_PTHREAD): New variable.
13020 (LIBES): Add LIB_PTHREAD (Bug#9216).
13021
13022 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13023 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13024
213bd7f2
AS
130252011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13026
6b02f655 13027 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 13028
99aaf75f
JD
130292011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13030
13031 * xterm.c (x_find_topmost_parent): New function.
13032 (x_set_frame_alpha): Find topmost parent window with
13033 x_find_topmost_parent and set the property there also (bug#9181).
13034 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13035
c74e9d86
PE
130362011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13037
13038 * callproc.c (Fcall_process): Avoid vfork clobbering
13039 the local vars buffer, coding_systems, current_dir.
13040
640c8776
SM
130412011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13042
13043 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13044
f26d0e4c
PE
130452011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13046
8a10d76c
PE
13047 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13048 so that it is not optimized away.
13049
f26d0e4c
PE
13050 * xdisp.c (compute_display_string_pos): Remove unused local.
13051
55439c61
EZ
130522011-08-02 Eli Zaretskii <eliz@gnu.org>
13053
13054 Fix slow cursor motion and scrolling in large buffers with
13055 selective display, like Org Mode buffers. (Bug#9218)
13056
13057 * dispextern.h (struct bidi_it): New member disp_prop_p.
13058
13059 * xdisp.c: Remove one-slot cache of display string positions.
13060 (compute_display_string_pos): Accept an additional argument
5e617bc2 13061 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
13062 for a display string or property. If found, set DISP_PROP_P
13063 non-zero.
13064
13065 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
13066 DISP_PROP_P, and pass it to compute_display_string_pos.
13067 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
13068 non-zero. All callers of bidi_fetch_char changed.
13069
fb33fa43
SM
130702011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13071
13072 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13073
b099e063
DM
130742010-12-03 Don March <don@ohspite.net>
13075
13076 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13077 last character M-[char] is translated to ESC [char] (bug#7541).
13078
5cc7f7af
KH
130792011-08-02 Kenichi Handa <handa@m17n.org>
13080
d0fffa3f 13081 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
13082
13083 * chartab.c (uniprop_table): Make it non-static.
13084
525d5e6e
EZ
130852011-08-01 Eli Zaretskii <eliz@gnu.org>
13086
13087 * xdisp.c (forward_to_next_line_start): Accept additional argument
13088 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13089 on the newline.
13090 (reseat_at_next_visible_line_start): Use the bidi iterator state
13091 returned by forward_to_next_line_start to restore the state of
13092 it->bidi_it after backing up to previous newline. (Bug#9212)
13093
31011111
AS
130942011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13095
13096 * regex.c (re_comp): Protoize.
13097 (re_exec): Fix return type.
13098 (regexec): Fix type of `ret'. (Bug#9203)
13099
476371c4
PE
131002011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13101
e5d76069
PE
13102 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13103 This is needed if max-image-size is a floating-point number.
13104
9a79b20c
AS
131052011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13106
13107 * print.c (print_object): Print empty symbol as ##.
13108
13109 * lread.c (read1): Read ## as empty symbol.
13110
d8c2fa78
AA
131112011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13112
13113 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13114 setting frame foreground color (Bug#9175).
13115 (x_set_background_color): Likewise.
13116
ffe57a7a
AA
13117 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13118 contents (Bug#9176).
13119 (EmacsTooltip -init): Remove bezels and add shadows to
13120 tooltip windows.
13121
bf3492a5
AA
13122 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13123 or scroll bar (Bug#8470).
13124
d55e9c53
AA
13125 * nsfont.m (nsfont_open): Remove assignment to voffset and
13126 unnecessary vars hshink, expand, hd, full_height, min_height.
13127 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13128
13129 * nsterm.h (nsfont_info): Remove voffset field.
13130
d8c2fa78 131312011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
13132
13133 Implement strike-through and overline on NextStep (Bug#8863).
13134
13135 * nsfont.m (nsfont_open): Use underline position provided by font,
13136 instead of hard-coded value of 2.
13137 (nsfont_draw): Call ns_draw_text_decoration instead.
13138
13139 * nsterm.h: Add declaration for ns_draw_text_decoration.
13140
13141 * nsterm.m (ns_draw_text_decoration): New function for drawing
13142 underline, overline, and strike-through.
13143 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13144 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 13145 accommodate underlining, etc.
4843aac3 13146
4cc60b9b
EZ
131472011-07-28 Eli Zaretskii <eliz@gnu.org>
13148
bc7ece87
EZ
13149 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13150 default.
4cc60b9b 13151
476371c4
PE
131522011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13153
66606eea
PE
13154 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13155 Without this fix, if a signal arrives just after memory fills up,
13156 'malloc' might be invoked reentrantly.
13157
476371c4
PE
13158 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13159 In other words, assume that every image size is allowed, on non-X
13160 hosts. This assumption is probably wrong, but it lets Emacs compile.
13161
f3fcc40d
AS
131622011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13163
13164 * regex.c (re_iswctype): Convert return values to boolean.
13165
350c992f
EZ
131662011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13167
13168 * xdisp.c (compute_display_string_pos): Don't use cached display
13169 string position if the buffer had its restriction changed.
13170 (Bug#9184)
13171
5266b4bb
PE
131722011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13173
13174 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13175
2573a837 131762011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 13177
41f55ccd 13178 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 13179
39e378da
PE
13180 * bidi.c: Integer size and overflow fixes.
13181 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13182 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13183 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13184 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13185 (bidi_find_other_level_edge):
13186 Use ptrdiff_t instead of EMACS_INT where either will do.
13187 This works better on 32-bit hosts configured --with-wide-int.
13188 (bidi_cache_ensure_space): Check for size-calculation overflow.
13189 Use % rather than repeated addition, for better worst-case speed.
13190 Don't set bidi_cache_size until after xrealloc returns, because it
13191 might not return.
13192 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
13193 (bidi_cache_ensure_space): Also check that the bidi cache size
13194 does not exceed that of the largest Lisp string or buffer. See Eli
13195 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 13196
5e927815
PE
13197 * alloc.c (__malloc_size_t): Remove.
13198 All uses replaced by size_t. See Andreas Schwab's note
13199 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13200
ca4aa935
PE
13201 * image.c: Improve checking for integer overflow.
13202 (check_image_size): Assume that f is nonnull, since
13203 it is always nonnull in practice. This is one less thing to
13204 worry about when checking for integer overflow later.
13205 (x_check_image_size): New function, which checks for integer
13206 overflow issues inside X.
13207 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13208 This removes the need for a memory_full check.
13209 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13210 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13211 (xbm_read_bitmap_data): Change locals back to 'int', since
13212 their values must fit in 'int'.
13213 (xpm_load_image, png_load, tiff_load):
13214 Invoke x_create_x_image_and_pixmap earlier,
13215 to avoid much needless work if the image is too large.
13216 (tiff_load): Treat overly large images as if
13217 x_create_x_image_and_pixmap failed, not as malloc failures.
13218 (gs_load): Use x_check_image_size.
13219
5f8f9cc2
PE
13220 * gtkutil.c: Omit integer casts.
13221 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13222 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13223
5adf60bc
PE
13224 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13225
c8907a93
PE
13226 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13227 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13228 would wrongly return t on a 64-bit host.
13229
e3c25c68
PE
13230 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13231 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13232 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13233 and therefore cause GCC to emit a bogus diagnostic in some cases.
13234
3f791afe
PE
13235 * image.c: Integer signedness and overflow and related fixes.
13236 This is not an exhaustive set of fixes, but it's time to
13237 record what I've got.
13238 (lookup_pixel_color, check_image_size): Remove redundant decls.
13239 (check_image_size): Don't assume that arbitrary EMACS_INT values
13240 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13241 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13242 (tiff_load, imagemagick_load_image):
13243 Check for overflow in size calculations.
13244 (x_create_x_image_and_pixmap): Remove unnecessary test for
13245 xmalloc returning NULL; that can't happen.
13246 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13247 (xpm_color_bucket): Use better integer hashing function.
13248 (xpm_cache_color): Don't possibly over-allocate memory.
13249 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13250 (gif_memory_source):
13251 Use ptrdiff_t, not int or size_t, to record sizes.
13252 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13253 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13254 either works, as we prefer signed integers.
13255 (tiff_read_from_memory, tiff_write_from_memory):
13256 Return tsize_t, not size_t, since that's what the TIFF API wants.
13257 (tiff_read_from_memory): Don't fail simply because the read would
13258 go past EOF; instead, return a short read.
13259 (tiff_load): Omit no-longer-needed casts.
13260 (Fimagemagick_types): Don't assume size fits into 'int'.
13261
3cc5a532
PE
13262 Improve hashing quality when configured --with-wide-int.
13263 * fns.c (hash_string): New function, taken from sxhash_string.
13264 Do not discard information about ASCII character case; this
13265 discarding is no longer needed.
13266 (sxhash-string): Use it. Change sig to match it. Caller changed.
13267 * lisp.h: Declare it.
13268 * lread.c (hash_string): Remove, since we now use fns.c's version.
13269 The fns.c version returns a wider integer if --with-wide-int is
13270 specified, so this should help the quality of the hashing a bit.
13271
b312a492
PE
13272 * emacs.c: Integer overflow minor fix.
13273 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13274 Define only if GNU_LINUX.
13275 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13276
dfd153ae
PE
13277 * dispnew.c: Integer signedness and overflow fixes.
13278 Remove unnecessary forward decls, that were a maintenance hassle.
13279 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13280 All uses changed.
13281 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13282 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13283 (prepare_desired_row, line_draw_cost):
13284 Use int, not unsigned, where either works.
13285 (save_current_matrix, restore_current_matrix):
13286 Use ptrdiff_t, not size_t, where either works.
13287 (init_display): Check for overflow more accurately, and without
13288 relying on undefined behavior.
13289
a81d11a3
PE
13290 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13291 Remove, replacing with the new symbols in lisp.h. All uses changed.
13292 * fileio.c (make_temp_name):
13293 * filelock.c (lock_file_1, lock_file):
13294 * xdisp.c (message_dolog):
13295 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13296 Use pMd etc. instead.
13297 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13298 replacing the pWIDE etc. symbols removed from editfns.c.
13299
3300e6fd
PE
13300 * keyboard.h (num_input_events): Now uintmax_t.
13301 This is (very slightly) less likely to mess up due to wraparound.
13302 All uses changed.
13303
fd05c7e9
PE
13304 * buffer.c: Integer signedness fixes.
13305 (alloc_buffer_text, enlarge_buffer_text):
13306 Use ptrdiff_t rather than size_t when either will do, as we prefer
13307 signed integers.
13308
903fe15d
PE
13309 * alloc.c: Integer signedness and overflow fixes.
13310 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13311 (__malloc_size_t): Default to size_t, not to int.
13312 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13313 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13314 Prefer ptrdiff_t to size_t when either would do, as we prefer
13315 signed integers.
13316 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13317 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13318 Now const. Initialize with values that are in range even if char
13319 is signed.
13320 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13321 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13322 These functions do the right thing with sizes > 2**32.
13323 (check_depth): Now ptrdiff_t, not int.
13324 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13325 Adjust to new way of storing sizes. Check for size overflow bugs
13326 in rest of code.
13327 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13328 slightly wrong anyway, as it missed one instance of
13329 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13330 (refill_memory_reserve): Omit needless cast to size_t.
13331 (mark_object_loop_halt): Mark as externally visible.
13332
ac82cc6a
PE
13333 * xselect.c: Integer signedness and overflow fixes.
13334 (Fx_register_dnd_atom, x_handle_dnd_message):
13335 Use ptrdiff_t, not size_t, since we prefer signed.
13336 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13337 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13338 x_dnd_atoms_size and x_dnd_atoms_length.
13339
c2d1e36d
PE
13340 * doprnt.c: Prefer signed to unsigned when either works.
13341 * eval.c (verror):
13342 * doprnt.c (doprnt):
13343 * lisp.h (doprnt):
13344 * xdisp.c (vmessage):
13345 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13346 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13347 prefer signed arithmetic to avoid comparison confusion.
13348 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13349 but is a bit tricky.
13350
0e926e56
PE
13351 Assume freestanding C89 headers, string.h, stdlib.h.
13352 * data.c, doprnt.c, floatfns.c, print.c:
13353 Include float.h unconditionally.
13354 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13355 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13356 * regex.c: Likewise for stddef.h, string.h.
13357 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13358 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13359 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13360 (STDC_HEADERS): Remove obsolete defines.
13361 * sysdep.c: Include limits.h unconditionally.
13362
9cfdb3ec
PE
13363 Assume support for memcmp, memcpy, memmove, memset.
13364 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13365 * regex.c (memcmp, memcpy):
13366 Remove; we assume C89 now.
13367
13368 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13369 (__malloc_safe_bcopy): Remove; no longer needed.
13370
cf950e6b 13371 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
13372 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13373 well either way, and we prefer signed to unsigned.
13374
dbf38e02
LMI
133752011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13376
13377 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13378 closes the connection while we're reading (bug#9182).
13379
d6f0886c 133802011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 13381
d6f0886c
JD
13382 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13383 are specified (Bug#9168).
24e0f6b1 13384
2eb1f9e6
PE
133852011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13386
13387 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13388 Found by GCC static checking and --with-wide-int on a 32-bit host.
13389
22381272 133902011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
13391
13392 * xdisp.c (compute_display_string_pos): Fix logic of caching
13393 previous display string position. Initialize cached_prev_pos to
13394 -1. Fixes slow-down at the beginning of a buffer.
13395
f25e39b4
EZ
133962011-07-24 Eli Zaretskii <eliz@gnu.org>
13397
13398 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13399 for attrs[LFACE_FONTSET_INDEX].
13400
04c4b52e
PE
134012011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13402
13403 * xml.c (parse_region): Remove unused local
13404 that was recently introduced.
13405
c1734fbd
EZ
134062011-07-23 Eli Zaretskii <eliz@gnu.org>
13407
be18c5a5
EZ
13408 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13409 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13410
c1734fbd
EZ
13411 * xdisp.c (move_it_in_display_line_to): Record the best matching
13412 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
13413 exit if none of the characters scanned was an exact match.
13414 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
13415 when exact match is impossible due to invisible text, and the
13416 lines are truncated.
13417
a258d627
JD
134182011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13419
13420 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13421 for OSX >= 10.7.
13422
b6d5a689
EZ
134232011-07-22 Eli Zaretskii <eliz@gnu.org>
13424
0f74f785
EZ
13425 Fix a significant slow-down of cursor motion with C-n, C-p,
13426 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13427 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 13428 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
13429 (next_element_from_buffer): Call compute_stop_pos_backwards to
13430 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
13431 base_level_stop.
13432 (reseat): Don't look for prev_stop, as that could mean a very long
13433 run.
13434 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13435 <cached_disp_overlay_modiff>: Cache for last found display string
13436 position.
551918c1 13437 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
13438 about the same buffer in the same area of character positions, and
13439 the buffer wasn't changed since the time the display string
13440 position was cached.
551918c1 13441
b2d0c91a
EZ
134422011-07-22 Eli Zaretskii <eliz@gnu.org>
13443
13444 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13445 is an integer, which is important for empty lines. (Bug#9149)
13446
043604ee
CY
134472011-07-22 Chong Yidong <cyd@stupidchicken.com>
13448
13449 * frame.c (Fmodify_frame_parameters): In tty case, update the
13450 default face if necessary (Bug#4238).
13451
da4adb04
CY
134522011-07-21 Chong Yidong <cyd@stupidchicken.com>
13453
13454 * editfns.c (Fstring_to_char): No need to explain what a character
13455 is in the docstring (Bug#6576).
13456
9abd0532
LMI
134572011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13458
13459 * xml.c (parse_region): Make sure we always return a tree.
13460
36881d16
HK
134612011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13462
13463 * xml.c (parse_region): If a document contains only comments,
13464 return that, too.
13465
1e98674d
LMI
134662011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13467
13468 * xml.c (make_dom): Return comments, too.
13469
590bd467
PE
134702011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13471
13472 Port to OpenBSD.
13473 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13474 and the surrounding thread.
13475 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13476 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13477 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13478 timer goes off.
13479 * s/openbsd.h (BROKEN_SIGIO): Define.
13480 * unexelf.c (unexec) [__OpenBSD__]:
13481 Don't update the .mdebug section of the Alpha COFF symbol table.
13482
f41628b2
LMI
134832011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13484
13485 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13486 (bug#8460).
13487
b59b67c5
PE
134882011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13489
15e3a074
PE
13490 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13491 This fixes some race conditions on the permissions of any newly
13492 created file.
13493
41bed37d
PE
13494 * alloc.c (valid_pointer_p): Use pipe, not open.
13495 This fixes some permissions issues when debugging.
13496
b59b67c5
PE
13497 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13498 If fchown fails to set both uid and gid, try to set just gid,
13499 as that is sometimes allowed. Adjust the file's mode to eliminate
13500 setuid or setgid bits that are inappropriate if fchown fails.
13501
925a6be7
SM
135022011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13503
13504 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13505 to compare Lisp_Objects.
13506 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13507 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13508 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13509
52968808
AS
135102011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13511
0a6a104b
AS
13512 * lread.c (read_integer): Unread even EOF character.
13513 (read1): Likewise. Properly record start position of symbol.
13514
52968808
AS
13515 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13516 symbol character follows.
13517
9e381cdd
PE
135182011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13519
13520 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13521 This works around a problem with the previous change to Fcopy_file.
13522 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13523 and without this change, GCC might complain about discarding
13524 fchown's return value.
13525
b5641435
JB
135262011-07-16 Juanma Barranquero <lekktu@gmail.com>
13527
13528 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13529
a8031457
PE
135302011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13531
13532 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13533
dd889327
LMI
135342011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13535
750c33f7
LMI
13536 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13537 it's used from the C level.
13538
dd889327
LMI
13539 * process.c: Use the same condition for POLL_FOR_INPUT in both
13540 keyboard.c and process.c (bug#1858).
13541
87e86684
LM
135422011-07-09 Lawrence Mitchell <wence@gmx.li>
13543
13544 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13545 (Fgnutls_boot): Use it.
13546
64348f40
AS
135472011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13548
13549 * doc.c (Fsubstitute_command_keys): Revert last change.
13550
1d698799
LMI
135512011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13552
f863868c
LMI
13553 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13554 quotes the next character, and doesn't affect other longer
13555 sequences (bug#8935).
13556
1d698799
LMI
13557 * lread.c (syms_of_lread): Clarify that is isn't only
13558 `eval-buffer' and `eval-defun' that's affected by
13559 `lexical-binding' (bug#8460).
13560
aa4b6df6
EZ
135612011-07-15 Eli Zaretskii <eliz@gnu.org>
13562
13563 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 13564 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 13565
5d856da6
PE
135662011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13567
ad6042bb
PE
13568 Fix minor problems found by static checking.
13569 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13570 (elsz): Now a signed constant, not a size_t var. We prefer signed
13571 types to unsigned, to avoid integer comparison confusion. Without
13572 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13573 "cannot optimize loop, the loop counter may overflow", a symptom
13574 of the confusion.
f00bbb22 13575 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
13576 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13577
6468f31c
LMI
135782011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13579
49080b10
LMI
13580 * search.c (Fre_search_backward): Mention `case-fold-search' in
13581 all the re_search_* functions (bug#8138).
13582
6468f31c
LMI
13583 * keyboard.c (Fopen_dribble_file): Document when the file is
13584 closed (bug#8056).
13585
c965adc5
EZ
135862011-07-14 Eli Zaretskii <eliz@gnu.org>
13587
df9733bf
EZ
13588 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13589 bidi_cache_idx.
13590
0bb23927
EZ
13591 Support bidi reordering of display and overlay strings.
13592 * xdisp.c (compute_display_string_pos)
13593 (compute_display_string_end): Accept additional argument STRING.
13594 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13595 (reseat_to_string): Initialize bidi_it->string.s and
13596 bidi_it->string.schars.
13597 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
13598 NULL (avoids a crash in bidi_paragraph_init).
13599 Initialize itb.string.lstring.
0bb23927
EZ
13600 (init_iterator): Call bidi_init_it only of a valid
13601 buffer position was specified. Initialize paragraph_embedding to
13602 L2R.
13603 (reseat_to_string): Initialize the bidi iterator.
13604 (display_string): If we need to ignore text properties of
13605 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13606 original value of -1 will not work with bidi.)
13607 (compute_display_string_pos): First arg is now struct
13608 `text_pos *'; all callers changed. Support display properties on
13609 Lisp strings.
13610 (compute_display_string_end): Support display properties on Lisp
13611 strings.
13612 (init_iterator, reseat_1, reseat_to_string): Initialize the
13613 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13614 when iterating on a string not from display properties).
640c8776
SM
13615 (compute_display_string_pos, compute_display_string_end):
13616 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
13617 arrow keys.
13618 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
13619 base_level_stop; instead, set base_level_stop to BEGV.
13620 Fixes crashes in vertical-motion.
0bb23927
EZ
13621 (next_element_from_buffer): Improve commentary for when
13622 the iterator is before prev_stop.
13623 (init_iterator): Initialize bidi_p from the default value of
13624 bidi-display-reordering, not from buffer-local value. Use the
13625 buffer-local value only if initializing for buffer iteration.
13626 (handle_invisible_prop): Support invisible properties on strings
13627 that are being bidi-reordered.
13628 (set_iterator_to_next): Support bidi reordering of C strings and
13629 Lisp strings.
13630 (next_element_from_string): Support bidi reordering of Lisp
13631 strings.
13632 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
13633 (display_string): Support display of R2L glyph rows.
13634 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
13635 (init_iterator): Don't initialize it->bidi_p for strings
13636 here.
13637 (reseat_to_string): Initialize it->bidi_p for strings here.
13638 (next_element_from_string, next_element_from_c_string)
13639 (next_element_from_buffer): Add xassert's for correspondence
13640 between IT's object being iterated and it->bidi_it.string
13641 structure.
13642 (face_before_or_after_it_pos): Support bidi iteration.
13643 (next_element_from_c_string): Handle the case of the first string
13644 character that is not the first one in the visual order.
13645 (get_visually_first_element): New function, refactored from common
13646 parts of next_element_from_buffer, next_element_from_string, and
13647 next_element_from_c_string.
13648 (tool_bar_lines_needed, redisplay_tool_bar)
13649 (display_menu_bar): Force left-to-right direction. Add a FIXME
13650 comment for making that be controlled by a user option.
13651 (push_it, pop_it): Save and restore the state of the
13652 bidi iterator. Save and restore the bidi_p flag.
13653 (pop_it): Iterate out of display property for string iteration as
13654 well.
13655 (iterate_out_of_display_property): Support iteration over strings.
13656 (handle_single_display_spec): Set up it->bidi_it for iteration
13657 over a display string, and call bidi_init_it.
13658 (handle_single_display_spec, next_overlay_string)
13659 (get_overlay_strings_1, push_display_prop): Set up the bidi
13660 iterator for displaying display or overlay strings.
13661 (forward_to_next_line_start): Don't use the shortcut if
13662 bidi-iterating.
13663 (back_to_previous_visible_line_start): If handle_display_prop
13664 pushed the iterator stack, restore the internal state of the bidi
13665 iterator by calling bidi_pop_it same number of times.
13666 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13667 and we are bidi-iterating, don't decrement the iterator position;
13668 instead, set the first_elt flag in the bidi iterator, to produce
13669 the same effect.
13670 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13671 (push_display_prop): xassert that we are iterating a buffer.
13672 (push_it, pop_it): Save and restore paragraph_embedding member.
13673 (handle_single_display_spec, next_overlay_string)
13674 (get_overlay_strings_1, reseat_1, reseat_to_string)
13675 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13676 correctly. Don't assume unibyte strings are not bidi-reordered.
13677 (compute_display_string_pos)
13678 (compute_display_string_end): Fix handling the case of C string.
13679 (push_it, pop_it): Save and restore from_disp_prop_p.
13680 (handle_single_display_spec, push_display_prop): Set the
13681 from_disp_prop_p flag.
13682 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13683 (pop_it): Call iterate_out_of_display_property only if we are
13684 popping after iteration over a string that came from a display
13685 property. Fix a typo in popping stretch info. Add an assertion
13686 for verifying that the iterator position is in sync with the bidi
13687 iterator.
13688 (handle_single_display_spec, get_overlay_strings_1)
13689 (push_display_prop): Fix initialization of paragraph direction for
13690 string when that of the parent object is not yet determined.
13691 (reseat_1): Call bidi_init_it to resync the bidi
13692 iterator with IT's position. (Bug#7616)
13693 (find_row_edges): If ROW->start.pos gives position
13694 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13695 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13696 Reset the from_disp_prop_p flag.
13697 (SAVE_IT, RESTORE_IT): New macros.
13698 (pos_visible_p, face_before_or_after_it_pos)
13699 (back_to_previous_visible_line_start)
13700 (move_it_in_display_line_to, move_it_in_display_line)
13701 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13702 (try_scrolling, redisplay_window, display_line): Use them when
13703 saving a temporary copy of the iterator and restoring it back.
13704 (back_to_previous_visible_line_start, reseat_1)
13705 (init_iterator): Empty the bidi cache "stack".
13706 (move_it_in_display_line_to): If iterator ended up at
13707 EOL, but we never saw any buffer positions smaller than
13708 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13709 motion in bidi-reordered lines.
13710 (move_it_in_display_line_to): Record prev_method and prev_pos
13711 immediately before the call to set_iterator_to_next. Fixes cursor
13712 motion in bidi-reordered lines with stretch glyphs and strings
13713 displayed in margins. (Bug#8133) (Bug#8867)
13714 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13715 TO_CHARPOS.
640c8776
SM
13716 (pos_visible_p): Support positions in bidi-reordered lines.
13717 Save and restore bidi cache.
0bb23927
EZ
13718
13719 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13720 (bidi_paragraph_info): Delete unused struct.
13721 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13722 (bidi_cache_start): New variable.
13723 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13724 to zero.
13725 (bidi_cache_fetch_state, bidi_cache_search)
13726 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13727 (bidi_cache_find, bidi_peek_at_next_level)
13728 (bidi_level_of_next_char, bidi_find_other_level_edge)
13729 (bidi_move_to_visually_next): Compare cache index with
13730 bidi_cache_start rather than with zero.
13731 (bidi_fetch_char): Accept new argument STRING; all callers
13732 changed. Support iteration over a string. Support strings with
13733 display properties. Support unibyte strings. Fix the type of
13734 `len' according to what STRING_CHAR_AND_LENGTH expects.
13735 (bidi_paragraph_init, bidi_resolve_explicit_1)
13736 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
13737 (bidi_level_of_next_char, bidi_move_to_visually_next):
13738 Support iteration over a string.
0bb23927
EZ
13739 (bidi_set_sor_type, bidi_resolve_explicit_1)
13740 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13741 can now be zero (for strings); special values 0 and -1 were
13742 changed to -1 and -2, respectively.
13743 (bidi_char_at_pos): New function.
13744 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13745 Call it instead of FETCH_MULTIBYTE_CHAR.
13746 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13747 initialized to valid values.
13748 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13749 values.
13750 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13751 the test for valid cached positions. Fix the logic for looking up
13752 the sentinel state in the cache. GCPRO the Lisp string we are
13753 iterating.
13754 (bidi_push_it, bidi_pop_it): New functions.
13755 (bidi_initialize): Initialize the bidi cache start stack pointer.
13756 (bidi_cache_ensure_space): New function, refactored from part of
13757 bidi_cache_iterator_state. Don't assume the required size is just
13758 one BIDI_CACHE_CHUNK away.
13759 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13760 (bidi_count_bytes, bidi_char_at_pos): New functions.
13761 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13762 always valid if bidi_cache_idx is valid.
13763 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13764 is valid if it's going to be used.
13765 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13766 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
13767 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13768 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
13769 (bidi_find_other_level_edge, bidi_cache_start_stack):
13770 All variables related to cache indices are now EMACS_INT.
c965adc5 13771
0bb23927
EZ
13772 * dispextern.h (struct bidi_string_data): New structure.
13773 (struct bidi_it): New member `string'. Make flag members be 1-bit
13774 fields, and put them last in the struct.
640c8776
SM
13775 (compute_display_string_pos, compute_display_string_end):
13776 Update prototypes.
0bb23927
EZ
13777 (bidi_push_it, bidi_pop_it): Add prototypes.
13778 (struct iterator_stack_entry): New members bidi_p,
13779 paragraph_embedding, and from_disp_prop_p.
13780 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
13781 (bidi_shelve_cache, bidi_unshelve_cache):
13782 Declare prototypes.
0bb23927
EZ
13783
13784 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13785 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13786 and vector-like objects.
13787
13788 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13789 cache around display iteration.
13790
13791 * window.c (Fwindow_end, window_scroll_pixel_based)
13792 (displayed_window_lines, Frecenter): Save and restore the bidi
13793 cache around display iteration.
13794
3bbd2265
LMI
137952011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13796
13797 * editfns.c (Fdelete_region): Clarify the use of the named
13798 parameters (bug#6788).
13799
adc47434
MR
138002011-07-14 Martin Rudalics <rudalics@gmx.at>
13801
13802 * indent.c (Fvertical_motion): Set and restore w->pointm when
13803 saving and restoring the window's buffer (Bug#9006).
13804
837c31f8
LMI
138052011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13806
13807 * editfns.c (Fstring_to_char): Clarify just what is returned
13808 (bug#6576). Text by Eli Zaretskii.
13809
ac389d0c
JB
138102011-07-13 Juanma Barranquero <lekktu@gmail.com>
13811
13812 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13813
0be0ce47
EZ
138142011-07-13 Eli Zaretskii <eliz@gnu.org>
13815
13816 * buffer.c (mmap_find): Fix a typo.
13817
cd18e7e3
JB
138182011-07-13 Johan Bockgård <bojohan@gnu.org>
13819
13820 Fix execution of x selection hooks.
13821 * xselect.c (Qx_lost_selection_functions)
13822 (Qx_sent_selection_functions): New vars.
13823 (syms_of_xselect): DEFSYM them.
13824 (x_handle_selection_request): Pass Qx_sent_selection_functions
13825 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13826 (x_handle_selection_clear,x_clear_frame_selections):
13827 Pass Qx_lost_selection_functions rather than
13828 Vx_lost_selection_functions to Frun_hook_with_args.
13829
47ea7f44
PE
138302011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13831
ac389d0c 13832 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
13833 The old code sometimes used this field without initializing it.
13834
47ea7f44
PE
13835 * alloc.c (gc_sweep): Don't read past end of array.
13836 In theory, the old code could also have corrupted Emacs internals,
13837 though it'd be very unlikely.
13838
bc985c87
AS
138392011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13840
13841 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 13842 argument. (Bug#4026)
bc985c87 13843
0cf34688
LMI
138442011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13845
b3dadd76
LMI
13846 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13847 key" (bug#4257).
13848
0cf34688
LMI
13849 * window.c (Fset_window_start): Doc fix (bug#4199).
13850 (Fset_window_hscroll): Ditto.
13851
270768cd
PE
138522011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13853
077e3dda 13854 Fix minor new problems caught by GCC 4.6.1.
270768cd 13855 * term.c (init_tty): Remove unused local.
490011a6 13856 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 13857 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 13858 not used otherwise.
270768cd 13859
b1f58454
CY
138602011-07-12 Chong Yidong <cyd@stupidchicken.com>
13861
13862 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13863
22b9578d
LMI
138642011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13865
6e70ab07
LMI
13866 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13867 are the mini-buffer and the echo area (bug#3320).
13868
22b9578d
LMI
13869 * term.c (init_tty): Remove support for supdup, c10 and perq
13870 terminals, which are no longer supported (bug#1482).
13871
8974cc9f
JB
138722011-07-10 Johan Bockgård <bojohan@gnu.org>
13873
13874 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13875
a560d974
JD
138762011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13877
13878 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13879 for non-popups (Bug#3642).
13880
1dae0f0a
AS
138812011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13882
268c2c36 13883 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 13884 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
13885 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13886 * cm.c (losecursor): Likewise.
1dae0f0a
AS
13887 * data.c (fmod): Likewise.
13888 * dispnew.c (swap_glyphs_in_rows): Likewise.
13889 * emacs.c (memory_warning_signal): Likewise.
13890 * floatfns.c (float_error): Likewise.
13891 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13892 (otf_open, font_otf_capability, generate_otf_features)
13893 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13894 Likewise.
13895 * image.c (pbm_read_file): Likewise.
13896 * indent.c (string_display_width): Likewise.
13897 * intervals.c (check_for_interval, search_for_interval)
13898 (inc_interval_count, count_intervals, root_interval)
13899 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13900 * lread.c (defalias): Likewise.
268c2c36 13901 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
13902 * regex.c (set_image_of_range_1, set_image_of_range)
13903 (regex_grow_registers): Likewise.
13904 * sysdep.c (strerror): Likewise.
13905 * termcap.c (valid_filename_p, tprint, main): Likewise.
13906 * tparam.c (main): Likewise.
13907 * unexhp9k800.c (run_time_remap, save_data_space)
13908 (update_file_ptrs, read_header, write_header, calculate_checksum)
13909 (copy_file, copy_rest, display_header): Likewise.
13910 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13911 Likewise.
13912 * xdisp.c (check_it): Likewise.
13913 * xfaces.c (register_color, unregister_color, unregister_colors):
13914 Likewise.
13915 * xfns.c (print_fontset_result): Likewise.
13916 * xrdb.c (member, fatal, main): Likewise.
13917
99033785
PE
139182011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13919
13920 Fix minor problems found by static checking (Bug#9031).
13921 * chartab.c (char_table_set_range, map_sub_char_table):
13922 Remove unused locals.
13923 (uniprop_table): Now static.
13924 * composite.c (_work_char): Remove unused static var.
13925
9cb2ac56
JB
139262011-07-09 Juanma Barranquero <lekktu@gmail.com>
13927
13928 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13929
f25661f0
JD
139302011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13931
13932 * gtkutil.c (qttip_cb): Remove code without function.
13933
8278c4fe
EZ
139342011-07-09 Eli Zaretskii <eliz@gnu.org>
13935
13936 * w32.c (pthread_sigmask): New stub.
13937
1692ae2d 139382011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 13939
8a6ebd58 13940 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
13941 sigprocmask is portable only for single-threaded applications, and
13942 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
13943 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13944 (LIBES): Use it.
13945 * callproc.c (Fcall_process):
13946 * process.c (create_process):
13947 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13948 Use pthread_sigmask, not sigprocmask.
123403e4 13949
1b854618
JD
139502011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13951
13952 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13953 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13954 wrong (Bug#8591).
13955
3fe4b549
JD
139562011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13957
0ce7e563
JD
13958 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13959 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13960 (xg_hide_tooltip): Fix comment.
13961
3fe4b549
JD
13962 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13963 in registerServicesMenuSendTypes.
13964 (validRequestorForSendType): Don't check ns_return_types.
13965
13966 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13967 ns_return_type.
13968
5df75e47
JR
139692011-07-08 Jason Rumney <jasonr@gnu.org>
13970
22610910
JR
13971 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13972 SH_SHOW for hidden windows (Bug#5482).
13973
5df75e47
JR
13974 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13975 frame struct members of non-existent frames (Bug#6284).
13976
699c10bd
JD
139772011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13978
4393663b
JD
13979 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13980 variable firstTime not needed on OSX >= 10.6.
13981 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13982 >= 10.5. Use setKnobProportion, setDoubleValue.
13983
13984 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13985 (MAC_OS_X_VERSION_10_5): Define if not defined.
13986 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13987 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13988 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13989
13990 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 13991 cString and lossyCString on OSX >= 10.4.
4393663b 13992
58179cce 13993 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
13994 sizeToFit on OSX >= 10.2.
13995
13996 * nsimage.m (allocInitFromFile): Don't use deprecated method
13997 bestRepresentationForDevice on OSX >= 10.6.
13998
13999 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14000 to avoid warning.
14001
14002 * emacs.c: Declare unexec_init_emacs_zone.
14003
a63e0781
JD
14004 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14005
699c10bd
JD
14006 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14007
14008 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14009 on svcsMenu (Bug#8842).
14010
14011 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14012 ns_return_types.
14013 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14014
14015 * nsterm.m (QUTF8_STRING): Declare.
14016 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14017 (validRequestorForSendType): Return type is (id).
14018 Change indexOfObjectIdenticalTo to indexOfObject.
14019 Check if we have local selection before returning self (Bug#8842).
14020 (writeSelectionToPasteboard): Put local selection into paste board
14021 if we have a local selection (Bug#8842).
14022 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14023
14024 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14025 (ns_get_local_selection): Declare.
14026
54e10184
LMI
140272011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14028
9888ff71
LMI
14029 * keymap.c (describe_map_tree): Don't insert a double newline at
14030 the end of the buffer (bug#1169) and return whether we inserted
14031 something.
14032
54e10184
LMI
14033 * callint.c (Fcall_interactively): Change "reading args" to
14034 "providing args" to try to clarify what it does (bug#1010).
14035
15fa4783
KH
140362011-07-07 Kenichi Handa <handa@m17n.org>
14037
14038 * composite.c (composition_compute_stop_pos): Ignore a static
14039 composition starting before CHARPOS (Bug#8915).
14040
14041 * xdisp.c (handle_composition_prop): Likewise.
14042
a8815b00
EZ
140432011-07-07 Eli Zaretskii <eliz@gnu.org>
14044
14045 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14046 (Bug#9015)
14047
ef7b981d 140482011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
14049
14050 * character.h (unicode_category_t): New enum type.
14051
14052 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14053 (Qchar_code_property_table): New variable.
14054 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14055 (UNIPROP_COMPRESSED_FORM_P): New macros.
14056 (char_table_ascii): Uncompress the compressed values.
14057 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14058 Uncompress the compressed values.
ac389d0c 14059 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
14060 (char_table_ref_and_range): Uncompress the compressed values.
14061 (sub_char_table_set): New arg is_uniprop. Callers changed.
14062 Uncompress the compressed values.
14063 (sub_char_table_set_range): Args changed. Callers changed.
14064 (char_table_set_range): Adjuted for the above change.
14065 (map_sub_char_table): Delete args default_val and parent. Add arg
14066 top. Give decoded values to a Lisp function.
640c8776 14067 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
14068 values to a Lisp function. Gcpro more variables.
14069 (uniprop_table_uncompress)
14070 (uniprop_decode_value_run_length): New functions.
14071 (uniprop_decoder, uniprop_decoder_count): New variables.
14072 (uniprop_get_decoder, uniprop_encode_value_character)
14073 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14074 New functions.
14075 (uniprop_encoder, uniprop_encoder_count): New variables.
14076 (uniprop_get_encoder, uniprop_table)
14077 (Funicode_property_table_internal, Fget_unicode_property_internal)
14078 (Fput_unicode_property_internal): New functions.
14079 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14080 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 14081 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
14082 char-code-property-alist.
14083
640c8776 14084 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
14085 Vunicode_category_table.
14086
640c8776 14087 * font.c (font_range): Adjust for the change of
c805dec0
KH
14088 Vunicode_category_table.
14089
76b397fb
DN
140902011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14091
14092 * m/iris4d.h: Remove file, move contents ...
14093 * s/irix6-5.h: ... here.
14094
22b4128e
PE
140952011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14096
14097 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
14098 * alloc.c (mark_buffer):
14099 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14100 (clone_per_buffer_values): Don't assume that
22b4128e
PE
14101 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14102 This isn't true in general, and it's particularly not true
14103 if Emacs is configured with --with-wide-int.
14104 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14105 New macros, used in the buffer.c change.
14106
869795d6
JD
141072011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14108
14109 * xsettings.c: Use both GConf and GSettings if both are available.
14110 (store_config_changed_event): Add comment.
14111 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14112 (store_tool_bar_style_changed): New functions.
5e617bc2 14113 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
14114 (struct xsettings): Move font inside HAVE_XFT.
14115 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 14116 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 14117 Move inside HAVE_XFT.
640c8776 14118 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
14119 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14120 also.
14121 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 14122 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 14123 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
14124 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14125 (parse_settings): Move check for font inside HAVE_XFT.
14126 (read_settings, apply_xft_settings): Add comment.
14127 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14128 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14129 call store_font_name_changed.
14130 (xft_settings_event): Add comment.
14131 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14132 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14133 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14134 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14135 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
14136 (xsettings_get_system_font, xsettings_get_system_normal_font):
14137 Add comment.
869795d6 14138
d8ed26bd
PE
141392011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14140
14141 Random fixes. E.g., (random) never returned negative values.
14142 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14143 subseconds part to the entropy, as that's a bit more random.
14144 Prefer signed to unsigned, since the signedness doesn't matter and
14145 in general we prefer signed. When given a limit, use a
14146 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14147 latter isn't right if USE_2_TAGS_FOR_INTS.
14148 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14149 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14150
cabf1cac
SM
141512011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14152
14153 * textprop.c (text_property_stickiness):
14154 Obey Vtext_property_default_nonsticky.
14155 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14156 * w32fns.c (syms_of_w32fns):
14157 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14158
6e9b2be9
PE
141592011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14160
14161 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14162 This is more efficient than Ffile_directory_p and avoids a minor race.
14163
90186c68
LMI
141642011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14165
7c301272
LMI
14166 * buffer.c (Foverlay_put): Say what the return value is
14167 (bug#7835).
14168
c4f2d8d4
LMI
14169 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14170 is a directory before asking whether to use the file name
14171 (bug#7564).
ad637907
LMI
14172 (barf_or_query_if_file_exists): Make the "File is a directory"
14173 error be more correct.
c4f2d8d4 14174
90186c68
LMI
14175 * fns.c (Frequire): Remove the mention of the .gz files, since
14176 that's installation-specific, but keep the mention of
14177 `get-load-suffixes'.
14178
da64016e
PE
141792011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14180
14181 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14182 Report string overflow if the output is too long.
14183
7d47b580
JB
141842011-07-04 Juanma Barranquero <lekktu@gmail.com>
14185
a555cb87
JB
14186 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14187 (syms_of_gnutls): Remove duplicate DEFSYM for
14188 Qgnutls_bootprop_verify_hostname_error, an error for
14189 Qgnutls_bootprop_verify_error (which is no longer used).
14190
7d47b580
JB
14191 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14192 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14193 Also (re)move comments that are misplaced or no longer relevant.
14194
1e49bfab
LMI
141952011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14196
14197 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14198
1485f4c0
CY
141992011-07-03 Chong Yidong <cyd@stupidchicken.com>
14200
14201 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14202 and background color parameters if they have been changed.
14203
a9ab721e
LMI
142042011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14205
14206 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14207
cf7cff57
PE
142082011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14209
2e13213d
PE
14210 * xsettings.c (SYSTEM_FONT): Define only when used.
14211 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14212
cf7cff57
PE
14213 * keymap.c (access_keymap_1): Now static.
14214
7a8e04f7
CY
142152011-07-02 Chong Yidong <cyd@stupidchicken.com>
14216
14217 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14218 leave any prefix arg for the up event (Bug#1586).
14219
61352f62
LMI
142202011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14221
69bb1ef7
LMI
14222 * lread.c (syms_of_lread): Mention single symbols defined by
14223 `defvar' or `defconst' (bug#7154).
14224
61352f62 14225 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 14226 (Frequire): Mention get-load-suffixes.
61352f62 14227
28545e04
MR
142282011-07-02 Martin Rudalics <rudalics@gmx.at>
14229
14230 * window.h (window): Remove clone_number slot.
14231 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14232 Remove.
14233 (make_parent_window, make_window, saved_window)
14234 (Fset_window_configuration, save_window_save): Don't deal with
14235 clone numbers.
14236 * buffer.c (Qclone_number): Remove declaration.
14237 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14238
3349e122
SM
142392011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14240
14241 Add multiple inheritance to keymaps.
14242 * keymap.c (Fmake_composed_keymap): New function.
14243 (Fset_keymap_parent): Simplify.
14244 (fix_submap_inheritance): Remove.
14245 (access_keymap_1): New function extracted from access_keymap to handle
14246 embedded parents and handle lists of maps.
14247 (access_keymap): Use it.
14248 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14249 (Fcopy_keymap): Handle embedded parents.
14250 (Fcommand_remapping, define_as_prefix): Simplify.
14251 (Fkey_binding): Simplify.
14252 (syms_of_keymap): Move minibuffer-local-completion-map,
14253 minibuffer-local-filename-completion-map,
14254 minibuffer-local-must-match-map, and
14255 minibuffer-local-filename-must-match-map to Elisp.
14256 (syms_of_keymap): Defsubr make-composed-keymap.
14257 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14258 (parse_menu_item): Trivial simplification.
14259
3279eb87
GM
142602011-07-01 Glenn Morris <rgm@gnu.org>
14261
14262 * Makefile.in (SETTINGS_LIBS): Fix typo.
14263
39cb9e56 142642011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
14265
14266 * coding.c (Fencode_coding_string): Record the last coding system
14267 used, as the function doc string says (bug#8738).
14268
0949d2b6
JD
142692011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14270
14271 * xsettings.c (store_monospaced_changed): Take new font as arg and
14272 check for change against current_mono_font.
14273 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14274 (emacs_settings_constructor, emacs_settings_get_property)
14275 (emacs_settings_set_property, emacs_settings_class_init)
14276 (emacs_settings_init, gsettings_obj): Remove.
14277 (something_changedCB): New function for HAVE_GSETTINGS.
14278 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14279 with value as argument.
14280 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14281 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 14282 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
14283 "changed".
14284
14285 * xgselect.c: Add defined (HAVE_GSETTINGS).
14286 (xgselect_initialize): Ditto.
14287
14288 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14289 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14290 xg_select.
14291
bbc6b304
PE
142922011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14293
14294 * eval.c (struct backtrace): Simplify and port the data structure.
14295 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14296 signed bit field, as this assumption is not portable and it makes
14297 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14298 "char debug_on_exit : 1" as this is not portable either; instead,
14299 use the portable "unsigned int debug_on_exit : 1". Remove unused
14300 member evalargs. Remove obsolete comments about cc bombing out.
14301
9851bfc5
JD
143022011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14303
51bb811f 14304 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
14305 Let HAVE_GSETTINGS override HAVE_GCONF.
14306 (store_monospaced_changed): New function.
14307 (EMACS_SETTINGS): A new type derived from GObject to handle
14308 GSettings notifications.
14309 (emacs_settings_constructor, emacs_settings_get_property)
14310 (emacs_settings_set_property, emacs_settings_class_init):
14311 New functions.
14312 (gsettings_client, gsettings_obj): New variables.
14313 (GSETTINGS_SCHEMA): New define.
14314 (something_changedCB): Call store_monospaced_changed.
14315 (init_gsettings): New function.
14316 (xsettings_initialize): Call init_gsettings.
14317 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14318 to NULL.
14319
640c8776 14320 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
14321 GCONF_CFLAGS/LIBS.
14322
5386012d
MR
143232011-06-29 Martin Rudalics <rudalics@gmx.at>
14324
14325 * window.c (resize_root_window, grow_mini_window)
14326 (shrink_mini_window): Rename Qresize_root_window to
14327 Qwindow_resize_root_window and Qresize_root_window_vertically to
14328 Qwindow_resize_root_window_vertically.
14329
f13e0b08
PE
143302011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14331
14332 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14333
94515237
JB
143342011-06-27 Juanma Barranquero <lekktu@gmail.com>
14335
14336 * makefile.w32-in: Redesign dependencies so they reflect more
14337 clearly which files are directly included by each source file,
14338 and not through other includes.
14339
e43b6e43
MR
143402011-06-27 Martin Rudalics <rudalics@gmx.at>
14341
14342 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14343 (sort_overlays, overlay_strings): When an overlay's clone number
14344 matches the window's clone number process the overlay even if
14345 the overlay's window property doesn't match the current window.
14346
d68443dc
MR
14347 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14348 (Fwindow_hchild): Rename to Fwindow_left_child.
14349 (Fwindow_next): Rename to Fwindow_next_sibling.
14350 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
14351 (resize_window_check): Rename to window_resize_check.
14352 (resize_window_apply): Rename to window_resize_apply.
14353 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14354 (Fdelete_other_windows_internal, resize_frame_windows)
14355 (Fsplit_window_internal, Fdelete_window_internal)
14356 (grow_mini_window, shrink_mini_window)
14357 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 14358
c7e73be5
JD
143592011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14360
14361 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14362 (emacs_fixed_set_min_size): Remove.
14363 (emacs_fixed_new): Take frame as argument.
14364
14365 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14366 (_EmacsFixedPrivate): Remove minwidth/height.
14367 Add struct frame *f.
14368 (emacs_fixed_init): Initialize priv->f.
14369 (get_parent_class, emacs_fixed_set_min_size): Remove.
14370 (emacs_fixed_new): Set priv->f to argument.
14371 (emacs_fixed_get_preferred_width)
14372 (emacs_fixed_get_preferred_height): Use min_width/height from
14373 frames size_hint to set minimum and natural (Bug#8919).
14374 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14375 and use min_width/height from frames size_hint to set
14376 min_width/height (Bug#8919).
14377
14378 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
14379 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14380 Fix indentation.
c7e73be5 14381
cf99dcf8
EZ
143822011-06-26 Eli Zaretskii <eliz@gnu.org>
14383
14384 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14385 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14386 called at ZV.
14387
029529ac
CY
143882011-06-26 Chong Yidong <cyd@stupidchicken.com>
14389
14390 * process.c (wait_reading_process_output): Bypass select if
14391 waiting for a cell while ignoring keyboard input, and input is
14392 pending. Suggested by Jan Djärv (Bug#8869).
14393
7a7ef429
PE
143942011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14395
14396 Use gnulib's dup2 module instead of rolling our own.
14397 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14398
11fdef7d 143992011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
14400
14401 * dispnew.c (scrolling_window): Before scrolling, turn off a
14402 mouse-highlight in the window being scrolled.
14403
cd3520a4
JB
144042011-06-24 Juanma Barranquero <lekktu@gmail.com>
14405
14406 Move DEFSYM to lisp.h and use everywhere.
14407
14408 * character.h (DEFSYM): Move declaration...
14409 * lisp.h (DEFSYM): ...here.
14410
14411 * gnutls.c:
14412 * minibuf.c:
14413 * w32menu.c:
14414 * w32proc.c:
14415 * w32select.c: Don't include character.h.
14416
14417 * alloc.c (syms_of_alloc):
14418 * buffer.c (syms_of_buffer):
14419 * bytecode.c (syms_of_bytecode):
14420 * callint.c (syms_of_callint):
14421 * casefiddle.c (syms_of_casefiddle):
14422 * casetab.c (init_casetab_once):
14423 * category.c (init_category_once, syms_of_category):
14424 * ccl.c (syms_of_ccl):
14425 * cmds.c (syms_of_cmds):
14426 * composite.c (syms_of_composite):
14427 * dbusbind.c (syms_of_dbusbind):
14428 * dired.c (syms_of_dired):
14429 * dispnew.c (syms_of_display):
14430 * doc.c (syms_of_doc):
14431 * editfns.c (syms_of_editfns):
14432 * emacs.c (syms_of_emacs):
14433 * eval.c (syms_of_eval):
14434 * fileio.c (syms_of_fileio):
14435 * fns.c (syms_of_fns):
14436 * frame.c (syms_of_frame):
14437 * fringe.c (syms_of_fringe):
14438 * insdel.c (syms_of_insdel):
14439 * keymap.c (syms_of_keymap):
14440 * lread.c (init_obarray, syms_of_lread):
14441 * macros.c (syms_of_macros):
14442 * msdos.c (syms_of_msdos):
14443 * print.c (syms_of_print):
14444 * process.c (syms_of_process):
14445 * search.c (syms_of_search):
14446 * sound.c (syms_of_sound):
14447 * syntax.c (init_syntax_once, syms_of_syntax):
14448 * terminal.c (syms_of_terminal):
14449 * textprop.c (syms_of_textprop):
14450 * undo.c (syms_of_undo):
14451 * w32.c (globals_of_w32):
14452 * window.c (syms_of_window):
14453 * xdisp.c (syms_of_xdisp):
14454 * xfaces.c (syms_of_xfaces):
14455 * xfns.c (syms_of_xfns):
14456 * xmenu.c (syms_of_xmenu):
14457 * xsettings.c (syms_of_xsettings):
14458 * xterm.c (syms_of_xterm): Use DEFSYM.
14459
4228cf16
TZ
144602011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14461
cd3520a4 14462 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 14463
7fcccf1e
PE
144642011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14465
7efb4e0e
PE
14466 Integer and buffer overflow fixes (Bug#8873).
14467
ff5844ad
PE
14468 * print.c (printchar, strout): Check for string overflow.
14469 (PRINTPREPARE, printchar, strout):
14470 Don't set size unless allocation succeeds.
14471
90532f02
PE
14472 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14473 for sizes. Check for string overflow more accurately.
14474 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14475
6d84508d
PE
14476 * macros.c: Integer and buffer overflow fixes.
14477 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14478 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14479 Use ptrdiff_t, not int, for sizes.
14480 Don't increment bufsize until after realloc succeeds.
14481 Check for size-calculation overflow.
14482 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14483
437b2cb4
PE
14484 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14485
8b9ac8b4
PE
14486 * lread.c: Integer overflow fixes.
14487 (read_integer): Radix is now EMACS_INT, not int,
14488 to improve quality of diagnostics for out-of-range radices.
14489 Calculate buffer size correctly for out-of-range radices.
14490 (read1): Check for integer overflow in radices, and in
14491 read-circle numbers.
82cb60d3
PE
14492 (read_escape): Avoid int overflow.
14493 (Fload, openp, read_buffer_size, read1)
14494 (substitute_object_recurse, read_vector, read_list, map_obarray):
14495 Use ptrdiff_t, not int, for sizes.
14496 (read1): Use EMACS_INT, not int, for sizes.
20270765 14497 Check for size overflow.
8b9ac8b4 14498
7fcccf1e
PE
14499 * image.c (cache_image): Check for size arithmetic overflow.
14500
bfbbd7e7
PE
14501 * lread.c: Integer overflow issues.
14502 (saved_doc_string_size, saved_doc_string_length)
14503 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14504 Now ptrdiff_t, not int.
14505 (read1): Don't assume doc string length fits in int. Check for
14506 out-of-range doc string lengths.
14507 (read_list): Don't assume file position fits in int.
39019e54 14508 (read_escape): Check for hex character overflow.
bfbbd7e7 14509
4e323265
LL
145102011-06-22 Leo Liu <sdl.web@gmail.com>
14511
14512 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14513 Move to minibuffer.el.
14514
85fece3e
PE
145152011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14516
20b84ce9 14517 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
14518 The following patches are for when GLYPH_DEBUG && !XASSERT.
14519 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14520 * dispnew.c (flush_stdout):
14521 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14522 Mark as externally visible.
14523 * dispnew.c (check_window_matrix_pointers): Now static.
14524 * dispnew.c (window_to_frame_vpos):
14525 * xfns.c (unwind_create_frame):
14526 * xterm.c (x_check_font): Remove unused local.
14527 * scroll.c (CHECK_BOUNDS):
14528 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14529 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14530 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14531 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14532 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14533 Now static.
14534 (debug_method_add): Use va_list and vsprintf rather than relying
14535 on undefined behavior with wrong number of arguments.
14536 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14537 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14538 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14539 since we're not interested in debugging glyphs with old libraries.
14540 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14541 GCC 4.6.0's static checking.
14542
0766b489
PE
145432011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14544
31fd4b32
PE
14545 Integer overflow and signedness fixes (Bug#8873).
14546 A few related buffer overrun fixes, too.
14547
b79e8648
PE
14548 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14549
0766b489
PE
14550 * dispextern.h (struct face.stipple):
14551 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14552 (x_bitmap_mask, x_allocate_bitmap_record)
14553 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14554 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14555 (x_create_bitmap_from_xpm_data):
14556 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14557 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14558 (.bitmaps_last):
14559 * xfaces.c (load_pixmap):
14560 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14561 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14562 (.bitmaps_last, struct x_output.icon_bitmap):
14563 Use ptrdiff_t, not int, for bitmap indexes.
14564 (x_allocate_bitmap_record): Check for size overflow.
14565 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14566
b081724f
PE
14567 Use ptrdiff_t, not int, for overlay counts.
14568 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14569 * editfns.c (overlays_around, get_pos_property):
14570 * textprop.c (get_char_property_and_overlay):
14571 * xdisp.c (next_overlay_change, note_mouse_highlight):
14572 * xfaces.c (face_at_buffer_position):
21514da7
PE
14573 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14574 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14575 (Fnext_overlay_change, Fprevious_overlay_change)
14576 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 14577 Use ptrdiff_t, not int, for sizes.
21514da7 14578 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 14579
3de73e5e
PE
14580 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14581
2606c57b
PE
14582 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14583 (x_session_initialize): Do not assume string length fits in int.
14584
aaafe47a
PE
14585 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14586 This is unlikely, but can occur if DPI is outlandish.
14587
2674ddc8 14588 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
14589 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14590
28154962
PE
14591 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14592 * xrdb.c (magic_file_p, search_magic_path):
14593 Omit last arg SUFFIX; it was always 0. All callers changed.
14594 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14595
7de51af5
PE
14596 * xfont.c (xfont_match): Avoid need for strlen.
14597
25ed6cc3
PE
14598 * xfns.c: Don't assume strlen fits in int.
14599 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14600
4eab31dd
PE
14601 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14602 not unsigned long, as we prefer signed integers. All callers changed.
14603 Detect integer overflow in repeat count.
14604 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 14605 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 14606
171e2a58
PE
14607 * termcap.c: Don't assume sizes fit in int and never overflow.
14608 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14609 (gobble_line): Check for size-calculation overflow.
14610
ad39faca 14611 * minibuf.c (Fread_buffer):
6e5bb2dc 14612 * lread.c (intern, intern_c_string):
74ca2eb3
PE
14613 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14614 Don't assume string length fits in int.
14615
52c61c22 14616 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
14617 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14618
b5b8c9e5
PE
14619 * font.c: Don't assume string length fits in int.
14620 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14621 Use ptrdiff_t, not int.
ccd6111c
PE
14622 (font_intern_prop): Don't assume string length fits in int.
14623 Don't assume integer property fits in fixnum.
14624 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 14625
882f0d81 14626 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 14627 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
14628 Reformulate so as not to need the command string.
14629 Invoke gzip -cd rather than gunzip, as it's more portable.
14630 (lock_info_type, lock_file_1, lock_file):
14631 Don't assume pid_t and time_t fit in unsigned long.
14632 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14633 (current_lock_owner): Prefer signed type for sizes.
14634 Use memcpy, not strncpy, where memcpy is what is really wanted.
14635 Don't assume (via atoi) that time_t and pid_t fit in int.
14636 Check for time_t and/or pid_t out of range, e.g., via a network share.
14637 Don't alloca where an auto var works fine.
14638
93f4cf88
PE
14639 * fileio.c: Fix some integer overflow issues.
14640 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14641 Don't assume string length fits in int.
14642 (directory_file_name): Don't assume string length fits in long.
14643 (make_temp_name): Don't assume pid fits in int, or that its print
14644 length is less than 20.
14645
f3e92b69
PE
14646 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14647
1bfdaf10
PE
14648 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14649
35016e9a
PE
14650 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14651
3d1e65a1
PE
14652 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14653 We prefer signed integers, even for size calculations.
14654
0b963a93
PE
14655 * emacs.c: Don't assume string length fits in 'int'.
14656 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14657 (main): Don't invoke strlen when not needed.
14658
573f4b54
PE
14659 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14660 (XD_DEBUG_MESSAGE): Don't waste a byte.
14661
989f33ba
PE
14662 * callproc.c (getenv_internal_1, getenv_internal)
14663 (Fgetenv_internal):
965d34eb
PE
14664 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14665
e4d29b33
PE
14666 * lread.c (invalid_syntax): Omit length argument.
14667 All uses changed. This doesn't fix a bug, but it simplifies the
14668 code away from its former Hollerith-constant appearance, and it's
14669 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 14670 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 14671
eb49b136
PE
14672 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14673 This didn't break anything, but it didn't help either.
14674 It's confusing to put a bogus integer in a place where the actual
14675 value does not matter.
9f62aeb1 14676 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 14677 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 14678
15375a22
PE
14679 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14680 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14681 implementation.
b61cc01c
PE
14682 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14683 We prefer signed types, and the value cannot exceed the EMACS_INT
14684 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
14685 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14686 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14687 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 14688
53b2623d
PE
14689 * indent.c (sane_tab_width): New function.
14690 (current_column, scan_for_column, Findent_to, position_indentation)
14691 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 14692 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 14693
51cab52b 14694 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 14695
f2ed8a70
PE
14696 * lisp.h (lint_assume): New macro.
14697 * composite.c (composition_gstring_put_cache):
14698 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14699
abe80cc6
PE
14700 * editfns.c, insdel.c:
14701 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 14702
b02c740e
PE
14703 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14704
ebc96716
PE
14705 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14706
b4e50fa0 14707 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 14708 Use much-faster test for byte-length change.
311d5d7c 14709 Don't assume string byte-length fits in 'int'.
a4cf38e4 14710 Check that character arg fits in 'int'.
85461888 14711 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 14712
c0c1ee9f
PE
14713 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14714
a498d7f4
PE
14715 * fns.c (concat): Catch string overflow earlier.
14716 Do not rely on integer wraparound.
14717
51cab52b
PE
14718 * dispextern.h (struct it.overlay_strings_charpos)
14719 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
14720 * xdisp.c (forward_to_next_line_start)
14721 (back_to_previous_visible_line_start)
14722 (reseat_at_next_visible_line_start, next_element_from_buffer):
14723 Don't arbitrarily truncate the value of 'selective' to int.
14724
76031fad
PE
14725 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14726
5eb55db9
PE
14727 * composite.c: Don't truncate sizes to 'int'.
14728 (composition_gstring_p, composition_reseat_it)
14729 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
14730 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14731 not EMACS_UINT, for indexes.
5eb55db9 14732
0703a717
PE
14733 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14734
d6202519
PE
14735 * buffer.c: Include <verify.h>.
14736 (struct sortvec.priority, struct sortstr.priority):
8961a454 14737 Now EMACS_INT, not int.
c20998a7 14738 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
14739 (struct sortstr.size, record_overlay_string)
14740 (struct sortstrlist.size, struct sortlist.used):
14741 Don't truncate size to int.
14742 (record_overlay_string): Check for size-calculation overflow.
d6202519 14743 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 14744
d5a19415
JM
147452011-06-22 Jim Meyering <meyering@redhat.com>
14746
029529ac 14747 Don't leak an XBM-image-sized buffer
d5a19415
JM
14748 * image.c (xbm_load): Free the image buffer after using it.
14749
a9041e6c
PE
147502011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14751
14752 Port to Sun C.
14753 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14754 that Sun C diagnosed.
14755 * fns.c (secure_hash): Fix pointer signedness issue.
14756 * intervals.c (static_offset_intervals): New function.
14757 (offset_intervals): Use it.
14758
7f3f739f
LL
147592011-06-21 Leo Liu <sdl.web@gmail.com>
14760
14761 * deps.mk (fns.o):
14762 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14763 sha512.h.
14764
14765 * fns.c (secure_hash): Rename from crypto_hash_function and change
14766 the first arg to accept symbols.
5b66d427 14767 (Fsecure_hash): New primitive.
7f3f739f
LL
14768 (syms_of_fns): New symbols.
14769
76147d94
DD
147702011-06-20 Deniz Dogan <deniz@dogan.se>
14771
14772 * process.c (Fset_process_buffer): Clarify return value in
14773 docstring.
14774
7d7d0045
CY
147752011-06-18 Chong Yidong <cyd@stupidchicken.com>
14776
14777 * dispnew.c (add_window_display_history): Use BVAR.
14778
14779 * xdisp.c (debug_method_add): Use BVAR.
14780 (check_window_end, dump_glyph_matrix, dump_glyph)
14781 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14782
14783 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14784 Likewise.
14785
14786 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14787 check till after the cache is created in init_frame_faces.
14788
ff2bc410
SM
147892011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14790
14791 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14792
28177add
PE
147932011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14794
dd3482fe
PE
14795 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14796 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14797 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14798
393d71f3 14799 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
14800 * fileio.c (Finsert_file_contents):
14801 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14802 Remove the old (too-loose) buffer overflow checks.
14803 They weren't needed, since make_gap checks for buffer overflow.
14804 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14805 The old code merely checked for Emacs fixnum overflow, and relied
14806 on undefined (wraparound) behavior. The new code avoids undefined
14807 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14808
2e6813b0 14809 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
14810 Tune. Don't use wider integers than needed. Don't use alloca.
14811 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 14812
599a9e4f
PE
14813 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14814
99561444
PE
14815 * insdel.c, lisp.h (buffer_overflow): New function.
14816 (insert_from_buffer_1, replace_range, replace_range_2):
14817 * insdel.c (make_gap_larger):
14818 * editfns.c (Finsert_char):
14819 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14820
28177add
PE
14821 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14822
e69dafad
PE
148232011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14824
4baa020d 14825 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 14826
b1c46f02
PE
14827 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14828 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14829
e69dafad
PE
14830 * fileio.c: Don't assume EMACS_INT fits in off_t.
14831 (emacs_lseek): New static function.
14832 (Finsert_file_contents, Fwrite_region): Use it.
14833 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14834
566684ea
PE
14835 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14836
e6966cd6
PE
14837 * fns.c: Don't overflow int when computing a list length.
14838 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14839 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14840 truncation on 64-bit hosts. Check for QUIT every
14841 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14842 faster and is responsive enough.
14843 (Flength): Report an error instead of overflowing an integer.
14844 (Fsafe_length): Return a float if the value is not representable
14845 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 14846 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 14847 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 14848
dd0b0efb
PE
14849 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14850 (header_size, word_size): New constants.
14851 (allocate_vectorlike): Don't check size overflow here.
14852 (allocate_vector): Check it here instead, since this is the only
14853 caller of allocate_vectorlike that could cause overflow.
14854 Check that the new vector's length is representable as a fixnum.
14855
86fe5cfe
PE
14856 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14857 The previous code was bogus. For example, next_almost_prime (32)
14858 returned 39, which is undesirable as it is a multiple of 3; and
14859 next_almost_prime (24) returned 25, which is a multiple of 5 so
14860 why was the code bothering to check for multiples of 7?
14861
80e88859
PE
14862 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14863
4a2f0ad6
PE
14864 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14865
f66c7cf8
PE
14866 Variadic C functions now count arguments with ptrdiff_t.
14867 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14868 Back then I didn't know that the Emacs coding style prefers signed int.
14869 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
14870 were being counted with int, which may truncate counts on 64-bit
14871 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
14872 * lisp.h (struct Lisp_Subr.function.aMANY)
14873 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14874 Arg counts are now ptrdiff_t, not size_t.
14875 All variadic functions and their callers changed accordingly.
14876 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14877 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14878 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14879 * callint.c (Fcall_interactively): Check arg count for overflow,
14880 to avoid potential buffer overrun. Use signed char, not 'int',
14881 for 'varies' array, so that we needn't bother to check its size
14882 calculation for overflow.
14883 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14884 * eval.c (apply_lambda):
14885 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14886 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14887 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14888
a1759b76
PE
14889 * callint.c (Fcall_interactively): Don't use index var as event count.
14890
d96be9fc
PE
14891 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14892 * mem-limits.h (SIZE): Remove; no longer used.
14893
a690a978 14894 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 14895
578c21e6
PE
14896 Remove unnecessary casts.
14897 * xterm.c (x_term_init):
14898 * xfns.c (x_set_border_pixel):
14899 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14900 These aren't needed now that we assume ANSI C.
14901
96f53c6c
PE
14902 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14903 It's more likely to cause problems (due to unsigned overflow)
14904 than to cure them.
14905
83c77d31
PE
14906 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14907
ee2079f1
PE
14908 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14909
6da65536
PE
14910 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14911
7147c4a4
PE
14912 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14913
193e32d9
PE
14914 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14915
e5533da6
PE
14916 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14917
9910e595
PE
14918 GLYPH_CODE_FACE returns EMACS_INT, not int.
14919 * dispextern.h (merge_faces):
14920 * xfaces.c (merge_faces):
01103c44
PE
14921 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14922 Don't assume EMACS_INT fits in int.
9910e595 14923
2638320e
PE
14924 * character.h (CHAR_VALID_P): Remove unused parameter.
14925 * fontset.c, lisp.h, xdisp.c: All uses changed.
14926
045eb8d9
PE
14927 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14928
c1f134b5
PE
14929 * fns.c (concat): Minor tuning based on overflow analysis.
14930 This doesn't fix any bugs. Use int to hold character, instead
14931 of constantly refetching from Emacs object. Use XFASTINT, not
14932 XINT, for value known to be a character. Don't bother comparing
14933 a single byte to 0400, as it's always less.
14934
395fcb93 14935 * floatfns.c (Fexpt):
327eeec8
PE
14936 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14937
abbd3d23
PE
14938 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14939 for characters.
14940
684a03ef
PE
14941 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14942
0fed43f3
PE
14943 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14944 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14945 incorrectly succeed when S was a string, because 4294967386 was
14946 truncated before it was used.
14947
8fd02eb7
PE
14948 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14949 Otherwise, an out-of-range integer could cause undefined behavior
14950 on a 64-bit host.
14951
f8c86b69
PE
14952 * composite.c: Use int, not EMACS_INT, for characters.
14953 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14954 EMACS_INT, for values that are known to be in character range.
14955 This doesn't fix any bugs but is the usual style inside Emacs and
14956 may generate better code on 32-bit machines.
14957
34206dd2
PE
14958 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14959 This is for reasons similar to the recent CHAR_STRING fix.
14960 * charset.c (Fencode_char): Check that character arg is actually
14961 a character. Pass an int to ENCODE_CHAR.
14962 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14963 wider than 'int', as a compile-time check to prevent future regressions
14964 in this area.
14965
c5958d4c 14966 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
14967
14968 Make sure a 64-bit char is never passed to CHAR_STRING.
14969 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14970 by silently ignoring the top 32 bits, allowing some values
14971 that were far too large to be valid characters.
14972 * character.h: Include <verify.h>.
14973 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14974 arguments are no wider than unsigned, as a compile-time check
14975 to prevent future regressions in this area.
14976 * data.c (Faset):
01103c44 14977 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
14978 (Fsubst_char_in_region):
14979 * fns.c (concat):
14980 * xdisp.c (decode_mode_spec_coding):
14981 Adjust to CHAR_STRING's new requirement.
14982 * editfns.c (Finsert_char, Fsubst_char_in_region):
14983 * fns.c (concat): Check that character args are actually
14984 characters. Without this test, these functions did the wrong
14985 thing with wildly out-of-range values on 64-bit hosts.
14986
d37ca623
PE
14987 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14988 These casts should not be needed on 32-bit hosts, either.
14989 * keyboard.c (read_char):
14990 * lread.c (Fload): Remove casts to unsigned.
14991
ea204efb
PE
14992 * lisp.h (UNSIGNED_CMP): New macro.
14993 This fixes comparison bugs on 64-bit hosts.
14994 (ASCII_CHAR_P): Use it.
14995 * casefiddle.c (casify_object):
01103c44 14996 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
14997 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14998 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14999 * dispextern.h (FACE_FROM_ID):
15000 * keyboard.c (read_char): Use UNSIGNED_CMP.
15001
41cb286c
PE
15002 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15003 not to EMACS_INT, to avoid GCC warning.
15004
4a1b9832
PE
15005 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15006
55daad71
PE
15007 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15008 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15009 isn't needed on 32-bit machines.
8f95c75c 15010
01103c44
PE
15011 * buffer.c (Fgenerate_new_buffer_name):
15012 Use EMACS_INT for count, not int.
0ceccced 15013 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
15014
15015 * data.c (Qcompiled_function): Now static.
15016
c6f072e7
PE
15017 * window.c (window_body_lines): Now static.
15018
20ce5912
PE
15019 * image.c (gif_load): Rename local to avoid shadowing.
15020
9c4c5f81
PE
15021 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15022 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15023 * alloc.c (make_save_value): Integer argument is now of type
15024 ptrdiff_t, not int.
15025 (mark_object): Use ptrdiff_t, not int.
15026 * lisp.h (pD): New macro.
15027 * print.c (print_object): Use it.
15028
c0c5c8ae
PE
15029 * alloc.c: Use EMACS_INT, not int, to count objects.
15030 (total_conses, total_markers, total_symbols, total_vector_size)
15031 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
15032 (total_free_floats, total_floats, total_free_intervals)
15033 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
15034 Now EMACS_INT, not int. All uses changed.
15035 (Fgarbage_collect): Compute overall total using a double, so that
15036 integer overflow is less likely to be a problem. Check for overflow
15037 when converting back to an integer.
5a25e253
PE
15038 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15039 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15040 These were 'int' variables that could overflow on 64-bit hosts;
15041 they were never used, so remove them instead of repairing them.
211a0b2a 15042 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
15043 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15044 Previously, this ceilinged at INT_MAX, but that doesn't work on
15045 64-bit machines.
e46bb31a 15046 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 15047
c78baabf 15048 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 15049 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
15050 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15051 when a (possibly-narrower) signed value would do just as well.
15052 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 15053
c9d624c6
PE
15054 * alloc.c: Catch some string size overflows that we were missing.
15055 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15056 for convenience in STRING_BYTES_MAX.
15057 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15058 The definition here is exact; the one in lisp.h was approximate.
15059 (allocate_string_data): Check for string overflow. This catches
15060 some instances we weren't catching before. Also, it catches
15061 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15062 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15063 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 15064
c9d624c6
PE
15065 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15066 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 15067 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 15068
353032ce
PE
15069 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15070
2bccce07
PE
15071 * alloc.c (Fmake_string): Check for out-of-range init.
15072
0ac30604
SM
150732011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15074
15075 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15076
c195f2de
JD
150772011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15078
15079 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15080 xg_get_default_scrollbar_width.
15081
15082 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15083 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15084 (style_changed_cb): Call update_theme_scrollbar_width and call
15085 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15086 all frames (Bug#8505).
15087 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15088 Call gtk_window_set_resizable if HAVE_GTK3.
15089 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15090 and height if HAVE_GTK3 (Bug#8505).
15091 (scroll_bar_width_for_theme): New variable.
15092 (update_theme_scrollbar_width): New function.
15093 (xg_get_default_scrollbar_width): Move code to
15094 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15095 (xg_initialize): Call update_theme_scrollbar_width.
15096
15097 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15098
15099 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15100
e10ac9f1
MR
151012011-06-12 Martin Rudalics <rudalics@gmx.at>
15102
15103 * frame.c (make_frame): Call other_buffer_safely instead of
15104 other_buffer.
15105
15106 * window.c (temp_output_buffer_show): Call display_buffer with
15107 second argument Vtemp_buffer_show_specifiers and reset latter
15108 immediately after the call.
15109 (Vtemp_buffer_show_specifiers): New variable.
15110 (auto_window_vscroll_p, next_screen_context_lines)
15111 (Vscroll_preserve_screen_position): Remove leading asterisks from
15112 doc-strings.
15113
2d3c217e 151142011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 15115
7b7f97e8 15116 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
15117 * buffer.c (Qclone_number): Remove for now, as it's unused.
15118 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15119 (record_buffer): Remove unused local.
15120 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15121 (set_frame_buffer_list): Remove; unused.
15122 * frame.h (other_visible_frames): Remove decl.
15123 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15124 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15125 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15126 if HAVE_GPM.
15127 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15128 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15129 Define only if HAVE_GPM.
15130 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15131 (update_hints_inhibit): Remove; never set. All uses removed.
15132 * widgetprv.h (emacsFrameClassRec): Remove decl.
15133 * window.c (delete_deletable_window): Now returns void, since it
15134 wasn't returning anything.
15135 (compare_window_configurations): Remove unused locals.
15136 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15137 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
15138 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15139 the same widths as pointers. This follows up on the 2011-05-06 patch.
15140 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15141 * xterm.h: Likewise.
15142 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15143
1384b89e
JB
151442011-06-12 Juanma Barranquero <lekktu@gmail.com>
15145
15146 * makefile.w32-in: Update dependencies.
15147 (LISP_H): Add lib/intprops.h.
15148
1100a63c
CY
151492011-06-11 Chong Yidong <cyd@stupidchicken.com>
15150
15151 * image.c (gif_load): Add animation frame delay to the metadata.
15152 (syms_of_image): Use DEFSYM. New symbol `delay'.
15153
6198ccd0
MR
151542011-06-11 Martin Rudalics <rudalics@gmx.at>
15155
15156 * window.c (delete_deletable_window): Re-add.
15157 (Fset_window_configuration): Rewrite to handle dead buffers and
15158 consequently deletable windows.
15159 (window_tree, Fwindow_tree): Remove. Supply functionality in
15160 window.el.
15161 (compare_window_configurations): Simplify code.
15162
b6e3633c
AS
151632011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15164
1ab0dee5
AS
15165 * image.c (imagemagick_load_image): Fix type mismatch.
15166 (Fimagemagick_types): Likewise.
15167
b6e3633c
AS
15168 * window.h (replace_buffer_in_windows): Declare.
15169
9397e56f
MR
151702011-06-11 Martin Rudalics <rudalics@gmx.at>
15171
15172 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15173 Qclone_number. Remove external declaration of Qdelete_window.
15174 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15175 code.
640c8776
SM
15176 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15177 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
15178 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15179 buffer list implementation.
15180 (other_buffer_safely): New function.
15181 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15182 calls to replace_buffer_in_windows and
15183 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15184 if allowed.
15185 (record_buffer): Inhibit quitting and rewrite using quittable
15186 functions. Run Qbuffer_list_update_hook if allowed.
15187 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
15188 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15189 Move switch-to-buffer to window.el.
9397e56f
MR
15190 (bury-buffer): Move to window.el.
15191 (Vbuffer_list_update_hook): New variable.
15192
15193 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15194 section.
15195
15196 * window.h (resize_frame_windows): Move up in code.
15197 (Fwindow_frame): Remove EXFUN.
15198 (replace_buffer_in_all_windows): Remove prototype.
15199 (replace_buffer_in_windows_safely): Add prototype.
15200
15201 * window.c: Declare Qdelete_window static again. Move down
15202 declaration of select_count.
15203 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15204 (Fother_window): Move to window.el.
15205 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15206 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15207 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15208 window.el.
15209 (replace_buffer_in_windows): Implement by calling
15210 Qreplace_buffer_in_windows.
15211 (replace_buffer_in_all_windows): Remove with some functionality
15212 moved into replace_buffer_in_windows_safely.
15213 (replace_buffer_in_windows_safely): New function.
15214 (select_window_norecord, select_frame_norecord): Move in front
15215 of run_window_configuration_change_hook. Remove now obsolete
15216 declarations.
640c8776
SM
15217 (Fset_window_buffer): Rewrite doc-string.
15218 Call Qrecord_window_buffer.
9397e56f
MR
15219 (keys_of_window): Move binding for other-window to window.el.
15220
b50691aa
CY
152212011-06-11 Chong Yidong <cyd@stupidchicken.com>
15222
15223 * dispextern.h (struct image): Replace data member, whose int_val
15224 and ptr_val fields were not used by anything, with a single
15225 lisp_val object.
15226
15227 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15228 (gif_clear_image, gif_load, imagemagick_load_image)
15229 (gs_clear_image, gs_load): Callers changed.
15230
3f754b86
PE
152312011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15232
cca69397
PE
15233 * buffer.h: Include <time.h>, for time_t.
15234 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15235
109e28d0
PE
15236 Fix minor problems found by static checking.
15237
60737f02
PE
15238 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15239
4b66faf3
PE
15240 Make identifiers static if they are not used in other modules.
15241 * data.c (Qcompiled_function, Qframe, Qvector):
15242 * image.c (QimageMagick, Qsvg):
15243 * minibuf.c (Qmetadata):
15244 * window.c (resize_window_check, resize_root_window): Now static.
15245 * window.h (resize_window_check, resize_root_window): Remove decls.
15246
109e28d0
PE
15247 * window.c (window_deletion_count, delete_deletable_window):
15248 Remove; unused.
46a4ce9e
PE
15249 (window_body_lines): Now static.
15250 (Fdelete_other_windows_internal): Mark vars as initialized.
15251 Make sure 'resize_failed' is initialized.
15252 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15253 (resize_window_apply): Remove unused local.
15254 * window.h (delete_deletable_window): Remove decl.
15255
109e28d0 15256 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
15257 (imagemagick_load_image): Fix pointer signedness problem by changing
15258 last arg from unsigned char * to char *. All uses changed.
15259 Also, fix a local for similar reasons.
15260 Remove unused locals. Remove locals to avoid shadowing.
15261 (fn_rsvg_handle_free): Remove; unused.
15262 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 15263 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 15264
3f754b86
PE
15265 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15266
2547adb1
CY
152672011-06-10 Chong Yidong <cyd@stupidchicken.com>
15268
15269 * image.c (gif_load): Fix omitted cast error introduced by
15270 2011-06-06 change.
15271
2c8e37d4
MR
152722011-06-10 Martin Rudalics <rudalics@gmx.at>
15273
15274 * window.h (resize_proportionally, orig_total_lines)
15275 (orig_top_line): Remove from window structure.
15276 (set_window_height, set_window_width, change_window_heights)
15277 (Fdelete_window): Remove prototypes.
15278 (resize_frame_windows): Remove duplicate declaration.
15279
440a42e3
EZ
152802011-06-10 Eli Zaretskii <eliz@gnu.org>
15281
15282 * window.h (resize_frame_windows, resize_window_check)
15283 (delete_deletable_window, resize_root_window)
15284 (resize_frame_windows): Declare prototypes.
15285
15286 * window.c (resize_window_apply): Make definition be "static" to
15287 match the prototype.
15288
562dd5e9
MR
152892011-06-10 Martin Rudalics <rudalics@gmx.at>
15290
15291 * window.c: Remove declarations of Qwindow_size_fixed,
15292 window_min_size_1, window_min_size_2, window_min_size,
15293 size_window, window_fixed_size_p, enlarge_window, delete_window.
15294 Remove static from declaration of Qdelete_window, it's
15295 temporarily needed by Fbury_buffer.
15296 (replace_window): Don't assign orig_top_line and
15297 orig_total_lines.
15298 (Fdelete_window, delete_window): Remove. Window deletion is
15299 handled by window.el.
640c8776
SM
15300 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15301 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
15302 (Fdelete_other_windows): Remove. Deleting other windows is
15303 handled by window.el.
15304 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15305 handled in window.el.
15306 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15307 Window minimum sizes are handled in window.el.
15308 (shrink_windows, size_window, set_window_height)
15309 (set_window_width, change_window_heights, window_height)
15310 (window_width, CURBEG, CURSIZE, enlarge_window)
15311 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15312 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15313 handled in window.el.
15314 (make_dummy_parent): Rename to make_parent_window and give it a
15315 second argument horflag.
15316 (make_window): Don't set resize_proportionally any more.
15317 (Fsplit_window): Remove. Windows are split in window.el.
15318 (save_restore_action, save_restore_orig_size)
15319 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15320 Resize mini windows in window.el.
15321 (grow_mini_window, shrink_mini_window): Implement by calling
15322 Qresize_root_window_vertically, resize_window_check and
15323 resize_window_apply.
640c8776
SM
15324 (saved_window, Fset_window_configuration, save_window_save):
15325 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
15326 resize_proportionally.
15327 (window_min_height, window_min_width): Move to window.el.
15328 (keys_of_window): Move bindings for delete-other-windows,
15329 split-window, delete-window and enlarge-window to window.el.
15330
15331 * buffer.c: Temporarily extern Qdelete_window.
15332 (Fbury_buffer): Temporarily call Qdelete_window instead of
15333 Fdelete_window (Fbury_buffer will move to window.el soon).
15334
15335 * frame.c (set_menu_bar_lines_1): Remove code handling
15336 orig_top_line and orig_total_lines.
15337
15338 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15339 set_window_height but set heights directly.
15340 (change_frame_size_1): Use resize_frame_windows.
15341
15342 * xdisp.c (init_xdisp): Don't use set_window_height but set
15343 heights directly.
15344
640c8776
SM
15345 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15346 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
15347 run_window_configuration_change_hook.
15348
15349 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15350 instead of change_window_heights and run
15351 run_window_configuration_change_hook.
15352
1a13852e
MR
153532011-06-09 Martin Rudalics <rudalics@gmx.at>
15354
15355 * window.c (replace_window): Rename second argument REPLACEMENT to
15356 NEW. New third argument SETFLAG. Rewrite.
15357 (delete_window, make_dummy_parent): Call replace_window with
15358 third argument 1.
15359 (window_list_1): Move down in code.
15360 (run_window_configuration_change_hook): Move set_buffer part
15361 before select_frame_norecord part in order to unwind correctly.
15362 Rename count1 to count.
15363 (recombine_windows, delete_deletable_window, resize_root_window)
15364 (Fdelete_other_windows_internal)
15365 (Frun_window_configuration_change_hook, make_parent_window)
15366 (resize_window_check, resize_window_apply, Fresize_window_apply)
15367 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
15368 (Fdelete_window_internal, Fresize_mini_window_internal):
15369 New functions.
1a13852e
MR
15370 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15371
f3d1777e
MR
153722011-06-08 Martin Rudalics <rudalics@gmx.at>
15373
496e208e
MR
15374 * window.h (window): Add some new members to window structure -
15375 normal_lines, normal_cols, new_total, new_normal, clone_number,
15376 splits, nest, prev_buffers, next_buffers.
15377 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 15378 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 15379
f3d1777e
MR
15380 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15381 Remove.
496e208e
MR
15382 (make_dummy_parent): Set new members of windows structure.
15383 (make_window): Move down in code. Handle new members of window
15384 structure.
15385 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15386 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15387 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15388 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
15389 (Fset_window_next_buffers, Fset_window_clone_number):
15390 New functions.
496e208e
MR
15391 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15392 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15393 Doc-string fixes.
15394 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15395 Argument WINDOW can be now internal window too.
15396 (Fwindow_use_time): Move up in code.
15397 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15398 Rewrite doc-string.
15399 (Fset_window_configuration, saved_window)
15400 (Fcurrent_window_configuration, save_window_save): Handle new
15401 members of window structure.
b9e809c2
MR
15402 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15403 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15404 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15405 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15406 Qget_mru_window, Qresize_root_window,
15407 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15408 Qauto_buffer_name; staticpro them.
f3d1777e 15409
abde8f8c
MR
154102011-06-07 Martin Rudalics <rudalics@gmx.at>
15411
15412 * window.c (Fwindow_total_size, Fwindow_left_column)
15413 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15414 (Fwindow_list_1): New functions.
15415 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
15416 (Fwindow_width, Fscroll_left, Fscroll_right):
15417 Use window_body_cols instead of window_box_text_cols.
15418 (delete_window, Fset_window_configuration):
15419 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
15420 (delete_all_subwindows): Take a window as argument and not a
15421 structure. Rewrite.
190b47e6
MR
15422 (window_loop): Remove handling of GET_LRU_WINDOW and
15423 GET_LARGEST_WINDOW.
15424 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
15425
15426 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
15427 window_box_text_cols. delete_all_subwindows now takes a
15428 Lisp_Object as argument.
abde8f8c 15429
640c8776
SM
15430 * indent.c (compute_motion, Fcompute_motion):
15431 Use window_body_cols instead of window_box_text_cols.
abde8f8c 15432
fa8a67e6
MR
15433 * frame.c (delete_frame): Call delete_all_subwindows with root
15434 window as argument.
15435
a54e3482
DC
154362011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15437
15438 * fns.c (Fputhash): Document return value.
15439
60002bf5
CY
154402011-06-06 Chong Yidong <cyd@stupidchicken.com>
15441
15442 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15443
0c671da6 154442011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 15445
b862a52a 15446 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 15447
be44ca6c
PE
15448 Check for overflow when converting integer to cons and back.
15449 * charset.c (Fdefine_charset_internal, Fdecode_char):
15450 Use cons_to_unsigned to catch overflow.
15451 (Fencode_char): Use INTEGER_TO_CONS.
15452 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15453 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15454 * data.c (long_to_cons, cons_to_long): Remove.
15455 (cons_to_unsigned, cons_to_signed): New functions.
15456 These signal an error for invalid or out-of-range values.
15457 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15458 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15459 * font.c (Ffont_variation_glyphs):
15460 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15461 * lisp.h: Include <intprops.h>.
15462 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15463 (cons_to_signed, cons_to_unsigned): New decls.
15464 (long_to_cons, cons_to_long): Remove decls.
15465 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15466 (Fprimitive_undo): Use CONS_TO_INTEGER.
15467 * xfns.c (Fx_window_property): Likewise.
15468 * xselect.c: Include <limits.h>.
15469 (x_own_selection, selection_data_to_lisp_data):
15470 Use INTEGER_TO_CONS.
15471 (x_handle_selection_request, x_handle_selection_clear)
15472 (x_get_foreign_selection, Fx_disown_selection_internal)
15473 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15474 (lisp_data_to_selection_data): Use cons_to_unsigned.
15475 (x_fill_property_data): Use cons_to_signed.
15476 Report values out of range.
15477
d1f3d2af
PE
15478 Check for buffer and string overflow more precisely.
15479 * buffer.h (BUF_BYTES_MAX): New macro.
15480 * lisp.h (STRING_BYTES_MAX): New macro.
15481 * alloc.c (Fmake_string):
15482 * character.c (string_escape_byte8):
15483 * coding.c (coding_alloc_by_realloc):
15484 * doprnt.c (doprnt):
15485 * editfns.c (Fformat):
15486 * eval.c (verror):
15487 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15488 since they may not be the same number.
15489 * editfns.c (Finsert_char):
15490 * fileio.c (Finsert_file_contents):
15491 Likewise for BUF_BYTES_MAX.
15492
dd52fcea
PE
15493 * image.c: Use ptrdiff_t, not int, for sizes.
15494 (slurp_file): Switch from int to ptrdiff_t.
15495 All uses changed.
15496 (slurp_file): Check that file size fits in both size_t (for
15497 malloc) and ptrdiff_t (for sanity and safety).
15498
7f9bbdbb
PE
15499 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15500 if b->modtime has its maximal value.
15501
dfe18f82
PE
15502 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15503
84acfcf0
PE
15504 Don't assume time_t can fit into int.
15505 * buffer.h (struct buffer.modtime): Now time_t, not int.
15506 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15507 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15508
ccd9a01a
PE
15509 Minor fixes for signed vs unsigned integers.
15510 * character.h (MAYBE_UNIFY_CHAR):
15511 * charset.c (maybe_unify_char):
15512 * keyboard.c (read_char, reorder_modifiers):
15513 XINT -> XFASTINT, since the integer must be nonnegative.
15514 * ftfont.c (ftfont_spec_pattern):
15515 * keymap.c (access_keymap, silly_event_symbol_error):
15516 XUINT -> XFASTINT, since the integer must be nonnegative.
15517 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15518 since it makes no difference and we prefer signed.
15519 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15520 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15521 nonnegative.
15522
d6d100dd
SM
155232011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15524
15525 * window.h (Fwindow_frame): Declare.
15526
2b6148e4
PE
155272011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15528
15529 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15530 (SPARE_MEMORY): Always define.
15531 (LARGE_REQUEST): Remove.
15532 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15533
f230ecc9
MR
155342011-06-06 Martin Rudalics <rudalics@gmx.at>
15535
727e958e
MR
15536 * lisp.h: Move EXFUNS for Fframe_root_window,
15537 Fframe_first_window and Fset_frame_selected_window to window.h.
15538
15539 * window.h: Move EXFUNS for Fframe_root_window,
15540 Fframe_first_window and Fset_frame_selected_window here from
15541 lisp.h.
15542
15543 * frame.c (Fwindow_frame, Fframe_first_window)
15544 (Fframe_root_window, Fframe_selected_window)
15545 (Fset_frame_selected_window): Move to window.c.
15546 (Factive_minibuffer_window): Move to minibuf.c.
15547 (Fother_visible_frames_p): New function.
15548
15549 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15550
f230ecc9
MR
15551 * window.c (decode_window, decode_any_window): Move up in code.
15552 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15553 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
15554 (Fwindow_buffer): Move up and rewrite doc-string.
15555 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15556 (Fwindow_prev): New functions.
727e958e
MR
15557 (Fwindow_frame): Move here from frame.c. Accept any window as
15558 argument.
15559 (Fframe_root_window, Fframe_first_window)
15560 (Fframe_selected_window): Move here from frame.c. Accept frame
15561 or arbitrary window as argument. Update doc-strings.
15562 (Fminibuffer_window): Move up in code.
15563 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
15564 (Fset_frame_selected_window): Move here from frame.c.
15565 Marginal rewrite.
727e958e
MR
15566 (Fselected_window, select_window, Fselect_window): Move up in
15567 code. Minor doc-string fixes.
f230ecc9 15568
4d09bcf6
PE
155692011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15570
15571 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15572 Do not assume that spare memory exists; that assumption is valid
15573 only if SYSTEM_MALLOC.
15574 (LARGE_REQUEST): New macro, so that the issue of large requests
15575 is separated from the issue of spare memory.
15576
810928a2
AS
155772011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15578
172418ad
AS
15579 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15580 format. (Bug#8806)
15581
43f862f7
AS
15582 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15583
810928a2
AS
15584 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15585 before statements.
15586
a059fe24
JD
155872011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15588
15589 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15590
15591 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15592
15593 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15594 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15595
989bf368
JB
155962011-06-05 Juanma Barranquero <lekktu@gmail.com>
15597
15598 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15599
4b80f674
CY
156002011-06-04 Chong Yidong <cyd@stupidchicken.com>
15601
15602 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15603 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
15604 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15605 New error handlers.
4b80f674
CY
15606 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15607 Obey Vx_select_enable_clipboard_manager. Catch errors in
15608 x_clipboard_manager_save (Bug#8779).
15609 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 15610 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 15611
99a33b77 156122011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
15613
15614 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15615
99a33b77 156162011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
15617
15618 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15619 in the current matrix if keep_current_p is non-zero.
15620
8264569d
EZ
156212011-06-04 Eli Zaretskii <eliz@gnu.org>
15622
15623 * bidi.c (bidi_level_of_next_char): Fix last change.
15624
57f97249
EZ
156252011-06-03 Eli Zaretskii <eliz@gnu.org>
15626
fec2107c 15627 Support bidi reordering of text covered by display properties.
57f97249 15628
fec2107c
EZ
15629 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15630 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15631 (bidi_cache_search, bidi_cache_iterator_state)
15632 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
15633 (bidi_level_of_next_char, bidi_move_to_visually_next):
15634 Support character positions inside a run of characters covered by a
fec2107c
EZ
15635 display string.
15636 (bidi_paragraph_init, bidi_resolve_explicit_1)
15637 (bidi_level_of_next_char): Call bidi_fetch_char and
15638 bidi_fetch_char_advance instead of FETCH_CHAR and
15639 FETCH_CHAR_ADVANCE.
15640 (bidi_init_it): Initialize new members.
15641 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15642 definitions.
15643 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15644 instead of using explicit *_CHAR codes.
d6d100dd
SM
15645 (bidi_resolve_explicit, bidi_resolve_weak):
15646 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
15647 bidirectional text is supported only in multibyte buffers.
15648 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15649 it to initialize the frame_window_p member of struct bidi_it.
15650 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15651 (bidi_resolve_explicit, bidi_resolve_weak)
15652 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15653 bidi_it->nchars is non-positive.
15654 (bidi_level_of_next_char): Don't try to lookup the cache for the
15655 next/previous character if nothing is cached there yet, or if we
15656 were just reseat()'ed to a new position.
c40e2fb2 15657
0e14fe90
EZ
15658 * xdisp.c (set_cursor_from_row): Set start and stop points
15659 according to the row's direction when priming the loop that looks
15660 for the glyph on which to display cursor.
15661 (single_display_spec_intangible_p): Function deleted.
15662 (display_prop_intangible_p): Reimplement to call
15663 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
15664 Accept 3 additional arguments needed by handle_display_spec.
15665 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
15666 values: lists, `(when COND...)' forms, etc.
15667 (single_display_spec_string_p): Support property values that are
15668 lists with the argument STRING its top-level element.
15669 (display_prop_string_p): Fix the condition for processing a
15670 property that is a list to be consistent with handle_display_spec.
fec2107c 15671 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
15672 last portion of handle_display_prop.
15673 (compute_display_string_pos): Accept additional argument
15674 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15675 value of a `display' property is a "replacing spec".
15676 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15677 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15678 the display property, but just return a value indicating whether
15679 the display property will replace the characters it covers.
15680 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15681 frame_window_p members of struct bidi_it.
d6d100dd
SM
15682 (compute_display_string_pos, compute_display_string_end):
15683 New functions.
fec2107c
EZ
15684 (push_it): Accept second argument POSITION, where pop_it should
15685 jump to continue iteration.
15686 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 15687
fec2107c
EZ
15688 * keyboard.c (adjust_point_for_property): Adjust the call to
15689 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
15690
15691 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
15692 (bidi_init_it): Update prototypes.
15693 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
15694 (compute_display_string_pos, compute_display_string_end):
15695 Declare prototypes.
fec2107c
EZ
15696 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15697 EMACS_INT.
fc6f18ce 15698
40087514 156992011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 15700
57f53182
PE
15701 Malloc failure behavior now depends on size of allocation.
15702 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15703 * lisp.h: Change signatures accordingly.
15704 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15705 All callers changed. (Bug#8762)
15706
15707 * gnutls.c: Use Emacs's memory allocators.
15708 Without this change, the gnutls library would invoke malloc etc.
15709 directly, which causes problems on non-SYNC_INPUT hosts, and which
15710 runs afoul of improving memory_full behavior. (Bug#8761)
15711 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15712 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15713 xfree instead of the default malloc, realloc, free.
15714 (Fgnutls_boot): No need to check for memory allocation failure,
15715 since xmalloc does that for us.
15716
ac32cd99 15717 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
15718 * category.c (hash_get_category_set):
15719 * ccl.c (ccl_driver):
15720 * charset.c (Fdefine_charset_internal):
15721 * charset.h (struct charset.hash_index):
15722 * composite.c (get_composition_id, gstring_lookup_cache)
15723 (composition_gstring_put_cache):
15724 * composite.h (struct composition.hash_index):
15725 * dispextern.h (struct image.hash):
15726 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15727 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15728 (hashfn_equal, hashfn_user_defined, make_hash_table)
15729 (maybe_resize_hash_table, hash_lookup, hash_put)
15730 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15731 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15732 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15733 * image.c (make_image, search_image_cache, lookup_image)
15734 (xpm_put_color_table_h):
15735 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 15736 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 15737 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 15738 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
15739 * alloc.c (allocate_vectorlike):
15740 Check for overflow in vector size calculations.
15741 * ccl.c (ccl_driver):
15742 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
15743 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15744 need to be updated by these changes.
40087514
PE
15745 * fns.c (make_hash_table, maybe_resize_hash_table):
15746 Check for integer overflow with large hash tables.
0de4bb68
PE
15747 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15748 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15749 (SXHASH_REDUCE): New macro.
15750 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15751 Use it instead of discarding useful hash info with large hash values.
15752 (sxhash_float): New function.
15753 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15754 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
15755 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15756 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
15757 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15758 Adjust signatures to match updated version of code.
15759 (consing_since_gc): Now EMACS_INT, since a single hash table can
15760 use more than INT_MAX bytes.
15761
698d32e2
DN
157622011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15763
15764 Make it possible to build with GCC-4.6+ -O2 -flto.
15765
15766 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15767
fd6fa53f
SM
157682011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15769
15770 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15771 Call minibuffer-inactive-mode.
15772
864db017
JB
157732011-05-31 Juanma Barranquero <lekktu@gmail.com>
15774
15775 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15776 Update dependencies.
15777
2ad0baf4
DN
157782011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15779
15780 * data.c (init_data): Remove code for UTS, this system is not
15781 supported anymore.
15782
4fcc2638
DN
157832011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15784
15785 Don't force ./temacs to start in terminal mode.
15786
15787 * frame.c (make_initial_frame): Initialize faces in all cases, not
15788 only when CANNOT_DUMP is defined.
15789 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15790
c56e0fd5
DN
157912011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15792
15793 * dispnew.c (add_window_display_history): Use const for the string
15794 pointer. Remove declaration, not needed.
15795
333d54da 157962011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 15797
55d4c1b2 15798 Use 'inline', not 'INLINE'.
333d54da 15799 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
15800 * alloc.c, fontset.c (INLINE): Remove.
15801 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15802 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15803 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15804 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15805 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15806
738db178
DN
158072011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15808
15809 Make it possible to run ./temacs.
15810
15811 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15812 syms_of_callproc does the same thing. Remove test for
15813 "initialized", do it in the caller.
15814 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15815
620c53a6
SM
158162011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15817
15818 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15819 (read_minibuf): Use get_minibuffer.
15820 (syms_of_minibuf): Use DEFSYM.
15821 (Qmetadata): New var.
15822 * data.c (Qbuffer): Don't make it static.
15823 (syms_of_data): Use DEFSYM.
15824
e003a292
PE
158252011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15826
15827 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15828 (CCL_CODE_MIN): New macro.
15829
ed008a6d
PE
158302011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15831
3687c2ef
PE
15832 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15833
ed008a6d
PE
15834 * eval.c (Qdebug): Now static.
15835 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15836 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15837 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15838
d66c4c7c
CY
158392011-05-29 Chong Yidong <cyd@stupidchicken.com>
15840
15841 * image.c: Various fixes to ImageMagick code comments.
15842 (Fimagemagick_types): Doc fix.
15843
5fbc2025
PE
158442011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15845
0196f88a
PE
15846 Minor fixes prompted by GCC 4.6.0 warnings.
15847
15848 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15849
5fbc2025
PE
15850 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15851 (x_clipboard_manager_save_all): Move extern decl to ...
15852 * xterm.h: ... here, so that it can be checked for consistency.
15853
1dd3c2d9
CY
158542011-05-29 Chong Yidong <cyd@stupidchicken.com>
15855
15856 * xselect.c (x_clipboard_manager_save_frame)
15857 (x_clipboard_manager_save_all): New functions.
15858 (Fx_clipboard_manager_save): Lisp function deleted.
15859
15860 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15861 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15862
15863 * xterm.h: Update prototype.
15864
5ba6571d
WX
158652011-05-28 William Xu <william.xwl@gmail.com>
15866
15867 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15868 exiting (Bug#8239).
15869
3eaff834
JM
158702011-05-28 Jim Meyering <meyering@redhat.com>
15871
e1900994 15872 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
15873 * fns.c (to_uchar): Define.
15874 (crypto_hash_function): Use it to convert some newly-signed
15875 variables to unsigned, to avoid sign-extension bugs. For example,
15876 without this change, (md5 "truc") would evaluate to
15877 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15878 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 15879 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 15880
0f6990a7
PE
158812011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15882
15883 Integer overflow fixes.
c8a9ca5a 15884
08686060
PE
15885 * dbusbind.c: Serial number integer overflow fixes.
15886 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
15887 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15888 to hold a serial number that is too large for a fixnum.
15889 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15890 Check for serial numbers out of range. Decode any serial number
59568bf0 15891 that was so large that it became a float. (Bug#8722)
08686060 15892
2d1fc3c7
PE
15893 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15894 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15895 Use XFASTINT rather than XUINT when numbers are nonnegative.
15896 (xd_append_arg, Fdbus_method_return_internal):
15897 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15898 arguments, check that Lisp number is nonnegative, rather than
59568bf0 15899 silently wrapping negative numbers around. (Bug#8722)
30217ff0 15900 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 15901 (Bug#8722)
2d1fc3c7 15902
c8a9ca5a
PE
15903 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15904
519e1d69
PE
15905 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15906
6df6ae42 15907 ccl: Add integer overflow checks.
30569699
PE
15908 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15909 (IN_INT_RANGE): New macros.
15910 (ccl_driver): Use them to check for integer overflow when
15911 decoding a CCL program. Many of the new checks are whether XINT (x)
15912 fits in int; it doesn't always, on 64-bit hosts. The new version
15913 doesn't catch all possible integer overflows, but it's an
847044ea 15914 improvement. (Bug#8719)
30569699 15915
c11285dc
PE
15916 * alloc.c (make_event_array): Use XINT, not XUINT.
15917 There's no need for unsigned here.
15918
fdccd48e
PE
15919 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15920 This follows up to the 2011-05-06 change that substituted uintptr_t
15921 for EMACS_INT. This case wasn't caught back then.
15922
37910ab2
PE
15923 Rework Fformat to avoid integer overflow issues.
15924 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15925 now (part of C89). Include <verify.h>.
15926 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15927 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15928 (Fformat): Avoid the prepass trying to compute sizes; it was only
15929 approximate and thus did not catch overflow reliably. Instead, walk
15930 through the format just once, formatting and computing sizes as we go,
15931 checking for integer overflow at every step, and allocating a larger
15932 buffer as needed. Keep track separately whether the format is
15933 multibyte. Keep only the most-recently calculated precision, rather
15934 than them all. Record whether each argument has been converted to
15935 string. Use EMACS_INT, not int, for byte and char and arg counts.
15936 Support field widths and precisions larger than INT_MAX. Avoid
15937 sprintf's undefined behavior with conversion specifications such as %#d
15938 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15939 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15940 formatting out-of-range floating point numbers with int
9173deec 15941 formats. (Bug#8668)
37910ab2 15942
2e6578fb
PE
15943 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15944
0ae6bdee
PE
15945 * data.c: Avoid integer truncation in expressions involving floats.
15946 * data.c: Include <intprops.h>.
15947 (arith_driver): When there's an integer overflow in an expression
15948 involving floating point, convert the integers to floating point
15949 so that the resulting value does not suffer from catastrophic
15950 integer truncation. For example, on a 64-bit host (* 4
15951 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15952 Do not rely on undefined behavior after integer overflow.
15953
de883a70
PE
15954 merge count_size_as_multibyte, parse_str_to_multibyte
15955 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 15956 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
15957 Check for integer overflow.
15958 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15959 since it's now a duplicate of the other. This is more of
15960 a character than a buffer op, so better that it's in character.c.
15961 * fns.c, print.c: Adjust to above changes.
15962
2ff916cb
PE
159632011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15964
15965 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15966
f1b54466
PE
159672011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15968
fb1ac845
PE
15969 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15970 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15971 (x_clipboard_manager_save): Now static.
15972 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15973
f1b54466
PE
15974 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15975 (crypto_hash_function): Now static.
15976 Fix pointer signedness problems. Avoid unnecessary initializations.
15977
a9f737ee
CY
159782011-05-27 Chong Yidong <cyd@stupidchicken.com>
15979
15980 * termhooks.h (Vselection_alist): Make it terminal-local.
15981
15982 * terminal.c (create_terminal): Initialize it.
15983
15984 * xselect.c: Support for clipboard managers.
15985 (Vselection_alist): Move to termhooks.h as terminal-local var.
15986 (LOCAL_SELECTION): New macro.
15987 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15988 (symbol_to_x_atom): Remove gratuitous arg.
15989 (x_handle_selection_request, lisp_data_to_selection_data)
15990 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
15991 (x_own_selection, x_get_local_selection, x_convert_selection):
15992 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
15993 (some_frame_on_display): Delete unused function.
15994 (Fx_own_selection_internal, Fx_get_selection_internal)
15995 (Fx_disown_selection_internal, Fx_selection_owner_p)
15996 (Fx_selection_exists_p): New optional frame arg.
15997 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15998 (x_handle_selection_clear): Don't treat other terminals with the
15999 same keyboard specially. Use the terminal-local Vselection_alist.
16000 (x_clear_frame_selections): Use Frun_hook_with_args.
16001
16002 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16003
16004 * xterm.h: Add support for those atoms.
16005
e067f0c1
CY
160062011-05-26 Chong Yidong <cyd@stupidchicken.com>
16007
16008 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16009 (converted_selections, conversion_fail_tag): New global variables.
16010 (x_selection_request_lisp_error): Free the above.
16011 (x_get_local_selection): Remove unnecessary code.
16012 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
16013 of converted selections stored in converted_selections.
16014 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
16015 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16016 (x_convert_selection): New function.
16017 (x_handle_selection_event): Simplify.
16018 (x_get_foreign_selection): Don't ignore incoming requests while
16019 waiting for an answer; this will fail when we implement
16020 SAVE_TARGETS, and seems unnecessary anyway.
16021 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16022 (Vx_sent_selection_functions): Doc fix.
16023
0f4aebc0
LL
160242011-05-26 Leo Liu <sdl.web@gmail.com>
16025
16026 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16027
e61124cd
YM
160282011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16029
16030 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16031
16032 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16033 for fringe update if it has periodic bitmap.
ac389d0c 16034 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
16035 and fringe_bitmap_periodic_p.
16036
16037 * fringe.c (get_fringe_bitmap_data): New function.
16038 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16039 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16040 row. Mark glyph row for fringe update if periodicity changed.
16041
16042 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16043 for fringe update unless it has periodic bitmap.
16044
f16d9837
KH
160452011-05-25 Kenichi Handa <handa@m17n.org>
16046
16047 * xdisp.c (get_next_display_element): Set correct it->face_id for
16048 a static composition.
16049
e1b90ef6
LL
160502011-05-24 Leo Liu <sdl.web@gmail.com>
16051
16052 * deps.mk (fns.o):
16053 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16054
16055 * fns.c (crypto_hash_function, Fsha1): New function.
16056 (Fmd5): Use crypto_hash_function.
16057 (syms_of_fns): Add Ssha1.
16058
7400048f
PE
160592011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16060
16061 * gnutls.c: Remove unused macros.
16062 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16063 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16064 Remove macros that are defined and never used.
16065 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16066
abb71cf4
CY
160672011-05-22 Chong Yidong <cyd@stupidchicken.com>
16068
16069 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16070 (Fx_get_selection_internal): Minor cleanup.
16071 (Fx_own_selection_internal): Rename arguments for consistency with
16072 select.el.
16073
6307db39
PE
160742011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16075
16076 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16077
f3d4e0a4
CY
160782011-05-22 Chong Yidong <cyd@stupidchicken.com>
16079
16080 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16081
4d8ade89
YM
160822011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16083
16084 * dispnew.c (scrolling_window): Don't exclude the case that the
16085 last enabled row in the desired matrix touches the bottom boundary.
16086
32078c8d
GM
160872011-05-21 Glenn Morris <rgm@gnu.org>
16088
16089 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
16090 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16091 and add some more files.
32078c8d 16092
7285dc67
EZ
160932011-05-20 Eli Zaretskii <eliz@gnu.org>
16094
16095 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16096 report_file_error introduced by the change from 2011-05-07.
16097
89d1bd22
PE
160982011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16099
16100 * systime.h (Time): Define only if emacs is defined.
16101 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16102 where the include path doesn't have X11/X.h by default. See
16103 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16104
cd394be1 161052011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
16106
16107 * composite.c (find_automatic_composition): Fix previous change.
16108
b9704ad9
GM
161092011-05-20 Glenn Morris <rgm@gnu.org>
16110
16111 * lisp.mk: New file, split from Makefile.in.
16112 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16113 (shortlisp): Remove.
16114 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16115
4a720484
GM
161162011-05-19 Glenn Morris <rgm@gnu.org>
16117
16118 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16119 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16120 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16121 (lisp): Set the order to that of loadup.el.
16122 (shortlisp): Make it a copy of $lisp.
16123 (SOME_MACHINE_LISP): Remove.
16124 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16125 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16126
a28d4396
KH
161272011-05-18 Kenichi Handa <handa@m17n.org>
16128
16129 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16130 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16131 (find_automatic_composition): Mostly rewrite for efficiency.
16132
a2b1fa8e
JB
161332011-05-18 Juanma Barranquero <lekktu@gmail.com>
16134
16135 * makefile.w32-in: Update dependencies.
16136
8e1f5610
CS
161372011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16138
16139 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 16140 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 16141
7025ee00 161422011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 16143
cdfa6eab
PE
16144 Fix some integer overflow issues, such as string length overflow.
16145
06d6db33
PE
16146 * insdel.c (count_size_as_multibyte): Check for string overflow.
16147
2b4560a8
PE
16148 * character.c (lisp_string_width): Check for string overflow.
16149 Use EMACS_INT, not int, for string indexes and lengths; in
16150 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16151 the resulting string length overflows an EMACS_INT; instead,
16152 report a string overflow if no precision given. When checking for
16153 precision exhaustion, use a check that cannot possibly have
16154 integer overflow. (Bug#8675)
16155 * character.h (lisp_string_width): Adjust to new signature.
16156
cb93f9be
PE
16157 * alloc.c (string_overflow): New function.
16158 (Fmake_string): Use it. This doesn't change behavior, but saves
16159 a few bytes and will simplify future changes.
16160 * character.c (string_escape_byte8): Likewise.
16161 * lisp.h (string_overflow): New decl.
16162
1a1f3366
PE
16163 Fixups, following up to the user-interface timestamp change.
16164 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16165 for UI timestamps, instead of unsigned long.
9fbd6841
PE
16166 * msdos.c (mouse_get_pos): Likewise.
16167 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
16168 * w32gui.h (Time): Define by including "systime.h" rather than by
16169 declaring it ourselves. (Bug#8664)
16170
d4e3e4d3
PE
16171 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16172 * image.c (clear_image_cache): Likewise.
16173
f6a24d19
PE
16174 * term.c (term_mouse_position): Don't assume time_t wraparound.
16175
08dc5ae6
PE
16176 Be more systematic about user-interface timestamps.
16177 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
16178 and sometimes 'EMACS_UINT', to represent these timestamps.
16179 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
16180 This makes the code easier to follow, and makes it easier to catch
16181 integer overflow bugs such as Bug#8664.
16182 * frame.c (Fmouse_position, Fmouse_pixel_position):
16183 Use Time, not unsigned long, for user-interface timestamps.
16184 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16185 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16186 * keyboard.h (last_event_timestamp): Likewise.
16187 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16188 * menu.h (xmenu_show): Likewise.
16189 * term.c (term_mouse_position): Likewise.
16190 * termhooks.h (struct input_event.timestamp): Likewise.
16191 (struct terminal.mouse_position_hook): Likewise.
16192 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16193 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16194 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16195 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16196 what it was before.
16197 * menu.h, termhooks.h: Include "systime.h", for Time.
16198
8e55734a
PE
16199 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16200 Don't assume that the difference between two unsigned long values
16201 can fit into an integer. At this point, we know button_down_time
16202 <= event->timestamp, so the difference must be nonnegative, so
16203 there's no need to cast the result if double-click-time is
16204 nonnegative, as it should be; check that it's nonnegative, just in
16205 case. This bug is triggered when events are more than 2**31 ms
86db42d2 16206 apart (about 25 days). (Bug#8664)
8e55734a 16207
841f1b75 16208 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 16209 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 16210
3e26f69c
PE
16211 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16212 that always fit in int. Use a sentinel instead of a counter, to
16213 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
16214 * frame.h (struct frame): Use int for menu_bar_items_used
16215 instead of EMACS_INT, since it always fits in int.
3e26f69c 16216
5cc152c0
PE
16217 * menu.c (grow_menu_items): Check for int overflow.
16218
d89eb65e
PE
16219 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16220
5235bd3e
PE
16221 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16222 Before, the code was not consistent. These values cannot exceed
16223 2**31 - 1 so there's no need to make them unsigned.
16224 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16225 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16226 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16227 as modifiers.
16228 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16229
bc827e23
PE
16230 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16231 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16232 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16233 presumably because the widths might not match.
16234
78eb494e
PE
16235 * window.c (size_window): Avoid needless test at loop start.
16236
04f2d78b
CB
162372011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16238
16239 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16240
d2fc7e3d 162412011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
16242
16243 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16244
d2fc7e3d 162452011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
16246
16247 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16248 `width' to `bar_area_x' and `bar_area_width', respectively.
16249 (x_scroll_run): Take account of fringe background extension.
16250
04f2d78b
CB
16251 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16252 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
16253 `bar_area_width', respectively.
16254 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16255 background extension.
16256
79b70037
GM
162572011-05-10 Jim Meyering <meyering@redhat.com>
16258
16259 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16260
2f142cc5
JB
162612011-05-10 Juanma Barranquero <lekktu@gmail.com>
16262
16263 * image.c (Finit_image_library): Return t for built-in image types,
16264 like pbm and xbm. (Bug#8640)
16265
57679c86
AS
162662011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16267
16268 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16269
888c9e86
EZ
162702011-05-07 Eli Zaretskii <eliz@gnu.org>
16271
b0512a1d
EZ
16272 * w32console.c (Fset_screen_color): Doc fix.
16273 (Fget_screen_color): New function.
16274 (syms_of_ntterm): Defsubr it.
16275
7285dc67
EZ
16276 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16277 unlink the temporary file if Fcall_process didn't create it in the
16278 first place.
16279 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16280 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
16281 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16282 cue to call_process_cleanup not to close that handle.
16283
4d3fcc8e
BK
162842011-05-07 Ben Key <bkey76@gmail.com>
16285
16286 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16287 one of two shell specific rules, either bootstrap-temacs-CMD or
16288 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16289 to the previous implementation of the bootstrap-temacs rule.
16290 The bootstrap-temacs-CMD rule is similar to the previous
16291 implementation of the bootstrap-temacs rule except that it
16292 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16293 variable.
16294
16295 These changes, along with some changes to nt/configure.bat,
16296 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16297 earlier fix to add support for --cflags and --ldflags options
16298 that include quotes so that it works whether make uses cmd or
16299 sh as the shell.
16300
b4289b64
MA
163012011-05-06 Michael Albinus <michael.albinus@gmx.de>
16302
16303 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16304 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16305 is a constant.
16306 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16307 a string. Handle both cases.
16308 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16309 (Fdbus_register_method): Use Qinvalid_function.
16310
af4c0e28
JB
163112011-05-06 Juanma Barranquero <lekktu@gmail.com>
16312
16313 * makefile.w32-in: Update dependencies.
16314 (LISP_H): Add inttypes.h and stdin.h.
16315 (PROCESS_H): Add unistd.h.
16316
c51453d9
EZ
163172011-05-06 Eli Zaretskii <eliz@gnu.org>
16318
16319 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16320 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16321
8ff0ac3c 163222011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 16323
4c4b566b
PE
16324 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16325
aab2b9b5
PE
16326 * term.c (vfatal): Remove stray call to va_end.
16327 It's not needed and the C Standard doesn't allow it here anyway.
16328
c378da0b
PE
16329 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16330 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16331
288b08c7
PE
16332 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16333 bytes.
16334
e3601888
PE
16335 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16336
db6c0e74
PE
16337 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16338
dd5963ea
PE
16339 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16340
88c9450f
PE
16341 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16342
2f9442b8
PE
16343 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16344
c032b5f8
PE
16345 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16346 * charset.c (Fdefine_charset_internal): Don't initialize
16347 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 16348 32-bit int (Bug#8600).
a108c10b
PE
16349
16350 * lread.c (read_integer): Be more consistent with string-to-number.
16351 Use string_to_number to do the actual conversion; this avoids
16352 rounding errors and fixes some other screwups. Without this fix,
16353 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16354 (digit_to_number): Move earlier, for benefit of read_integer.
16355 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 16356 not a digit in any supported base. (Bug#8602)
a108c10b 16357
ad5f9eea
PE
16358 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16359
aec1708a
PE
16360 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16361 to match comment at start of function. This also removes a
16362 GCC warning about overflow in a 32+64-bit port.
16363
47be4ab5
PE
16364 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16365
371cac43
PE
16366 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16367 Reported by Stefan Monnier in
16368 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
16369 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16370 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 16371
d01a7826
PE
16372 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16373 (EMACS_UINTPTR): Likewise, with uintptr_t.
16374
7fd47d5c
PE
16375 * lisp.h: Prefer 64-bit EMACS_INT if available.
16376 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16377 on 32-bit hosts that have 64-bit int, so that they can access
16378 large files.
122b0c86
PE
16379 However, temporarily disable this change unless the temporary
16380 symbol WIDE_EMACS_INT is defined.
7fd47d5c 16381
8727937b
PE
16382 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16383
8ac068ac
PE
16384 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16385 This removes an assumption that EMACS_INT and long are the same
16386 width as pointers. The assumption is true for Emacs porting targets
16387 now, but we want to make other targets possible.
16388 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16389 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16390 In the rest of the code, change types of integers that hold casted
16391 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16392 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16393 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16394 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16395 No need to cast type when ORing.
16396 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16397 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16398 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16399 assume EMACS_INT is the same width as char *.
16400 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16401 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16402 Remove no-longer-needed casts.
16403 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16404 (xg_tool_bar_help_callback, xg_make_tool_item):
16405 Use EMACS_INTPTR to hold an integer
16406 that will be cast to void *; this can avoid a GCC warning
16407 if EMACS_INT is not the same width as void *.
16408 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16409 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16410 (current_message_1, set_message_1):
16411 Use a local to convert to proper width without a cast.
16412 * xmenu.c (dialog_selection_callback): Likewise.
16413
ede49d71
PE
16414 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16415 Also, don't assume VALBITS / RAND_BITS is less than 5,
16416 and don't rely on undefined behavior when shifting a 1 left into
16417 the sign bit.
16418 * lisp.h (get_random): Change signature to match.
16419
2f30ecd0
PE
16420 * lread.c (hash_string): Use size_t, not int, for hash computation.
16421 Normally we prefer signed values; but hashing is special, because
16422 it's better to use unsigned division on hash table sizes so that
16423 the remainder is nonnegative. Also, size_t is the natural width
16424 for hashing into memory. The previous code used 'int', which doesn't
16425 retain enough info to hash well into very large tables.
16426 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16427
2a866e7b
PE
16428 * dbusbind.c: Don't possibly lose pointer info when converting.
16429 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16430 Use XPNTR rather than XHASH, so that the high-order bits of
16431 the pointer aren't lost when converting through void *.
16432
51639eac
PE
16433 * eval.c (Fautoload): Don't double-shift a pointer.
16434
92394119
PE
16435 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16436
dbdb9a7c
JB
164372011-05-06 Juanma Barranquero <lekktu@gmail.com>
16438
16439 * gnutls.c (DEF_GNUTLS_FN):
16440 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16441
db7a0b4f
AS
164422011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16443
16444 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16445 marker. (Bug#8610)
16446
cd394be1 164472011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
16448
16449 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16450 New version that can reserve upto 2GB of heap space.
16451
f7ff1b0f 164522011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
16453
16454 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16455
639c109b
TZ
164562011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16457
16458 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16459 `gnutls_certificate_set_x509_key_file'.
16460
d2127135
JB
164612011-05-05 Juanma Barranquero <lekktu@gmail.com>
16462
16463 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16464 Update dependencies.
16465
e968f4f3
JB
164662011-05-04 Juanma Barranquero <lekktu@gmail.com>
16467
16468 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16469 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16470 Remove unused parameter `fildes'.
16471 * process.c (read_process_output, send_process): Don't pass it.
16472
84d358f0
JB
164732011-05-04 Juanma Barranquero <lekktu@gmail.com>
16474
16475 Fix previous change: the library cache is defined in w32.c.
16476 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16477 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16478
0898ca10
JB
164792011-05-04 Juanma Barranquero <lekktu@gmail.com>
16480
16481 Implement dynamic loading of GnuTLS on Windows.
16482
16483 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16484 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16485 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16486 Declare.
16487
16488 * gnutls.c (Qgnutls_dll): Define.
16489 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16490 (gnutls_*): Declare function pointers.
16491 (init_gnutls_functions): New function to initialize function pointers.
16492 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16493 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16494 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16495 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16496 (emacs_gnutls_write, emacs_gnutls_read)
16497 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16498 (Fgnutls_available_p): New function.
16499 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16500 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16501 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16502
16503 * image.c: Include w32.h.
16504 (Vimage_type_cache): Delete.
16505 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16506 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16507 (w32_delayed_load): Move to w32.c.
16508
16509 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16510
16511 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16512 (w32_delayed_load): Move from image.c. When loading a library, record
16513 its filename in the :loaded-from property of the library id.
16514 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16515 Initialize and staticpro them.
16516 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16517
16518 * process.c: Include lisp.h before w32.h, not after.
16519 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16520 instead of gnutls_record_check_pending.
16521
16522 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16523
ff4de4aa
TZ
165242011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16525
16526 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16527 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16528 as passed in.
16529
abe95abb
JD
165302011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16531
16532 * xterm.c (x_set_frame_alpha): Do not set property on anything
16533 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16534
e16e55d4
JB
165352011-05-02 Juanma Barranquero <lekktu@gmail.com>
16536
16537 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16538
bafcf6a5
JB
165392011-05-02 Juanma Barranquero <lekktu@gmail.com>
16540
16541 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16542 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16543 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16544 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16545 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16546 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16547 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16548 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16549 (Qgnutls_bootprop_callbacks_verify): Make static.
16550
e7a6747f
AS
165512011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16552
19ed11ba
AS
16553 * callproc.c: Indentation fixup.
16554
e7a6747f 16555 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
16556 (wait_for_termination, interruptible_wait_for_termination):
16557 Move after wait_for_termination_1.
e7a6747f 16558
1ef14cb4
LMI
165592011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16560
16561 * sysdep.c (interruptible_wait_for_termination): New function
16562 which is like wait_for_termination, but allows keyboard
16563 interruptions.
16564
16565 * callproc.c (Fcall_process): Add (:file "file") as an option for
16566 the STDOUT buffer.
16567 (Fcall_process_region): Ditto.
16568
330d880c
EZ
165692011-04-30 Eli Zaretskii <eliz@gnu.org>
16570
8db90b73
EZ
16571 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16572 rather than `XVECTOR (FOO)->size'.
16573
330d880c
EZ
16574 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16575 inttypes.h, as a gnulib replacement is used if it not available in
16576 system headers.
16577
15cbd324
EZ
165782011-04-21 Eli Zaretskii <eliz@gnu.org>
16579
16580 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16581 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16582 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16583
16584 * coding.c (coding_alloc_by_realloc): Error out if destination
16585 will grow beyond MOST_POSITIVE_FIXNUM.
16586 (decode_coding_emacs_mule): Abort if there isn't enough place in
16587 charbuf for the composition carryover bytes. Reserve an extra
16588 space for up to 2 characters produced in a loop.
16589 (decode_coding_iso_2022): Abort if there isn't enough place in
16590 charbuf for the composition carryover bytes.
16591
165922011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 16593
ae940cca
EZ
16594 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16595 aborting when %lld or %lll format is passed.
16596 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16597 %llo or %llx format is passed. (Bug#8545)
16598
03ab8921
EZ
16599 * window.c (window_scroll_line_based): Use a marker instead of
16600 simple variables to record original value of point. (Bug#7952)
16601
afda1437
EZ
16602 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16603 produced by %s or %c overflows available buffer space. (Bug#8545)
16604
f76dee0c
PE
166052011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16606
16607 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 16608 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 16609
fdc5744d
JB
166102011-04-28 Juanma Barranquero <lekktu@gmail.com>
16611
16612 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16613
638f053a
JB
166142011-04-28 Juanma Barranquero <lekktu@gmail.com>
16615
16616 * keyboard.c (Qdelayed_warnings_hook): Define.
16617 (command_loop_1): Run `delayed-warnings-hook'
16618 if Vdelayed_warnings_list is non-nil.
16619 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16620 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16621
d178f871
EZ
166222011-04-28 Eli Zaretskii <eliz@gnu.org>
16623
16624 * doprnt.c (doprnt): Don't return value smaller than the buffer
16625 size if the message was truncated. (Bug#8545).
16626
b124fd93
JB
166272011-04-28 Juanma Barranquero <lekktu@gmail.com>
16628
16629 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16630 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16631
e810457d
PE
166322011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16633
16634 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16635
ea51cceb
JB
166362011-04-27 Juanma Barranquero <lekktu@gmail.com>
16637
16638 * makefile.w32-in: Update dependencies.
16639
94dcfacf
EZ
166402011-04-27 Eli Zaretskii <eliz@gnu.org>
16641
16642 Improve `doprnt' and its usage. (Bug#8545)
16643 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16644 `format_end'. Remove support for %l as a conversion specifier.
16645 Don't use xrealloc. Improve diagnostics when the %l size modifier
16646 is used. Update the commentary.
16647
16648 * eval.c (verror): Simplify calculation of size_t.
16649
16650 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16651 messages.
16652
f61f41d7
PE
166532011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16654
16655 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16656 change.
16657
96fb4434
PE
166582011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16659
16660 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16661 This makes this file independent of the recent pseudovector change.
16662
671875da 166632011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 16664
69e9b5a3
PE
16665 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16666
b5f869a7 16667 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 16668 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 16669 Remove unused local.
c8926152 16670 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 16671
841a1577 16672 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
16673 GCC 4.6.0 optimizes based on type-based alias analysis.
16674 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
16675 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16676 != &v->size, and therefore "v->size = 1; b->size = 2; return
16677 v->size;" must therefore return 1. This assumption is incorrect
16678 for Emacs, since it type-puns struct Lisp_Vector * with many other
16679 types. To fix this problem, this patch adds a new type struct
f904488f 16680 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
16681 and pseudovectors, and helps optimizing compilers not get fooled
16682 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16683 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
16684 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16685 the size member.
eab3844f
PE
16686 (XSETPVECTYPE): Rewrite in terms of new macro.
16687 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16688 This is a bit clearer, and further avoids the possibility of
16689 undesirable aliasing.
16690 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 16691 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
16692 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16693 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
16694 (ASIZE): Now uses header.size rather than size.
16695 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
16696 to avoid the hassle of writing XVECTOR (foo)->header.size.
16697 (struct vectorlike_header): New type.
eab3844f
PE
16698 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16699 object, to help avoid aliasing.
16700 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16701 (SUBRP): Likewise, since Lisp_Subr is a special case.
16702 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16703 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16704 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 16705 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
16706 changed to be "header.size" and "header.next".
16707 * buffer.h (struct buffer): Likewise.
16708 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16709 * frame.h (struct frame): Likewise.
16710 * process.h (struct Lisp_Process): Likewise.
16711 * termhooks.h (struct terminal): Likewise.
16712 * window.c (struct save_window_data, struct saved_window): Likewise.
16713 * window.h (struct window): Likewise.
16714 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16715 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16716 * buffer.c (init_buffer_once): Likewise.
16717 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16718 special case.
16719 * process.c (Fformat_network_address): Use local var for size,
16720 for brevity.
16721
0df1eac5
PE
16722 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16723
847ab9d1 16724 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
16725 * data.c (atof): Remove decl; no longer used or needed.
16726 (digit_to_number): Move to lread.c.
16727 (Fstring_to_number): Use new string_to_number function, to be
16728 consistent with how the Lisp reader treats infinities and NaNs.
16729 Do not assume that floating-point numbers represent EMACS_INT
16730 without losing information; this is not true on most 64-bit hosts.
16731 Avoid double-rounding errors, by insisting on integers when
16732 parsing non-base-10 numbers, as the documentation specifies.
16733 * lisp.h (string_to_number): New decl, replacing ...
16734 (isfloat_string): Remove.
bc0a5c13 16735 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 16736 (read1): Do not accept +. and -. as integers; this
452f4150
PE
16737 appears to have been a coding error. Similarly, do not accept
16738 strings like +-1e0 as floating point numbers. Do not report
16739 overflow for integer overflows unless the base is not 10 which
16740 means we have no simple and reliable way to continue.
16741 Break out the floating-point parsing into a new
16742 function string_to_number, so that Fstring_to_number parses
16743 floating point numbers consistently with the Lisp reader.
04f2d78b 16744 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
16745 (E_CHAR, EXP_INT): Remove, replacing with ...
16746 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16747 (string_to_number): New function, replacing isfloat_string.
16748 This function checks for valid syntax and produces the resulting
16749 Lisp float number too. Rework it so that string-to-number
bc0a5c13 16750 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
16751 so that overflow for non-base-10 numbers is reported only when
16752 there's no portable and simple way to convert to floating point.
452f4150 16753
67769ffc
PE
16754 * textprop.c (set_text_properties_1): Rewrite for clarity,
16755 and to avoid GCC warning about integer overflow.
16756
c20db43f
PE
16757 * intervals.h (struct interval): Use EMACS_INT for members
16758 where EMACS_UINT might cause problems. See
16759 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16760 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16761 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16762 All uses changed.
37aa2f85
PE
16763 (offset_intervals): Tell GCC not to worry about length overflow
16764 when negating a negative length.
c20db43f 16765
2538aa2f
PE
16766 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16767 (overrun_check_free): Likewise.
16768
f2d3008d
PE
16769 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16770 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16771 word size.
16772
ec8df744
PE
16773 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16774 (gnutls_make_error): Rename local to avoid shadowing.
16775 (gnutls_emacs_global_deinit): ifdef out; not used.
16776 (Fgnutls_boot): Use const for pointer to readonly storage.
16777 Comment out unused local. Fix pointer signedness problems.
16778
640ee02d
PE
16779 * lread.c (openp): Don't stuff size_t into an 'int'.
16780 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16781 about possible signed overflow.
16782
6048fb2a
PE
16783 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16784 (GDK_KEY_g): Don't define if already defined.
16785 (xg_prepare_tooltip): Avoid pointer signedness problem.
16786 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16787
fa3c87e1
PE
16788 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16789 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16790
2172544b
PE
16791 * xfns.c (Fx_window_property): Simplify a bit,
16792 to make a bit faster and to avoid GCC 4.6.0 warning.
16793 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16794
9b821a21
PE
16795 * fns.c (internal_equal): Don't assume size_t fits in int.
16796
3c616cfa
PE
16797 * alloc.c (compact_small_strings): Tighten assertion a little.
16798
c2982e87
PE
16799 Replace pEd with more-general pI, and fix some printf arg casts.
16800 * lisp.h (pI): New macro, generalizing old pEd macro to other
16801 conversion specifiers. For example, use "...%"pI"d..." rather
16802 than "...%"pEd"...".
16803 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 16804 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
16805 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16806 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16807 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16808 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16809 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16810 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16811 64-bit hosts.
16812 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16813 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16814 * print.c (safe_debug_print, print_object): Likewise.
16815 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16816 to int.
6f04d126
PE
16817 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16818 avoiding the 0 flag, which is not portable.
c2982e87
PE
16819 * process.c (Fmake_network_process): Use pI to avoid cast.
16820 * region-cache.c (pp_cache): Likewise.
16821 * xdisp.c (decode_mode_spec): Likewise.
16822 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16823 behavior on 64-bit hosts with printf arg.
6f04d126 16824 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
16825 (x_stop_queuing_selection_requests): Likewise.
16826 (x_get_window_property): Don't truncate byte count to an 'int'
16827 when tracing.
0b432f21 16828
5e073ec7
PE
16829 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16830 here, since it parses constructs like leading '-' and spaces,
16831 which are not wanted; and it overflows with large numbers.
16832 Instead, simply match F[0-9]+, which is what is wanted anyway.
16833
36372bf9
PE
16834 * alloc.c: Remove unportable assumptions about struct layout.
16835 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16836 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16837 (allocate_vectorlike, make_pure_vector): Use the new macros,
16838 plus offsetof, to remove unportable assumptions about struct layout.
16839 These assumptions hold on all porting targets that I know of, but
16840 they are not guaranteed, they're easy to remove, and removing them
16841 makes further changes easier.
16842
0b432f21
PE
16843 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16844 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
16845 (string_overrun_cookie): Now const. Use initializers that
16846 don't formally overflow signed char, to avoid warnings.
000098c1
PE
16847 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16848 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
16849 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16850 multiple of sizeof (EMACS_INT); it need not be, if
16851 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 16852 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 16853
895009e1
JB
168542011-04-26 Juanma Barranquero <lekktu@gmail.com>
16855
16856 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16857
6a7a1b0b
TZ
168582011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16859
16860 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 16861 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
16862 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16863
841a1577 168642011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
16865
16866 * lisp.h (Qdebug): List symbol.
895009e1 16867 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
16868 * keyboard.c (debug-on-event): New variable.
16869 (handle_user_signal): Break into debugger when debug-on-event
16870 matches the current signal symbol.
16871
f2d3ba6f
DN
168722011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16873
16874 * alloc.c (check_sblock, check_string_bytes)
16875 (check_string_free_list): Convert to standard C.
16876
42ce4c63
TZ
168772011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16878
16879 * w32.c (emacs_gnutls_push): Fix typo.
16880
825cd63c
EZ
168812011-04-25 Eli Zaretskii <eliz@gnu.org>
16882
fb11d64d
EZ
16883 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16884 "cast to pointer from integer of different size".
16885
825cd63c
EZ
16886 Improve doprnt and its use in verror. (Bug#8545)
16887 * doprnt.c (doprnt): Document the set of format control sequences
16888 supported by the function. Use SAFE_ALLOCA instead of always
16889 using `alloca'.
16890
16891 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16892 is one byte too soon. Don't use xrealloc; instead xfree and
16893 xmalloc anew.
16894
e061a11b
TZ
168952011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16896
16897 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16898 callbacks stage.
16899
16900 * gnutls.c: Renamed global_initialized to
16901 gnutls_global_initialized. Added internals for the
16902 :verify-hostname-error, :verify-error, and :verify-flags
16903 parameters of `gnutls-boot' and documented those parameters in the
16904 docstring. Start callback support.
9173deec
JB
16905 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16906 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16907 on error. Return error code.
e061a11b
TZ
16908 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16909 (emacs_gnutls_read): Likewise.
16910 (Fgnutls_boot): Return handshake error code.
16911 (emacs_gnutls_handle_error): New function.
16912 (wsaerror_to_errno): Likewise.
16913
16914 * w32.h (emacs_gnutls_pull): Add prototype.
16915 (emacs_gnutls_push): Likewise.
16916
16917 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16918 (emacs_gnutls_push): Likewise.
16919
169202011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16921
16922 * process.c (wait_reading_process_output): Check if GnuTLS
16923 buffered some data internally if no FDs are set for TLS
16924 connections.
16925
16926 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16927 (LIBS): Link to USER_LIBS.
16928 ($(BLD)/gnutls.$(0)): New target.
16929
fa6996bc
EZ
169302011-04-24 Eli Zaretskii <eliz@gnu.org>
16931
eb35682e
EZ
16932 * xdisp.c (handle_single_display_spec): Rename the
16933 display_replaced_before_p argument into display_replaced_p, to
16934 make it consistent with the commentary. Fix typos in the
16935 commentary.
16936
e2ad650c
EZ
16937 * textprop.c (syms_of_textprop): Remove dead code.
16938 (copy_text_properties): Delete obsolete commentary about an
16939 interface that was deleted long ago. Fix typos in the description
16940 of arguments.
16941
1b2de274
EZ
16942 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16943 to changes in oldXMenu/XMenu.h from 2011-04-16.
16944 <menu_help_message, prev_menu_help_message>: Constify.
16945 (IT_menu_make_room): menu->help_text is now `const char **';
16946 adjust.
16947
16948 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16949 to changes in oldXMenu/XMenu.h from 2011-04-16.
16950 (struct XMenu): Declare `help_text' `const char **'.
16951
16952 * xfaces.c <Qunspecified>: Make extern again.
16953
16954 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 16955 required by POSIX.
1b2de274 16956
762b15be
EZ
16957 * doc.c (get_doc_string): Improve the format passed to `error'.
16958
16959 * doprnt.c (doprnt): Improve commentary.
16960
16961 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16962
16963 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16964 them with etags.
16965
f1052e5d
EZ
16966 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16967 changes in globals.h immediately force recompilation.
762b15be
EZ
16968 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16969 $(CURDIR)/s/ms-w32.h.
16970 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 16971
fa6996bc
EZ
16972 * character.c (Fchar_direction): Function deleted.
16973 (syms_of_character): Don't defsubr it.
16974 <char-direction-table>: Deleted.
16975
e6c3da20
EZ
169762011-04-23 Eli Zaretskii <eliz@gnu.org>
16977
16978 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16979 * doprnt.c: Include limits.h.
16980 (SIZE_MAX): New macro.
04f2d78b
CB
16981 (doprnt): Return a size_t value. 2nd arg is now size_t.
16982 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
16983 Improve overflow protection. Support `l' modifier for integer
16984 conversions. Support %l conversion. Don't assume an EMACS_INT
16985 argument for integer conversions and for %c.
16986
16987 * lisp.h (doprnt): Restore prototype.
16988
16989 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16990 $(SRC)/character.h.
16991
16992 * Makefile.in (base_obj): Add back doprnt.o.
16993
16994 * deps.mk (doprnt.o): Add back prerequisites.
16995 (callint.o): Depend on character.h.
16996
16997 * eval.c (internal_lisp_condition_case): Include the handler
16998 representation in the error message.
16999 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17000 when breaking from the loop.
17001
17002 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17003
17004 * callint.c (Fcall_interactively): When displaying error message
17005 about invalid control letter, pass the character's codepoint, not
17006 a pointer to its multibyte form. Improve display of the character
17007 in octal and display also its hex code.
17008
17009 * character.c (char_string): Use %x to display the (unsigned)
17010 codepoint of an invalid character, to avoid displaying a bogus
17011 negative value.
17012
17013 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17014 `error', not SYMBOL_NAME itself.
17015
17016 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17017 character arguments to `error'.
17018
17019 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17020 to `error' in error message about FINAL_CHAR argument. Make sure
17021 FINAL_CHAR is a character, and use %c when it is passed as
17022 argument to `error'.
17023
4ffd0d6b 170242011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
17025
17026 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17027
17028 * w32.c: Include <time.h>.
17029 (sys_localtime): New function.
17030
4ffd0d6b 170312011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
17032
17033 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17034
4ffd0d6b 17035 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 17036
4ffd0d6b 170372011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 17038
4ffd0d6b
GM
17039 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17040 zombies (Bug#8467).
aac0c6e3 17041
04c56954
EZ
170422011-04-19 Eli Zaretskii <eliz@gnu.org>
17043
17044 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17045 gl_state.e_property when gl_state.object is Qt.
17046
17047 * insdel.c (make_gap_larger): Remove limitation of buffer size
17048 to <= INT_MAX.
17049
16a43933
CY
170502011-04-18 Chong Yidong <cyd@stupidchicken.com>
17051
17052 * xdisp.c (lookup_glyphless_char_display)
17053 (produce_glyphless_glyph): Handle cons cell entry in
17054 glyphless-char-display.
17055 (Vglyphless_char_display): Document it.
17056
17057 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17058 glyphless-char-display.
17059
4581706e
CY
170602011-04-17 Chong Yidong <cyd@stupidchicken.com>
17061
17062 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17063
17064 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17065
17066 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17067 definition for no-X builds.
17068
4887c6e2 170692011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 17070
fd35b6f9
PE
17071 Static checks with GCC 4.6.0 and non-default toolkits.
17072
5c1ccb01
PE
17073 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17074
006c5daa
PE
17075 * process.c (keyboard_bit_set): Define only if SIGIO.
17076 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17077 (send_process): Repair possible setjmp clobbering.
17078
efc736d3
PE
17079 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17080
4e2fe2e6
PE
17081 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17082
f97334a2
PE
17083 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17084
4e75f29d
PE
17085 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17086 Define only if needed.
17087
90efadd1
PE
17088 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17089 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 17090 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 17091
3c647824
PE
17092 * dispextern.h (struct redisplay_interface): Rename param
17093 to avoid shadowing.
e264f262 17094 * termhooks.h (struct terminal): Likewise.
761383f4 17095 * xterm.c (xembed_send_message): Likewise.
3c647824 17096
b58c5c4a
PE
17097 * insdel.c (make_gap_smaller): Define only if
17098 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17099
cad59032
PE
17100 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17101 it.
17102
c339dc2e
PE
17103 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17104 so that we aren't warned about unused symbols.
17105
91a3e27b
PE
17106 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17107
399c71d3 17108 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 17109
8ffc96f5
PE
17110 * xfns.c (x_real_positions): Mark locals as initialized.
17111
eef9bc79
PE
17112 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17113
098db9dd
PE
17114 * xterm.c: Fix problems found by static analysis with other toolkits.
17115 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
17116 (x_dispatch_event): Declare static if USE_GTK, and
17117 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 17118 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 17119 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
17120 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17121 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 17122
eb18f6cc
PE
17123 * xmenu.c (menu_help_callback): Pointer type fixes.
17124 Use const pointers when pointing at readonly data. Avoid pointer
17125 signedness clashes.
17126 (FALSE): Remove unused macro.
17127 (update_frame_menubar): Remove unused decl.
17128
1fe72bf8
PE
17129 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17130
60d9e1db
PE
17131 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17132 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17133 (single_menu_item): Rename local to avoid shadowing.
17134
39261c26
PE
17135 * keyboard.c (make_lispy_event): Remove unused local var.
17136
018c5e19
PE
17137 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17138 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17139
63d2b86e
PE
17140 * bitmaps: Change bitmaps from unsigned char back to the X11
17141 compatible char. Avoid the old compiler warnings about
17142 out-of-range initializers by using, for example, '\xab' rather
17143 than 0xab.
17144
aefd87e1
PE
17145 * xgselect.c (xgselect_initialize): Check vs interface
17146 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17147
bf501fb9
PE
17148 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17149
e9829fdf
PE
17150 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17151 to read-only memory.
17152
1086c095
PE
17153 * fns.c (vector): Remove; this old hack is no longer needed.
17154
2baccd04 17155 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 17156 Remove unused var.
dde42981 17157 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 17158
72391843 17159 * xrdb.c (x_load_resources): Omit unused local.
3565b346 17160
436c16df 17161 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 17162 (x_window): Rename locals to avoid shadowing.
dc5ddd85 17163 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 17164
92bb796d 17165 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 17166 (x_term_init): Remove local to avoid shadowing.
92bb796d 17167
764430a3 17168 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
17169
17170 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17171 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17172
d1dfb56c
EZ
171732011-04-16 Eli Zaretskii <eliz@gnu.org>
17174
c4354cb4
EZ
17175 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17176
d1dfb56c
EZ
17177 Fix regex.c, syntax.c and friends for buffers > 2GB.
17178 * syntax.h (struct gl_state_s): Declare character position members
17179 EMACS_INT.
17180
17181 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17182
04f2d78b
CB
17183 * textprop.c (verify_interval_modification, interval_of):
17184 Declare arguments EMACS_INT.
d1dfb56c
EZ
17185
17186 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17187 EMACS_INT.
17188
17189 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17190
17191 * indent.c (Fvertical_motion): Local variable it_start is now
17192 EMACS_INT.
17193
17194 * regex.c (re_match, re_match_2, re_match_2_internal)
17195 (bcmp_translate, regcomp, regexec, print_double_string)
17196 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17197 (re_compile_pattern, re_exec): Declare arguments and local
17198 variables `size_t' and `ssize_t' and return values `regoff_t', as
17199 appropriate.
17200 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17201 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17202 <compile_stack_type>: `size' and `avail' are now `size_t'.
17203
17204 * regex.h <regoff_t>: Use ssize_t, not int.
17205 (re_search, re_search_2, re_match, re_match_2): Arguments that
17206 specify buffer/string position and length are now ssize_t and
17207 size_t. Return type is regoff_t.
17208
613052cd
BK
172092011-04-16 Ben Key <bkey76@gmail.com>
17210
17211 * nsfont.m: Fixed bugs in ns_get_family and
17212 ns_descriptor_to_entity that were caused by using free to
17213 deallocate memory blocks that were allocated by xmalloc (via
17214 xstrdup). This caused Emacs to crash when compiled with
17215 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17216 --enable-checking=xmallocoverrun). xfree is now used to
17217 deallocate these memory blocks.
17218
4170f62f 172192011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 17220
71b41406
PE
17221 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17222
9587a89d
PE
17223 emacs_write: Accept and return EMACS_INT for sizes.
17224 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17225 et seq.
17226 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17227 Accept and return EMACS_INT.
17228 (emacs_gnutls_write): Return the number of bytes written on
17229 partial writes.
17230 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
17231 (emacs_read, emacs_write): Remove check for negative size, as the
17232 Emacs source code has been audited now.
9587a89d
PE
17233 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17234 (emacs_read, emacs_write): Use it.
273a5f82
PE
17235 * process.c (send_process): Adjust to the new signatures of
17236 emacs_write and emacs_gnutls_write. Do not attempt to store
17237 a byte offset into an 'int'; it might overflow.
9587a89d 17238 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 17239
3e047f51
PE
17240 * sound.c: Don't assume sizes fit in 'int'.
17241 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 17242 Return EMACS_INT, not int.
3e047f51 17243 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
17244 Accept EMACS_INT, not int.
17245 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
17246 record read return values.
17247
cc39a9db
BK
172482011-04-15 Ben Key <bkey76@gmail.com>
17249
c9d0ec6d
JB
17250 * keyboard.c (Qundefined): Don't declare static since it is used
17251 in nsfns.m.
17252 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17253 static since they are used in nsfont.m.
cc39a9db 17254
6c60eb9f
SM
172552011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17256
17257 * process.c (Qprocessp): Don't declare static.
17258 * lisp.h (Qprocessp): Declare again.
17259
7990b61a
JB
172602011-04-15 Juanma Barranquero <lekktu@gmail.com>
17261
17262 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17263
5d4cb038
PE
172642011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17265
8bd7b830 17266 Improve C-level modularity by making more things 'static'.
cd64ea1d 17267
e3b27b31
PE
17268 Don't publish debugger-only interfaces to other modules.
17269 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17270 (verify_bytepos, count_markers): Move decls to the only modules
17271 that need them.
17272 * region-cache.h (pp_cache): Likewise.
17273 * window.h (check_all_windows): Likewise.
17274 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17275
5d4cb038
PE
17276 * sysdep.c (croak): Now static, if
17277 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17278 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
17279
17280 * alloc.c (refill_memory_reserve): Now static if
17281 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17282 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 17283
e87b6180
PE
17284 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17285 Define only if USE_LUCID.
17286
ac64929e
PE
17287 * xrdb.c (x_customization_string, x_rm_string): Now static.
17288
6f37259d
PE
17289 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17290 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17291
1683e3ab
PE
17292 * xdisp.c (draw_row_with_mouse_face): Now static.
17293 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17294
de9c2632
PE
17295 * window.h (check_all_windows): Mark externally visible.
17296
2b96acb7
PE
17297 * window.c (window_deletion_count): Now static.
17298
17299 * undo.c: Make symbols static if they're not exported.
17300 (last_undo_buffer, last_boundary_position, pending_boundary):
17301 Now static.
17302
50436f33
PE
17303 * textprop.c (interval_insert_behind_hooks): Now static.
17304 (interval_insert_in_front_hooks): Likewise.
17305
64520e5c
PE
17306 * term.c: Make symbols static if they're not exported.
17307 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17308 (max_frame_lines, tty_set_terminal_modes):
17309 (tty_reset_terminal_modes, tty_turn_off_highlight):
17310 (get_tty_terminal): Now static.
17311 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17312 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 17313 HAVE_WINDOW_SYSTEM.
64520e5c
PE
17314 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17315 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17316
1fa53021
PE
17317 * sysdep.c: Make symbols static if they're not exported.
17318 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17319 Now static.
17320 (sigprocmask_set, full_mask): Remove; unused.
17321 (wait_debugging): Mark as visible.
17322 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17323 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17324
d4b43b22
PE
17325 * syntax.c (syntax_temp): Define only if !__GNUC__.
17326
b7c513d0
PE
17327 * sound.c (current_sound_device, current_sound): Now static.
17328
989b29ad
PE
17329 * search.c (searchbufs, searchbuf_head): Now static.
17330
13a55a78
PE
17331 * scroll.c (scroll_cost): Remove; unused.
17332 * dispextern.h (scroll_cost): Remove decl.
17333
de68a1fc
PE
17334 * region-cache.h (pp_cache): Mark as externally visible.
17335
40ccffa6
PE
17336 * process.c: Make symbols static if they're not exported.
17337 (process_tick, update_tick, create_process, chan_process):
17338 (Vprocess_alist, proc_buffered_char, datagram_access):
17339 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17340 (deactivate_process): Mark defn as static, as well as decl.
17341 * lisp.h (create_process): Remove decl.
17342 * process.h (chan_process, Vprocess_alist): Remove decls.
17343
ad64fc97
PE
17344 * print.c: Make symbols static if they're not exported.
17345 (print_depth, new_backquote_output, being_printed, print_buffer):
17346 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17347 (print_interval, print_number_index, initial_stderr_stream):
17348 Now static.
17349 * lisp.h (Fprinc): Remove decl.
17350 (debug_output_compilation_hack): Mark as externally visible.
17351
adddb265
PE
17352 * sysdep.c (croak): Move decl from here to syssignal.h.
17353 * syssignal.h (croak): Put it here, so the API can be checked when
17354 'croak' is called from dissociate_if_controlling_tty.
17355
1717ede2
PE
17356 * minibuf.c: Make symbols static if they're not exported.
17357 (minibuf_save_list, choose_minibuf_frame): Now static.
17358 * lisp.h (choose_minibuf_frame): Remove decl.
17359
fa5fb2bc
PE
17360 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17361
1e3890d1
PE
17362 * lread.c: Make symbols static if they're not exported.
17363 (read_objects, initial_obarray, oblookup_last_bucket_number):
17364 Now static.
17365 (make_symbol): Remove; unused.
17366 * lisp.h (initial_obarray, make_symbol): Remove decls.
17367
8a1414fa
PE
17368 * keyboard.c: Make symbols static if they're not exported.
17369 (single_kboard, recent_keys_index, total_keys, recent_keys):
17370 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17371 (this_single_command_key_start, echoing, last_auto_save):
17372 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17373 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17374 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17375 (Vlispy_mouse_stem, double_click_count):
17376 Now static.
17377 (force_auto_save_soon): Define only if SIGDANGER.
17378 (ignore_mouse_drag_p): Now static if
17379 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17380 (print_help): Remove; unused.
17381 (stop_character, last_timer_event): Mark as externally visible.
17382 * keyboard.h (ignore_mouse_drag_p): Declare only if
17383 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17384 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17385 * lisp.h (echoing): Remove decl.
17386 (force_auto_save_soon): Declare only if SIGDANGER.
17387 * xdisp.c (redisplay_window): Simplify code, to make it more
17388 obvious that ignore_mouse_drag_p is not accessed if !defined
17389 USE_GTK && !defined HAVE_NS.
17390
93ea6e8f
PE
17391 * intervals.c: Make symbols static if they're not exported.
17392 (merge_properties_sticky, merge_interval_right, delete_interval):
17393 Now static.
17394 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17395
77382fcc
PE
17396 * insdel.c: Make symbols static if they're not exported.
17397 However, leave prepare_to_modify_buffer alone. It's never
17398 called from outside this function, but that appears to be a bug.
17399 (combine_after_change_list, combine_after_change_buffer):
4889fc82 17400 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
17401 (adjust_after_replace_noundo): Remove; unused.
17402 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 17403 (signal_before_change): Remove decls.
77382fcc 17404
9306c32e
PE
17405 * indent.c (val_compute_motion, val_vmotion): Now static.
17406
cd44d2eb
PE
17407 * image.c: Make symbols static if they're not exported.
17408 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17409 if USE_GTK.
17410 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17411 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17412
ad9a7a06
PE
17413 * fringe.c (standard_bitmaps): Now static.
17414 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17415
81626931
PE
17416 * frame.c: Make symbols static if they're not exported.
17417 (x_report_frame_params, make_terminal_frame): Now static.
17418 (get_frame_param): Now static, unless HAVE_NS.
17419 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17420 (x_get_resource_string): Remove; not used.
17421 * frame.h (make_terminal_frame, x_report_frame_params):
17422 (x_get_resource_string); Remove decls.
17423 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17424 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17425
239f9db9
PE
17426 * font.c, fontset.c: Make symbols static if they're not exported.
17427 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17428 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17429 * font.c (font_close_object): Now static.
17430 * font.h (font_close_object): Remove.
17431 * fontset.c (FONTSET_OBJLIST): Remove.
17432 (free_realized_fontset) #if-0 the body, which does nothing.
17433 (face_suitable_for_char_p): #if-0, as it's never called.
17434 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
17435 * xfaces.c (face_at_string_position):
17436 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
17437 since 0 is always ASCII.
17438
dfcf3579
PE
17439 * fns.c (weak_hash_tables): Now static.
17440
5045092b
PE
17441 * fileio.c: Make symbols static if they're not exported.
17442 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17443 (Vwrite_region_annotation_buffers): Now static.
17444
57a96f5c
PE
17445 * eval.c: Make symbols static if they're not exported.
17446 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17447 * lisp.h (backtrace_list): Remove decl.
17448
35f08c38
PE
17449 * emacs.c: Make symbols static if they're not exported.
17450 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17451 (fatal_error_code, fatal_error_signal_hook, standard_args):
17452 Now static.
17453 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17454 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17455 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17456 * lisp.h (fatal_error_signal_hook): Remove decl.
17457 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17458
f44bd759
PE
17459 * editfns.c: Move a (normally-unused) function to its only use.
17460 * editfns.c, lisp.h (get_operating_system_release): Remove.
17461 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17462 worth the hassle of breaking this out.
17463
b532497d
PE
17464 * xterm.c: Make symbols static if they're not exported.
17465 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17466 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17467 (x_destroy_window, x_delete_display):
17468 Now static.
17469 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17470 (x_mouse_leave): Remove; unused.
17471 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17472 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17473 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17474 Remove decls.
17475 (x_mouse_leave): Declare only if WINDOWSNT.
17476 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17477 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17478 USE_X_TOOLKIT.
17479
1675728f
PE
17480 * ftxfont.c: Make symbols static if they're not exported.
17481 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17482 HAVE_FREETYPE.
17483 * font.h (ftxfont_driver): Likewise.
17484
e4cebfca
PE
17485 * xfns.c: Make symbols static if they're not exported.
17486 (x_last_font_name, x_display_info_for_name):
17487 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17488 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17489 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17490 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17491 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17492 (last_show_tip_args): Now static.
17493 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17494 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17495 (x_screen_planes): Remove; unused.
17496 * dispextern.h (x_screen_planes): Remove decl.
17497
5bf46f05
PE
17498 * dispnew.c: Make symbols static if they're not exported.
17499 * dispextern.h (redraw_garbaged_frames, scrolling):
17500 (increment_row_positions): Remove.
17501 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17502 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17503 Now static.
17504 (redraw_garbaged_frames): Remove; unused.
17505
435f4c28
PE
17506 * xfaces.c: Make symbols static if they're not exported.
17507 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17508 Remove decls.
17509 * xterm.h (defined_color): Remove decls.
17510 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17511 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17512 (menu_face_changed_default, defined_color, free_realized_face):
17513 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17514 (ascii_face_of_lisp_face): Remove; unused.
17515
8524aef3
PE
17516 * xdisp.c: Make symbols static if they're not exported.
17517 * dispextern.h (scratch_glyph_row, window_box_edges):
17518 (glyph_to_pixel_coords, set_cursor_from_row):
17519 (get_next_display_element, set_iterator_to_next):
17520 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17521 (show_mouse_face): Remove decls
17522 * frame.h (message_buf_print): Likewise.
17523 * lisp.h (pop_message, set_message, check_point_in_composition):
17524 Likewise.
17525 * xterm.h (set_vertical_scroll_bar): Likewise.
17526 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17527 (message_buf_print, scratch_glyph_row, displayed_buffer):
17528 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17529 (get_next_display_element, show_mouse_face, window_box_edges):
17530 (frame_to_window_pixel_xy, check_point_in_composition):
17531 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17532 (glyph_to_pixel_coords): Remove; unused.
17533
16390cd2
PE
17534 * dired.c (file_name_completion): Now static.
17535
17536 * dbusbind.c (xd_in_read_queued_messages): Now static.
17537
a25f4dfa
PE
17538 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17539 * data.c (circular_list_error): Remove.
17540
14a9c8df
PE
17541 * commands.h (last_point_position, last_point_position_buffer):
17542 (last_point_position_window): Remove decls.
17543 * keyboard.c: Make these variables static.
17544
04f2d78b
CB
17545 * coding.h (coding, code_convert_region, encode_coding_gap):
17546 Remove decls.
74ab6df5
PE
17547 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17548 (iso_code_class, detect_coding, code_convert_region): Now static.
17549 (encode_coding_gap): Remove; unused.
17550
38dfbee1
PE
17551 * chartab.c (chartab_chars, chartab_bits): Now static.
17552
a2cb4e63
PE
17553 * charset.h (charset_iso_8859_1): Remove decl.
17554 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17555 Now static.
17556
127198fd
PE
17557 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17558 * ccl.c (Vccl_program_table): Now static.
17559 (check_ccl_update): Remove; unused.
17560
d85b608f
PE
17561 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17562 * category.h: ... from here.
17563 * category.c (check_category_table, set_category_set): Now static.
17564
31cd66f3
PE
17565 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17566 * lisp.h: Remove these decls.
17567
c358e587
PE
17568 * buffer.c (buffer_count): Remove unused var.
17569
e78aecca
PE
17570 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17571 so that it's not optimized away.
17572 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17573 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17574 exported only to the debugger.
17575
e192d7d3 17576 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 17577 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 17578
92470028
PE
17579 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17580 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17581 was inaccessible from Lisp.
17582 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17583 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17584
244ed907
PE
17585 alloc.c: Import and export fewer symbols, and remove unused items.
17586 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17587 is defined.
17588 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17589 it's not optimized away by whole-program optimization.
17590 (message_enable_multibyte, free_misc): Remove.
17591 (catchlist, handlerlist, mark_backtrace):
17592 Declare only if BYTE_MARK_STACK.
17593 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17594 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17595 (message_enable_multibyte): Remove decl.
17596 (free_misc, interval_free_list, float_block, float_block_index):
17597 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17598 (cons_free_list, last_marked_index):
17599 Now static.
17600 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17601 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17602 (mark_backtrace): Define only if BYTE_MARK_STACK.
17603 * xdisp.c (message_enable_multibyte): Now static.
17604
61c2b50e 17605 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
17606 This makes it easier for human readers (and static analyzers)
17607 to see whether these variables are used from other modules.
17608 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17609 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17610 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17611 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17612 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17613 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17614 * xmenu.c, xselect.c:
17615 Declare Q* vars static if they are not used in other modules.
17616 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17617 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17618 Remove decls of unexported vars.
17619 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17620
95c82688
PE
17621 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17622
16a97296
PE
17623 Make Emacs functions such as Fatom 'static' by default.
17624 This makes it easier for human readers (and static analyzers)
17625 to see whether these functions can be called from other modules.
17626 DEFUN now defines a static function. To make the function external
17627 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
17628 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17629 (Finit_image_library):
16a97296
PE
17630 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17631 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17632 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17633 Remove decls, since these functions are now static.
17634 (Funintern, Fget_internal_run_time): New decls, since these functions
17635 were already external.
95c82688 17636
16a97296
PE
17637 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17638 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17639 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17640 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17641 * keyboard.c, keymap.c, lread.c:
17642 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17643 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17644 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17645 Mark functions with DEFUE instead of DEFUN,
17646 if they are used in other modules.
17647 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17648 decls for now-static functions.
17649 * buffer.h (Fdelete_overlay): Remove decl.
17650 * callproc.c (Fgetenv_internal): Mark as internal.
17651 * composite.c (Fremove_list_of_text_properties): Remove decl.
17652 (Fcomposition_get_gstring): New forward static decl.
17653 * composite.h (Fcomposite_get_gstring): Remove decl.
17654 * dired.c (Ffile_attributes): New forward static decl.
17655 * doc.c (Fdocumntation_property): New forward static decl.
17656 * eval.c (Ffetch_bytecode): New forward static decl.
17657 (Funintern): Remove extern decl; now in .h file where it belongs.
17658 * fileio.c (Fmake_symbolic_link): New forward static decl.
17659 * image.c (Finit_image_library): New forward static decl.
17660 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17661 * intervals.h (Fprevious_property_change):
17662 (Fremove_list_of_text_properties): Remove decls.
17663 * keyboard.c (Fthis_command_keys): Remove decl.
17664 (Fcommand_execute): New forward static decl.
17665 * keymap.c (Flookup_key): New forward static decl.
17666 (Fcopy_keymap): Now static.
17667 * keymap.h (Flookup_key): Remove decl.
17668 * process.c (Fget_process): New forward static decl.
17669 (Fprocess_datagram_address): Mark as internal.
17670 * syntax.c (Fsyntax_table_p): New forward static decl.
17671 (skip_chars): Remove duplicate decl.
17672 * textprop.c (Fprevious_property_change): New forward static decl.
17673 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17674 Now internal.
17675 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17676 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17677
785bbd42
PE
17678 * editfns.c (Fformat): Remove unreachable code.
17679
8b913b57
AS
176802011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17681
17682 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17683 change. (Bug#8496)
17684
a6744a35
EZ
176852011-04-13 Eli Zaretskii <eliz@gnu.org>
17686
17687 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17688 when at ZV. (Bug#8487)
17689
e7974947
AS
176902011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17691
baad03f0
AS
17692 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17693 (Bug#8437)
17694 * keyboard.c (parse_tool_bar_item): Likewise.
17695 * sound.c (sound_cleanup, alsa_close): Likewise.
17696 * termcap.c (tgetent): Likewise.
17697 * xfns.c (x_default_font_parameter): Likewise.
17698 * xsettings.c (read_and_apply_settings): Likewise.
17699
e7974947
AS
17700 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17701 (overrun_check_free): Protoize.
17702
28272684
PE
177032011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17704
17705 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17706 since callers should never pass a negative size.
17707 Change the signature to match that of plain 'read' and 'write'; see
17708 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17709 * lisp.h: Update prototypes of emacs_write and emacs_read.
17710
11997c76
EZ
177112011-04-11 Eli Zaretskii <eliz@gnu.org>
17712
17713 * xdisp.c (redisplay_window): Don't try to determine the character
17714 position of the scroll margin if the window start point w->startp
e896f03c 17715 is outside the buffer's accessible region. (Bug#8468)
11997c76 17716
8a2cbd72
EZ
177172011-04-10 Eli Zaretskii <eliz@gnu.org>
17718
17719 Fix write-region and its subroutines for buffers > 2GB.
17720 * fileio.c (a_write, e_write): Modify declaration of arguments and
17721 local variables to support buffers larger than 2GB.
17722 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17723
17724 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17725 argument, local variables, and return value.
17726
17727 * lisp.h: Update prototypes of emacs_write and emacs_read.
17728
17729 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17730
4073e537 177312011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 17732
1ebfdcb6
PE
17733 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17734
b2ded58d
PE
17735 Fix more problems found by GCC 4.6.0's static checks.
17736
7d66342c
PE
17737 * xdisp.c (vmessage): Use a better test for character truncation.
17738
bbf47d44
PE
17739 * charset.c (load_charset_map): <, not <=, for optimization,
17740 and to avoid potential problems with integer overflow.
9248994d 17741 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 17742 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 17743 * editfns.c (Fformat): Likewise.
1e69125e 17744 * syntax.c (skip_chars): Likewise.
3befa583 17745
e3019616
PE
17746 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17747 This also lets GCC 4.6.0 generate slightly better loop code.
17748
becfa255
PE
17749 * callint.c (Fcall_interactively): <, not <=, for optimization.
17750 (Fcall_interactively): Count the number of arguments produced,
17751 not the number of arguments given. This is simpler and lets GCC
17752 4.6.0 generate slightly better code.
17753
dae0cd48
PE
17754 * ftfont.c: Distingish more carefully between FcChar8 and char.
17755 The previous code passed unsigned char * to a functions like
17756 strlen and xstrcasecmp that expect char *, which does not
17757 conform to the C standard.
17758 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17759 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17760 char * when the C standard requires it.
17761
76032d70
PE
17762 * keyboard.c (read_char): Remove unused var.
17763
eb3f1cc8
PE
17764 * eval.c: Port to Windows vsnprintf (Bug#8435).
17765 Include <limits.h>.
17766 (SIZE_MAX): Define if the headers do not.
17767 (verror): Do not give up if vsnprintf returns a negative count.
17768 Instead, grow the buffer. This ports to Windows vsnprintf, which
17769 does not conform to C99. Problem reported by Eli Zaretskii.
17770 Also, simplify the allocation scheme, by avoiding the need for
17771 calling realloc, and removing the ALLOCATED variable.
17772
70476b54
PE
17773 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17774
12020a9e
PE
17775 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17776 But keep the doprint source code for now, as we might revamp it
17777 and use it again (Bug#8435).
ea6c7ae6
PE
17778 * lisp.h (doprnt): Remove.
17779 * Makefile.in (base_obj): Remove doprnt.o.
17780 * deps.mk (doprnt.o): Remove.
17781
5fdb398c
PE
17782 error: Print 32- and 64-bit integers portably (Bug#8435).
17783 Without this change, on typical 64-bit hosts error ("...%d...", N)
17784 was used to print both 32- and 64-bit integers N, which relied on
17785 undefined behavior.
61bdb816 17786 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
17787 * lisp.h (error, verror): Mark as printf-like functions.
17788 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17789 Report overflow in size calculations when allocating printf buffer.
17790 Do not truncate output string at its first null byte.
17791 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17792 Truncate the output at a character boundary, since vsnprintf does not
17793 do that.
17794 * charset.c (check_iso_charset_parameter): Convert internal
17795 character to string before calling 'error', since %c now has the
17796 printf meaning.
17797 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17798 overflow when computing char to be passed to 'error'. Do not
17799 pass Lisp_Object to 'error'; pass the integer instead.
17800 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17801 formatted with plain %d.
17802
b189fa66
PE
17803 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17804
bff87ef0
PE
17805 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17806
7e2cac20
PE
17807 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17808
ce4d90b5
PE
17809 * xterm.c (x_catch_errors): Remove duplicate declaration.
17810
266c9547
PE
17811 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17812
79c49ad2
PE
17813 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17814
368f4090
JM
178152011-04-10 Jim Meyering <meyering@redhat.com>
17816
17817 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17818 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17819 return ssize_t not "int", and use size_t as the buffer length.
17820 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17821 * gnutls.h: Update declarations.
17822 * process.c (read_process_output): Use ssize_t, to match.
17823 (send_process): Likewise.
17824
a32d4040
CY
178252011-04-09 Chong Yidong <cyd@stupidchicken.com>
17826
17827 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17828
8546720e 178292011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 17830
04f2d78b
CB
17831 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17832 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 17833
8546720e
GM
17834 * xterm.c (handle_one_xevent):
17835 * xmenu.c (create_and_show_popup_menu):
17836 * xselect.c (x_decline_selection_request)
17837 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 17838
0a2f5c1a 178392011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
17840
17841 Fix some uses of `int' instead of EMACS_INT.
17842 * search.c (string_match_1, fast_string_match)
17843 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17844 (scan_buffer, find_next_newline_no_quit)
17845 (find_before_next_newline, search_command, Freplace_match)
17846 (Fmatch_data): Make some `int' variables be EMACS_INT.
17847
17848 * xdisp.c (display_count_lines): 3rd argument and return value now
17849 EMACS_INT. All callers changed.
17850 (pint2hrstr): Last argument is now EMACS_INT.
17851
17852 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17853 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17854 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17855 (decode_coding_utf_16, decode_coding_emacs_mule)
17856 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17857 (decode_coding_ccl, decode_coding_charset)
17858 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17859 (decode_coding_iso_2022, decode_coding_emacs_mule)
17860 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17861 <char_offset, last_offset>: Declare EMACS_INT.
17862 (encode_coding_utf_8, encode_coding_utf_16)
17863 (encode_coding_emacs_mule, encode_invocation_designation)
17864 (encode_designation_at_bol, encode_coding_iso_2022)
17865 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17866 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17867 Declare EMACS_INT.
17868 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17869 (encode_invocation_designation): Last argument P_NCHARS is now
17870 EMACS_INT.
17871 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17872 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17873
17874 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17875 All users changed.
17876
17877 * ccl.c (Fccl_execute_on_string): Declare some variables
17878 EMACS_INT.
17879
8546720e 178802011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
17881
17882 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17883
4e19a977
CS
178842011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17885
17886 * process.c (Fformat_network_address): Doc fix.
17887
87302331
R
178882011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17889
ee7683eb 17890 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 17891
cbb59342
CY
178922011-04-08 Chong Yidong <cyd@stupidchicken.com>
17893
17894 * keyboard.c (read_char): Call Lisp function help-form-show,
17895 instead of using internal_with_output_to_temp_buffer.
17896 (Qhelp_form_show): New var.
e0d38eeb 17897 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
17898
17899 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17900
17901 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17902
e67a13ab
CY
179032011-04-06 Chong Yidong <cyd@stupidchicken.com>
17904
04f2d78b
CB
17905 * process.c (Flist_processes): Remove to Lisp.
17906 (list_processes_1): Delete.
e67a13ab 17907
973f782d
EZ
179082011-04-06 Eli Zaretskii <eliz@gnu.org>
17909
7c106b1e
EZ
17910 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17911
973f782d
EZ
17912 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17913
41cf7d1a 179142011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 17915
ca23cc88
PE
17916 Fix more problems found by GCC 4.6.0's static checks.
17917
f390e2d5
PE
17918 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17919
42eea0d0
PE
17920 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17921
b69769da 17922 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 17923
f9541e84
PE
17924 * xdisp.c (vmessage): Mark as a printf-like function.
17925
13841b55
PE
17926 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17927
c136c10f
PE
17928 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17929
5e2d4a30
PE
17930 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17931 printf-like functions.
17932 (tiff_load): Add casts to remove these marks before passing them
17933 to system-supplied API.
17934
583f48b9
PE
17935 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17936
b25d760e
PE
17937 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17938 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
17939 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17940 directly, rather than having caller test rule sign. This avoids
17941 some unnecessary tests.
17942 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17943 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17944 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 17945
bc7b6697 17946 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 17947 (xfont_open): Avoid unnecessary tests.
bc7b6697 17948
27ccc379
PE
17949 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17950
dcd5c89a
PE
17951 * composite.h, composite.c (composition_gstring_put_cache):
17952 Use EMACS_INT, not int, for length.
17953
b13a45c6
PE
17954 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17955 breaking out part of COMPOSITION_DECODE_RULE.
17956 (COMPOSITION_DECODE_RULE): Use it.
17957 * composite.c (get_composition_id): Remove unused local vars,
17958 by using the new macro.
17959
1e792e4d
PE
17960 * textprop.c (set_text_properties_1): Change while to do-while,
17961 since the condition is always true at first.
17962
dc6c6455 17963 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
17964 (interval_deletion_adjustment): Return unsigned value.
17965 All uses changed.
dc6c6455 17966
aba7731a
PE
17967 * process.c (list_processes_1, create_pty, read_process_output):
17968 (exec_sentinel): Remove vars that were set but not used.
afd4052b 17969 (create_pty): Remove unnecessary "volatile"s.
bc57d757 17970 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 17971 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 17972 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 17973
fdfc4bf3
PE
17974 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17975
fca8fe46 17976 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 17977 (update_syntax_table): Use unsigned instead of int.
fca8fe46 17978
06a0259a 17979 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 17980 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 17981 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 17982
e7b9e80f
PE
17983 * print.c (print_error_message): Avoid int overflow.
17984
56201685
PE
17985 * font.c (font_list_entities): Redo for clarity,
17986 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17987
78834453 17988 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 17989 (font_score): Avoid potential overflow in diff calculation.
78834453 17990
0bc0b309 17991 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 17992 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 17993
e610eaca
PE
17994 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17995
b895abce
PE
17996 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17997 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17998 can always succeed if overflow has undefined behavior.
17999
1f1d9321 18000 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 18001 (wordify): Omit three unnecessary tests.
1f1d9321 18002
c59478bc
PE
18003 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18004 All callers changed. This avoids the need for an unused var.
18005
79b73827
PE
18006 * casefiddle.c (casify_region): Remove var that is set but not used.
18007
a4db5dfe
PE
18008 * dired.c (file_name_completion): Remove var that is set but not used.
18009
43aae36e
PE
18010 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18011
2a47c44d 18012 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 18013 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 18014
a37c69bf
PE
18015 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18016 Check for integer overflow on size calculations.
18017
328ab8e7
PE
18018 * buffer.c (Fprevious_overlay_change): Remove var that is set
18019 but not used.
18020
e5a2a5cb
PE
18021 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18022 Remove vars that are set but not used.
8d84a6eb 18023 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 18024 (timer_check_2): Mark vars as initialized.
e5a2a5cb 18025
a60e5f68
PE
18026 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18027
f661cb61 18028 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 18029 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 18030
f0397f5a
PE
18031 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18032 that are set but not used.
18033
8664db06 18034 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 18035 if XCreateBitmapFromData fails (Bug#8410).
8664db06 18036
6abdaa4a
PE
18037 * xselect.c (x_get_local_selection, x_handle_property_notify):
18038 Remove vars that are set but not used.
18039
0ce7538d 18040 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 18041 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 18042
9ae848fc
PE
18043 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18044 Remove var that is set but not used.
0b918413
PE
18045 (scroll_bar_windows_size): Now size_t, not int.
18046 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18047 Check for overflow.
9ae848fc 18048
a5a62657
PE
18049 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18050 (map_tty_color) [!defined MSDOS]: Likewise.
18051
5c5cdd39
PE
18052 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18053
66ebf983
PE
18054 * coding.c: Remove vars that are set but not used.
18055 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18056 All callers changed.
18057 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18058 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18059 (decode_coding_charset): Remove vars that are set but not used.
18060
1be4d761
PE
18061 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18062 that is set but not used.
18063
47553fa8
PE
18064 * print.c (print_object): Remove var that is set but not used.
18065
1f7196bf 18066 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
18067 The gnulib version avoids calling malloc in the usual case,
18068 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18069 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18070 * filelock.c (current_lock_owner): Likewise.
18071 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18072 * sysdep.c: Include allocator.h, careadlinkat.h.
18073 (emacs_no_realloc_allocator): New static constant.
18074 (emacs_readlink): New function.
fdb61804
PE
18075 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18076 ../lib/careadlinkat.h.
d1fdcab7 18077
f84c17c7
SM
180782011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18079
18080 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18081 first non-nil return value).
18082
ef3862ad
JD
180832011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18084
18085 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18086 if not defined (Bug#8403).
18087
376a7006
JB
180882011-04-02 Juanma Barranquero <lekktu@gmail.com>
18089
18090 * xdisp.c (display_count_lines): Remove parameter `start',
18091 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18092 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18093 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18094 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18095 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18096 and thereabouts. All callers changed.
18097 (get_per_char_metric): Remove parameter `f', unused since
18098 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18099
6ca3801d
JM
181002011-04-02 Jim Meyering <meyering@redhat.com>
18101
18102 do not dereference NULL upon failed strdup
18103 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18104 (ns_get_family): Likewise.
18105
d8e2b5ba
JB
181062011-04-02 Juanma Barranquero <lekktu@gmail.com>
18107
18108 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18109
8c74fcbd
JD
181102011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18111
18112 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18113 later (Bug#8403).
18114
7200d79c
SM
181152011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18116
03408648 18117 Add lexical binding.
7200d79c 18118
03408648
SM
18119 * window.c (Ftemp_output_buffer_show): New fun.
18120 (Fsave_window_excursion):
18121 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18122
18123 * lread.c (lisp_file_lexically_bound_p): New function.
18124 (Fload): Bind Qlexical_binding.
18125 (readevalloop): Remove `evalfun' arg.
18126 Bind Qinternal_interpreter_environment.
18127 (Feval_buffer): Bind Qlexical_binding.
18128 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18129 Mark as dynamic.
18130 (syms_of_lread): Declare `lexical-binding'.
18131
18132 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18133
18134 * keyboard.c (eval_dyn): New fun.
18135 (menu_item_eval_property): Use it.
ca105506
SM
18136
18137 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 18138
03408648
SM
18139 * fns.c (concat, mapcar1): Accept byte-code-functions.
18140
18141 * eval.c (Fsetq): Handle lexical vars.
18142 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18143 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18144 (FletX, Flet): Obey lexical binding.
18145 (Fcommandp): Handle closures.
18146 (Feval): New `lexical' arg.
18147 (eval_sub): New function extracted from Feval. Use it almost
18148 everywhere where Feval was used. Look up vars in lexical env.
18149 Handle closures.
18150 (Ffunctionp): Move from subr.el.
18151 (Ffuncall): Handle closures.
18152 (apply_lambda): Remove `eval_flags'.
18153 (funcall_lambda): Handle closures and new byte-code-functions.
18154 (Fspecial_variable_p): New function.
18155 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18156 but without exporting it to Lisp.
23aba0ea 18157
23aba0ea 18158 * doc.c (Fdocumentation, store_function_docstring):
03408648 18159 * data.c (Finteractive_form): Handle closures.
23aba0ea 18160
03408648
SM
18161 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18162 interactive spec.
ba83908c 18163
04f2d78b
CB
18164 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18165 New byte-codes.
03408648
SM
18166 (exec_byte_code): New function extracted from Fbyte_code to handle new
18167 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 18168
03408648 18169 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 18170
03408648 18171 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 18172
e2abce01
JB
181732011-03-31 Juanma Barranquero <lekktu@gmail.com>
18174
18175 * xdisp.c (redisplay_internal): Fix prototype.
18176
63696a73 181772011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 18178
63696a73 18179 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
18180 (try_scrolling): Use it when setting scroll_limit.
18181 Limit scrolling to 100 screen lines.
63696a73
EZ
18182 (redisplay_window): Even when falling back on "recentering",
18183 position point in the window according to scroll-conservatively,
18184 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18185
18186 (try_scrolling): When point is above the window, allow searching
18187 as far as scroll_max, or one screenful, to compute vertical
18188 distance from PT to the scroll margin position. This prevents
18189 try_scrolling from unnecessarily failing when
18190 scroll-conservatively is set to a value slightly larger than the
18191 window height. Clean up the case of PT below the margin at bottom
18192 of window: scroll_max can no longer be INT_MAX. When aggressive
18193 scrolling is in use, don't let point enter the opposite scroll
18194 margin as result of the scroll.
18195 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
18196 threshold of 100 lines for never-recentering scrolling.
18197
e4cc2dfc
JB
181982011-03-31 Juanma Barranquero <lekktu@gmail.com>
18199
18200 * dispextern.h (move_it_by_lines):
18201 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18202 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18203 (message_log_check_duplicate): Remove parameters `prev_bol' and
18204 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18205 (redisplay_internal): Remove parameter `preserve_echo_area',
18206 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18207
18208 * indent.c (Fvertical_motion):
18209 * window.c (window_scroll_pixel_based, Frecenter):
18210 Don't pass `need_y_p' to `move_it_by_lines'.
18211
1c470562
SM
182122011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18213
44f230aa
SM
18214 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18215 steal a few bits to be more compact.
18216 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18217 Remove unneeded casts.
18218
1c470562
SM
18219 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18220
888adce9
ZK
182212011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18222
18223 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18224 binding" message (bug#7967).
18225
f838ed7b
PE
182262011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18227
77861b95
PE
18228 Fix more problems found by GCC 4.6.0's static checks.
18229
de6dbc14
PE
18230 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18231 Remove unused local var.
18232
f838ed7b
PE
18233 * editfns.c (Fmessage_box): Remove unused local var.
18234
792c7b2b
PE
18235 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18236 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18237 Omit unused local vars.
c499e557 18238 * window.c (shrink_windows): Omit unused local var.
b01a1c29 18239 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
18240 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18241 Omit unused local var.
18242
ba0165e1
PE
18243 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18244 Don't assume string length fits in int.
32ad8845 18245 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 18246 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 18247
3c59b4c9
PE
18248 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18249 instead of alloca (Bug#8344).
18250
a3eed478 18251 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 18252 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 18253
eb4d412d
PE
18254 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18255
1658b401
PE
18256 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18257 concerns.
18258
18259 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18260
18261 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 18262
9a2c6e05
PE
18263 * keyboard.c (syms_of_keyboard): Use the same style as later
18264 in this function when indexing through an array. This also
18265 works around GCC bug 48267.
18266
03d0a109
PE
18267 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18268
44f730c8
PE
18269 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18270
fe75f926
PE
18271 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18272 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18273
ffa8c828
PE
18274 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18275 This avoids undefined behavior on integer overflow, and is a bit
18276 more convenient anyway since it is compared to a size_t variable.
18277
c5101a77
PE
18278 Variadic C functions now count arguments with size_t, not int.
18279 This avoids an unnecessary limitation on 64-bit machines, which
18280 caused (substring ...) to crash on large vectors (Bug#8344).
18281 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18282 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 18283 All variadic functions and their callers changed accordingly.
c5101a77
PE
18284 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18285 * data.c (arith_driver, float_arith_driver): Likewise.
18286 * editfns.c (general_insert_function): Likewise.
18287 * eval.c (struct backtrace.nargs, interactive_p)
18288 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18289 (funcall_lambda, mark_backtrace): Likewise.
18290 * fns.c (concat): Likewise.
18291 * frame.c (x_set_frame_parameters): Likewise.
18292 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18293 0 if not found, not -1. All callers changed.
18294
dd3f25f7
PE
18295 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18296 (stack_copy_size): Now size_t, not int.
18297 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18298
461c2ab9
JB
182992011-03-28 Juanma Barranquero <lekktu@gmail.com>
18300
18301 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18302 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18303 All callers changed.
18304
18305 * lisp.h (multibyte_char_to_unibyte):
18306 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18307 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18308 * character.h (CHAR_TO_BYTE8):
18309 * cmds.c (internal_self_insert):
18310 * editfns.c (general_insert_function):
18311 * keymap.c (push_key_description):
18312 * search.c (Freplace_match):
18313 * xdisp.c (message_dolog, set_message_1): All callers changed.
18314
f6d62986
SM
183152011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18316
18317 * keyboard.c (safe_run_hook_funcall): New function.
18318 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18319 don't set the hook to nil, but remove the offending function instead.
18320 (Qcommand_hook_internal): Remove, unused.
18321 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18322 Vcommand_hook_internal.
18323
18324 * eval.c (enum run_hooks_condition): Remove.
18325 (funcall_nil, funcall_not): New functions.
18326 (run_hook_with_args): Call each function through a `funcall' argument.
18327 Remove `cond' argument, now redundant.
18328 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18329 (Frun_hook_with_args_until_failure): Adjust accordingly.
18330 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18331
1db5b1ad
JB
183322011-03-28 Juanma Barranquero <lekktu@gmail.com>
18333
18334 * dispextern.h (string_buffer_position): Remove declaration.
18335
18336 * print.c (strout): Remove parameter `multibyte', unused since
18337 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18338
18339 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18340 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18341 All callers changed.
18342
18343 * w32.c (_wsa_errlist): Use braces for struct initializers.
18344
18345 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18346 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18347 All callers changed.
18348 (string_buffer_position): Likewise. Also, make static (it's never
18349 used outside xdisp.c).
18350 (cursor_row_p): Remove parameter `w', unused since
18351 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18352 (decode_mode_spec): Remove parameter `precision', introduced during
18353 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18354 All callers changed.
18355
5ffb62aa
JD
183562011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18357
18358 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18359
461c2ab9 183602011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
18361
18362 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18363 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18364 (ns_update_auto_hide_menu_bar): New functions.
18365 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18366 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18367 ns_constrain_all_frames.
18368 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18369 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18370
5c380ffb
JD
183712011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18372
18373 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18374
9af30bdf
GM
183752011-03-27 Glenn Morris <rgm@gnu.org>
18376
18377 * syssignal.h: Replace RETSIGTYPE with void.
18378 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18379 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18380 Replace SIGTYPE with void everywhere.
18381 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18382 * s/template.h (SIGTYPE): Remove commented out definition.
18383
e2abce01
JB
183842011-03-26 Eli Zaretskii <eliz@gnu.org>
18385
18386 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18387 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18388
f868cd8a
JB
183892011-03-26 Juanma Barranquero <lekktu@gmail.com>
18390
59eb0929
JB
18391 * w32.c (read_unc_volume): Use parameter `henum', instead of
18392 global variable `wget_enum_handle'.
18393
18394 * keymap.c (describe_vector): Remove parameters `indices' and
18395 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18396 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18397
f868cd8a
JB
18398 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18399
18400 * keyboard.c (timer_check): Remove parameter `do_it_now',
18401 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18402 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18403 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18404
18405 * keyboard.c (read_char):
18406 * w32menu.c (w32_menu_display_help):
18407 * xmenu.c (show_help_event, menu_help_callback):
18408 Adjust calls to `show_help_echo'.
18409
18410 * gtkutil.c (xg_maybe_add_timer):
18411 * keyboard.c (readable_events):
18412 * process.c (wait_reading_process_output):
18413 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18414
18415 * insdel.c (adjust_markers_gap_motion):
18416 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18417 (gap_left, gap_right): Don't call it.
18418
2ecf6fdb
CY
184192011-03-25 Chong Yidong <cyd@stupidchicken.com>
18420
18421 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18422 incurred during fontification.
18423
6b1f9ba4
JB
184242011-03-25 Juanma Barranquero <lekktu@gmail.com>
18425
18426 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18427 (DEFVAR_PER_BUFFER): Don't pass it.
18428
18429 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18430 (scrolling_window): Don't pass it.
18431
0f4a96b5
JB
184322011-03-25 Juanma Barranquero <lekktu@gmail.com>
18433
18434 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18435
18436 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18437 and `suffix'.
18438 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18439 of variables specific to SELinux and computation of `encoded_absname'.
18440
18441 * image.c (XPutPixel): Remove unused variable `height'.
18442
18443 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18444
18445 * unexw32.c (get_section_info): Remove unused variable `section'.
18446
18447 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18448 (system_process_attributes): Remove unused variable `sess'.
18449 (sys_read): Remove unused variable `err'.
18450
18451 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18452 (w32_wnd_proc): Remove unused variable `isdead'.
18453 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18454 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18455 (x_create_tip_frame): Remove unused variable `tem'.
18456
18457 * w32inevt.c (w32_console_read_socket):
18458 Remove unused variable `no_events'.
18459
18460 * w32term.c (x_draw_composite_glyph_string_foreground):
18461 Remove unused variable `width'.
18462
1149507c
JB
184632011-03-24 Juanma Barranquero <lekktu@gmail.com>
18464
18465 * w32term.c (x_set_glyph_string_clipping):
18466 Don't pass uninitialized region to CombineRgn.
18467
9c88f339
JB
184682011-03-23 Juanma Barranquero <lekktu@gmail.com>
18469
18470 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18471 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18472 (Fx_close_connection): Remove unused variable `i'.
18473
18474 * w32font.c (w32font_draw): Return number of glyphs.
18475 (w32font_open_internal): Remove unused variable `i'.
18476 (w32font_driver): Add missing initializer.
18477
18478 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18479 (fill_in_menu): Remove unused variable `items_added'.
18480
18481 * w32term.c (last_mouse_press_frame): Remove static global variable.
18482 (w32_clip_to_row): Remove unused variable `f'.
18483 (x_delete_terminal): Remove unused variable `i'.
18484
18485 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18486 (NOTHING): Remove unused static global variable.
18487 (uniscribe_check_otf): Remove unused variable `table'.
18488 (uniscribe_font_driver): Add missing initializers.
18489
dee091a3
JD
184902011-03-23 Julien Danjou <julien@danjou.info>
18491
18492 * term.c (Fsuspend_tty, Fresume_tty):
18493 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18494 * window.c (temp_output_buffer_show):
18495 * insdel.c (signal_before_change):
18496 * frame.c (Fhandle_switch_frame):
18497 * fileio.c (Fdo_auto_save):
18498 * emacs.c (Fkill_emacs):
18499 * editfns.c (save_excursion_restore):
18500 * cmds.c (internal_self_insert):
18501 * callint.c (Fcall_interactively):
18502 * buffer.c (Fkill_all_local_variables):
18503 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18504 Use Frun_hooks.
0f4a96b5 18505 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 18506 unconditionally since it does the check itself.
dee091a3 18507
2c520ab5 185082011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 18509
c9c49752
PE
18510 Fix more problems found by GCC 4.5.2's static checks.
18511
8abc3f12
PE
18512 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18513 the first time through the loop, since we know p0 < p1 then.
18514 This also avoids a gcc -Wstrict-overflow warning.
18515
a2d26660
PE
18516 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18517 leading to a memory leak, possible in functions like
18518 load_charset_map_from_file that can allocate an unbounded number
b12ef411 18519 of objects (Bug#8318).
a2d26660 18520
916c72e9
PE
18521 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18522 that could (at least in theory) be that large.
18523
19ab8a18
PE
18524 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18525 This is less likely to overflow, and avoids undefined behavior if
18526 overflow does occur. All callers changed. Use strtoul to scan
18527 for the unsigned long integer.
b7cbbd6f
PE
18528 (pint2hrstr): Simplify and tune code slightly.
18529 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 18530
f0641eff
PE
18531 * scroll.c (do_scrolling): Work around GCC bug 48228.
18532 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18533
7f650bb9
PE
18534 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18535 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
18536 (validate_x_resource_name): Simplify count usage.
18537 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 18538
37dd57d1
PE
18539 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18540 fail (Bug#8306).
81e56e61 18541
699979fc 18542 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 18543
401bf9b4
PE
18544 * process.c (Fmake_network_process): Use socklen_t, not int,
18545 where POSIX says socklen_t is required in portable programs.
18546 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 18547 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
18548 (Fmake_network_process, server_accept_connection):
18549 (wait_reading_process_output, read_process_output):
18550 Likewise.
18551
b93aacde
PE
18552 * process.c: Rename or move locals to avoid shadowing.
18553 (list_processes_1, Fmake_network_process):
18554 (read_process_output_error_handler, exec_sentinel_error_handler):
18555 Rename or move locals.
4dc343ee 18556 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 18557 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 18558 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 18559 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 18560 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 18561
af8a867c 18562 Make tparam.h and terminfo.c consistent.
44f230aa
SM
18563 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18564 Include tparam.h instead, since it declares them.
af8a867c
PE
18565 * cm.h (PC): Remove extern decl; tparam.h now does this.
18566 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18567 * terminfo.c: Include tparam.h, to check interfaces.
18568 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18569 (tparam): Adjust signature to match interface in tparam.h;
18570 this removes some undefined behavior. Check that outstring and len
18571 are zero, which they always are with Emacs.
18572 * tparam.h (PC, BC, UP): New extern decls.
18573
0248044d 18574 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 18575 (xftfont_open): Rename locals to avoid shadowing.
0248044d 18576
8ff096c1 18577 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
18578 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18579 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 18580 (ftfont_list): Remove unused local.
49eaafba
PE
18581 (get_adstyle_property, ftfont_pattern_entity):
18582 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18583 Rename locals to avoid shadowing.
8ff096c1 18584
e2be39f6
PE
18585 * xfont.c (xfont_list_family): Mark var as initialized.
18586
c9735e30
PE
18587 * xml.c (make_dom): Now static.
18588
8f5201ae
PE
18589 * composite.c (composition_compute_stop_pos): Rename local to
18590 avoid shadowing.
b246f932
PE
18591 (composition_reseat_it): Remove unused locals.
18592 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 18593 (composition_update_it): Mark var as initialized.
11b61122
PE
18594 (find_automatic_composition): Mark vars as initialized,
18595 with a FIXME (Bug#8290).
8f5201ae 18596
760fbc2c
PE
18597 character.h: Rename locals to avoid shadowing.
18598 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18599 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18600 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18601 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18602 to avoid shadowing.
18603
ff08eb85
PE
18604 * textprop.c (property_change_between_p): Remove; unused.
18605
fc7bf025
PE
18606 * intervals.c (interval_start_pos): Now static.
18607
235d7abc
PE
18608 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18609
44f230aa
SM
18610 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18611 Rename locals to avoid shadowing.
3e7d6594 18612
50060332
PE
18613 * sound.c (wav_play, au_play, Fplay_sound_internal):
18614 Fix pointer signedness.
d01f234b 18615 (alsa_choose_format): Remove unused local var.
c83b8872
PE
18616 (wav_play): Initialize a variable to 0, to prevent undefined
18617 behavior (Bug#8278).
50060332 18618
c4fc4e30
PE
18619 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18620
918436ed
PE
18621 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18622
c939f91b
PE
18623 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18624 clobbering (Bug#8298).
b9c7f648
PE
18625 * sysdep.c (sys_subshell): Likewise.
18626 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 18627
6bd8c144
PE
18628 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18629 This should get cleaned up, so that child_setup has the
18630 same signature on all platforms.
18631
7710357c 18632 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 18633 (relocate_fd): Rename locals to avoid shadowing.
7710357c 18634
c59da222
CY
186352011-03-22 Chong Yidong <cyd@stupidchicken.com>
18636
18637 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18638 not to be necessary, and produces flickering.
18639
66b87493
GM
186402011-03-20 Glenn Morris <rgm@gnu.org>
18641
18642 * config.in: Remove file.
18643
45b6f6d5
JB
186442011-03-20 Juanma Barranquero <lekktu@gmail.com>
18645
18646 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18647 are now in src/globals.h.
18648 (syms_of_minibuf): Remove spurious & from previous change.
18649
cd394be1 186502011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
18651
18652 * minibuf.c (completing-read-function): New variable.
18653 (completing-read-default): Rename from completing-read.
18654 (completing-read): Call completing-read-function.
18655
b14e3e21
CY
186562011-03-19 Juanma Barranquero <lekktu@gmail.com>
18657
18658 * xfaces.c (Fx_load_color_file):
18659 Read color file from absolute filename (bug#8250).
18660
f2b726e6
JB
186612011-03-19 Juanma Barranquero <lekktu@gmail.com>
18662
18663 * makefile.w32-in: Update dependencies.
18664
09f6ff02
EZ
186652011-03-17 Eli Zaretskii <eliz@gnu.org>
18666
18667 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18668
29a6015a
PE
186692011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18670
a3a6c54e
PE
18671 Fix more problems found by GCC 4.5.2's static checks.
18672
b766f867
PE
18673 * process.c (make_serial_process_unwind, send_process_trap):
18674 (sigchld_handler): Now static.
18675
be02381c
PE
18676 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18677 That way, the code declares only the vars that it needs.
18678 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18679 * s/cygwin.h (PTY_ITERATION): Likewise.
18680 * s/darwin.h (PTY_ITERATION): Likewise.
18681 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18682
57048744
PE
18683 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18684 * process.c (allocate_pty): Don't declare stb unless it's needed.
18685
7914961c 18686 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
18687 (CONSTANTLIM): Remove; unused.
18688 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18689 Define only if needed.
7914961c 18690
b3967b18
PE
18691 * unexelf.c (unexec): Name an expression,
18692 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
18693 Use a different way to cause a compilation error if anyone uses
18694 n rather than nn, a way that does not involve shadowing.
73366a00 18695 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 18696
29a6015a
PE
18697 * deps.mk (unexalpha.o): Remove; unused.
18698
43cfc33e 18699 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 18700 * unexec.h: New file.
ce701a33
PE
18701 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18702 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18703 Depend on unexec.h.
18704 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18705 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18706 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 18707 Change as necessary to match prototype in unexec.h.
ce701a33 18708
01f44d5a
PE
18709 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18710 shadowing.
4f63c6bb 18711 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 18712
a6670b0b
PE
18713 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18714 Rename locals to avoid shadowing.
18715
cef2010d 18716 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 18717 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 18718
d4d7173a
PE
18719 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18720
f08b802a
PE
18721 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18722 warning when compiling print.c.
18723
3ddb0639
PE
18724 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18725 instead of using an uninitialized var.
5ad03b97 18726 (font_sort_entities): Mark var as initialized.
3ddb0639 18727
170a2692
PE
18728 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18729
e663c700
PE
18730 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18731 pointers to constants.
89bc529a 18732 (font_parse_fcname): Remove unused vars.
7b81e2d0 18733 (font_delete_unmatched): Now static.
ea838e10 18734 (font_get_spec): Remove; unused.
13a547c6
PE
18735 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18736 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18737 Rename or move locals to avoid shadowing.
e663c700 18738
2a80c887 18739 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 18740 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 18741
1384fa33 18742 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 18743 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 18744
8b2c52e9
PE
18745 * alloc.c (mark_backtrace): Move decl from here ...
18746 * lisp.h: ... to here, so that it can be checked.
18747
475545b5 18748 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 18749 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
18750 (lisp_indirect_variable): Name an expression,
18751 to avoid gcc -Wbad-function-cast warning.
1faed8ae 18752 (Fdefvar): Rename locals to avoid shadowing.
475545b5 18753
b1349114 18754 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 18755 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 18756 Use const pointer when appropriate.
b1349114 18757
a2928364
PE
18758 * lisp.h (get_system_name, get_operating_system_release):
18759 Move decls here, to check interfaces.
18760 * process.c (get_operating_system_release): Move decl to lisp.h.
18761 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
18762 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18763 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18764 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
18765 (Fformat_time_string, Fencode_time, Finsert_char):
18766 (Ftranslate_region_internal, Fformat):
18767 Rename or remove local vars to avoid shadowing.
9710023e 18768 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 18769
a415e694
PE
18770 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18771 avoid shadowing.
18772
8ef4622d
PE
18773 * lisp.h (eassert): Check that the argument compiles, even if
18774 ENABLE_CHECKING is not defined.
18775
946f9a5b
PE
18776 * data.c (Findirect_variable): Name an expression, to avoid
18777 gcc -Wbad-function-cast warning.
112396d6 18778 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 18779 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
18780 (Fmake_variable_buffer_local, Fmake_local_variable):
18781 Mark variables as initialized.
52746918 18782 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 18783
e5aab7e7 18784 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
18785 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18786 Rename locals to avoid shadowing.
dff45157
PE
18787 (mark_stack): Move local variables into the #ifdef region where
18788 they're used.
7bc26fdb
PE
18789 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18790 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18791 needed otherwise.
18792 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18793 (GC_STRING_CHARS): Remove; not used.
d40d4be1 18794 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 18795
e5aab7e7
PE
18796 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18797 avoids undefined behavior in theory.
18798
4da60324
PE
18799 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18800
88043301
PE
18801 Use functions, not macros, for up- and down-casing (Bug#8254).
18802 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18803 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18804 to use the following functions instead of these macros.
18805 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18806 EMACS_INT, since callers assume the returned value fits in int.
18807 (upcase1): Likewise, for UPCASE_TABLE.
18808 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 18809 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 18810 the race-condition problem in the old DOWNCASE.
88043301 18811
19ed5445
PE
18812 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18813 Rename locals to avoid shadowing.
18814 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
18815 (regex_compile, re_search_2, re_match_2_internal):
18816 Remove unused local vars.
952db0d7
PE
18817 (FREE_VAR): Rewrite so as not to use empty "else",
18818 which gcc can warn about.
da053e48 18819 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
18820 (RETALLOC_IF): Define only if needed.
18821 (WORDCHAR_P): Likewise. This one is never needed, but is used
18822 only in a comment talking about a compiler bug, so put inside
18823 the #if 0 of that comment.
18824 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18825 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18826 Remove; unused.
19ed5445 18827
1f3561e4 18828 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
18829 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18830 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 18831
ded6f8f7
PE
18832 * search.c (simple_search): Remove unused var.
18833
dbd37a95
PE
18834 * dired.c (compile_pattern): Move decl from here ...
18835 * lisp.h: ... to here, so that it can be checked.
18836 (struct re_registers): New forward decl.
18837
7e47afad
PE
18838 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18839
85f24f61
PE
18840 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18841 All uses changed.
18842 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18843 Rename locals to avoid shadowing.
5671df8f 18844 (Fvertical_motion): Mark locals as initialized.
85f24f61 18845
181aa2be 18846 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 18847 (casify_region): Mark local as initialized.
181aa2be 18848
930d429c
PE
18849 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18850
7082eac6
PE
18851 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18852 New macros, so that the caller can use some names other than
18853 gcpro1, gcpro2, etc.
18854 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18855 of the new macros.
18856 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18857 argument, for consistency with GCPRO2_VAR, etc: it is now the
18858 prefix of the variable, not the variable itself. All uses
18859 changed.
38b2c076
PE
18860 * dired.c (directory_files_internal, file_name_completion):
18861 Rename locals to avoid shadowing.
18862
15206ed9
PE
18863 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18864 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18865 dired.c's scmp function, had undefined behavior.
18866 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18867 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18868 * buffer.h: ... to here, because these macros use current_buffer,
18869 and the new implementation with inline functions needs to have
18870 current_buffer in scope now, rather than later when the macros
18871 are used.
18872 (downcase, upcase1): New static inline functions.
18873 (DOWNCASE, UPCASE1): Reimplement using these functions.
18874 This avoids undefined behavior in expressions like
18875 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18876 from race conditions in accessing the global variables
18877 case_temp1 and case_temp2.
18878 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18879 * lisp.h (case_temp1, case_temp2): Remove their decls.
18880 * character.h (ASCII_CHAR_P): Move from here ...
18881 * lisp.h: ... to here, so that the inline functions mentioned
18882 above can use them.
18883
4a6bea26
PE
18884 * dired.c (directory_files_internal_unwind): Now static.
18885
f14b7e14
PE
18886 * fileio.c (file_name_as_directory, directory_file_name):
18887 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18888 Now static.
2893f146
PE
18889 (file_name_as_directory): Use const pointers when appropriate.
18890 (Fexpand_file_name): Likewise. In particular, newdir might
18891 point at constant storage, so make it a const pointer.
fd4ead52 18892 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
18893 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18894 signedness issues.
f839df0c
PE
18895 (Fset_file_times, Finsert_file_contents, auto_save_error):
18896 Rename locals to avoid shadowing.
f14b7e14 18897
5716756e 18898 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
18899 (Ftry_completion, Fall_completions): Rename or remove locals
18900 to avoid shadowing.
5716756e 18901
b4c3046a
PE
18902 * marker.c (bytepos_to_charpos): Remove; unused.
18903
b45db522
PE
18904 * lisp.h (verify_bytepos, count_markers): New decls,
18905 so that gcc does not warn that these functions aren't declared.
18906
85876d07
PE
18907 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18908 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 18909 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 18910 (copy_text): Remove unused local var.
85876d07 18911
03d78a21 18912 * filelock.c (within_one_second): Now static.
b3dd38ab 18913 (lock_file_1): Rename local to avoid shadowing.
03d78a21 18914
5df8f01b
PE
18915 * buffer.c (fix_overlays_before): Mark locals as initialized.
18916 (fix_start_end_in_overlays): Likewise. This function should be
18917 simplified by using pointers-to-pointers, but that's a different
18918 matter.
b1d876f1 18919 (switch_to_buffer_1): Now static.
8f54f30a
PE
18920 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18921 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 18922
a70072c9 18923 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 18924 Fix pointer signedness issue.
edced198
PE
18925 (sys_subshell): Mark local as volatile if checking for lint,
18926 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 18927 (MAXPATHLEN): Define only if needed.
a70072c9 18928
a0977c44
PE
18929 * process.c (serial_open, serial_configure): Move decls from here ...
18930 * systty.h: ... to here, so that they can be checked.
18931
a884fdcc
PE
18932 * fns.c (get_random, seed_random): Move extern decls from here ...
18933 * lisp.h: ... to here, so that they can be checked.
18934
604efe86 18935 * sysdep.c (reset_io): Now static.
b8950c94 18936 (wait_for_termination_signal): Remove; unused.
604efe86 18937
38fc62d9
PE
18938 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18939 (copy_keymap_item, append_key, push_text_char_description):
18940 Now static.
1004a21a 18941 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 18942 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
18943 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18944 (describe_map_tree):
18945 Rename locals to avoid shadowing.
38fc62d9 18946
2f2650da
PE
18947 * keyboard.c: Declare functions static if they are not used elsewhere.
18948 (echo_char, echo_dash, cmd_error, top_level_2):
18949 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
18950 (read_char, kbd_buffer_get_event, make_lispy_position):
18951 (make_lispy_event, make_lispy_movement, apply_modifiers):
18952 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18953 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18954 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 18955 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 18956 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 18957
a053e86c 18958 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
18959 (mark_kboards): Move decl here ...
18960 * alloc.c (mark_kboards): ... from here.
a053e86c 18961
4752793e
PE
18962 * lisp.h (force_auto_save_soon): New decl.
18963
74f10ca7 18964 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
18965 (DEFINE_DUMMY_FUNCTION): New macro.
18966 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18967 Use it.
c03cd23f
PE
18968 (main): Add casts to avoid warnings
18969 if GCC considers string literals to be constants.
74f10ca7 18970
022e70d4
PE
18971 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18972
59d6fe83
PE
18973 * dbusbind.c: Pointer signedness fixes.
18974 (xd_signature, xd_append_arg, xd_initialize):
18975 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18976 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18977 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18978 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18979
78320123
PE
18980 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18981 if GCC considers string literals to be constants.
49cebcca 18982 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 18983
35ac2a97
SM
189842011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18985
fb103ca9
SM
18986 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18987 (print_preprocess, print_object): New macro to fix last change.
18988
35ac2a97
SM
18989 * print.c (print_preprocess): Don't forget font objects.
18990
62973b41
JB
189912011-03-16 Juanma Barranquero <lekktu@gmail.com>
18992
18993 * emacs.c (USAGE3): Doc fixes.
18994
0e48bb22
AS
189952011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18996
18997 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18998 structure.
18999
7684e57b
JB
190002011-03-14 Juanma Barranquero <lekktu@gmail.com>
19001
19002 * lisp.h (VWindow_system, Qfile_name_history):
19003 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19004 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19005 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19006
19007 * w32select.c: Don't #include "keyboard.h".
c96bbc66 19008 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
19009
19010 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19011 * w32console.c (detect_input_pending, read_input_pending)
19012 (encode_terminal_code):
19013 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19014 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19015 (w32_system_caret_y, Qfile_name_history):
19016 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19017 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19018 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19019 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19020 * w32proc.c (Qlocal, report_file_error):
19021 * w32term.c (Vwindow_system, updating_frame):
19022 * w32uniscribe.c (initialized, uniscribe_font_driver):
19023 Remove unneeded extern declarations.
19024
2aa46d6c
CY
190252011-03-14 Chong Yidong <cyd@stupidchicken.com>
19026
c96bbc66 19027 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 19028
cffc6f3b
CY
190292011-03-13 Chong Yidong <cyd@stupidchicken.com>
19030
19031 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19032 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19033 These macros can no longer be used for assignment.
19034
44f230aa
SM
19035 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19036 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
19037 (record_buffer_markers, fetch_buffer_markers): New functions for
19038 recording and fetching special buffer markers.
19039 (set_buffer_internal_1, set_buffer_temp): Use them.
19040
19041 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19042
19043 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19044
19045 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19046 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19047
19048 * xdisp.c (hscroll_window_tree):
19049 (reconsider_clip_changes): Use PT instead of BUF_PT.
19050
d251f04b
EZ
190512011-03-13 Eli Zaretskii <eliz@gnu.org>
19052
19053 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19054 $(EMACS_ROOT)/lib/intprops.h.
19055
f0c77cd1
PE
190562011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19057
3eca4629
PE
19058 Fix more problems found by GCC 4.5.2's static checks.
19059
7c86ee98
PE
19060 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19061 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
19062 (xg_free_frame_widgets): Make it clear that a local variable is
19063 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
19064 (gdk_window_get_screen): Make it clear that this macro is needed
19065 only if USE_GTK_TOOLTIP.
1e5524e7
PE
19066 (int_gtk_range_get_value): New function, which avoids a diagnostic
19067 from gcc -Wbad-function-cast.
19068 (xg_set_toolkit_scroll_bar_thumb): Use it.
19069 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19070 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
19071 (get_utf8_string, xg_get_file_with_chooser):
19072 Rename locals to avoid shadowing.
19073 (create_dialog): Move locals to avoid shadowing.
7c86ee98 19074
41729b81
PE
19075 * xgselect.c (xg_select): Remove unused var.
19076
f0c77cd1
PE
19077 * image.c (four_corners_best): Mark locals as initialized.
19078 (gif_load): Initialize transparent_p to zero (Bug#8238).
19079 Mark another local as initialized.
ec6cf4c6 19080 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 19081
ce0ad53d 19082 * image.c (clear_image_cache): Now static.
d5d5a617 19083 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 19084 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
19085 (x_edge_detection): Remove unnecessary cast that
19086 gcc -Wbad-function-cast diagnoses.
2037898d 19087 (gif_load): Fix pointer signedness.
6ae141d6
PE
19088 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19089 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 19090
33383987 190912011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 19092
d32df629
PE
19093 Improve quality of tests for time stamp overflow.
19094 For example, without this patch (encode-time 0 0 0 1 1
19095 1152921504606846976) returns the obviously-bogus value (-948597
19096 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19097 reports time overflow. See
19098 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
19099 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19100 * editfns.c: Include limits.h and intprops.h.
19101 (TIME_T_MIN, TIME_T_MAX): New macros.
19102 (time_overflow): Move earlier, to before first use.
19103 (hi_time, lo_time): New functions, for an accurate test for
19104 out-of-range times.
19105 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19106 (Fget_internal_run_time): Don't assume time_t fits in int.
19107 (make_time): Use list2 instead of Fcons twice.
19108 (Fdecode_time): More accurate test for out-of-range times.
19109 (check_tm_member): New function.
19110 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
19111 (lisp_time_argument): Don't rely on undefined left-shift and
19112 right-shift behavior when checking for time stamp overflow.
8be6f318 19113
fe31d94c
PE
19114 * editfns.c (time_overflow): New function, refactoring common code.
19115 (Fformat_time_string, Fdecode_time, Fencode_time):
19116 (Fcurrent_time_string): Use it.
19117
8be6f318
PE
19118 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19119 * dired.c (make_time): Move to ...
19120 * editfns.c (make_time): ... here.
19121 * systime.h: Note the move.
19122
09d9db2c 191232011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 19124
126bc0dc
YM
19125 * fringe.c (update_window_fringes): Remove unused variables.
19126
c47cbdfd
YM
19127 * unexmacosx.c (copy_data_segment): Also copy __got section.
19128 (Bug#8223)
19129
7ac80be9
EZ
191302011-03-12 Eli Zaretskii <eliz@gnu.org>
19131
c96bbc66 19132 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
19133 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19134 Constify `char *' arguments and their references according to
19135 prototypes in tparam.h.
19136
ecb0f94d 19137 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 19138
7ac80be9
EZ
19139 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19140 Adapt all references accordingly.
19141
19142 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19143
ef1fd07e
TT
191442011-03-11 Tom Tromey <tromey@redhat.com>
19145
19146 * buffer.c (syms_of_buffer): Remove obsolete comment.
19147
7ef4b50c
EZ
191482011-03-11 Eli Zaretskii <eliz@gnu.org>
19149
19150 * termhooks.h (encode_terminal_code): Declare prototype.
19151
19152 * msdos.c (encode_terminal_code): Don't declare prototype.
19153
19154 * term.c (encode_terminal_code): Now external again, used by
19155 w32console.c and msdos.c.
19156
44f230aa
SM
19157 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19158 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 19159
4b1ec863 191602011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 19161
1714f52b 19162 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 19163
4b1ec863
PE
19164 * fringe.c (update_window_fringes): Mark locals as initialized
19165 (Bug#8227).
19166 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 19167
524c7aa6
PE
19168 * alloc.c (mark_fringe_data): Move decl from here ...
19169 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19170 to check its interface.
19171 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19172
a5c0af81 19173 * fontset.c (free_realized_fontset): Now static.
7519b8cd 19174 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 19175 (fontset_font): Mark local as initialized.
a9a06e0b 19176 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 19177
b4716021
PE
19178 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19179
811e9bac 19180 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 19181 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
19182 (x_own_selection, Fx_disown_selection_internal): Rename locals
19183 to avoid shadowing.
19184 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 19185
7e3ab302
PE
19186 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19187 so that the caller can use some name other than gcpro1.
19188 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
19189 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19190 (Fx_backspace_delete_keys_p):
19191 Use them to avoid shadowing, and rename vars to avoid shadowing.
19192 (x_decode_color, x_set_name, x_window): Now static.
6b437900 19193 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 19194 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
19195 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19196 Remove unused locals.
7e3ab302
PE
19197 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19198 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19199 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19200 macros.
f78faa98 19201
e2b13473
PE
19202 * xterm.h (x_mouse_leave): New decl.
19203
77f23912
PE
19204 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19205 Remove unused functions.
cdf4ba58
PE
19206 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19207 (x_calc_absolute_position): Now static.
7411c686 19208 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 19209 Don't declare local "event" unless it's used.
ed7bf3a5
PE
19210 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19211 unless they are used.
38d0b34a
PE
19212 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19213 (x_fatal_error_signal): Remove; not used.
a6067996
PE
19214 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19215 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19216 (x_error_catcher, x_connection_closed, x_error_handler):
19217 (x_error_quitter, xembed_send_message, x_iconify_frame):
19218 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 19219 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 19220 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 19221
44f230aa
SM
19222 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19223 Rename or move locals to avoid shadowing.
6b463e58 19224 (tty_defined_color, merge_face_heights): Now static.
5967d051 19225 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
19226 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19227 does not deduce is never used uninitialized.
73719eba
PE
19228 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19229 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 19230
426994c3 19231 * terminal.c (store_terminal_param): Now static.
5489860b 19232
032f1620 19233 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 19234 (set_frame_menubar): Remove unused local.
d4323972 19235 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
19236 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19237 since they might point to immutable storage.
281585b0
PE
19238 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19239 since it's unused otherwise.
032f1620 19240
367c19e5 19241 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 19242 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
19243 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19244 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 19245 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
19246 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19247 does not deduce are never used uninitialized.
70739cbe 19248
07b48fa9
PE
19249 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19250
8868a238 19251 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
19252 * window.c (window_loop, size_window):
19253 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 19254
7e5cf297 19255 * window.c (display_buffer): Now static.
d6550a9f
PE
19256 (size_window): Mark variables that gcc -Wuninitialized
19257 does not deduce are never used uninitialized.
a586633d
PE
19258 * window.h (check_all_windows): New decl, to forestall
19259 gcc -Wmissing-prototypes diagnostic.
5b555da1 19260 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 19261
f6095868
PE
19262 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19263 shadowing.
19264 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
19265 Include <limits.h>.
19266 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19267 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
19268 (load_charset_map): Mark variables that gcc -Wuninitialized
19269 does not deduce are never used uninitialized.
53df7c11 19270 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 19271
f38b440c
PE
19272 * coding.c (coding_set_source, coding_set_destination):
19273 Use "else { /* comment */ }" rather than "else /* comment */;"
19274 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
19275 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19276 a block, when the outer 'i' will do.
19277 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19278 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19279 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19280 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19281 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19282 Rename locals to avoid shadowing.
19283 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
19284 * coding.c (emacs_mule_char, encode_invocation_designation):
19285 Now static, since they're not used elsewhere.
413bb2db 19286 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 19287 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
19288 (decode_coding_emacs_mule): Mark variables that gcc
19289 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
19290 (detect_coding_iso_2022): Initialize a local variable that might
19291 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 19292 this initialization is needed. (Bug#8211)
5f58e762
PE
19293 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19294 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19295 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19296 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19297 Remove unused macros.
f38b440c 19298
232b38b9 19299 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 19300 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 19301 * character.c (string_count_byte8): Likewise.
232b38b9 19302
fb90da1b
PE
19303 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19304 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19305
fb93dbc2
PE
19306 * chartab.c (copy_sub_char_table): Now static, since it's not used
19307 elsewhere.
5c156ace
PE
19308 (sub_char_table_ref_and_range, char_table_ref_and_range):
19309 Rename locals to avoid shadowing.
bbcd0949 19310 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 19311
7d3b3862 19312 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 19313 (BIDI_BOB): Remove unused macro.
7d3b3862 19314
6be7d3da
PE
19315 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19316 deduce are never used uninitialized.
c2ed9c8b 19317 * term.c (encode_terminal_code): Likewise.
6be7d3da 19318
75f8807f 19319 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 19320
50938595
PE
19321 * tparam.h: New file.
19322 * term.c, tparam.h: Include it.
19323 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19324 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19325 Move these decls to tparam.h, and make them agree with what
19326 is actually in tparam.c. The previous trick of using incompatible
19327 decls in different modules does not conform to the C standard.
19328 All callers of tparam changed to use tparam's actual API.
19329 * tparam.c (tparam1, tparam, tgoto):
19330 Use const pointers where appropriate.
19331
fbceeba2
PE
19332 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19333 * cm.h (struct cm): Likewise.
19334 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19335 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19336 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19337 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19338 (turn_on_face, init_tty): Likewise.
19339 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 19340
7f3f1250
PE
19341 * term.c (term_mouse_position): Rename local to avoid shadowing.
19342
e6ca6543
PE
19343 * alloc.c (mark_ttys): Move decl from here ...
19344 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19345
c40f8d15
AS
193462011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19347
19348 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19349
cfe0661d
JB
193502011-03-09 Juanma Barranquero <lekktu@gmail.com>
19351
19352 * search.c (compile_pattern_1): Remove argument regp, unused since
19353 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19354 (compile_pattern): Don't pass it.
19355
0afb4571
J
193562011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19357
19358 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19359 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19360 for ! HAVE_GTK3.
19361 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19362
19363 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19364
19365 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19366 gdk_window_get_screen, gdk_window_get_geometry,
19367 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19368 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19369 (xg_get_pixbuf_from_pixmap): New function.
19370 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19371 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19372 Call xg_get_pixbuf_from_pixmap instead of
19373 gdk_pixbuf_get_from_drawable.
19374 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19375 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19376 (xg_check_special_colors): Use GtkStyleContext and its functions
19377 for HAVE_GTK3.
19378 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19379 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19380 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
19381 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19382 Call gtk_widget_get_preferred_size.
0afb4571
J
19383 (xg_frame_resized): gdk_window_get_geometry only takes 5
19384 parameters.
44f230aa
SM
19385 (xg_win_to_widget, xg_event_is_for_menubar):
19386 Call gdk_x11_window_lookup_for_display.
0afb4571
J
19387 (xg_set_widget_bg): New function.
19388 (delete_cb): New function.
895009e1 19389 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 19390 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
19391 (xg_set_background_color): Call xg_set_widget_bg.
19392 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19393 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19394 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19395 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19396 if ! HAVE_GTK3.
19397 (update_frame_tool_bar): Call gtk_widget_hide.
19398 (xg_initialize): Use GDK_KEY_g.
19399
19400 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19401 if ! HAVE_GTK3
19402 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19403
19404 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19405 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19406 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19407
1c2cc4ef
JB
194082011-03-08 Juanma Barranquero <lekktu@gmail.com>
19409
19410 * w32xfns.c (select_palette): Check success of RealizePalette against
19411 GDI_ERROR, not zero.
19412
33383987 19413See ChangeLog.11 for earlier changes.
aac0c6e3
MR
19414
19415;; Local Variables:
19416;; coding: utf-8
aac0c6e3
MR
19417;; End:
19418
2f097256 19419 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
19420
19421 This file is part of GNU Emacs.
19422
19423 GNU Emacs is free software: you can redistribute it and/or modify
19424 it under the terms of the GNU General Public License as published by
19425 the Free Software Foundation, either version 3 of the License, or
19426 (at your option) any later version.
19427
19428 GNU Emacs is distributed in the hope that it will be useful,
19429 but WITHOUT ANY WARRANTY; without even the implied warranty of
19430 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19431 GNU General Public License for more details.
19432
19433 You should have received a copy of the GNU General Public License
19434 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.