]> code.delx.au - gnu-emacs/blob - src/ChangeLog
w32proc.c (sys_spawnve): Initialize escape_char.
[gnu-emacs] / src / ChangeLog
1 2013-02-01 Eli Zaretskii <eliz@gnu.org>
2
3 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
4 even if w32-quote-process-args is nil.
5
6 2013-01-27 Eli Zaretskii <eliz@gnu.org>
7
8 * w32.c (sys_open): Zero out the flags for the new file descriptor.
9 (sys_close): Zero out the flags for the file descriptor before
10 closing it. (Bug#13546)
11
12 2013-01-26 Eli Zaretskii <eliz@gnu.org>
13
14 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
15 (logon_network_drive, stat_worker, symlink, chase_symlinks): Use
16 CharNextExA and CharPrevExA to iterate over file names encoded in
17 DBCS. (Bug#13553)
18
19 2013-01-25 Eli Zaretskii <eliz@gnu.org>
20
21 * w32.c (w32_get_long_filename, init_environment, readlink):
22 Support file names encoded in DBCS codepages.
23 (readlink): Use the current file-name-coding-system, not the ANSI
24 codepage, to decode and handle targets of symlinks.
25
26 2013-01-23 Eli Zaretskii <eliz@gnu.org>
27
28 * w32.c (max_filename_mbslen): New function.
29 (normalize_filename, readdir): Use it to detect locales where ANSI
30 encoding of file names uses a double-byte character set (DBCS).
31 If a DBCS encoding is used, advance by characters using
32 CharNextExA, instead of incrementing a 'char *' pointer. Use
33 _mbslwr instead of _strlwr. (Bug#13515)
34
35 2013-01-22 Eli Zaretskii <eliz@gnu.org>
36
37 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
38 request of memory reservation to 1.7GB. (Bug#13065)
39
40 2013-01-20 Andreas Schwab <schwab@linux-m68k.org>
41
42 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
43 at check_extra_latin label. (Bug#13505)
44
45 2013-01-17 Glenn Morris <rgm@gnu.org>
46
47 * fns.c (Frandom): Doc fix.
48
49 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
50
51 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
52 (nsfont_draw): Remove disabling of LCD smoothing.
53 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
54 Bug#11484 with LCD smoothing on.
55
56 2013-01-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
57
58 * gtkutil.c (xg_initialize): Backport from trunk.
59 Add ifdef HAVE_FREETYPE around x_last_font_name (Bug#13403).
60
61 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
62
63 Backport typo fix from trunk, for AIX (Bug#13408).
64 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
65 This follows up on the 2012-09-29 patch that removed indirection
66 for the 'function' field. Reported by Sergey Vinokurov in
67 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
68
69 Fix SIGDANGER handlers, for AIX (Bug#13408).
70 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
71 Move handlers here from emacs.c; they were out of place.
72
73 2013-01-05 Eli Zaretskii <eliz@gnu.org>
74
75 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
76 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
77 digits for buffer positions, before misalignment starts. Display
78 "0" for integer "object" field.
79 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
80 Display the newline glyph more unambiguously.
81
82 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
83
84 * nsterm.m (ns_draw_underwave):
85 * w32term.c (w32_draw_underwave):
86 * xterm.c (x_draw_underwave): Make underwave look more triangular
87 and also degrade gracefully for small fonts. (Bug#13000)
88
89 * nsterm.m (ns_draw_text_decoration):
90 * w32term.c (x_draw_glyph_string):
91 * xterm.c (x_draw_glyph_string): Don't use previous underline
92 thickness and position if previous underline type is underwave.
93
94 2012-12-31 Glenn Morris <rgm@gnu.org>
95
96 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
97
98 2012-12-29 Andreas Schwab <schwab@linux-m68k.org>
99
100 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
101 (LIBS_GNUSTEP): Define.
102 (LIBES): Add $(LIBS_GNUSTEP).
103 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
104
105 2012-12-27 Eli Zaretskii <eliz@gnu.org>
106
107 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
108 continuation glyph on a TTY with an indication of an empty line.
109 (Bug#13277)
110
111 2012-12-27 Glenn Morris <rgm@gnu.org>
112
113 * cygw32.c (Fcygwin_convert_file_name_to_windows)
114 (Fcygwin_convert_file_name_from_windows): Doc fixes.
115
116 2012-12-24 Eli Zaretskii <eliz@gnu.org>
117
118 * fileio.c (file_name_as_directory, directory_file_name): Accept
119 an additional argument MULTIBYTE to indicate whether the input C
120 came from a multibyte or a unibyte Lisp string; all callers
121 adjusted. Don't assume the input string is always multibyte.
122 (Bug#13262)
123 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
124 don't ENCODE_FILE them, and return a unibyte string if the input
125 was unibyte.
126 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
127 don't assume the input strings will always be multibyte. If the
128 input strings are multibyte, decode strings obtained from C
129 library functions.
130
131 2012-12-22 Martin Rudalics <rudalics@gmx.at>
132
133 * window.c (Fselect_window): Reword doc-string (Bug#13248).
134
135 2012-12-21 Eli Zaretskii <eliz@gnu.org>
136
137 * fileio.c (Finsert_file_contents): Doc fix.
138
139 * w32proc.c (new_child, delete_child, find_child_pid): For a
140 subprocess, consider its slot being in use as long as its process
141 handle (procinfo.hProcess) is not NULL. This avoids reusing the
142 slot when a new process is started immediately after killing
143 another one, without waiting enough time for the first process to
144 be reaped and resources allocated for it be orderly freed.
145 (Bug#13086)
146 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
147
148 2012-12-21 Chong Yidong <cyd@gnu.org>
149
150 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
151
152 2012-12-15 Chong Yidong <cyd@gnu.org>
153
154 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
155
156 2012-12-14 Eli Zaretskii <eliz@gnu.org>
157
158 * w32.c (get_name_and_id): Always pass NULL as the first argument
159 of lookup_account_sid. Avoids crashes with UNC file names that
160 refer to DFS domains, not to specific machine names. (Bug#12621)
161 Remove now unused argument FNAME; all callers changed.
162 (get_file_owner_and_group): Remove now unused argument FNAME; all
163 callers changed.
164
165 2012-12-11 Eli Zaretskii <eliz@gnu.org>
166
167 * search.c (search_buffer): Check the inverse translations of each
168 character in pattern when the buffer being searched is unibyte.
169 (Bug#13084)
170
171 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
172
173 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
174 files, fixing a regression from 24.2.
175 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
176
177 2012-12-08 Jan Djärv <jan.h.d@swipnet.se>
178
179 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
180
181 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
182
183 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
184 DWORD_PTR, for compatibility with 64-bit builds.
185
186 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
187 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
188 (system_process_attributes): Use SIZE_T rather than DWORD, for
189 compatibility with 64-bit builds.
190
191 2012-12-08 Christopher Schmidt <christopher@ch.ristopher.com>
192
193 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
194
195 2012-12-07 Eli Zaretskii <eliz@gnu.org>
196
197 * indent.c (Fvertical_motion): If a display string will be
198 displayed on the left or the right margin, don't consider it as a
199 factor in cursor positioning. (Bug#13108)
200
201 2012-12-07 Martin Rudalics <rudalics@gmx.at>
202
203 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
204
205 2012-12-05 Eli Zaretskii <eliz@gnu.org>
206
207 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
208 fails, signal an error instead of continuing with an empty
209 string. (Bug#13079)
210 Encode expanded temp file pattern before passing it to mkstemp or
211 mktemp.
212
213 2012-12-04 Eli Zaretskii <eliz@gnu.org>
214
215 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
216 Encode the file name before passing it to dostounix_filename, in
217 case it will downcase it (under w32-downcase-file-names).
218 (Bug#12933)
219
220 2012-12-01 Chong Yidong <cyd@gnu.org>
221
222 * fileio.c (Vauto_save_list_file_name): Doc fix.
223
224 2012-11-30 Fabrice Popineau <fabrice.popineau@gmail.com>
225
226 * w32fns.c: Remove prototype of atof.
227 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
228 builds.
229 (file_dialog_callback): Declared UINT_PTR.
230
231 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
232 with 64-bit builds.
233
234 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
235 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
236 defined.
237
238 2012-11-27 Glenn Morris <rgm@gnu.org>
239
240 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
241
242 2012-11-26 Eli Zaretskii <eliz@gnu.org>
243
244 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
245 (Bug#11964)
246
247 2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
248
249 Revert recent change for Bug#8855.
250 As reported by Harald Hanche-Olsen in
251 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00445.html>
252 the change introduces a further bug, of creating lots of zombie
253 processes in some cases. Further work is needed to come up with a
254 better fix for Bug#8855.
255
256 2012-11-24 Eli Zaretskii <eliz@gnu.org>
257
258 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
259 highlighting on the frame was cleared. Prevents assertion
260 violations when repeatedly clicking on the "Top" link of the
261 "bread-crumbs" in Info buffers.
262
263 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
264 Eli Zaretskii <eliz@gnu.org>
265
266 Fix a race condition with glib (Bug#8855).
267 The symptom is a diagnostic "GLib-WARNING **: In call to
268 g_spawn_sync(), exit status of a child process was requested but
269 SIGCHLD action was set to SIG_IGN and ECHILD was received by
270 waitpid(), so exit status can't be returned." The diagnostic
271 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
272 The real bug is a race condition between Emacs and glib: Emacs
273 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
274 so that glib can't find it. Work around the bug by invoking
275 waitpid only on subprocesses that Emacs itself creates.
276
277 This is a backport from the trunk, consisting of:
278
279 * w32proc.c (create_child): Don't clip the PID of the child
280 process to fit into an Emacs integer, as this is no longer a
281 restriction.
282 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
283 reaping only the process specified by PID argument, if that is
284 positive. Use PID instead of dead_child to know which process to
285 reap. Wait for the child to die only if WNOHANG is not in
286 OPTIONS.
287 (sys_select): Don't set dead_child.
288
289 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
290 as it is no longer needed.
291
292 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
293 no longer needed.
294 (create_process, record_child_status_change): Don't use special
295 value -1 in pid field, as the caller now must know the pid rather
296 than having the callee infer it. The inference was sometimes
297 incorrect anyway, due to another race.
298 (create_process): Set new 'alive' member if child is created.
299 (process_status_retrieved): New function.
300 (record_child_status_change): Use it.
301 Accept negative 1st argument, which means to wait for the
302 processes that Emacs already knows about. Move special-case code
303 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
304 processes that have already been waited for, by testing and
305 clearing new 'alive' member. Remove the setting of
306 record_at_most_one_child for the !WNOHANG case.
307 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
308 now does this internally.
309 (handle_child_signal): Let record_child_status_change do all
310 the work, since we do not want to reap all exited child processes,
311 only the child processes that Emacs itself created.
312 * process.h (Lisp_Process): New boolean member 'alive'.
313
314 2012-11-23 Eli Zaretskii <eliz@gnu.org>
315
316 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
317 between bpos_covered and bpos_max. This fixes cursor display when
318 several display strings follow each other.
319
320 * .gdbinit (pgx): If the glyph's object is a string, display the
321 pointer to string data, rather than the value of the string object
322 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
323
324 2012-11-21 Eli Zaretskii <eliz@gnu.org>
325
326 * indent.c (Fvertical_motion): If the starting position is covered
327 by a display string, return to one position before that, to avoid
328 overshooting it inside move_it_to. (Bug#12930)
329
330 2012-11-20 Daniel Colascione <dancol@dancol.org>
331
332 * w32fns.c (Fx_file_dialog):
333 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
334 cygwin_convert_file_name*.
335
336 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
337 Rename cygwin_convert_path* to cygwin_convert_file_name*.
338
339 2012-11-20 Ken Brown <kbrown@cornell.edu>
340
341 * emacs.c (main): Set the G_SLICE environment variable for all
342 Cygwin builds, not just GTK builds. See
343 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
344
345 2012-11-19 Eli Zaretskii <eliz@gnu.org>
346
347 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Don't mix declaration of
348 w32_note_current_window with code. (Backport from trunk.)
349
350 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
351 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
352 Define for the MSVC compiler.
353
354 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing
355 semi-colon.
356
357 2012-11-18 Eli Zaretskii <eliz@gnu.org>
358
359 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
360 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
361 dostounix_filename. Prevents crashes down the road, because
362 dostounix_filename assumes it gets a unibyte string. Reported by
363 Michel de Ruiter <michel@sentient.nl>, see
364 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
365
366 2012-11-17 Eli Zaretskii <eliz@gnu.org>
367
368 * w32select.c: Include w32common.h before w32term.h, so that
369 windows.h gets included before w32term.h uses some of its
370 features, see below.
371
372 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
373 typedefs.
374 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
375 prototypes.
376 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
377
378 2012-11-17 Jan Djärv <jan.h.d@swipnet.se>
379
380 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
381 (ns_select): Return at once if events are held (Bug#12834).
382
383 2012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
384
385 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
386 Needed following 2012-10-20 change. (Bug#12902)
387
388 2012-11-16 Glenn Morris <rgm@gnu.org>
389
390 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
391
392 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
393
394 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
395
396 2012-11-14 Eli Zaretskii <eliz@gnu.org>
397
398 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
399 use the same value of thread handle.
400 (start_timer_thread): If the timer thread exited (due to error),
401 clean up by closing the two handles it used. Duplicate the caller
402 thread's handle here, so it gets duplicated only once, when
403 launching the timer thread. Set priority of the timer thread, not
404 the caller thread.
405 (getitimer): Don't duplicate the caller thread's handle here.
406 (Bug#12832)
407
408 2012-11-13 Jan Djärv <jan.h.d@swipnet.se>
409
410 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
411 called (Bug#12834).
412
413 2012-11-12 Eli Zaretskii <eliz@gnu.org>
414
415 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
416 passed to pint2str and pint2hrstr to be at most the size of the
417 frame's decode_mode_spec_buffer. This avoids crashes with very
418 large values of FIELD_WIDTH argument to decode_mode_spec.
419 (Bug#12867)
420
421 2012-11-07 Martin Rudalics <rudalics@gmx.at>
422
423 * window.c (Fsplit_window_internal): Set combination limit of
424 new parent window to t iff Vwindow_combination_limit is t;
425 fixing a regression introduced with the change from 2012-09-22.
426 (Fwindow_combination_limit, Fset_window_combination_limit):
427 Fix doc-strings.
428
429 2012-11-06 Eli Zaretskii <eliz@gnu.org>
430
431 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
432 amount when the scroll margins are too large. When scrolling
433 backwards in the buffer, give up if cannot reach point or the
434 scroll margin within a reasonable number of screen lines.
435 Fixes point position in window under scroll-up/down-aggressively when
436 point is positioned many lines beyond the window top/bottom.
437 (Bug#12811)
438
439 2012-11-05 Eli Zaretskii <eliz@gnu.org>
440
441 * ralloc.c (relinquish): If real_morecore fails to return memory
442 to the system, don't crash; instead, leave the last heap
443 unchanged and return. (Bug#12774)
444
445 2012-11-03 Eli Zaretskii <eliz@gnu.org>
446
447 * lisp.mk: Adjust comments to the fact that term/internal is now
448 loaded from loadup.el.
449
450 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
451 (msdos_fatal_signal): New function.
452 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
453 its argument list.
454
455 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
456 for GCC versions before 4.
457 (emacs_raise): Define to call msdos_fatal_signal.
458
459 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
460 iterator when starting in the middle of a display or overlay
461 string. (Bug#12745)
462
463 2012-11-03 Jan Djärv <jan.h.d@swipnet.se>
464
465 * widget.c (resize_cb): New function.
466 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
467 (EmacsFrameResize): Check if all is up to date before changing frame
468 size.
469
470 2012-11-01 Eli Zaretskii <eliz@gnu.org>
471
472 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
473
474 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
475
476 Fix crash when using Emacs as commit editor for git (Bug#12697).
477 * callproc.c (setpgrp): Remove macro, as we now use setpgid
478 and it is configured in conf_post.h.
479 (Fcall_process): Don't invoke both setsid and setpgid; the former
480 is enough, if it exists.
481 * callproc.c (Fcall_process, child_setup):
482 * process.c (create_process): Use setpgid.
483 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
484 for the real thing.
485 * dispnew.c (init_display): Initialize the foreground group
486 if we are running a tty display.
487 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
488 * lisp.h (init_foreground_group): New decl.
489 * sysdep.c (inherited_pgroup): New static var.
490 (init_foreground_group, tcsetpgrp_without_stopping)
491 (narrow_foreground_group, widen_foreground_group): New functions.
492 (init_sys_modes): Narrow foreground group.
493 (reset_sys_modes): Widen foreground group.
494
495 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
496
497 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
498
499 2012-10-31 Martin Rudalics <rudalics@gmx.at>
500
501 * minibuf.c (read_minibuf): Restore current buffer since
502 choose_minibuf_frame calling Fset_frame_selected_window may
503 change it (Bug#12766).
504
505 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
506
507 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
508
509 2012-10-30 Kenichi Handa <handa@gnu.org>
510
511 * font.c (Ffont_at): If WINDOW is specified and it is not
512 displaying the current buffer, signal an error.
513
514 2012-10-29 Daniel Colascione <dancol@dancol.org>
515
516 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
517 In preparation for fixing bug#12739, move these functions from
518 here...
519
520 * coding.h, coding.c: ... to here, and compile them only when
521 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
522 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
523
524 2012-10-28 Eli Zaretskii <eliz@gnu.org>
525
526 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
527 (timer_loop, getitimer, setitimer): Use it instead of
528 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
529 'clock'.
530 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
531 literal 10000.
532
533 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
534
535 * nsterm.m (NO_APPDEFINED_DATA): New define.
536 (last_appdefined_event_data): New variable
537 (last_appdefined_event): Remove.
538 (ns_select): Initialize t from last_appdefined_event_data instead
539 of [last_appdefined_event data1].
540 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
541 remove last_appdefined_event (Bug#12698).
542
543 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
544
545 * frame.c (x_set_font): Catch internal error.
546
547 2012-10-27 Eli Zaretskii <eliz@gnu.org>
548
549 Avoid overflow in w32 implementation of interval timers.
550 When possible, for ITIMER_PROF count only times the main thread
551 actually executes.
552 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
553 'volatile ULONGLONG' types. All the other data which was
554 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
555 (GetThreadTimes_Proc): New typedef.
556 (w32_get_timer_time): New function, returns a suitable time value
557 for the timer.
558 (timer_loop): Enter critical section when accessing ULONGLONG
559 values of the itimer_data struct, as these accesses are no longer
560 atomic. Call 'w32_get_timer_time' instead of 'clock'.
561 Remove unused variable.
562 (init_timers): Initialize s_pfn_Get_Thread_Times.
563 (start_timer_thread): Don't assign itimer->caller_thread here.
564 (getitimer): Assign itimer->caller_thread here.
565 (setitimer): Always call getitimer to get the value of ticks_now.
566 (sys_spawnve): Avoid compiler warning about format mismatch.
567
568 2012-10-26 Eli Zaretskii <eliz@gnu.org>
569
570 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
571 mouse movement events if the menu bar is active. This avoids
572 producing a busy "hour-glass" cursor by Windows if the mouse
573 pointer is positioned over a tooltip shown for some menu item.
574
575 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
576
577 Don't assume process IDs fit in int.
578 * emacs.c (shut_down_emacs) [!DOS_NT]:
579 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
580 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
581 Use pid_t, not int, to store process IDs, as 'int'
582 is not wide enough on a few platforms (e.g., AIX and IRIX).
583
584 2012-10-23 Kenichi Handa <handa@gnu.org>
585
586 The following change is to make face-font-rescale-alist work
587 correctly for non-ASCII fonts.
588
589 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
590 (font_open_for_lface): Handle Vface_font_rescale_alist.
591
592 2012-10-23 Chong Yidong <cyd@gnu.org>
593
594 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
595
596 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
597
598 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
599 for screen font.
600 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
601
602 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
603 event (Bug#12681).
604
605 2012-10-21 Glenn Morris <rgm@gnu.org>
606
607 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
608
609 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
610
611 Port to OpenBSD 5.1.
612 * frame.c (Fmouse_position, Fmouse_pixel_position):
613 * xdisp.c (produce_stretch_glyph):
614 Declare local vars only when they're needed.
615 This is clearer and avoids a warning on OpenBSD about unused vars.
616 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
617 This is safer, and avoids OpenBSD warnings about unused vars.
618 * keyboard.c (record_menu_key): Remove unnecessary decl.
619 (poll_timer): Define only if POLL_FOR_INPUT is defined.
620 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
621 as our definition clashes with OpenBSD's.
622 * xfaces.c (load_face_colors, check_lface_attrs)
623 (get_lface_attributes_no_remap, get_lface_attributes)
624 (lface_fully_specified_p, x_supports_face_attributes_p)
625 (tty_supports_face_attributes_p, face_fontset, realize_face)
626 (realize_x_face, realize_tty_face):
627 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
628 merely Lisp_Object *. This is more informative and avoids
629 a warning on OpenBSD about accessing beyond an object's size.
630
631 2012-10-20 Chong Yidong <cyd@gnu.org>
632
633 * lread.c (Fload): Doc fix (Bug#12592).
634
635 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
636
637 * font.c (Ffont_at): Fix previous change.
638
639 2012-10-19 Eli Zaretskii <eliz@gnu.org>
640
641 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
642 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
643 for the reasons.
644
645 * alloc.c (NSTATICS): Decrease to 0x800.
646
647 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
648
649 * fns.c (Fnreverse): Include the problem element when signalling an
650 error (bug#12677).
651
652 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
653
654 * nsterm.m (ns_select): Check writefds before call to
655 FD_ISSET (Bug#12668).
656
657 2012-10-18 Daniel Colascione <dancol@dancol.org>
658
659 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
660 (staticpro): If we run out of staticpro slots, die with an
661 informative error instead of just calling emacs_abort.
662
663 2012-10-18 Martin Rudalics <rudalics@gmx.at>
664
665 Fix two flaws reported by Dmitry Antipov.
666 * window.c (Ftemp_output_buffer_show): Remove.
667 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
668 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
669
670 2012-10-17 Eli Zaretskii <eliz@gnu.org>
671
672 * makefile.w32-in ($(BLD)/w32.$(O)):
673 ($(BLD)/vm-limit.$(O)):
674 ($(BLD)/term.$(O)):
675 ($(BLD)/unexw32.$(O)):
676 ($(BLD)/fileio.$(O)):
677 ($(BLD)/dispnew.$(O)): Update dependencies.
678
679 * w32term.h (w32_initialize_display_info, initialize_w32_display):
680 Add prototypes.
681
682 * w32proc.c: Include ctype.h.
683
684 * w32.h (init_environment, check_windows_init_file)
685 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
686 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
687 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
688 (sys_link): Add prototypes.
689
690 * w32.c: Include w32select.h.
691 (sys_access, e_malloc, sys_select): Add prototypes.
692 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
693
694 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
695
696 * unexw32.c: Include lisp.h and w32.h.
697
698 * term.c [WINDOWSNT]: Include w32term.h.
699
700 * process.c [WINDOWSNT]: Add prototype of sys_select.
701
702 * fileio.c [WINDOWSNT]: Include w32.h.
703
704 * dispnew.c [WINDOWSNT]: Include w32.h.
705
706 * cygw32.c (Fcygwin_convert_path_to_windows)
707 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
708 Lisp_Object values. (Bug#12661)
709
710 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
711 to Lisp_Object. (Bug#12661)
712
713 2012-10-17 Kenichi Handa <handa@gnu.org>
714
715 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
716 invalidate.
717
718 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
719
720 * buffer.c (Fkill_buffer): When unchaining the marker,
721 reset its buffer pointer to NULL (Bug#12652).
722
723 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
724
725 Do not verify indirection counters of killed buffers (Bug#12579).
726 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
727 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
728
729 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
730
731 * alloc.c (Fmake_byte_code): Fix typo in comment.
732 * print.c (print_interval): Define as static to match prototype.
733 * indent.c (disptab_matches_widthtab, recompute_width_table):
734 Convert to eassert.
735
736 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
737
738 * editfns.c (get_system_name): Remove.
739 * lisp.h (get_system_name): Remove prototype.
740 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
741 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
742
743 2012-10-15 Daniel Colascione <dancol@dancol.org>
744
745 * dbusbind.c: Add comment explaining reason for previous change.
746
747 2012-10-15 Martin Rudalics <rudalics@gmx.at>
748
749 * window.c (Fwindow_end): Rewrite check whether cached position
750 can be used (Bug#12600).
751 (resize_frame_windows, grow_mini_window, shrink_mini_window):
752 Set windows_or_buffers_changed.
753
754 2012-10-15 Daniel Colascione <dancol@dancol.org>
755
756 * dbusbind.c: Fix cygw32 build break when compiling with dbus
757 enabled by undefining the symbol "interface", which the platform
758 headers define to something incompatible.
759
760 2012-10-14 Daniel Colascione <dancol@dancol.org>
761
762 * image.c (init_tiff_functions, init_imagemagick_functions)
763 (init_svg_functions): Fix cygw32 build break by using these
764 functions only when WINDOWSNT _and_ HAVE_NTGUI.
765
766 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
767
768 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
769
770 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
771
772 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
773
774 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
775
776 * coding.c (detect_coding): Set coding->id before calling
777 this->detector.
778
779 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
780
781 * fileio.c: Formatting fixes.
782
783 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
784
785 Fix some stat-related races.
786 * fileio.c (Fwrite_region): Avoid race condition if a file is
787 removed or renamed by some other process immediately after Emacs
788 writes it but before Emacs stats it. Do not assume that stat (or
789 fstat) succeeds.
790 * image.c (slurp_file): Resolve the file name with fopen + fstat
791 rather than stat + fopen.
792 (pbm_read_file) [0]: Remove unused code with stat race.
793 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
794 Remove ineffective code with stat race.
795
796 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
797
798 * doc.c (get_doc_string): Don't signal an error if the file is missing.
799
800 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
801
802 * nsterm.m (hold_event_q): New static variable.
803 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
804 ! q_event_ptr.
805 (hold_event): New function.
806 (ns_read_socket): If hold_event_q have events, store them and
807 return (Bug#12384).
808 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
809 is zero (Bug#12384).
810
811 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
812
813 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
814
815 2012-10-12 Eli Zaretskii <eliz@gnu.org>
816
817 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
818
819 * fileio.c (check_existing): New function.
820 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
821 instead of calling 'stat', when what's needed is to check whether
822 a file exists. This avoids expensive system calls on MS-Windows.
823 (Bug#12587)
824
825 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
826
827 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
828 determine whether a file exists and is not a directory.
829
830 * lisp.h (check_existing): Add prototype.
831
832 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
833
834 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
835
836 2012-10-12 Glenn Morris <rgm@gnu.org>
837
838 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
839
840 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
841
842 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
843
844 * eval.c (Fautoload): Remember previous autoload status in load-history.
845
846 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
847
848 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
849 * lread.c (load_each_byte, new_backquote_flag, readchar)
850 (read_filtered_event, lisp_file_lexically_bound_p)
851 (safe_to_load_version, Fload, complete_filename_p, openp)
852 (build_load_history, readevalloop, read_escape, read1)
853 (string_to_number, read_vector, read_list):
854 * macros.c (Fstart_kbd_macro):
855 * marker.c (CONSIDER):
856 * menu.c (parse_single_submenu, digest_single_submenu)
857 (find_and_return_menu_selection, Fx_popup_menu):
858 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
859 (Ftry_completion):
860 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
861 (ns_menu_show):
862 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
863 (xmenu_show, xdialog_show):
864 Use bool for booleans.
865 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
866 as it's not a predicate. All uses changed. Omit unnecessary
867 buffer termination.
868
869 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
870
871 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
872 (save_excursion_restore): Do not restore mark if it was not saved.
873
874 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
875
876 * marker.c (cached_modiff): EMACS_INT, not int.
877
878 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
879 instead of having a wrong decl.
880 * nsmenu.m (waiting_for_input): Remove wrong decl.
881
882 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
883
884 keyboard.c, keymap.c: Use bool for booleans.
885 * dispnew.c (sit_for): Distinguish between 3-way display_option
886 and boolean do_display.
887 * keyboard.c (single_kboard, this_command_key_count_reset)
888 (waiting_for_input, echoing, immediate_quit, input_pending)
889 (interrupt_input, interrupts_deferred, pop_kboard)
890 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
891 (command_loop_1, adjust_point_for_property)
892 (safe_run_hooks_error, input_polling_used, read_char):
893 (help_char_p, readable_events, kbd_buffer_events_waiting)
894 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
895 (lucid_event_type_list_p, get_input_pending):
896 (gobble_input, menu_separator_name_p, menu_bar_item)
897 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
898 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
899 (keyremap_step, test_undefined, read_key_sequence)
900 (detect_input_pending, detect_input_pending_ignore_squeezables)
901 (detect_input_pending_run_timers, requeued_events_pending_p)
902 (quit_throw_to_read_char, Fset_input_interrupt_mode):
903 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
904 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
905 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
906 (accessible_keymaps_1, Fkey_description, push_key_description):
907 (shadow_lookup, struct where_is_internal_data)
908 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
909 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
910 (describe_map, describe_vector):
911 * menu.c (single_menu_item):
912 * nsmenu.m (ns_update_menubar):
913 * process.c (wait_reading_process_output):
914 * search.c (scan_buffer, scan_newline):
915 Use bool for boolean.
916 * keyboard.c (timers_run, swallow_events)
917 (detect_input_pending_run_timers):
918 * process.c (wait_reading_process_output):
919 Use unsigned for counter where wraparound-on-overflow is desired,
920 since unsigned is guaranteed to have that behavior and signed is not.
921 (read_char): Use ptrdiff_t for string length.
922 (get_input_pending): Remove first argument, since it was always
923 the same pointer-to-int (now pointer-to-boolean) &input_pending,
924 and behave as if it had that value. Return new value of
925 input_pending. All callers changed.
926 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
927 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
928 a string length.
929 * keymap.c (push_key_description): Omit last arg, which was always 1.
930 All callers changed.
931
932 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
933
934 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
935
936 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
937 ($(BLD)/term.$(O)): Update dependencies.
938
939 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
940
941 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
942 * lisp.h (enum pvec_type): Adjust comments and omit explicit
943 initializer for PVEC_NORMAL_VECTOR.
944
945 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
946
947 Clean out old termopts cruft.
948 * termopts.h (flow_control, meta_key): Remove unused decls.
949 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
950 Don't include termopts.h.
951
952 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
953
954 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
955
956 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
957
958 * commands.h (immediate_quit): Remove duplicate decl.
959
960 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
961
962 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
963 caching.
964 (nsfont_open): Remove setting of Vfonts_in_cache.
965 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
966
967 2012-10-09 Eli Zaretskii <eliz@gnu.org>
968
969 * w32fns.c (w32_last_error): Change the return value to DWORD, to
970 match what GetLastError returns. Explain why the function is
971 needed.
972
973 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
974 'is_tooltip_frame', to avoid confusion with its global namesake.
975
976 2012-10-08 Daniel Colascione <dancol@dancol.org>
977
978 * xdisp.c (start_hourglass): Call w32_note_current_window when
979 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
980 build that caused Emacs to display the hourglass cursor forever.
981
982 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
983 which is broken under remote desktop, calculate the number of
984 colors available for a display based on the display's number of
985 planes and number of bits per pixel per plane. (bug#10397).
986
987 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
988
989 * nsfont.m (Vfonts_in_cache): New variable.
990 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
991 are used. Add cached fonts to Vfonts_in_cache.
992 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
993
994 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
995
996 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
997 in nt/config.nt.
998 (FONT_H): Define after FRAME_H.
999 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
1000 Update dependencies.
1001
1002 * w32term.c: Remove leftover declaration of keyboard_codepage.
1003
1004 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1005
1006 * makefile.w32-in (FONT_H): Add $(FRAME_H).
1007 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
1008 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
1009 (GLOBAL_SOURCES): Add cygw32.c.
1010 ($(BLD)/unexw32.$(O)):
1011 ($(BLD)/w32.$(O)):
1012 ($(BLD)/w32console.$(O)):
1013 ($(BLD)/w32fns.$(O)):
1014 ($(BLD)/w32heap.$(O)):
1015 ($(BLD)/w32menu.$(O)):
1016 ($(BLD)/w32proc.$(O)): Add w32common.h.
1017
1018 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
1019 'const char *'.
1020 (x_to_w32_color): Don't modify the argument, modify a copy instead.
1021
1022 2012-10-08 Daniel Colascione <dancol@dancol.org>
1023
1024 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
1025 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
1026 accidental message numbering hole. Change other messages to
1027 match.
1028
1029 * w32select.h (HAVE_W32SELECT): Remove.
1030
1031 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1032 w32common.h instead of w32heap.h.
1033
1034 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
1035 (get_allocation_unit, get_processor_type, get_w32_major_version)
1036 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1037 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1038 (OS_NT, os_subtype, cache_system_info): Move declarations to
1039 w32common.
1040
1041 * w32heap.c: Include w32common.h.
1042 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
1043 (w32_minor_version, w32_build_number, w32_subtype):
1044 Remove duplicate definitions.
1045
1046 * w32fns.c: Include w32common.h; include w32heap.h only in
1047 WINDOWSNT.
1048
1049 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
1050 Use `report_file_error' instead of `error' in order to better
1051 inform users of what went wrong. Increase NTGUI_UNICODE file
1052 dialog box file name length to 32k, the maximum allowed by the NT
1053 kernel.
1054
1055 * w32common.h: New file.
1056 (ROUND_UP, ROUND_DOWN, get_page_size)
1057 (get_allocation_unit, get_processor_type, get_w32_major_version)
1058 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1059 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1060 (OS_NT, os_subtype, cache_system_info): Move here.
1061
1062 * unexw32.c, unexcw.c: Include w32common.h.
1063
1064 * emacs.c (main): Use (defined (WINDOWSNT) || defined
1065 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1066 to call syms_of_w32select.
1067
1068 * cygw32.h: Remove obsolete EXFUN declarations.
1069
1070 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1071
1072 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1073 of w32inevt.o from SOME_MACHINE_OBJECTS.
1074
1075 2012-10-08 Daniel Colascione <dancol@dancol.org>
1076
1077 * image.c: Permanent fix for JPEG compilation issue --- limit
1078 jpeglib `boolean' redefinition to Cygwin builds.
1079
1080 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1081
1082 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1083
1084 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1085 Cygwin.
1086
1087 2012-10-08 Daniel Colascione <dancol@dancol.org>
1088
1089 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1090 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1091 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1092 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1093 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1094 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1095 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1096 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1097 now a supported configuration.
1098
1099 * Makefile.in: consolidate image variables into LIBIMAGE; add
1100 W32_OBJ and W32_LIBS. Compile new files.
1101
1102 * conf_post.h:
1103 (_DebPrint) declare tracing facility for W32 debugging. We need
1104 to unify tracing later.
1105
1106 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1107 unconditional use of W32 Unicode functions. Cygwin runs only on
1108 100% Unicode operating systems.
1109
1110 * cygw32.c: New file. Define Cygwin-specific facilities.
1111 (Fcygwin_convert_path_to_windows)
1112 (Fcygwin_convert_path_from_windows): New user functions for
1113 accessing Cygwin path-munging routines.
1114
1115 * cygw32.h: New file.
1116 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1117 UTF-16LE strings temporarily inside non-Lisp-visible string
1118 objects.
1119
1120 (w32_strerror): Just what it says on the tin.
1121
1122 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1123 also run for Cygwin; both systems have the same problem with using
1124 GUI facilities in a forked child. Also call syms_of_cygw32,
1125 syms_of_w32select in correct places.
1126
1127 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1128 needs fork-then-exec for daemon launching.
1129
1130 * font.h: Include frame.h.
1131
1132 * image.c: Use the image library cache machinery only when we're
1133 compiling for native WINDOWSNT; Cygwin can use shared libraries
1134 like any other Unixlike system.
1135
1136 * keyboard.c: Clarify a comment regarding the input loop.
1137
1138 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1139 functions directly instead of trying to detect at runtime that our
1140 host operating system supports them. We make this change for two
1141 reasons: Cygwin lacks support for the multibyte character
1142 conversion functions used by the legacy menu code, and Cygwin
1143 never needs to rely on non-Unicode APIs.
1144
1145 * unexw32.c (hinst): Declare extern.
1146
1147 * w32.c: Change header order;
1148 (w32_strerror): Move to w32fns.c because we need it for
1149 non-WINDOWSNT builds.
1150
1151 * w32.h: Add #error macro to make sure we don't include w32.h for
1152 Cygwin builds. Remove w32select declarations.
1153
1154 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1155 w32fns.c. w32console.c is WINDOWSNT-only.
1156
1157 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1158 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
1159 POSIXy alternative.
1160 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1161 (w32_major_version, w32_minor_version, w32_build_number)
1162 (os_subtype, sound_type): Define here
1163 (w32_defined_color): Make color parameter const for consistency
1164 with other _defined_color functions.
1165 (w32_createwindow): Unconditionally call w32_init_class instead of
1166 doing so only when hprevinst is non-NULL. Plumbing hprevinst
1167 through the code is complex and unnecessary because class
1168 registration is practically free.
1169 (w32_name_of_message): New EMACSDEBUG-only function.
1170 (Fset_message_beep): Move here
1171 (Fx_open_connection): Require that the display name for Windows be
1172 "w32" for consistency, emacsclient disambiguation, and maybe, one
1173 day, multi-window-system support.
1174 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1175 Cygwin files for W32 GUI facilities, since these clearly don't
1176 expect Cygwin names.
1177 (_DebPrint): Define.
1178 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1179 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1180 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1181 (w32_last_error): Remove.
1182
1183 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1184
1185 * w32heap.c (syspage_mask): Declare here.
1186 (cache_system_info): Remove.
1187
1188 * w32inevt.c (faked_key): Define globally, not statically.
1189 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1190 (w32_console_toggle_lock_key): Move to w32fns.c.
1191
1192 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
1193
1194 * w32proc.c (_DebPrint): Move to w32fns.c.
1195 * w32select.c: Include string.h, stdio.h for Cygwin.
1196 * w32select.h: New File.
1197
1198 * w32term.c: Include io.h for non-CYGWIN builds; needed for
1199 get_osfhandle.
1200 (w32_message_fd): New variable. Under Cygwin, holds the file
1201 descriptor the system used to tell us about pending thread
1202 messages.
1203
1204 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1205 that prevented compilation under non-WINDOWSNT systems.
1206
1207 (w32_initialize): Open /dev/windows and assign it to
1208 w32_message_fd. Provide w32 feature.
1209
1210 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1211 (WM_EMACS_INPUT_READY): add.
1212 (prepend_msg, w32_message_fd): Declare globally.
1213
1214 * w32xfns.c:
1215 (keyboard_handle): Use only when WINDOWSNT.
1216 (notify_msg_ready): New function. Posts a message to the main
1217 thread's message queue under CYGWIN, which wakes up the main
1218 thread from select(2) by making the /dev/windows file descriptor
1219 ready. Under WINDOWSNT, it sets an event the same way the old
1220 code did.
1221
1222 (post, prepend_msg): Actually call notify_msg_ready instead of
1223 setting the input event directly.
1224
1225 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1226
1227 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1228 but it still has blocs in it, don't return it to the system,
1229 instead of aborting. (Bug#12402)
1230
1231 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1232
1233 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1234
1235 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1236 MAC_OS_X_VERSION_10_6.
1237 (syms_of_nsterm): Remove comment about Panther and above for
1238 ns-antialias-text.
1239 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1240 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1241 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1242
1243 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1244 MAC_OS_X_VERSION_10_4.
1245
1246 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1247 MAC_OS_X_VERSION_10_2.
1248
1249 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1250
1251 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1252 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1253
1254 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1255 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1256 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1257 Remove ns_in_resize check.
1258 (ns_clear_frame_area): Remove resize handle code.
1259
1260 * nsfns.m (ns_in_resize): Remove.
1261 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1262 Remove ns_in_resize check.
1263
1264 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1265
1266 Improve sys_siglist detection.
1267 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1268 defined as a macro, as is done in Solaris.
1269 (sys_siglist_entries): New macro.
1270 (save_strsignal): Use it.
1271 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1272 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1273
1274 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1275
1276 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1277 fullscreen/Fullscreen.
1278
1279 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1280 tobar_height is new.
1281
1282 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1283 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1284 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1285 (windowDidResize:): Check for correct window if old style fullscreen.
1286 Capitalize word in comment. Remove incorrect comment.
1287 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1288 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1289 error in drawing background.
1290 (toggleFullScreen:): Remove comment. Rearrange calls.
1291 Set toolbar values to zero, save old height in tobar_height.
1292 Restore tool bar height when leaving fullscreen.
1293 (canBecomeMainWindow): New function.
1294
1295 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1296
1297 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1298
1299 2012-10-05 Eli Zaretskii <eliz@gnu.org>
1300
1301 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1302
1303 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1304 that time stamps of directories could also be changed.
1305 Don't request the too broad GENERIC_WRITE, only the more restrictive
1306 FILE_WRITE_ATTRIBUTES access rights.
1307
1308 * fileio.c (Fset_file_times): Special-case ignoring errors for
1309 directories only on MSDOS, not on MS-Windows.
1310
1311 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
1312
1313 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1314
1315 2012-10-04 Eli Zaretskii <eliz@gnu.org>
1316
1317 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1318 see whether CreateFile failed.
1319
1320 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1321
1322 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1323 to avoid similar races.
1324 * keyboard.c (pending_signals): Now bool, not int.
1325
1326 Port timers to OpenBSD, plus check for timer failures.
1327 OpenBSD problem reported by Han Boetes.
1328 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1329 and/or setitimer.
1330 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1331 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1332 like OpenBSD, which has timer_settime but does not declare it.
1333 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1334 whether to use itimerspec-related primitives. All uses of
1335 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1336
1337 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1338
1339 * profiler.c (handle_profiler_signal): Fix a malloc race
1340 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1341
1342 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1343
1344 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1345
1346 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1347
1348 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1349 consistent with the change in return value of 'safe_strsignal'.
1350
1351 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1352
1353 Prefer plain 'static' to 'static inline' (Bug#12541).
1354 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1355 (bidi_set_sor_type, bidi_push_embedding_level)
1356 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1357 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1358 (bidi_cache_search, bidi_cache_ensure_space)
1359 (bidi_cache_iterator_state, bidi_cache_find)
1360 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1361 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1362 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1363 Now 'static', not 'static inline'.
1364
1365 Count overruns when profiling; change units to ns.
1366 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1367 Give extra weight to samples after overruns, to attempt to count
1368 the time more accurately.
1369 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1370 the underlying primitives nominally do ns.
1371 (Fprofiler_cpu_start): Document the change. Mention that
1372 the sampling intervals are only approximate.
1373
1374 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1375
1376 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1377
1378 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1379 case for the special 0 coding-system.
1380
1381 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1382 (Fmake_overlay): Remove redundant tests.
1383 (fix_start_end_in_overlays): Remove redundant recentering.
1384
1385 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1386
1387 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1388 Update dependencies.
1389
1390 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1391
1392 Fix a malloc race condition involving strsignal.
1393 A signal can arrive in the middle of a malloc, and Emacs's signal
1394 handler can invoke strsignal, which can invoke malloc, which is
1395 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1396 Fix it by altering the signal handler so that it does not invoke
1397 strsignal.
1398 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1399 * process.c (status_message): Use const pointer, in case strsignal
1400 is #defined to safe_strsignal.
1401 * sysdep.c (sys_siglist, init_signals): Always define and
1402 initialize a substitute sys_siglist if the system does not define
1403 one, even if HAVE_STRSIGNAL.
1404 (safe_strsignal): Rename from strsignal. Always define,
1405 using sys_siglist. Return a const pointer.
1406 * syssignal.h (safe_strsignal): New decl.
1407 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1408
1409 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1410
1411 * w32proc.c (timer_loop): Fix code that waits for timer
1412 expiration, to avoid high CPU usage.
1413
1414 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1415
1416 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1417 (sweep_weak_table): Remove redundant prototypes.
1418
1419 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1420
1421 * emacs.c: Move the inclusion of TERM_HEADER after including
1422 windows.h on WINDOWSNT. This avoids compilation problems with
1423 MSVC.
1424
1425 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1426
1427 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1428 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1429 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1430 as the previous version used 'void *'.
1431
1432 * ralloc.c (ROUNDUP): Fix last change.
1433 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1434 'size_t'.
1435
1436 * w32proc.c <disable_itimers>: New static flag.
1437 (init_timers): Initialize it to zero, after creating the critical
1438 sections used by the timer threads.
1439 (term_timers): Set to 1 before deleting the critical sections.
1440 (getitimer, setitimer): If disable_itimers is non-zero, return an
1441 error indication without doing anything. Reported by Fabrice
1442 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1443 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1444 return results.
1445 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1446 support timers.
1447
1448 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1449 term_ntproc after all the other bookkeeping, to get timers working
1450 as long as possible.
1451
1452 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1453
1454 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1455 Suggested by Juri Linkov in
1456 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1457
1458 Prefer plain 'static' to 'static inline' (Bug#12541).
1459 With static functions, modern compilers inline pretty well by
1460 themselves; advice from programmers often hurts as much as it helps.
1461 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1462 this change shrinks the text size of the Emacs executable by 1.1%
1463 without affecting CPU significantly in my benchmark.
1464 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1465 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1466 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1467 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1468 (bset_auto_fill_function, bset_auto_save_file_format)
1469 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1470 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1471 (bset_cache_long_line_scans, bset_case_fold_search)
1472 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1473 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1474 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1475 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1476 (bset_header_line_format, bset_indicate_buffer_boundaries)
1477 (bset_indicate_empty_lines, bset_invisibility_spec)
1478 (bset_left_fringe_width, bset_major_mode, bset_mark)
1479 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1480 (bset_name, bset_overwrite_mode, bset_pt_marker)
1481 (bset_right_fringe_width, bset_save_length)
1482 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1483 (bset_scroll_up_aggressively, bset_selective_display)
1484 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1485 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1486 (set_buffer_overlays_after):
1487 * category.c (bset_category_table):
1488 * charset.c (read_hex):
1489 * coding.c (produce_composition, produce_charset)
1490 (handle_composition_annotation, handle_charset_annotation)
1491 (char_encodable_p):
1492 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1493 (assign_row, set_frame_matrix_frame, make_current)
1494 (add_row_entry):
1495 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1496 * fns.c (maybe_resize_hash_table):
1497 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1498 * gmalloc.c (register_heapinfo):
1499 * image.c (lookup_image_type):
1500 * intervals.c (set_interval_object, set_interval_left)
1501 (set_interval_right, copy_interval_parent, rotate_right)
1502 (rotate_left, balance_possible_root_interval):
1503 * keyboard.c (kset_echo_string, kset_kbd_queue)
1504 (kset_keyboard_translate_table, kset_last_prefix_arg)
1505 (kset_last_repeatable_command, kset_local_function_key_map)
1506 (kset_overriding_terminal_local_map, kset_real_last_command)
1507 (kset_system_key_syms, clear_event, set_prop):
1508 * lread.c (digit_to_number):
1509 * marker.c (attach_marker, live_buffer, set_marker_internal):
1510 * nsterm.m (ns_compute_glyph_string_overhangs):
1511 * process.c (pset_buffer, pset_command)
1512 (pset_decode_coding_system, pset_decoding_buf)
1513 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1514 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1515 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1516 * syntax.c (bset_syntax_table, dec_bytepos):
1517 * terminal.c (tset_param_alist):
1518 * textprop.c (interval_has_some_properties)
1519 (interval_has_some_properties_list):
1520 * window.c (wset_combination_limit, wset_dedicated)
1521 (wset_display_table, wset_hchild, wset_left_fringe_width)
1522 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1523 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1524 (wset_right_fringe_width, wset_right_margin_cols)
1525 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1526 (wset_vertical_scroll_bar_type, wset_window_parameters):
1527 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1528 (wset_column_number_displayed, wset_region_showing)
1529 (window_box_edges, run_window_scroll_functions)
1530 (append_glyph_string_lists, prepend_glyph_string_lists)
1531 (append_glyph_string, set_glyph_string_background_width)
1532 (append_glyph, append_composite_glyph)
1533 (take_vertical_position_into_account):
1534 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1535 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1536 (lface_hash, lface_same_font_attributes_p, lookup_face):
1537 * xml.c (libxml2_loaded_p):
1538 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1539 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1540 Now 'static', not 'static inline'.
1541
1542 * bidi.c: Tune.
1543 (bidi_copy_it): Do the whole copy with a single memcpy.
1544 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1545
1546 Revert the FOLLOW-SYMLINKS change for file-attributes.
1547 Doing it right would require several changes to Tramp, and there's
1548 not enough time to get that tested before the freeze today.
1549 * dired.c (directory_files_internal, Ffile_attributes):
1550 Undo last change.
1551
1552 * frame.c (x_report_frame_params): Port better to wider ints.
1553 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1554 or that pointers can be printed in 15 decimal digits.
1555 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1556
1557 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1558
1559 Support x64 build on MS-Windows.
1560 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1561 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1562 compatibility with x64.
1563 (x_get_focus_frame): Add prototype.
1564
1565 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1566 defining an XRectangle structure.
1567
1568 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1569 arithmetics for compatibility with x64.
1570
1571 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1572 compatibility with x64.
1573
1574 * w32heap.h: Adjust prototypes and declarations.
1575
1576 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1577 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1578 DWORD, long, and unsigned long, for compatibility with x64.
1579 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1580 (sbrk): Argument is now of type ptrdiff_t.
1581
1582 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1583 less than 0x0500.
1584 (w32_msg_pump): Use WPARAM type for 'result'.
1585
1586 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1587 architecture.
1588 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1589 compatibility with x64.
1590
1591 * vm-limit.c (lim_data): Now size_t.
1592 (check_memory_limits): Adjust prototypes of real_morecore and
1593 __morecore to receive argument of type ptrdiff_t. Use size_t for
1594 five_percent and data_size.
1595
1596 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1597 variables, for compatibility with x64.
1598 (rva_to_section, offset_to_section, relocate_offset)
1599 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1600 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1601 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1602 for compatibility with x64.
1603
1604 * sysdep.c (STDERR_FILENO): Define if not already defined.
1605
1606 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1607 (__morecore): Argument type is now ptrdiff_t.
1608 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1609 (relinquish): Use ptrdiff_t type for 'excess'.
1610 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1611
1612 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1613 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1614 instead of a literal number.
1615
1616 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1617 (min): Define only if not already defined.
1618
1619 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1620 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1621 hosts.
1622
1623 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1624 'bitmaps' is a pointer.
1625
1626 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1627
1628 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1629
1630 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1631
1632 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1633 * dired.c (directory_files_internal, Ffile_attributes):
1634 New arg follow_symlinks. All uses changed.
1635
1636 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1637
1638 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1639
1640 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1641
1642 Support atimers and CPU profiler via profile.c on MS-Windows.
1643 * w32proc.c (sig_mask, crit_sig): New static variables.
1644 (sys_signal): Support SIGALRM and SIGPROF.
1645 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1646 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1647 sigfillset, and sigprocmask are no longer no-ops.
1648 (sigismember): New function.
1649 (struct itimer_data): New definition.
1650 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1651 (crit_prof): New static variables.
1652 (MAX_SINGLE_SLEEP): New definition.
1653 (timer_loop, stop_timer_thread, term_timers, init_timers)
1654 (start_timer_thread, getitimer, setitimer): New functions.
1655 (alarm): No longer a no-op, calls setitimer.
1656
1657 * w32.c (term_ntproc): Call term_timers.
1658 (init_ntproc): Make sure all signals are unblocked at startup, to
1659 erase any traces of dumping. Call init_timers.
1660
1661 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1662 Windows-specific code to display the hourglass mouse pointer is no
1663 longer used.
1664 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1665 to hourglass timer expiration.
1666 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1667 Remove, no longer used.
1668 (w32_note_current_window, show_hourglass, hide_hourglass):
1669 New functions, in support of hourglass cursor display similar to other
1670 window systems.
1671 (syms_of_w32fns): Don't initialize hourglass_timer.
1672
1673 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1674 WINDOWSNT as well.
1675 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1676
1677 * w32.h (init_timers, term_timers): Add prototypes.
1678
1679 2012-09-30 Kenichi Handa <handa@gnu.org>
1680
1681 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1682 to the buffer relocation which may be caused by ccl_driver.
1683
1684 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1685
1686 * xfns.c (Fx_file_dialog): Update comment.
1687
1688 * w32fns.c (Fx_file_dialog): Update comment.
1689
1690 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1691 Initialize panel name field if OSX >= 10.6.
1692
1693 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1694
1695 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1696
1697 * nsterm.m (NEW_STYLE_FS): New define.
1698 (ns_fullscreen_hook, windowWillEnterFullScreen)
1699 (windowDidEnterFullScreen, windowWillExitFullScreen)
1700 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1701 (setFSValue): New functions.
1702 (EmacsFSWindow): New implementation.
1703 (canBecomeKeyWindow): New function for EmacsFSWindow.
1704 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1705 (dealloc): Release nonfs_window if in fullscreen.
1706 (updateFrameSize:): Call windowDidMove to update top/left.
1707 (windowWillResize:toSize:): Check if frame is still maximized.
1708 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1709 next_maximized, maximized_width, maximized_height and nonfs_window.
1710 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1711 tbar_height.
1712 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1713 fullscreen. Set maximized_width/height. Act on next_maximized.
1714
1715 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1716 (EmacsView): Add variables for fullscreen.
1717 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1718 (EmacsFSWindow): New interface for fullscreen.
1719
1720 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1721
1722 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1723
1724 2012-09-30 Chong Yidong <cyd@gnu.org>
1725
1726 * fns.c (Frandom): Doc fix.
1727
1728 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1729
1730 * window.c (Vwindow_combination_limit): New default value.
1731 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1732
1733 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1734
1735 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1736 Suggested by Eli Zaretskii in
1737 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1738
1739 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1740
1741 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1742 HAVE_TIMER_SETTIME is defined.
1743
1744 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1745
1746 Profiler improvements: more-accurate timers, overflow checks.
1747 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1748 signal.h, setjmp.h. Include systime.h instead.
1749 (saturated_add): New function.
1750 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1751 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1752 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1753 New static vars.
1754 (enum profiler_cpu_running): New enum.
1755 (profiler_cpu_running): Now of that enum type, not bool.
1756 All uses changed to store the new value.
1757 (handle_profiler_signal): Rename from sigprof_handler_1,
1758 for consistency with other handlers. Do not check whether
1759 cpu_log is a hash-table if garbage collecting, since it
1760 doesn't matter in that case.
1761 (deliver_profiler_signal): Rename from sigprof_handler,
1762 for consistency with other handlers.
1763 (setup_cpu_timer): New function, with much of what used to be in
1764 Fprofiler_cpu_start. Check for out-of-range argument.
1765 Prefer timer_settime if available, and prefer
1766 thread cputime clocks, then process cputime clocks, then
1767 monotonic clocks, to the old realtime clock. Use make_timeval
1768 to round more-correctly when falling back to setitimer.
1769 (Fprofiler_cpu_start): Use it.
1770 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1771 Don't assume that passing NULL as the 2nd argument of setitimer
1772 is the same as passing a pointer to all-zero storage.
1773 Ignore SIGPROF afterwards.
1774 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1775 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1776 non-fatal signal handlers. Ignore SIGPROF on startup.
1777 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1778 in profiler.c, since sysdep.c now uses it.
1779
1780 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1781 Suggested by Eli Zaretskii in
1782 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1783
1784 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1785
1786 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1787
1788 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1789
1790 * lisp.h (struct backtrace): Remove indirection for `function' field.
1791 * xdisp.c (redisplay_internal):
1792 * profiler.c (record_backtrace, sigprof_handler_1):
1793 * alloc.c (Fgarbage_collect):
1794 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1795 (Fbacktrace_frame): Adjust accordingly.
1796
1797 2012-09-28 Glenn Morris <rgm@gnu.org>
1798
1799 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1800 (Frun_hook_with_args_until_failure): Doc fixes.
1801
1802 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1803
1804 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1805 Qautomatic_redisplay and change the symbol name. All users changed.
1806
1807 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1808
1809 * profiler.c (sigprof_handler): Fix race condition.
1810
1811 2012-09-28 Glenn Morris <rgm@gnu.org>
1812
1813 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1814
1815 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1816
1817 Check more robustly for timer_settime.
1818 * Makefile.in (LIB_TIMER_TIME): New macro.
1819 (LIBES): Add it.
1820 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1821 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1822 call timer_settime.
1823
1824 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1825
1826 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1827
1828 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1829
1830 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1831
1832 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1833
1834 * character.h (MAYBE_UNIFY_CHAR): Remove.
1835 * charset.c, charset.h (maybe_unify_char): Now static.
1836 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1837 Since this stuff is now private to charset.c, there's no need for
1838 a public macro and no need to inline by hand.
1839
1840 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1841 Stefan Monnier <monnier@iro.umontreal.ca>
1842 Juanma Barranquero <lekktu@gmail.com>
1843
1844 * profiler.c: New file.
1845 * Makefile.in (base_obj): Add profiler.o.
1846 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1847 ($(BLD)/profiler.$(O)): New target.
1848 * emacs.c (main): Call syms_of_profiler.
1849 * alloc.c (Qautomatic_gc): New constant.
1850 (MALLOC_PROBE): New macro.
1851 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1852 (total_bytes_of_live_objects): New function.
1853 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1854 Call malloc_probe for the memory profiler.
1855 (syms_of_alloc): Define Qautomatic_gc.
1856 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1857 race condition.
1858 (struct backtrace): Move definition...
1859 * lisp.h (struct backtrace): ..here.
1860 (Qautomatic_gc, profiler_memory_running): Declare vars.
1861 (malloc_probe, syms_of_profiler): Declare functions.
1862 * xdisp.c (Qautomatic_redisplay): New constant.
1863 (redisplay_internal): Record itself in backtrace_list.
1864 (syms_of_xdisp): Define Qautomatic_redisplay.
1865
1866 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1867 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1868
1869 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1870
1871 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1872
1873 Prefer POSIX timers if available.
1874 They avoid a race if the timer is too close to the current time.
1875 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1876 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1877 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1878
1879 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1880
1881 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1882 CHAR_STRING_ADVANCE.
1883 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1884 STRING_CHAR_ADVANCE.
1885
1886 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1887
1888 Move Vlibrary_cache to emacs.c and reset before dumping.
1889
1890 * lisp.h (reset_image_types): Declare.
1891 [WINDOWSNT] (Vlibrary_cache): Declare.
1892
1893 * image.c (reset_image_types): New function.
1894
1895 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1896 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1897 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1898
1899 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1900 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1901
1902 * w32.h (Vlibrary_cache): Do not declare.
1903
1904 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1905
1906 * w32proc.c (sys_signal): Handle all signals defined by the
1907 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1908 handlers for signals supported by Windows. Don't override
1909 term_ntproc as the handler for SIGABRT.
1910 (sigaction): Rewrite to call sys_signal instead of duplicating its
1911 code.
1912 (sys_kill): Improve commentary.
1913
1914 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1915 consistency with a signature of a signal handler. All callers
1916 changed.
1917 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1918 install term_ntproc as a signal handler for SIGABRT, as that
1919 should be done by the dumped Emacs.
1920
1921 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1922
1923 * w32select.c (term_w32select): Protect against repeated
1924 invocation by setting clipboard_owner to NULL after calling
1925 DestroyWindow.
1926
1927 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1928 and term_ntproc to their modified signatures.
1929
1930 * character.c (char_string, string_char): Remove calls to
1931 MAYBE_UNIFY_CHAR. See the discussion starting at
1932 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1933 for the details.
1934
1935 2012-09-25 Chong Yidong <cyd@gnu.org>
1936
1937 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1938
1939 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1940
1941 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1942 when encountering an unknown bytecode.
1943
1944 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1945
1946 image.c, indent.c: Use bool for booleans.
1947 * dispextern.h (struct image_type): Members valid_p, load, init
1948 now return bool, not int. All uses changed.
1949 * image.c: Omit unnecessary static decls.
1950 (x_create_bitmap_mask, x_build_heuristic_mask):
1951 Return void, not int, since callers don't care about the return value.
1952 (x_create_bitmap_mask, define_image_type, valid_image_p)
1953 (struct image_keyword, parse_image_spec, image_spec_value)
1954 (check_image_size, image_background)
1955 (image_background_transparent, x_clear_image_1)
1956 (postprocess_image, lookup_image, x_check_image_size)
1957 (x_create_x_image_and_pixmap, xbm_image_p)
1958 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1959 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1960 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1961 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1962 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1963 (png_image_p, init_png_functions, png_load_body, png_load)
1964 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1965 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1966 (init_gif_functions, gif_load, imagemagick_image_p)
1967 (imagemagick_load_image, imagemagick_load, svg_image_p)
1968 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1969 (gs_load):
1970 * nsimage.m (ns_load_image):
1971 * nsterm.m (ns_defined_color):
1972 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1973 * xfns.c (x_defined_color):
1974 * xterm.c (x_alloc_lighter_color_for_widget)
1975 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1976 (x_alloc_lighter_color):
1977 * indent.c (disptab_matches_widthtab, current_column)
1978 (scan_for_column, string_display_width, indented_beyond_p)
1979 (compute_motion, vmotion, Fvertical_motion):
1980 Use bool for booleans.
1981
1982 2012-09-24 Chong Yidong <cyd@gnu.org>
1983
1984 * chartab.c (Fset_char_table_default): Obsolete function removed.
1985
1986 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1987
1988 Move pid_t related decls out of lisp.h.
1989 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1990 (interruptible_wait_for_termination):
1991 Move these decls from lisp.h to syswait.h, since they use pid_t.
1992 Needed on FreeBSD; see Herbert J. Skuhra in
1993 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1994 * callproc.c: Include syswait.h.
1995
1996 gnutls.c, gtkutil.c: Use bool for boolean.
1997 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1998 (emacs_gnutls_handle_error):
1999 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
2000 (xg_hide_tooltip, xg_create_frame_widgets)
2001 (create_dialog, xg_uses_old_file_dialog)
2002 (xg_get_file_with_chooser, xg_get_file_with_selection)
2003 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
2004 (xg_item_label_same_p, xg_update_menubar)
2005 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
2006 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
2007 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
2008 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
2009 (update_frame_tool_bar, free_frame_tool_bar):
2010 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
2011 * nsmenu.m (ns_update_menubar):
2012 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
2013 * xfns.c (Fx_show_tip) [USE_GTK]:
2014 Use bool for boolean.
2015 * gtkutil.c (xg_update_frame_menubar):
2016 * xmenu.c (update_frame_menubar):
2017 Return void, not int, since caller ignores return value.
2018 * gtkutil.c (xg_change_toolbar_position):
2019 Return void, not 1.
2020
2021 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2022
2023 * makefile.w32-in (BLOCKINPUT_H): Remove.
2024 (SYSSIGNAL_H): New macro.
2025 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
2026 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
2027 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
2028 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
2029 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
2030 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
2031 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
2032 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
2033 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
2034 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
2035 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
2036 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
2037 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
2038 ($(BLD)/w32xfns.$(O)): Update dependencies.
2039
2040 2012-09-23 Eli Zaretskii <eliz@gnu.org>
2041
2042 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
2043 fatal_error_backtrace.
2044
2045 * w32proc.c (sys_kill): Undo last change: don't do anything when
2046 invoked to deliver SIGABRT to our own process. This is now
2047 handled by emacs_raise.
2048
2049 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2050
2051 * w32term.c (w32_read_socket): Remove leftover reference to
2052 interrupt_input_pending.
2053
2054 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2055
2056 Do not use SA_NODEFER.
2057 Problem reported by Dani Moncayo in
2058 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2059 * alloc.c (die):
2060 * sysdep.c (emacs_abort): Do not reset signal handler.
2061 * emacs.c (terminate_due_to_signal): Reset signal handler here.
2062 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
2063 wanted even on POSIXish hosts, and it doesn't work on Windows.
2064
2065 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2066
2067 * xterm.c (x_term_init): Call fixup_locale before and after calling
2068 gtk_init (Bug#12392).
2069
2070 2012-09-23 Chong Yidong <cyd@gnu.org>
2071
2072 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2073 Vdynamic_library_alist.
2074
2075 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2076 (Fgnutls_available_p): Caller changed.
2077
2078 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2079 (Flibxml_parse_xml_region): Likewise.
2080
2081 * dispextern.h (struct image_type): Remove arg from init function.
2082
2083 * image.c (Finit_image_library, lookup_image_type)
2084 (define_image_type): Remove now-unneeded second arg.
2085 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2086 (init_tiff_functions, init_gif_functions, init_svg_functions):
2087 Arglist and w32_delayed_load calling convention changed.
2088 (gs_type): Remove init_gs_functions; there is no such function.
2089 (valid_image_p, make_image): Fix caller to lookup_image_type.
2090
2091 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2092
2093 Simplify and avoid signal-handling races (Bug#12471).
2094 * alloc.c (die):
2095 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2096 Avoid recursive loop if there's a fatal error in the function itself.
2097 * atimer.c (pending_atimers):
2098 * blockinput.h: Don't include "atimer.h"; no longer needed.
2099 (interrupt_input_pending): Remove. All uses removed.
2100 pending_signals now counts both atimers and ordinary interrupts.
2101 This is less racy than having three separate pending-signal flags.
2102 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2103 (input_blocked_p):
2104 Rename from their upper-case counterparts BLOCK_INPUT,
2105 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2106 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2107 This makes it easier to access volatile variables more accurately.
2108 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2109 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2110 that's more reliable if the code is buggy and sets
2111 interrupt_input_blocked to a negative value. All uses changed.
2112 * atimer.c (deliver_alarm_signal):
2113 Remove. No need to deliver this to the parent; any thread can
2114 handle this signal now. All uses replaced by underlying handler.
2115 * atimer.c (turn_on_atimers):
2116 * dispnew.c (handle_window_change_signal):
2117 * emacs.c (handle_danger_signal):
2118 * keyboard.c (kbd_buffer_get_event):
2119 Don't reestablish signal handler; not needed with sigaction.
2120 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2121 (UNBLOCK_INPUT_TO):
2122 Rework to avoid unnecessary accesses to volatile variables.
2123 (UNBLOCK_INPUT_TO): Now a function.
2124 (totally_unblock_input, unblock_input): New decls.
2125 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2126 (init_data): Remove. Necessary stuff now done in init_signal.
2127 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2128 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2129 (fatal_error_code): Remove; no longer needed.
2130 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2131 it doesn't always backtrace. All uses changed. No need to reset
2132 signal to default, since sigaction and/or die does that for us now.
2133 Use emacs_raise (FOO), not kill (getpid (), FOO).
2134 (main): Check more-accurately whether we're dumping.
2135 Move fatal-error setup to sysdep.c
2136 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2137 * gtkutil.c (xg_get_file_name, xg_get_font):
2138 Remove no-longer-needed signal-mask manipulation.
2139 * keyboard.c, process.c (POLL_FOR_INPUT):
2140 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2141 * keyboard.c (read_avail_input): Remove.
2142 All uses replaced by gobble_input.
2143 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2144 (kbd_buffer_store_event_hold, gobble_input):
2145 (record_asynch_buffer_change) [USABLE_SIGIO]:
2146 (store_user_signal_events):
2147 No need to mess with signal mask.
2148 (gobble_input): If blocking input and there are terminals, simply
2149 set pending_signals to 1 and return. All hooks changed to not
2150 worry about whether input is blocked.
2151 (process_pending_signals): Clear pending_signals before processing
2152 them, in case a signal comes in while we're processing.
2153 By convention callers now test pending_signals before calling us.
2154 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2155 New functions, to support changes to blockinput.h.
2156 (handle_input_available_signal): Now extern.
2157 (reinvoke_input_signal): Remove. All uses replaced by
2158 handle_async_input.
2159 (quit_count): Now volatile, since a signal handler uses it.
2160 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2161 All callers changed. Block SIGINT only if not already blocked.
2162 Clear sigmask reliably, even if Fsignal returns, which it can.
2163 Omit unnecessary accesses to volatile var.
2164 (quit_throw_to_read_char): No need to restore sigmask.
2165 * keyboard.c (gobble_input, handle_user_signal):
2166 * process.c (wait_reading_process_output):
2167 Call signal-handling code rather than killing ourselves.
2168 * lisp.h: Include <float.h>, for...
2169 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2170 (pending_signals): Now volatile.
2171 (syms_of_data): Now const if IEEE floating point.
2172 (handle_input_available_signal) [USABLE_SIGIO]:
2173 (terminate_due_to_signal, record_child_status_change): New decls.
2174 * process.c (create_process): Avoid disaster if memory is exhausted
2175 while we're processing a vfork, by tightening the critical section
2176 around the vfork.
2177 (send_process_frame, process_sent_to, handle_pipe_signal)
2178 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
2179 ignores SIGPIPE.
2180 (send_process): No need for setjmp/longjmp any more, since the
2181 SIGPIPE stuff is now gone. Instead, report an error if errno
2182 is EPIPE.
2183 (record_child_status_change): Now extern. PID and W are now args.
2184 Return void, not bool. All callers changed.
2185 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2186 Remove. All uses removed. This bug should be fixed now in a
2187 different way.
2188 (wait_for_termination_1): Use waitpid rather than sigsuspend,
2189 and record the child status change directly. This avoids the
2190 need to futz with the signal mask.
2191 (process_fatal_action): Move here from emacs.c.
2192 (emacs_sigaction_flags): New function, containing
2193 much of what used to be in emacs_sigaction_init.
2194 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
2195 caught by emacs, to make races less likely.
2196 (deliver_process_signal): Rename from handle_on_main_thread.
2197 All uses changed.
2198 (BACKTRACE_LIMIT_MAX): Now at top level.
2199 (thread_backtrace_buffer, threadback_backtrace_pointers):
2200 New static vars.
2201 (deliver_thread_signal, deliver_fatal_thread_signal):
2202 New functions, for more-accurate delivery of thread-specific signals.
2203 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2204 (deliver_arith_signal): Handle in this thread, not
2205 in the main thread, since it's triggered by this thread.
2206 (maybe_fatal_sig): New function.
2207 (init_signals): New arg DUMPING so that we can be more accurate
2208 about whether we're dumping. Caller changed.
2209 Treat thread-specific signals differently from process-general signals.
2210 Block all signals while handling fatal error; that's safer.
2211 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2212 on IEEE hosts.
2213 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2214 Ignore SIGPIPE unless batch.
2215 (emacs_backtrace): Output backtrace for the appropriate thread,
2216 which is not necessarily the main thread.
2217 * syssignal.h: Include <stdbool.h>.
2218 (emacs_raise): New macro.
2219 * xterm.c (x_connection_signal): Remove; no longer needed
2220 now that we use sigaction.
2221 (x_connection_closed): No need to mess with sigmask now.
2222 (x_initialize): No need to reset SIGPIPE handler here, since
2223 init_signals does this for us now.
2224
2225 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2226
2227 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2228 background rect may be larger (Bug#12245).
2229
2230 2012-09-23 Chong Yidong <cyd@gnu.org>
2231
2232 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2233
2234 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2235
2236 * .gdbinit: Just stop at fatal_error_backtrace.
2237 See Stefan Monnier's request in
2238 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2239 Remove no-longer-used query of system type.
2240
2241 2012-09-22 Chong Yidong <cyd@gnu.org>
2242
2243 * search.c (Freplace_match): Doc fix (Bug#12325).
2244
2245 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2246
2247 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2248 (Fline_end_position): Doc fix.
2249
2250 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2251
2252 2012-09-22 Chong Yidong <cyd@gnu.org>
2253
2254 * dispextern.h (struct image_type): Add new slot, storing a type
2255 initialization function.
2256
2257 * image.c (define_image_type): Call the image initializer function
2258 if it is defined. Arguments and return value changed.
2259 (valid_image_p, make_image): Callers changed.
2260 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2261 (gif_type, imagemagick_type, svg_type, gs_type):
2262 Add initialization functions.
2263 (Finit_image_library): Call lookup_image_type.
2264 (CHECK_LIB_AVAILABLE): Macro deleted.
2265 (lookup_image_type): Call define_image_type here, rather than via
2266 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2267 (syms_of_image): Move define_image_type calls for xbm_type and
2268 pbm_type to lookup_image_type.
2269
2270 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2271
2272 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2273 'idle_timers' from here ...
2274 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2275 lists, to avoid infloops when the timer does something stupid,
2276 like reinvoke itself with the same or smaller time-out.
2277 (Bug#12447)
2278
2279 2012-09-22 Martin Rudalics <rudalics@gmx.at>
2280
2281 * window.c (Fsplit_window_internal): Handle only Qt value of
2282 Vwindow_combination_limit separately.
2283 (Qtemp_buffer_resize): New symbol.
2284 (Vwindow_combination_limit): New default value.
2285 Rewrite doc-string.
2286
2287 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2288
2289 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2290 the new overlay string. (Bug#10159)
2291
2292 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2293
2294 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2295 or that fprintf is async-signal-safe. POSIX doesn't require
2296 either assumption.
2297
2298 2012-09-22 Chong Yidong <cyd@gnu.org>
2299
2300 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2301 (Bug#8207).
2302
2303 2012-09-22 Kenichi Handa <handa@gnu.org>
2304
2305 * composite.c (composition_reseat_it): Handle the case that a
2306 grapheme cluster is not covered by a single font (Bug#12352).
2307
2308 2012-09-21 Chong Yidong <cyd@gnu.org>
2309
2310 * image.c (define_image_type): Avoid adding duplicate types to
2311 image_types (Bug#12463). Suggested by Jörg Walter.
2312
2313 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2314
2315 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2316 (print_load_command_name): Add case LC_DATA_IN_CODE.
2317 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2318
2319 2012-09-21 Glenn Morris <rgm@gnu.org>
2320
2321 * eval.c (Frun_hook_with_args_until_success)
2322 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2323
2324 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
2325
2326 * fileio.c (Ffile_selinux_context): Only call freecon when
2327 lgetfilecon succeeded.
2328 (Fset_file_selinux_context): Likewise. (Bug#12444)
2329
2330 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2331
2332 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2333 reordering, locate the cursor by calling set_cursor_from_row; if
2334 that fails, clear the desired glyph matrix before returning a
2335 failure indication to the caller. Fixes leaving garbled display
2336 when fast scrolling with a down-key. (Bug#12403)
2337 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2338 scrolling through multibyte text.
2339
2340 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2341
2342 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2343 calling mark_vectorlike since that's the one that marks the window.
2344 (mark_discard_killed_buffers): Mark the final cdr.
2345 * window.h (struct window): Move prev/next_buffers to the
2346 non-standard fields.
2347 * window.c (make_window): Initialize prev/next_buffers manually.
2348
2349 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2350
2351 Omit unused arg EXPECTED from socket hooks.
2352 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2353 * nsterm.m (ns_term_init):
2354 * termhooks.h (struct terminal.read_socket_hook):
2355 * w32inevt.c (w32_console_read_socket):
2356 * w32term.c (w32_read_socket):
2357 * xterm.c (XTread_socket):
2358 Omit unused arg EXPECTED. All callers changed.
2359 (store_user_signal_events): Return void, not int, since callers no
2360 longer care about the return value. All uses changed.
2361
2362 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2363
2364 * w32gui.h (XParseGeometry): Do not declare.
2365
2366 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2367
2368 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2369 Ignore 'expected'. See Eli Zaretskii in
2370 <http://bugs.gnu.org/12471#8> (last line).
2371
2372 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2373 (XParseGeometry): Now static. Substitute extremal values for
2374 values that are out of range.
2375
2376 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2377
2378 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2379
2380 * nsfns.m (XParseGeometry): Remove.
2381 (Fx_create_frame): Call x_set_offset to correctly interpret
2382 top_pos in geometry.
2383
2384 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2385 (Fx_parse_geometry): If there is a space in string, call
2386 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2387
2388 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2389
2390 * search.c (scan_buffer): Use character positions in calls to
2391 region_cache_forward and region_cache_backward, not byte
2392 positions. (Bug#12196)
2393
2394 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2395 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2396
2397 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2398 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2399 emacs_blocked_malloc, now deleted.
2400
2401 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2402
2403 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2404 The workaround was for improving performance on Solaris 2.4, but
2405 is getting in the way now. Emacs will still work if someone is
2406 still running Solaris 2.4 in a museum somewhere; Sun dropped
2407 support for Solaris 2.4 in 2003.
2408 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2409 * process.c (create_process) [HAVE_WORKING_VFORK]:
2410 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2411 since Emacs no longer uses vfork on that platform.
2412
2413 2012-09-17 Glenn Morris <rgm@gnu.org>
2414
2415 * emacs.c: Use COPYRIGHT.
2416
2417 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2418
2419 Remove configure's --without-sync-input option (Bug#12450).
2420 When auditing signal-handling in preparation for cleaning it up,
2421 I found that SYNC_INPUT has race conditions and would be a real
2422 pain to fix. Since it's an undocumented and deprecated
2423 configure-time option, now seems like a good time to remove it.
2424 Also see <http://bugs.gnu.org/11080#16>.
2425 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2426 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2427 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2428 (malloc_hysteresis):
2429 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2430 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2431 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2432 (dont_register_blocks, bytes_used_when_reconsidered)
2433 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2434 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2435 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2436 Remove. All uses removed.
2437 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2438 implementation, one that depends on whether the new macro
2439 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2440 is defined.
2441 * atimer.c (run_timers, handle_alarm_signal):
2442 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2443 (handle_async_input, process_pending_signals)
2444 (handle_input_available_signal, init_keyboard):
2445 * nsterm.m (ns_read_socket):
2446 * process.c (wait_reading_process_output):
2447 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2448 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2449 (emacs_write):
2450 * xterm.c (XTread_socket):
2451 Assume SYNC_INPUT.
2452 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2453 * eval.c (handling_signal): Remove. All uses removed.
2454 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2455 All uses replaced with the SYNC_INPUT version.
2456 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2457 Remove decls.
2458 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2459 Now static.
2460
2461 * font.c (Ffont_shape_gstring): Remove unused local.
2462
2463 2012-09-16 Glenn Morris <rgm@gnu.org>
2464
2465 * Makefile.in (clean): No longer run nextstep's clean.
2466
2467 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2468 (ns_frag): Remove.
2469 (ns-app): Move here from ns.mk, and simplify.
2470 (clean): Simplify nextstep entry.
2471 * ns.mk: Remove file.
2472
2473 2012-09-17 Kenichi Handa <handa@gnu.org>
2474
2475 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2476 not covert the last few charactes.
2477
2478 2012-09-16 Kenichi Handa <handa@gnu.org>
2479
2480 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2481 here, but just check the validity of glyphs in the glyph-string.
2482
2483 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2484
2485 * window.c (Fwindow_parameter, Fset_window_parameter):
2486 Accept any window as argument (Bug#12452).
2487
2488 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2489
2490 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2491 to ns_term_init to avoid memory leak.
2492
2493 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2494 explicit retain/release.
2495 (ns_term_init): Only allow one display. Initialize outerpool and
2496 ns_*_types.
2497
2498 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2499
2500 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2501 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2502 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2503 the Microsoft problem in a different way, by altering ../nt/config.nt.
2504
2505 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2506
2507 * w32xfns.c:
2508 * w32uniscribe.c:
2509 * w32term.c:
2510 * w32select.c:
2511 * w32reg.c:
2512 * w32proc.c:
2513 * w32menu.c:
2514 * w32inevt.c:
2515 * w32heap.c:
2516 * w32font.c:
2517 * w32fns.c:
2518 * w32console.c:
2519 * w32.c:
2520 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2521 by lisp.h. This completes removal of setjmp.h inclusion
2522 erroneously announced in the previous commit. (Bug#12446)
2523
2524 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2525 more accurate.
2526
2527 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2528 not defined as a macro. The latter happens on MS-Windows.
2529 (Bug#12446)
2530
2531 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2532
2533 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2534 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2535 Some instances of '#include <setjmp.h>' removed, if the
2536 only reason for the instance was because "lisp.h" was included.
2537 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2538 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2539 and _longjmp with the new symbols. Emacs already uses _setjmp if
2540 available, so this change affects only POSIXish hosts that have
2541 sigsetjmp but not _setjmp, such as some versions of Solaris and
2542 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2543 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2544 (png_load_body) [HAVE_PNG]:
2545 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2546 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2547 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2548 since PNG requires jmp_buf. This is the only exception to the
2549 general rule that we now use sys_setjmp and sys_longjmp.
2550 This exception is OK since this code does not change the signal
2551 mask or longjmp out of a signal handler.
2552
2553 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2554
2555 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2556 Include "syssignal.h", for 'main_thread'.
2557
2558 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2559
2560 Avoid out-of-range marker position (Bug#12426).
2561 * insdel.c (replace_range, replace_range_2):
2562 Adjust markers before overlays, as suggested by comments.
2563 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2564 Remove redundant check before calling offset_intervals.
2565
2566 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2567
2568 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2569 current buffer (Bug#12387).
2570
2571 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2572
2573 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2574
2575 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2576
2577 Use a more backwards-compatible timer format (Bug#12430).
2578 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2579 vector element, not from the 4th, since PSECS is now at the end.
2580 (Fcurrent_idle_time): Doc fix.
2581
2582 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2583
2584 Function to mark objects and remove killed buffers at once.
2585 * alloc.c (discard_killed_buffers): Rename to ...
2586 (mark_discard_killed buffers) ... new name. Add marking
2587 of remaining objects. Fix comment. Adjust users.
2588 (mark_object): Do not touch frame buffer lists here.
2589 * frame.c (delete_frame): Reset frame buffer lists here.
2590
2591 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2592
2593 Better workaround for GNOME bug when --enable-gcc-warnings.
2594 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2595 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2596 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2597
2598 Simplify SIGIO usage (Bug#12408).
2599 The code that dealt with SIGIO was crufty and confusing, e.g., it
2600 played tricks like "#undef SIGIO" but these tricks were not used
2601 consistently. Simplify mostly by not #undeffing standard symbols,
2602 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2603 or not as we please) rather than "defined SIGIO" (standard symbol
2604 that we probably shouldn't #undef).
2605 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2606 Modules that need it can include it.
2607 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2608 * dispextern.h (ignore_sigio): New decl.
2609 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2610 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2611 * emacs.c (shut_down_emacs):
2612 * keyboard.c (kbd_buffer_store_event_hold):
2613 Use ignore_sigio rather than invoking 'signal' directly.
2614 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2615 for FIONREAD.
2616 (FIONREAD, SIGIO): Do not #undef.
2617 (tty_read_avail_input): Use #error rather than a syntax error.
2618 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2619 for I_PIPE, used by SETUP_SLAVE_PTY.
2620 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2621 * sysdep.c (croak): Remove; no longer needed. This bit of
2622 temporary code, with Fred N. Fish's comment that it's temporary,
2623 has been in Emacs since at least 1992!
2624 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2625 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2626 * syssignal.h (croak): Remove decl.
2627 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2628 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2629 now that we're termios-only.
2630 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2631 * term.c (dissociate_if_controlling_tty): Use #error rather than
2632 a run-time error.
2633
2634 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2635 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2636 to work around GNOME bug 683906.
2637 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2638 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2639 This works around GCC bug 54561.
2640
2641 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2642
2643 More fixes for 'volatile' and setjmp/longjmp.
2644 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2645 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2646 (png_load_body) [HAVE_PNG]:
2647 (jpeg_load_body) [HAVE_JPEG]:
2648 New function, with most of the old parent function's body.
2649 (png_load) [HAVE_PNG]:
2650 (jpeg_load) [HAVE_JPEG]:
2651 Invoke the new function, to avoid longjmp munging our locals.
2652 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2653 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2654 longjmp is passed 2, as the C standard doesn't guarantee this.
2655 Instead, store the failure code into mgr->failure_code.
2656
2657 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2658
2659 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2660 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2661 (syms_of_keyboard): Remove support for unread-command-char.
2662
2663 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2664
2665 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2666 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2667 violation. (Bug#12426)
2668
2669 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2670
2671 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2672
2673 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2674
2675 * eval.c: Add `inhibit-debugger'.
2676 (Qinhibit_debugger): New symbol.
2677 (call_debugger): Bind it instead of Qdebug_on_error.
2678 (maybe_call_debugger): Test Vinhibit_debugger.
2679 (syms_of_eval): Define inhibit-debugger.
2680 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2681 (syms_of_xdisp): Remove inhibit-debug-on-message.
2682
2683 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2684
2685 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2686 If a nonvolatile local variable is written before a _longjmp to
2687 the frame containing the variable, and is read after the _longjmp,
2688 the value read is indeterminate. Some local variables of type
2689 'struct handler' and 'struct catchtag' are used in this way, so
2690 mark each of their slots as volatile if the slot can be set before
2691 _longjmp and read afterwards.
2692 * lisp.h (struct handler): var and chosen_clause are now volatile.
2693 (struct catchtag): val, next, and pdlcount are now volatile.
2694
2695 * bidi.c (bidi_push_it, bidi_pop_it):
2696 * fns.c (copy_hash_table):
2697 * image.c (define_image_type):
2698 * keyboard.c (kbd_buffer_store_event_hold):
2699 * process.c (Fprocess_send_eof):
2700 * xfaces.c (x_create_gc) [HAVE_NS]:
2701 * xgselect.c (xg_select):
2702 Prefer assignment to memcpy when either will do.
2703
2704 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2705 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2706 time an item is removed. No need to mark this function 'inline';
2707 the compiler knows better than we do.
2708
2709 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2710
2711 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2712 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2713 to change_frame_size (Bug#12388).
2714 (windowDidResize:): Pass YES to updateFrameSize.
2715
2716 * nsterm.h: Add delay parameter to updateFrameSize.
2717
2718 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2719
2720 Discard killed buffers from deleted window and frame objects.
2721 This reduces an amount of references to killed buffers and
2722 helps GC to reclaim them faster.
2723 * alloc.c (discard_killed_buffers): New function.
2724 (mark_object): Use it for deleted windows and frames.
2725 (mark_object): If symbol's value is set up for a killed buffer
2726 or deleted frame, restore its global binding.
2727 * data.c (swap_in_global_binding): Add GC notice.
2728 (swap_in_symval_forwarding): Use convenient set_blv_where.
2729 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2730 * window.h: ... to here.
2731
2732 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2733
2734 Convenient macro to check whether the buffer is live.
2735 * buffer.h (BUFFER_LIVE_P): New macro.
2736 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2737 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2738
2739 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2740
2741 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2742 composition cases (Bug#12364).
2743
2744 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2745 overhang of succeeding glyphs overlapping box cursor.
2746
2747 * w32term.c (x_draw_glyph_string): Likewise.
2748
2749 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2750
2751 Simplify, document, and port floating-point (Bug#12381).
2752 The porting part of this patch fixes bugs on non-IEEE platforms
2753 with frexp, ldexp, logb.
2754 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2755 Now static.
2756 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2757 support, by removing commented-out code and briefly listing the
2758 C89 functions excluded. The commented-out stuff was confusing
2759 maintenance, e.g., we thought we needed cbrt but it was commented out.
2760 (logb): Remove decl; no longer needed.
2761 (isfinite): New macro, if not already supplied.
2762 (isnan): Don't replace any existing macro.
2763 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2764 are present on all C89 platforms.
2765 (Ffrexp): Do not special-case zero, as frexp does the right thing
2766 for that case.
2767 (Flogb): Do not use logb, as it doesn't have the desired meaning
2768 on hosts that use non-base-2 floating point. Instead, stick with
2769 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2770 frexp, to avoid getting an unspecified result.
2771
2772 * xdisp.c (Qinhibit_debug_on_message): Now static.
2773
2774 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2775
2776 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2777 NSBezierPath (Bug#12131).
2778
2779 2012-09-10 Chong Yidong <cyd@gnu.org>
2780
2781 * fns.c (Fdelq, Fdelete): Doc fix.
2782
2783 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2784
2785 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2786 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2787
2788 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2789
2790 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2791 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2792 Use it.
2793
2794 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2795
2796 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2797 left fringe if the window has a left margin. This avoids leaving
2798 traces of the cursor because its leftmost pixel is not drawn over.
2799
2800 * dispnew.c (update_window_line): When the left margin area of a
2801 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2802 that screen line. (Bug#12277)
2803
2804 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2805
2806 Assume C89 or later for math functions (Bug#12381).
2807 This simplifies the code, and makes it a bit smaller and faster,
2808 and (most important) makes it easier to clean up signal handling
2809 since we can stop worring about floating-point exceptions in
2810 library code. That was a problem before C89, but the problem
2811 went away many years ago on all practical Emacs targets.
2812 * data.c, image.c, lread.c, print.c:
2813 Don't include <math.h>; no longer needed.
2814 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2815 might be autoconfigured, as that never happens.
2816 * data.c (fmod):
2817 * doprnt.c (DBL_MAX_10_EXP):
2818 * print.c (DBL_DIG):
2819 Remove. C89 or later always defines these.
2820 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2821 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2822 (arith_error, domain_error, domain_error2):
2823 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2824 no longer needed -- we simply return what C returns. All uses removed.
2825 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2826 the wrapped code.
2827 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2828 Remove. All uses expanded, as these macros are no longer used
2829 more than once and are now more trouble than they're worth.
2830 (Ftan): Use tan, not sin / cos.
2831 (Flogb): Assume C89 frexp.
2832 (fmod_float): Assume C89 fmod.
2833 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2834 (init_floatfns): Remove. All uses removed.
2835
2836 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2837
2838 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2839 compositeToPoint for OSX < 10.6 (Bug#12390).
2840
2841 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2842
2843 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2844 This produces more-accurate results.
2845
2846 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2847
2848 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2849 changes (Bug#12088).
2850
2851 2012-09-08 Chong Yidong <cyd@gnu.org>
2852
2853 * syntax.c (Fstring_to_syntax): Doc fix.
2854
2855 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2856
2857 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2858 in the internal border.
2859 (x_set_window_size): Remove static variables and their usage.
2860 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2861 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2862 Remove fringe/internal border adjustment (Bug#11052).
2863 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2864 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2865 (ns_fix_rect_ibw): Remove.
2866 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2867 (ns_dumpglyphs_box_or_relief): Ditto.
2868 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2869 adjustment.
2870 (ns_dumpglyphs_image): Ditto.
2871 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2872 border adjustment.
2873 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2874 their usage. Add fringe_extended_p and its use as in other terms.
2875 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2876 scroll bar was removed.
2877 (updateFrameSize): New function.
2878 (windowDidResize): Move code to updateFrameSize and call it.
2879
2880 * nsterm.h (EmacsView): Add updateFrameSize.
2881
2882 2012-09-07 Chong Yidong <cyd@gnu.org>
2883
2884 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2885
2886 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2887
2888 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2889
2890 More signal-handler cleanup (Bug#12327).
2891 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2892 Problem introduced when merging patches. Noted by Eli Zaretskii in
2893 <http://bugs.gnu.org/12327#67>.
2894 * floatfns.c: Comment fix.
2895 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2896 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2897 and anyway the declaration is harmless even if SIGDANGER is not defined.
2898 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2899 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2900 source files not surprisingly expected syssignal.h to define, or
2901 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2902 Include <sys/ioctl.h>, for FIONREAD.
2903 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2904 This eliminates a problem whereby other files mysteriously had
2905 to include "syssignal.h" before including "systty.h" if they
2906 wanted to use "#ifdef SIGIO".
2907
2908 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2909
2910 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2911
2912 * w32.c (sigemptyset): Empty the set.
2913 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2914
2915 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2916
2917 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2918
2919 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2920 (mark_object): Likewise for frame objects.
2921
2922 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2923
2924 * syssignal.h (handle_on_main_thread): Always declare,
2925 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2926 This ports to platforms without HAVE_PTHREAD.
2927
2928 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2929
2930 Signal-handler cleanup (Bug#12327).
2931 Emacs's signal handlers were written in the old 4.2BSD style with
2932 sigblock and sigmask and so forth, and this led to some
2933 inefficiencies and confusion. Rewrite these to use
2934 pthread_sigmask etc. without copying signal sets around. Also,
2935 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2936 'signal', and instead use functions that do not attempt to take
2937 over the system name space. This patch causes Emacs's text
2938 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2939 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2940 Do not include <signal.h> or "syssignal.h", as these
2941 modules do not use signals.
2942 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2943 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2944 Do not include <signal.h>, as "syssignal.h" does that for us now.
2945 * atimer.c (sigmask_atimers): New function.
2946 (block_atimers, unblock_atimers): New functions,
2947 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2948 All uses replaced.
2949 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2950 no longer needed here.
2951 * emacs.c (main): Inspect existing signal handler with sigaction,
2952 so that there's no need to block and unblock SIGHUP.
2953 * sysdep.c (struct save_signal): New member 'action', replacing
2954 old member 'handler'.
2955 (save_signal_handlers, restore_signal_handlers):
2956 Use sigaction instead of 'signal' to save and restore.
2957 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2958 New function. All users of 'signal' modified to use set_sighandler
2959 if they're writeonly, and to use sys_signal if they're read+write.
2960 (emacs_sigaction_init, forwarded_signal): New functions.
2961 (sys_signal): Remove. All uses replaced by calls to sigaction
2962 and emacs_sigaction_init, or by direct calls to 'signal'.
2963 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2964 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2965 all uses replaced by pthread_sigmask etc. calls.
2966 * syssignal.h: Include <signal.h>.
2967 (emacs_sigaction_init, forwarded_signal): New decls.
2968 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2969 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2970 (sigmask, sys_sigmask): Remove; no longer needed.
2971 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2972 (sigblock, sigunblock, sigfree):
2973 (sigsetmask) [!defined sigsetmask]:
2974 Remove. All uses replaced by pthread_sigmask.
2975 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2976 no longer need to be replaced, and its typical old uses
2977 are now done via emacs_sigaction_init and sigaction.
2978 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2979 (sys_sigdel): Remove; unused.
2980 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2981
2982 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2983
2984 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2985 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2986
2987 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2988
2989 Explicitly mark buffer_defaults and buffer_local_symbols.
2990 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2991 mark_local_symbols here.
2992 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2993 since special buffers aren't marked here any more.
2994 (allocate_buffer): Chain new buffer with all_buffers here...
2995 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2996 not here.
2997 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2998 (syms_of_buffer): Remove staticpro of the above.
2999 (init_buffer_once): Set names for buffer_defaults and
3000 buffer_local_symbols.
3001
3002 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3003
3004 Use bool for booleans in font-related modules.
3005 * font.c (font_intern_prop, font_style_to_value)
3006 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
3007 (generate_otf_features, font_check_otf_features, font_check_otf)
3008 (font_match_p, font_list_entities, font_at):
3009 * fontset.c (fontset_id_valid_p, reorder_font_vector
3010 (fontset_find_font, Fset_fontset_font)
3011 (face_suitable_for_char_p) [0]:
3012 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
3013 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
3014 (m17n_flt_initialized, ftfont_shape_by_flt):
3015 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
3016 * nsfont.m (nsfont_draw):
3017 * w32font.c (w32font_draw):
3018 * w32term.c (x_draw_glyphless_glyph_string_foreground):
3019 Use bool for booleans.
3020 * font.h: Adjust to above API changes.
3021 (struct font, struct font_driver, struct font_driver_list):
3022 Use bool for booleans.
3023 (struct font): Remove useless member encoding_type.
3024 All users removed.
3025 * fontset.c, xftfont.c: Omit unnecessary static decls.
3026
3027 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3028
3029 * alloc.c (mark_object): Revert window marking code
3030 since it's unsafe for the Fset_window_configuration.
3031
3032 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3033
3034 Fix race conditions with signal handlers and errno (Bug#12327).
3035 Be more systematic about preserving errno whenever a signal
3036 handler returns, even if it's not in the main thread. Do this by
3037 renaming signal handlers to distinguish between signal delivery
3038 and signal handling. All uses changed.
3039 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
3040 * data.c (deliver_arith_signal): Rename from arith_error.
3041 * dispnew.c (deliver_window_change_signal): Rename from
3042 window_change_signal.
3043 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
3044 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
3045 * keyboard.c (deliver_input_available_signal): Rename from
3046 input_available_signal.
3047 (deliver_user_signal): Rename from handle_user_signal.
3048 (deliver_interrupt_signal): Rename from interrupt_signal.
3049 * process.c (deliver_pipe_signal): Rename from send_process_trap.
3050 (deliver_child_signal): Rename from sigchld_handler.
3051 * atimer.c (handle_alarm_signal):
3052 * data.c (handle_arith_signal):
3053 * dispnew.c (handle_window_change_signal):
3054 * emacs.c (handle_fatal_signal, handle_danger_signal):
3055 * keyboard.c (handle_input_available_signal):
3056 * keyboard.c (handle_user_signal, handle_interrupt_signal):
3057 * process.c (handle_pipe_signal, handle_child_signal):
3058 New functions, with the actual signal-handling code taken from the
3059 original respective signal handlers, sans the sporadic attempts to
3060 preserve errno, since that's now done by handle_on_main_thread.
3061 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3062 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3063 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3064 Move to sysdep.c.
3065 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3066 Move initialization of main_thread to sysdep.c's init_signals.
3067 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3068 our usage, and simplifies the mainline code.
3069 (record_child_status_change): New static function, as a helper
3070 for handle_child_signal, and with most of the old child handler's
3071 contents.
3072 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3073 (handle_child_signal): Use the above.
3074 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3075 Moved here from emacs.c.
3076 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3077 code moved here from emacs.c's main function.
3078 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3079 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
3080 This lets callers save and restore errno properly.
3081
3082 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3083
3084 Remove redundant or unused things here and there.
3085 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3086 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3087 * editfns.c (Fcompare_buffer_substrings): Likewise.
3088 * frame.h (struct terminal, struct font_driver_list):
3089 Remove redundant declarations.
3090 * window.h (Qleft, Qright): Likewise.
3091
3092 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3093
3094 Do not mark objects from deleted buffers, windows and frames.
3095 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3096 (mark_object): Likewise for windows and frames.
3097
3098 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3099
3100 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3101 buffer_defaults and buffer_local_symbols as valid objects.
3102 Return special value to denote them.
3103
3104 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3105
3106 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3107 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3108 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3109 (file_name_absolute_p, Fsubstitute_in_file_name):
3110 (check_executable, check_writable, Ffile_accessible_directory_p)
3111 (Fset_file_selinux_context, Fdefault_file_modes)
3112 (Finsert_file_contents, choose_write_coding_system)
3113 (Fwrite_region, build_annotations, a_write, e_write)
3114 (Fdo_auto_save):
3115 * filelock.c (boot_time_initialized, get_boot_time)
3116 (get_boot_time_1, lock_file_1, within_one_second):
3117 * floatfns.c (in_float):
3118 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3119 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3120 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3121 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3122 * window.c (compare_window_configurations):
3123 Use bool for booleans.
3124 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3125 (Fdefault_file_modes): Now mode_t, not int, for modes.
3126 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3127 (internal_delete_file): Now returns void, not a (boolean) int,
3128 since nobody was looking at the return value.
3129 * lisp.h, window.h: Adjust to above API changes.
3130
3131 * xdisp.c (set_message): Simplify and reindent last change.
3132
3133 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
3134
3135 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3136
3137 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3138
3139 * eval.c (call_debugger): Make the function non-static so that we
3140 can call it from set_message.
3141
3142 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3143 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3144
3145 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3146
3147 Give more-useful info on a fatal error (Bug#12328).
3148 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3149 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3150 of doing the work ourselves.
3151 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3152 do most of the work.
3153 (fatal_error_backtrace): New function, taken from the guts
3154 of the old fatal_error_signal, but with a new option to output
3155 a backtrace.
3156 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3157 info about the signal than just its number.
3158 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3159 * sysdep.c: Include <execinfo.h>
3160 (emacs_backtrace): New function, taken partly from the previous
3161 code of the 'die' function.
3162 (emacs_abort): Call fatal_error_backtrace rather than abort.
3163
3164 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
3165
3166 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3167 eager (load-time) macro-expansion.
3168 * lisp.mk (lisp): Add macroexp.
3169
3170 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3171
3172 Simplify redefinition of 'abort' (Bug#12316).
3173 Do not try to redefine the 'abort' function. Instead, redo
3174 the code so that it calls 'emacs_abort' rather than 'abort'.
3175 This removes the need for the NO_ABORT configure-time macro
3176 and makes it easier to change the abort code to do a backtrace.
3177 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3178 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3179 Remove; sysdep.c's emacs_abort now takes its place.
3180 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
3181 'abort' changed to use 'emacs_abort'.
3182 * msdos.c (dos_abort) [defined abort]: Remove; not used.
3183 (abort) [!defined abort]: Rename to ...
3184 (emacs_abort): ... new name.
3185 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3186 the place of the old 'abort' in emacs.c.
3187 * w32.c, w32fns.c (abort): Do not #undef.
3188 * w32.c (emacs_abort): Rename from w32_abort.
3189
3190 2012-09-04 Eli Zaretskii <eliz@gnu.org>
3191
3192 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3193 offsets[j].dv, since the y axis of the screen coordinates points
3194 down, while the y axis of the font definition coordinates points
3195 up. This fixes display of Arabic diacritics such as KASRA and
3196 KASRATAN. (Bug#11860)
3197
3198 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3199
3200 Be more systematic about _setjmp vs setjmp.
3201 * alloc.c (test_setjmp, mark_stack):
3202 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3203 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3204 (png_load, my_error_exit, jpeg_load):
3205 * process.c (send_process_trap, send_process):
3206 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3207 The underscored versions are up to 30x faster on some hosts.
3208 Formerly, the code used setjmp+longjmp sometimes and
3209 _setjmp+_longjmp at other times, with no particular reason to
3210 prefer setjmp+longjmp.
3211
3212 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3213
3214 Fix minor problem found by static checking.
3215 * buffer.c (Fdelete_all_overlays): Return nil.
3216
3217 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3218
3219 * buffer.c (Fdelete_all_overlays): New function.
3220
3221 2012-09-03 Chong Yidong <cyd@gnu.org>
3222
3223 * gtkutil.c: Add extern decl for Qxft.
3224
3225 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3226
3227 * emacs.c, eval.c: Use bool for boolean.
3228 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3229 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3230 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3231 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3232 (main, decode_env_path, Fdaemon_initialized):
3233 * eval.c (call_debugger, Finteractive_p, interactive_p):
3234 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3235 (maybe_call_debugger, Fbacktrace):
3236 * process.c (read_process_output, exec_sentinel):
3237 Use bool for booleans.
3238 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3239 All callers changed.
3240 * eval.c (interactive_p): Omit always-true boolean argument
3241 EXCLUDE_SUBRS_P. All callers changed.
3242 * dispextern.h, lisp.h: Reflect above API changes.
3243 * firstfile.c (dummy): Use the address of 'main', whose signature
3244 won't change, instead of the address of 'initialize', whose
3245 signature just changed from int to bool.
3246 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3247 * msdos.c (fatal_error_in_progress): ... from here.
3248 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3249 of incrementing it.
3250 (redisplay_internal, unwind_redisplay): Simply clear
3251 REDISPLAYING_P when unwinding, instead of saving its previous,
3252 always-false value and then restoring it.
3253
3254 Clean up some extern decls.
3255 Mostly, this hoists extern decls out of .c files and into .h files.
3256 That way, we're more likely to catch errors if the interfaces change.
3257 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3258 declare xg_mark_data.
3259 * dispextern.h (x_frame_parm_handlers):
3260 * font.h (Qxft):
3261 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3262 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3263 (Qultra_bold, Qoblique, Qitalic):
3264 Move extern decl here from .c file.
3265 * alloc.c (xg_mark_data) [USE_GTK]:
3266 * doc.c (Qclosure):
3267 * eval.c (Qlexical_binding):
3268 * fns.c (time) [!HAVE_UNISTD_H]:
3269 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3270 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3271 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3272 * lread.c (Qinternal_interpreter_environment):
3273 * minibuf.c (Qbuffer):
3274 * process.c (QCfamily, QCfilter):
3275 * widget.c (free_frame_faces):
3276 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3277 * xfont.c (x_clear_errors):
3278 * xterm.c (x_frame_parm_handlers):
3279 Remove now-redundant extern decls.
3280 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3281 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3282 Now static.
3283 * xfaces.c: Remove unnecessary static decls.
3284 * xterm.c (updating_frame): Remove decl of nonexistent object.
3285
3286 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3287 when building globals.h, as the objects that are not built on
3288 this host are not needed to compile C files on this host.
3289
3290 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3291
3292 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3293
3294 * frame.h: Add missing prototype for x_wm_set_size_hint.
3295
3296 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3297
3298 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3299 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3300 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3301 (Fsubstitute_command_keys):
3302 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3303 (save_excursion_save, save_excursion_restore)
3304 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3305 (format_time_string, general_insert_function)
3306 (make_buffer_string, make_buffer_string_both)
3307 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3308 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3309 (copy_text, insert_1, insert_1_both, insert_from_string)
3310 (insert_from_string_before_markers, insert_from_string_1)
3311 (insert_from_buffer, insert_from_buffer_1, replace_range)
3312 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3313 (del_range_2, modify_region):
3314 * intervals.c (intervals_equal, balance_possible_root_interval)
3315 (adjust_intervals_for_insertion, merge_properties_sticky)
3316 (graft_intervals_into_buffer, lookup_char_property)
3317 (adjust_for_invis_intang, set_point_both)
3318 (get_property_and_range, compare_string_intervals)
3319 (set_intervals_multibyte_1, set_intervals_multibyte):
3320 * keyboard.c (decode_timer):
3321 Use bool for boolean.
3322 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3323 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3324
3325 2012-09-02 Chong Yidong <cyd@gnu.org>
3326
3327 * keymap.c (push_key_description): Print M-TAB as C-M-i
3328 (Bug#11758).
3329
3330 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3331
3332 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3333 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3334 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3335 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3336 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3337 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3338 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3339
3340 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3341
3342 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3343 more than one grapheme cluster passed to the shaper: compute the
3344 offset adjustment values separately for each cluster. (Bug#11860)
3345
3346 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3347 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3348 about implicit conversions from integer to pointer.
3349
3350 2012-09-01 Daniel Colascione <dancol@dancol.org>
3351
3352 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3353 system used too early.
3354
3355 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3356
3357 Better seed support for (random).
3358 * emacs.c (main): Call init_random.
3359 * fns.c (Frandom): Set the seed from a string argument, if given.
3360 Remove long-obsolete Gentzel cruft.
3361 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3362 (init_random): New function.
3363
3364 2012-09-01 Daniel Colascione <dancol@dancol.org>
3365
3366 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3367 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3368 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3369 x_wm_set_size_hint, x_query_colors, x_real_positions,
3370 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3371 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3372 all of which have been moved to common code.
3373
3374 * xfaces.c: Include TERM_HEADER instead of listing all possible
3375 window-system headers.
3376
3377 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3378 to match header.
3379
3380 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3381 directly accessing frame internals.
3382
3383 * w32font.h: Include font.h. Define syms_of_w32font and
3384 globals_of_w32font.
3385
3386 * process.c: Include TERM_HEADER instead of listing all possible
3387 window-system headers.
3388
3389 * nsterm.h: Remove declarations now in frame.h.
3390 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3391
3392 * menu.c: Include TERM_HEADER instead of listing all possible
3393 window-system headers.
3394
3395 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3396 window system.
3397
3398 * keyboard.c: Include TERM_HEADER instead of listing all possible
3399 window-system headers.
3400
3401 * image.c: Include TERM_HEADER instead of listing all possible
3402 window-system headers. Declare Vlibrary_cache when compiling for
3403 Windows.
3404
3405 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3406 window system declarations.
3407
3408 * frame.h: Move common functions here: set_frame_menubar,
3409 x_set_window_size, x_sync, x_get_focus_frame,
3410 x_set_mouse_position, x_set_mouse_pixel_position,
3411 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3412 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3413 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3414 x_activate_menubar, x_real_positions, x_bitmap_icon,
3415 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3416 and x_query_colors.
3417
3418 * frame.c: Include TERM_HEADER instead of listing all possible
3419 window-system headers.
3420
3421 * font.c: Include TERM_HEADER instead of listing all possible
3422 window-system headers.
3423
3424 * emacs.c: Include TERM_HEADER.
3425
3426 * dispnew.c: Include TERM_HEADER instead of listing all possible
3427 window-system headers.
3428
3429 * ccl.h: Include character.h.
3430
3431 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3432 the current window system; include in list of objects to link into
3433 Emacs.
3434
3435 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3436
3437 Remove mark_ttys function and fix tty_display_info initialization.
3438 * lisp.h (mark_ttys): Remove prototype.
3439 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3440 to mark_ttys because all possible values of 'top_frame' slot are
3441 the frames which are reachable from Vframe_list.
3442 * term.c (mark_ttys): Remove.
3443 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3444
3445 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3446
3447 Change struct frame bitfields from unsigned char to unsigned.
3448 * frame.h (struct frame): Change type of 'display_preempted',
3449 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3450 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3451 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3452 bitfields from unsigned char to unsigned.
3453
3454 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3455
3456 Remove unused member of struct x_output and struct w32_output.
3457 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3458 * w32term.h (struct w32_output): Likewise.
3459
3460 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3461
3462 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3463 does not become zero (Bug#12234).
3464
3465 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3466
3467 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3468 for GCC 4.7.1 x86-64.
3469
3470 2012-08-30 Glenn Morris <rgm@gnu.org>
3471
3472 * lread.c (init_lread): For out-of-tree builds, only add the
3473 source directory's site-lisp dir to the load-path if it exists,
3474 consistent with in-tree builds. (Bug#12302)
3475
3476 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3477
3478 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3479 button_values to NULL. Call setStykeMask so dialogs get a close button.
3480 (windowShouldClose:): Set window_closed.
3481 (dealloc): New member, free button_values.
3482 (process_dialog:): Make member function. Remove window argument,
3483 replace window with self. Count buttons and allocate and store values
3484 in button_values.
3485 (addButton:value:row:): value is int with the name tag. Call setTag
3486 with tag. Remove return self, declare return value as void.
3487 (addString:row:): Remove return self, declare return value as void.
3488 (addSplit): Remove return self, declare return value as void.
3489 (clicked:): Remove return self, declare return value as void.
3490 Set dialog_return to button_values[seltag]. Code formatting change.
3491 (initFromContents:isQuestion:): Adjust call to process_dialog.
3492 Code formatting change.
3493 (timeout_handler:): Set timer_fired to YES.
3494 (runDialogAt:): Set timer_fired to NO.
3495 Handle click on close button as quit.
3496
3497 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3498 Add window_closed and button_values. Add void as return value for
3499 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3500 Add process_dialog as new member.
3501
3502 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3503
3504 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3505 is not one of the heaps we manage. (Bug#12242)
3506
3507 2012-08-28 Glenn Morris <rgm@gnu.org>
3508
3509 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3510
3511 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3512
3513 * window.c (Fset_window_configuration): Remove handling of
3514 auto-buffer-name window parameter. Install revision of reverted
3515 fix.
3516
3517 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3518
3519 Do not allow to set major mode for a dead buffer.
3520 * buffer.c (Fset_buffer_major_mode): Signal an error
3521 if the buffer is dead.
3522 (Fother_buffer, other_buffer_safely): Remove redundant
3523 nested declaration.
3524
3525 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3526
3527 Always use set_buffer_if_live to restore original buffer at unwind.
3528 * buffer.h (record_unwind_current_buffer): New function.
3529 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3530 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3531 * undo.c, window.c: Adjust users.
3532 * buffer.c (set_buffer_if_live): Fix comment.
3533
3534 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3535
3536 Fix usage of set_buffer_internal.
3537 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3538 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3539 * coding.c (decode_coding): Omit redundant test.
3540 * fileio.c (decide_coding_unwind): Likewise.
3541 * fns.c (secure_hash): Likewise.
3542 * insdel.c (modify_region): Likewise.
3543 * keyboard.c (command_loop_1): Likewise.
3544 * print.c (PRINTFINISH): Likewise.
3545 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3546
3547 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3548
3549 * dispnew.c: Use bool for boolean.
3550 (frame_garbaged, display_completed, delayed_size_change)
3551 (fonts_changed_p, add_window_display_history)
3552 (add_frame_display_history, verify_row_hash)
3553 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3554 (row_equal_p, realloc_glyph_pool)
3555 (allocate_matrices_for_frame_redisplay)
3556 (showing_window_margins_p)
3557 (adjust_frame_glyphs_for_frame_redisplay)
3558 (build_frame_matrix_from_leaf_window, make_current)
3559 (mirrored_line_dance, mirror_line_dance, update_frame)
3560 (update_window_tree, update_single_window)
3561 (check_current_matrix_flags, update_window, update_text_area)
3562 (update_window_line, set_window_update_flags, scrolling_window)
3563 (update_frame_1, scrolling, buffer_posn_from_coords)
3564 (do_pending_window_change, change_frame_size)
3565 (change_frame_size_1, sit_for):
3566 Use bool for boolean.
3567 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3568 and remove last int (actually boolean) argument, which was always 0.
3569 All callers changed.
3570 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3571 * dispextern.h (struct composition_it): Use bool for boolean.
3572 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3573 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3574 * dired.c (file_name_completion):
3575 Use bool for boolean. (This was missed in an earlier change.)
3576
3577 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3578
3579 * window.c (Fset_window_configuration): Revert first part of
3580 last change.
3581
3582 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3583
3584 * nsterm.h (NSPanel): New class variable dialog_return.
3585
3586 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3587 Initialize dialog_return.
3588 (windowShouldClose:): Use stop instead of stopModalWithCode.
3589 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3590 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3591 event.
3592 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3593 modal loop returns.
3594
3595 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3596
3597 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3598 * composite.c (find_composition, composition_gstring_p)
3599 (composition_reseat_it, find_automatic_composition):
3600 * data.c (let_shadows_buffer_binding_p)
3601 (let_shadows_global_binding_p, set_internal, make_blv)
3602 (Fmake_variable_buffer_local, Fmake_local_variable)
3603 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3604 (cons_to_signed, arith_driver):
3605 * dbusbind.c (xd_in_read_queued_messages):
3606 * dired.c (directory_files_internal, file_name_completion):
3607 Use bool for booleans.
3608 * dired.c (file_name_completion):
3609 * process.h (fd_callback):
3610 Omit int (actually boolean) argument. It wasn't being used.
3611 All uses changed.
3612 * composite.h, lisp.h: Reflect above API changes.
3613
3614 * cmds.c, coding.c: Use bool for booleans.
3615 * cmds.c (move_point, Fself_insert_command):
3616 * coding.h (struct composition status, struct coding_system):
3617 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3618 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3619 (emacs_mule_char, decode_coding_emacs_mule)
3620 (encode_coding_emacs_mule, detect_coding_iso_2022)
3621 (decode_coding_iso_2022, encode_invocation_designation)
3622 (encode_designation_at_bol, encode_coding_iso_2022)
3623 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3624 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3625 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3626 (encode_coding_raw_text, detect_coding_charset)
3627 (decode_coding_charset, encode_coding_charset, detect_eol)
3628 (detect_coding, get_translation_table, produce_chars)
3629 (consume_chars, reused_workbuf_in_use)
3630 (make_conversion_work_buffer, code_conversion_save)
3631 (decode_coding_object, encode_coding_object)
3632 (detect_coding_system, char_encodable_p)
3633 (Funencodable_char_position, code_convert_region)
3634 (code_convert_string, code_convert_string_norecord)
3635 (Fset_coding_system_priority):
3636 * fileio.c (Finsert_file_contents):
3637 Use bool for booleans.
3638 * coding.h, lisp.h: Reflect above API changes.
3639 * coding.c: Remove unnecessary static function decls.
3640 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3641 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3642 not a boolean 'int', since callers never look at the return value.
3643 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3644 * coding.h (decoding_buffer_size, encoding_buffer_size)
3645 (emacs_mule_string_char): Remove unused extern decls.
3646 (struct iso_2022_spec, struct coding_system):
3647 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3648 (struct emacs_mule_spec): Remove unused field 'full_support'.
3649 All initializations removed.
3650 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3651
3652 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3653
3654 Fix spare memory change (Bug#12286).
3655 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3656 (valid_lisp_object_p): Likewise.
3657
3658 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3659
3660 * window.c (Fset_window_configuration): Record any window's old
3661 buffer if it's replaced (see Bug#8789). If the new current
3662 buffer doesn't appear in the selected window, go to its old
3663 point (Bug#12208).
3664
3665 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3666
3667 Special MEM_TYPE_SPARE to denote reserved memory.
3668 * alloc.c (enum mem_type): New memory type.
3669 (refill_memory_reserve): Use new type for spare memory.
3670 This prevents live_cons_p and live_string_p from incorrect
3671 detection of uninitialized objects from spare memory as live.
3672
3673 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3674
3675 Spelling fixes.
3676 * Makefile.in (.PHONY): versioclean -> versionclean.
3677
3678 Remove unused external symbols.
3679 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3680 * window.c (Qwindow_valid_p, decode_valid_window):
3681 Now static, not extern.
3682 * data.c (Qinterval): Remove; unused.
3683 (syms_of_data): Do not define 'interval'.
3684 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3685 * window.h (decode_valid_window):
3686 Remove decls.
3687
3688 * character.c, charset.c, chartab.c: Use bool for booleans.
3689 * character.c (lisp_string_width, string_count_byte8)
3690 (string_escape_byte8):
3691 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3692 (load_charset_map_from_file, map_charset_chars)
3693 (Fdefine_charset_internal, define_charset_internal)
3694 (Fdeclare_equiv_charset, find_charsets_in_text)
3695 (Ffind_charset_region, char_charset, Fiso_charset):
3696 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3697 (sub_char_table_set, sub_char_table_set_range)
3698 (char_table_set_range, optimize_sub_char_table)
3699 (map_sub_char_table):
3700 Use bool for boolean.
3701 * character.c (str_to_unibyte): Omit last boolean argument; it was
3702 always 0. All callers changed.
3703 * character.h, charset.h: Adjust to match previous changes.
3704 * character.h (char_printable_p): Remove decl of nonexistent function.
3705 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3706 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3707 are all boolean, so make them single-bit bitfields.
3708
3709 * lisp.h (ASET): Remove attempt to detect side effects.
3710 It was meant to be temporary and it often doesn't work,
3711 because when IDX has side effects the behavior of IDX==IDX
3712 is undefined. See Stefan Monnier in
3713 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3714
3715 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3716
3717 * lisp.h (functionp): New function (extracted from Ffunctionp).
3718 (FUNCTIONP): Use it.
3719 * eval.c (Ffunctionp): Use it.
3720
3721 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3722
3723 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3724 as that's faster and simpler than static storage. Don't bother
3725 with the g_main_context_query overhead if g_main_context_pending
3726 says no events are pending.
3727 (gfds, gfds_size): Remove these static vars.
3728 (xgselect_initialize): Remove; no longer needed.
3729 All uses and decls removed.
3730
3731 * emacs.c (fatal_error_signal_hook): Remove.
3732 All uses removed. This leftover from old code was always 0.
3733
3734 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3735 * casefiddle.c (casify_object, casify_region):
3736 * casetab.c (set_case_table):
3737 * category.c, category.h (word_boundary_p):
3738 * category.h (CHAR_HAS_CATEGORY):
3739 Use bool for booleans, instead of int.
3740
3741 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3742
3743 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3744
3745 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3746
3747 On assertion failure, print backtrace if available.
3748 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3749 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3750 * Makefile.in (LIB_EXECINFO): New macro.
3751 (LIBES): Use it.
3752
3753 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3754 * bytecode.c (exec_byte_code):
3755 * callint.c (check_mark, Fcall_interactively):
3756 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3757 (getenv_internal, sync_process_alive, call_process_exited):
3758 * lisp.h (USE_SAFE_ALLOCA):
3759 Use bool for booleans, instead of int.
3760 * lisp.h, process.h: Adjust prototypes to match above changes.
3761 * callint.c (Fcall_interactively): Don't assume the mark's
3762 offset fits in 'int'.
3763
3764 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3765
3766 * buffer.c, buffer.h: Use bool for boolean.
3767 * buffer.c (reset_buffer_local_variables)
3768 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3769 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3770 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3771 (overlay_touches_p, overlay_strings, Foverlay_put)
3772 (report_overlay_modification, call_overlay_mod_hooks):
3773 (mmap_enlarge, mmap_set_vars):
3774 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3775 Use bool for booleans, instead of int.
3776 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3777 since the 1-or-0 return value is always ignored anyway.
3778 (mmap_initialized_p):
3779 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3780 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3781
3782 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3783
3784 * bidi.c: Use bool for boolean.
3785 This is a bit more readable, and makes the text segment of bidi.o
3786 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3787 Presumably it's faster too.
3788 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3789 Now bool.
3790 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3791 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3792 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3793 (bidi_explicit_dir_char, bidi_level_of_next_char)
3794 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3795 Use bool for booleans, instead of int.
3796 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3797 (bidi_unshelve_cache): Adjust decls to match code.
3798
3799 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3800
3801 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3802 argument.
3803
3804 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3805
3806 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3807 * atimer.h: Include <stdbool.h>.
3808
3809 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3810
3811 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3812 compile time tests instead of run time tests on systems that do
3813 not use them.
3814 (FRAME_MAC_P): Remove leftover from deleted code.
3815 * frame.c (syms_of_frame): Remove leftover from deleted code.
3816
3817 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3818
3819 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3820
3821 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3822
3823 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3824 Otherwise, the compiler complains about (A?B:C) where B is void
3825 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3826 (fontset_add): Return void, for FONTSET_ADD.
3827
3828 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3829
3830 * alloc.c: Use bool for booleans.
3831 (gc_in_progress, abort_on_gc)
3832 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3833 (dont_register_blocks) [GC_MALLOC_CHECK]:
3834 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3835 (check_string_bytes, make_specified_string, memory_full)
3836 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3837 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3838 (mark_stack, valid_pointer_p, make_pure_string)
3839 (Fgarbage_collect, survives_gc_p, gc_sweep):
3840 Use bool for booleans, instead of int.
3841 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3842 Remove unused local.
3843 * alloc.c (PURE_POINTER_P):
3844 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3845 * editfns.c (Fformat):
3846 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3847 (Fdo_auto_save):
3848 * fns.c (sweep_weak_table):
3849 * lisp.h (suppress_checking, push_message, survives_gc_p)
3850 (make_pure_string, gc_in_progress, abort_on_gc):
3851 * lread.c (readchar, read1):
3852 * print.c (Fprin1_to_string):
3853 * xdisp.c (push_message):
3854 Use bool for booleans affected directly or indirectly by
3855 alloc.c's changes.
3856
3857 Make recently-introduced setters macros.
3858 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3859 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3860 (set_fontset_default, set_fontset_fallback): Rename from their
3861 upper-case counterparts, and make them functions rather than macros.
3862 This is more consistent with the other recently-introduced setters.
3863 These don't need to be inline, since they're local.
3864
3865 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3866
3867 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3868 the loop (Bug#12247).
3869
3870 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3871
3872 * lisp.h (vcopy): Use memcpy rather than our own loop.
3873 This fixes a performance regression introduced by the recent
3874 addition of vcopy. This means 'vcopy' will need to be modified
3875 for a copying collector, but that's OK. Also, tighten the
3876 checking in the assertion.
3877
3878 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3879
3880 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3881 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3882 non-base glyph for the width of the base character, according to
3883 what x_draw_composite_glyph_string_foreground expects.
3884 Generate WADJUST value according to composition_gstring_width's
3885 expectations, to produce correct width of the composed character.
3886 Reverse the sign of the DU offset produced by ScriptPlace.
3887
3888 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3889
3890 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3891
3892 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3893
3894 Avoid direct writes to contents member of struct Lisp_Vector.
3895 * lisp.h (vcopy): New function to copy data into vector.
3896 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3897 * fns.c (Ffillarray): Use ASET.
3898 * keyboard.c (timer_check_2): Use AREF and ASET.
3899 (append_tool_bar_item, Frecent_keys): Use vcopy.
3900 * lread.c (read_vector): Use ASET.
3901 * msdos.c (Frecent_doskeys): Use vcopy.
3902 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3903 (Finternal_merge_in_global_face): Use ASET and vcopy.
3904 * xfont.c (xfont_list_pattern): Likewise.
3905
3906 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3907
3908 * window.c (Fwindow_point): For the selected window always return
3909 the position of its buffer's point.
3910 (Fset_window_point): For the selected window always go in its
3911 buffer to the specified position.
3912
3913 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3914
3915 Setter macros for fontsets.
3916 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3917 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3918 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3919 Adjust users.
3920
3921 2012-08-20 Glenn Morris <rgm@gnu.org>
3922
3923 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3924 Don't assume that `ln -f' works.
3925
3926 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3927
3928 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3929 and later about non-assignments with no effect. See discussion at
3930 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3931 details.
3932
3933 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3934
3935 Inline setter functions for Lisp_Objects slots of struct specbinding.
3936 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3937 Adjust users.
3938
3939 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3940
3941 * window.c (select_window): Always make selected window's buffer
3942 current.
3943
3944 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3945
3946 Use AREF and ASET for docstrings of category tables.
3947 * category.h (CATEGORY_DOCSTRING): Use AREF.
3948 (SET_CATEGORY_DOCSTRING): Use ASET.
3949 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3950
3951 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3952
3953 Inline setter functions for hash table members.
3954 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3955 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3956 (set_hash_key_and_value, set_hash_index, set_hash_next)
3957 (set_hash_hash): New functions.
3958 * charset.c, fns.c: Adjust users.
3959
3960 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3961
3962 Inline getter and setter functions for per-buffer values.
3963 * buffer.h (per_buffer_default, set_per_buffer_default)
3964 (per_buffer_value, set_per_buffer_value): New functions.
3965 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3966 * buffer.c, data.c: Adjust users.
3967
3968 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3969
3970 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3971
3972 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3973
3974 Rely on <config.h> + <unistd.h> to declare 'environ',
3975 as gnulib does this if the system doesn't.
3976 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3977 Remove declaration. MS-Windows declares it on stdlib.h which is
3978 included by conf_post.h.
3979 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3980 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3981 * vm-limit.c: Include <unistd.h>, for 'environ'.
3982
3983 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3984 (start_of_data): Remove decl; mem-limits.h provides it.
3985
3986 * xdisp.c (handle_invisible_prop): Make it a bit faster
3987 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3988
3989 2012-08-19 Chong Yidong <cyd@gnu.org>
3990
3991 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3992 ends (Bug#3874).
3993
3994 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3995
3996 * .gdbinit: Use call instead of set when calling a function in the
3997 inferior.
3998
3999 * data.c (set_internal): Don't use set_blv_found.
4000 (Fkill_local_variable): Likewise.
4001
4002 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
4003
4004 * nsfont.m (ns_ascii_average_width): Ensure the string
4005 ascii_printable is initialized with a null-terminated character
4006 array. Otherwise, it can contain undesired extra characters.
4007
4008 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4009
4010 port new setting code to Sun C 5.8 2005/10/13
4011 * chartab.c, lisp.h (char_table_set, char_table_set_range):
4012 Return void, not Lisp_Object. Otherwise, the compiler
4013 complains about (A?B:C) where B is void and C is Lisp_Object
4014 when compiling CHAR_TABLE_SET, due to the recent change to
4015 the API of sub_char_table_set_contents.
4016
4017 2012-08-18 Chong Yidong <cyd@gnu.org>
4018
4019 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
4020 for the string case (Bug#3874).
4021
4022 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4023
4024 * buffer.h (BSET): Remove (Bug#12215).
4025 Replace all uses with calls to new setter functions.
4026 (bset_bidi_paragraph_direction, bset_case_canon_table)
4027 (bset_case_eqv_table, bset_directory, bset_display_count)
4028 (bset_display_time, bset_downcase_table)
4029 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
4030 (bset_last_selected_window, bset_local_var_alist)
4031 (bset_mark_active, bset_point_before_scroll, bset_read_only)
4032 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
4033 (bset_width_table):
4034 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4035 (bset_auto_fill_function, bset_auto_save_file_format)
4036 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4037 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4038 (bset_cache_long_line_scans, bset_case_fold_search)
4039 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4040 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4041 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4042 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4043 (bset_header_line_format, bset_indicate_buffer_boundaries)
4044 (bset_indicate_empty_lines, bset_invisibility_spec)
4045 (bset_left_fringe_width, bset_major_mode, bset_mark)
4046 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4047 (bset_name, bset_overwrite_mode, bset_pt_marker)
4048 (bset_right_fringe_width, bset_save_length)
4049 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4050 (bset_scroll_up_aggressively, bset_selective_display)
4051 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4052 (bset_word_wrap, bset_zv_marker):
4053 * category.c (bset_category_table):
4054 * syntax.c (bset_syntax_table):
4055 New setter functions.
4056
4057 * process.h (PSET): Remove (Bug#12215).
4058 Replace all uses with calls to new setter functions.
4059 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4060 (PROCESS_INLINE): New macro.
4061 (pset_childp): New setter function.
4062 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4063 * process.c (PROCESS_INLINE):
4064 Define to EXTERN_INLINE, so that the corresponding functions
4065 are compiled into code.
4066 (pset_buffer, pset_command, pset_decode_coding_system)
4067 (pset_decoding_buf, pset_encode_coding_system)
4068 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4069 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4070 (pset_type, pset_write_queue): New setter functions.
4071
4072 * window.h (WSET): Remove (Bug#12215).
4073 Replace all uses with calls to new setter functions.
4074 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4075 (WINDOW_INLINE): New macro.
4076 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4077 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4078 (wset_total_lines, wset_vertical_scroll_bar)
4079 (wset_window_end_pos, wset_window_end_valid)
4080 (wset_window_end_vpos): New setter functions.
4081 * window.c (WINDOW_INLINE):
4082 Define to EXTERN_INLINE, so that the corresponding functions
4083 are compiled into code.
4084 (wset_combination_limit, wset_dedicated, wset_display_table)
4085 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4086 (wset_new_normal, wset_new_total, wset_next_buffers)
4087 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4088 (wset_prev_buffers, wset_right_fringe_width)
4089 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4090 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4091 (wset_window_parameters):
4092 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4093 (wset_column_number_displayed, wset_region_showing):
4094 New setter functions.
4095
4096 * termhooks.h (TSET): Remove (Bug#12215).
4097 Replace all uses with calls to new setter functions.
4098 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4099 (TERMHOOKS_INLINE): New macro.
4100 (tset_charset_list, tset_selection_alist): New setter functions.
4101 * terminal.c (TERMHOOKS_INLINE):
4102 Define to EXTERN_INLINE, so that the corresponding functions
4103 are compiled into code.
4104 (tset_param_alist): New setter function.
4105
4106 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4107
4108 * keyboard.h (KSET): Remove (Bug#12215).
4109 Replace all uses with calls to new setter functions.
4110 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4111 (KEYBOARD_INLINE): New macro.
4112 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4113 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4114 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4115 New setter functions.
4116 * keyboard.c (KEYBOARD_INLINE):
4117 Define to EXTERN_INLINE, so that the corresponding functions
4118 are compiled into code.
4119 (kset_echo_string, kset_kbd_queue)
4120 (kset_keyboard_translate_table, kset_last_prefix_arg)
4121 (kset_last_repeatable_command, kset_local_function_key_map)
4122 (kset_overriding_terminal_local_map, kset_real_last_command)
4123 (kset_system_key_syms): New setter functions.
4124
4125 * frame.h (FSET): Remove (Bug#12215).
4126 Replace all uses with calls to new setter functions.
4127 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4128 (FRAME_INLINE): New macro.
4129 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4130 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4131 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4132 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4133 (fset_param_alist, fset_root_window, fset_scroll_bars)
4134 (fset_selected_window, fset_title, fset_tool_bar_items)
4135 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4136 * frame.c (FRAME_INLINE):
4137 Define to EXTERN_INLINE, so that the corresponding functions
4138 are compiled into code.
4139 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4140
4141 A few more naming-convention fixes for getters and setters.
4142 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4143 and rename from buffer_overlays_set_before.
4144 (set_buffer_overlays_after): Move here from buffer.h, and rename
4145 from buffer_overlays_set_after.
4146 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4147 All uses changed.
4148 (set_buffer_intervals): Rename from buffer_set_intervals.
4149 * intervals.c (set_interval_object): Move here from intervals.h,
4150 and rename from interval_set_object.
4151 (set_interval_left): Move here from intervals.h, and rename from
4152 interval_set_left.
4153 (set_interval_right): Move here from intervals.h, and rename from
4154 interval_set_right.
4155 (copy_interval_parent): Move here from intervals.h, and rename from
4156 interval_copy_parent.
4157 * intervals.h (set_interval_parent): Rename from interval_set_parent.
4158 (set_interval_plist): Rename from interval_set_plist.
4159 Return void, not Lisp_Object, since no caller uses the result.
4160 * lisp.h (string_intervals): Rename from string_get_intervals.
4161 (set_string_intervals): Rename from string_set_intervals.
4162
4163 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4164 (set_char_table_contents): Rename from char_table_set_contents.
4165 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4166 All uses changed. See the end of
4167 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4168
4169 * lisp.h (CSET): Remove (Bug#12215).
4170 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4171 (set_char_table_purpose): New functions,
4172 replacing CSET. All uses changed. For example, replace
4173 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4174 "set_char_table_parent (char_table, parent);".
4175 The old version was confusing because it used the same name
4176 'parent' for two different things.
4177
4178 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4179
4180 Functions to get and set Lisp_Object fields of buffer-local variables.
4181 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4182 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4183 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4184 * data.c, eval.c, frame.c: Adjust users.
4185
4186 2012-08-17 Chong Yidong <cyd@gnu.org>
4187
4188 * xfaces.c (merge_face_vectors): If the target font specfies a
4189 font spec, make the font's attributes take precedence over
4190 directly-specified attributes.
4191 (merge_face_ref): Recognize :font.
4192
4193 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4194
4195 Do not use memcpy for copying intervals.
4196 * intervals.c (reproduce_interval): New function.
4197 (reproduce_tree, reproduce_tree_obj): Use it.
4198 (reproduce_tree_obj): Remove prototype.
4199
4200 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4201
4202 * lisp.h (duration_to_sec_usec): Remove unused decl.
4203
4204 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
4205
4206 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4207 to an allocated instance of NSString, not to the class itself.
4208
4209 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
4210
4211 * makefile.w32-in (C_CTYPE_H): New macro.
4212 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4213 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4214 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4215
4216 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4217
4218 Use ASCII tests for character types.
4219 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4220 * xfns.c, xterm.c:
4221 Don't include <ctype.h>; was not needed.
4222 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4223 * sysdep.c, xfaces.c:
4224 Include <c-ctype.h> instead of <ctype.h>.
4225 * nsterm.m: Include <c-ctype.h>.
4226 * charset.c (read_hex):
4227 * doc.c (Fsnarf_documentation):
4228 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4229 (DRIVE_LETTER) [DOS_NT]:
4230 (Ffile_name_directory, Fexpand_file_name)
4231 (Fsubstitute_in_file_name):
4232 * font.c (font_parse_xlfd, font_parse_fcname):
4233 * frame.c (x_set_font_backend):
4234 * gtkutil.c (xg_get_font):
4235 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4236 * nsimage.m (hexchar):
4237 * nsterm.m (ns_xlfd_to_fontname):
4238 * sysdep.c (system_process_attributes):
4239 * xfaces.c (hash_string_case_insensitive):
4240 Use C-locale tests instead of locale-specific tests for character
4241 types, since we want the ASCII interpretation here, not the
4242 interpretation suitable for whatever happens to be the current locale.
4243
4244 2012-08-16 Martin Rudalics <rudalics@gmx.at>
4245
4246 Consistently check windows for validity/liveness
4247 (Bug#11984, Bug#12025, Bug#12026).
4248 * lisp.h (CHECK_VALID_WINDOW): New macro.
4249 * window.c (decode_window): Rename to decode_live_window.
4250 (decode_valid_window, Fwindow_valid_p): New functions.
4251 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4252 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4253 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4254 (Fwindow_prev_sibling, Fwindow_combination_limit)
4255 (Fset_window_combination_limit, Fwindow_use_time)
4256 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4257 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4258 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4259 (Fwindow_hscroll, Fset_window_hscroll)
4260 (Fwindow_redisplay_end_trigger)
4261 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4262 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4263 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4264 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4265 (Fwindow_end, Fset_window_point, Fset_window_start)
4266 (Fpos_visible_in_window_p, Fwindow_line_height)
4267 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4268 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4269 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4270 (Fset_window_parameter, Fwindow_display_table)
4271 (Fset_window_display_table, Fdelete_other_windows_internal)
4272 (Fset_window_buffer, Fset_window_new_total)
4273 (Fset_window_new_normal, Fdelete_window_internal)
4274 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4275 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4276 (Fwindow_scroll_bars): Check whether argument window is a valid or
4277 live window. Update doc-strings.
4278 (syms_of_window): New symbol Qwindow_valid_p.
4279 * keyboard.c (Fposn_at_x_y): Check whether argument
4280 frame_or_window denotes a valid window.
4281
4282 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4283
4284 Fix previous char table change.
4285 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4286 * chartab.c (optimize_sub_char_table): Likewise.
4287
4288 2012-08-16 Chong Yidong <cyd@gnu.org>
4289
4290 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4291
4292 * xfont.c (xfont_open):
4293 * xftfont.c (xftfont_open): Set the font's max_width field.
4294
4295 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4296 min_width to space_width and average_width to the average over
4297 printable ASCII characters.
4298 (ns_char_width): Code cleanup.
4299 (ns_ascii_average_width): New utility function.
4300
4301 * font.h (struct font): Update comments.
4302
4303 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4304
4305 Simple interface to set Lisp_Object fields of character tables.
4306 * lisp.h (CSET): New macro.
4307 (char_table_set_extras, char_table_set_contents)
4308 (sub_char_table_set_contents): New function.
4309 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4310 * syntax.c: Adjust users.
4311
4312 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4313
4314 * eval.c (eval_sub): Bind lexical-binding.
4315 * lread.c (Qlexical_binding): Make non-static.
4316
4317 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4318
4319 * nsmenu.m (popupSession): Remove.
4320 (pop_down_menu): Remove endModalSession.
4321 (timeout_handler:): New method.
4322 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4323 Call runModalForWindow. Check timer_fired when it returns.
4324 If not set, cancel timer and break out of loop.
4325 Otherwise loop again, with a new timeout.
4326
4327 * nsterm.m: Include fcntl.h if present.
4328 (fd_entry, t_readfds, inNsSelect): Remove.
4329 (select_writefds, select_valid, select_timeout, selfds)
4330 (select_mutex, apploopnr): Add.
4331 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4332 Otherwise call kbd_buffer_store_event.
4333 (ns_send_appdefined): Remove release of fd_entry.
4334 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4335 Increment and decrement apploopnr.
4336 (ns_select): If no file descriptors, just do a NSTimer.
4337 Otherwise copy read/write masks and start select thread (fd_handler).
4338 Start main loop and wait for application defined event.
4339 Inform select thread to stop selecting after main loop is exited.
4340 (ns_term_init): Create selfds pipe and set non-blocking.
4341 Initialize select_mutex. Start the select thread (fd_handler).
4342 (fd_handler:): Loop forever, wait for info from the main thread
4343 to either start or stop selecting. When select returns, send
4344 and appdefined event.
4345 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4346 If not call kbd_buffer_store_event.
4347
4348 * nsterm.h (EmacsApp): fd_handler takes id argument.
4349 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4350
4351 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4352
4353 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4354
4355 * region-cache.c (move_cache_gap): Update gap_len using the actual
4356 growth of the boundaries array. Do not change cache_len.
4357 (Bug#12196)
4358
4359 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4360
4361 Generalize and cleanup font subsystem checks.
4362 * font.h (FONT_DEBUG, font_assert): Remove.
4363 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4364 Change font_assert to eassert. Use eassert where appropriate.
4365
4366 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4367
4368 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4369
4370 2012-08-15 Chong Yidong <cyd@gnu.org>
4371
4372 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4373 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4374 extract the font descriptor instead of just the font name.
4375 In that case, return a font spec instead of a string.
4376 (x_last_font_name): Move to this file from xfns.c.
4377
4378 * xfns.c (Fx_select_font): The return value can also be a font
4379 spec. Move x_last_font_name management to gtkutil.c.
4380
4381 * xfaces.c: Make font weight and style symbols non-static.
4382
4383 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4384
4385 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4386 (bug#12117).
4387
4388 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4389
4390 * alloc.c (Fgarbage_collect): Use plural form consistently.
4391
4392 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4393
4394 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4395 iteration through the command loop. Fixes a problem whereby mouse
4396 movements are ignored until the first mouse click.
4397
4398 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4399
4400 Use bool, not int, for Lisp booleans.
4401 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4402 makes Emacs a bit smaller and presumably a bit faster.
4403 * lisp.h: Include <stdbool.h>.
4404 (struct Lisp_Boolfwd, defvar_bool):
4405 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4406 * regex.c [!emacs]: Include <stdbool.h>.
4407 (false, true): Remove; <stdbool.h> does this for us now.
4408
4409 2012-08-14 Chong Yidong <cyd@gnu.org>
4410
4411 * character.c (Fcharacterp): Doc fix (Bug#12076).
4412
4413 * data.c (Findirect_variable): Doc fix (Bug#11040).
4414
4415 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4416
4417 * editfns.c (Fformat): Doc fix (Bug#12059).
4418 (Fsave_current_buffer): Doc fix (Bug#11542).
4419
4420 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4421
4422 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4423 (bug#12022).
4424
4425 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4426
4427 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4428 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4429 * minibuf.c (choose_minibuf_frame, read_minibuf):
4430 * w32fns.c (x_create_tip_frame):
4431 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4432 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4433
4434 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4435
4436 * intervals.c (offset_intervals): Remove obsolete comment.
4437
4438 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4439
4440 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4441
4442 2012-08-14 Gergely Risko <gergely@risko.hu>
4443
4444 * coding.c (decode_coding): Record buffer modification before
4445 disabling undo_list (Bug#11773).
4446
4447 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4448
4449 Revert and cleanup some recent overlay changes.
4450 * buffer.h (enum overlay_type): Remove.
4451 (buffer_get_overlays, buffer_set_overlays): Likewise.
4452 (buffer_set_overlays_before, buffer_set_overlays_after):
4453 New function. Adjust users.
4454 (unchain_both): Add eassert.
4455
4456 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4457
4458 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4459
4460 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4461
4462 * gtkutil.c (xg_mark_data): Don't assume C99.
4463
4464 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4465
4466 * gtkutil.c (xg_frame_tb_info): New struct.
4467 (TB_INFO_KEY): New define.
4468 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4469 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4470 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4471 if not present.
4472 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4473 is up to date. Otherwise store new data.
4474 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4475
4476 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4477
4478 Use KSET for write access to Lisp_Object members of struct kboard.
4479 * keyboard.h (KSET): New macro.
4480 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4481 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4482 * xterm.c: Adjust users.
4483
4484 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4485
4486 Use BSET for write access to Lisp_Object members of struct buffer.
4487 * buffer.h (BSET): New macro.
4488 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4489 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4490 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4491 * window.c, xdisp.c, xfns.c: Adjust users.
4492
4493 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4494
4495 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4496
4497 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4498
4499 * nsterm.m (not_in_argv): New function.
4500 (application:openFile, application:openTempFile:):
4501 (application:openFileWithoutUI:, application:openFiles:): Open file
4502 if not_in_argv returns non-zero (bug#12171).
4503
4504 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4505 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4506 Define for Gtk+ versions less than 3.2.
4507 (xg_get_font_name): Use those functions/macros here.
4508 Reported by Frans Oilinki <moilinki@gmail.com>.
4509
4510 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4511
4512 * unexmacosx.c (copy_data_segment): Copy initialized data in
4513 statically linked libraries from input file rather than memory.
4514
4515 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4516 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4517 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4518
4519 2012-08-10 Glenn Morris <rgm@gnu.org>
4520
4521 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4522 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4523
4524 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4525
4526 Fix last change to allow compilation with low optimization levels.
4527 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4528 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4529
4530 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4531
4532 Use common inline syntax in intervals.h.
4533 * intervals.h (INTERVALS_INLINE): New macro.
4534 Change all users from LISP_INLINE.
4535
4536 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4537
4538 Define Qnone once for all platforms.
4539 * frame.c (Qnone): Define here.
4540 (syms_of_frame): DEFSYM it.
4541 * lisp.h (Qnone): New declaration.
4542 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4543 * xfns.c: Remove duplication. Adjust users.
4544
4545 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4546
4547 Remove unused macros from intervals.h.
4548 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4549 * intervals.c: Adjust comment.
4550
4551 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4552
4553 * w32fns.c <w32_unicode_gui>: New static variable.
4554 (globals_of_w32fns): Initialize it according to os_subtype.
4555 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4556 testing os_subtype.
4557
4558 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4559 Eli Zaretskii <eliz@gnu.org>
4560
4561 Fix bug #10299 with Unicode characters sent by customized
4562 keyboards created by MSKLC.
4563 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4564 (w32_init_class): Use it to initialize the Emacs class with either
4565 ANSI or Unicode API calls.
4566 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4567 later.
4568 (w32_wnd_proc): If the character code sent by WM_CHAR or
4569 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4570 original message. Call DefWindowProcW on NT and later.
4571
4572 2012-08-10 Glenn Morris <rgm@gnu.org>
4573
4574 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4575
4576 * lisp.h (DIRECTORY_SEP): Let configure set it.
4577
4578 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4579
4580 Use TSET for write access to Lisp_Object slots of struct terminal.
4581 * termhooks.h (TSET): New macro.
4582 * coding.c, terminal.c, xselect.c: Adjust users.
4583
4584 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4585
4586 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4587 the failing expression, include them in the error message.
4588 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4589 * lisp.h (internal_condition_case_n): Update declaration.
4590
4591 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4592
4593 Inline functions to examine and change buffer overlays.
4594 * buffer.c (unchain_both): New function.
4595 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4596 (buffer_has_overlays): New function.
4597 (enum overlay_type): New enum.
4598 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4599 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4600
4601 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4602
4603 Inline functions to examine and change buffer intervals.
4604 * alloc.c (mark_interval_tree): Remove.
4605 (MARK_INTERVAL_TREE): Simplify.
4606 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4607 * intervals.c (buffer_balance_intervals): New function.
4608 (graft_intervals_into_buffer): Adjust indentation.
4609 (set_intervals_multibyte): Simplify.
4610 * buffer.h (BUF_INTERVALS): Remove.
4611 (buffer_get_intervals, buffer_set_intervals): New function.
4612 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4613 * intervals.c, textprop.c: Adjust users.
4614
4615 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4616
4617 Inline functions to examine and change string intervals.
4618 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4619 (string_get_intervals, string_set_intervals): New function.
4620 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4621 * lread.c, print.c, textprop.c: Adjust users.
4622
4623 2012-08-08 Glenn Morris <rgm@gnu.org>
4624
4625 * lisp.mk (lisp): Remove language/persian.elc.
4626
4627 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4628
4629 Cleanup intervals.
4630 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4631 (NULL_INTERVAL_P): Likewise. Adjust users.
4632 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4633 Adjust comment. Move under #if 0.
4634 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4635 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4636
4637 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4638
4639 Check total length of intervals with eassert.
4640 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4641 * intervals.c: Change all users to eassert.
4642
4643 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4644
4645 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4646 Rename fields to match removal of FGET and WGET and disuse of
4647 INTERNAL_FIELD in Lisp_Cons.
4648
4649 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4650
4651 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4652 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4653 name since all xname users are fixed long time ago. Do not
4654 use INTERNAL_FIELD.
4655 (set_symbol_name, set_symbol_function, set_symbol_plist):
4656 (set_symbol_next, set_overlay_plist): New function.
4657 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4658 (struct Lisp_Overlay): Likewise.
4659 (CVAR, MVAR, SVAR): Remove.
4660 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4661 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4662 * xterm.c: Adjust users.
4663 * .gdbinit: Change to use name field of struct Lisp_Symbol
4664 where appropriate.
4665
4666 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4667
4668 Basic functions to set Lisp_Object and pointer slots of intervals.
4669 * intervals.h (interval_set_parent, interval_set_object):
4670 (interval_set_left, interval_set_right, interval_set_plist):
4671 (interval_copy_parent): New function.
4672 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4673 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4674 Adjust indentation.
4675 (INTERVAL_SIZE): Remove. Adjust users.
4676 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4677
4678 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4679
4680 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4681 * process.h (PGET): Remove.
4682 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4683 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4684
4685 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4686
4687 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4688 * window.h (WGET): Remove.
4689 (struct window): Do not use INTERNAL_FIELD.
4690 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4691 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4692 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4693 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4694 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4695 Adjust users.
4696
4697 2012-08-07 Chong Yidong <cyd@gnu.org>
4698
4699 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4700 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4701 (Fdelete_window_internal): Signal an error if the window is not on
4702 a live frame (Bug#12025).
4703
4704 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4705
4706 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4707 * frame.h (FGET): Remove.
4708 (struct frame): Do not use INTERNAL_FIELD.
4709 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4710 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4711 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4712 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4713
4714 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4715
4716 * w32.c: Silence compiler warnings.
4717 (map_w32_filename): Remove unused variable `is_fat'.
4718 (chase_symlinks): Add parentheses around expression.
4719
4720 2012-08-06 Glenn Morris <rgm@gnu.org>
4721
4722 * sysdep.c: Respect BROKEN_GETWD.
4723
4724 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4725 Let configure handle it.
4726 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4727
4728 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4729
4730 Use GCALIGNMENT where appropriate.
4731 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4732 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4733 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4734
4735 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4736
4737 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4738 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4739
4740 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4741
4742 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4743 that should be sufficient for everyone.
4744
4745 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4746
4747 * keyboard.c (timer_check_2): Add break so timer_check returns next
4748 timeout.
4749
4750 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4751
4752 Fix Windows build errors introduced after converting to WGET and WSET.
4753 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4754 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4755
4756 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4757
4758 * nsterm.m (ns_frame_rehighlight): Use FSET.
4759
4760 * nsmenu.m (ns_update_menubar): Use FSET.
4761
4762 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4763
4764 Separate read and write access to Lisp_Object slots of Lisp_Process.
4765 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4766 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4767
4768 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4769
4770 Separate read and write access to Lisp_Object slots of struct window.
4771 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4772 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4773 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4774 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4775 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4776 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4777 Adjust users.
4778
4779 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4780
4781 Fix Windows build errors introduced after converting to FGET and FSET.
4782 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4783 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4784 (w32_judge_scroll_bars): Change to use FSET.
4785 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4786
4787 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4788
4789 Fix replacement typo.
4790 * window.c (replace_window): Set root_window instead of
4791 selected_window. This fixes a total window subsystem
4792 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4793
4794 2012-08-06 Glenn Morris <rgm@gnu.org>
4795
4796 * lisp.mk (lisp): Add language/persian.elc.
4797
4798 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4799
4800 Separate read and write access to Lisp_Object slots of struct frame.
4801 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4802 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4803 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4804 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4805 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4806
4807 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4808
4809 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4810
4811 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4812
4813 Generalize common compile-time constants.
4814 * lisp.h (header_size, bool_header_size, word_size): Now here.
4815 (struct Lisp_Vector): Add comment.
4816 (struct Lisp_Bool_Vector): Move up to define handy constants.
4817 (VECSIZE, PSEUDOVECSIZE): Simplify.
4818 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4819 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4820 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4821 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4822 * xfont.c, xmenu.c: Use word_size where appropriate.
4823
4824 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4825
4826 * search.c (Freplace_match): Treat \? in the replacement text
4827 literally (Bug#8161).
4828
4829 2012-08-05 Chong Yidong <cyd@gnu.org>
4830
4831 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4832 * frame.c (Vdelete_frame_functions):
4833 * emacs.c (Vkill_emacs_hook): Doc fix.
4834
4835 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4836
4837 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4838 --with-x-toolkit=no builds.
4839 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4840
4841 2012-08-04 Chong Yidong <cyd@gnu.org>
4842
4843 * syntax.c (Fmodify_syntax_entry): Doc fix.
4844
4845 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4846
4847 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4848 * w32.c (init_environment): Change the default values of many
4849 environment variables in dflt_envvars[] to NULL, to avoid pushing
4850 them into environment when they were not already defined.
4851 Remove the code that deletes site-lisp subdirectories from the default
4852 value of EMACSLOADPATH, as it is no longer needed.
4853 (check_windows_init_file): Now external, not static.
4854 Use Vload_path as is, without adding anything, as this function is now
4855 called when Vload_path is already set up.
4856
4857 * w32.h (check_windows_init_file): Add prototype.
4858
4859 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4860 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4861 compatibility with Posix platforms.
4862 (main): Move the call to check_windows_init_file to here from
4863 w32.c.
4864 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4865 any, in the DEFALT argument into the root of the Emacs build or
4866 installation tree, as appropriate.
4867
4868 * callproc.c (init_callproc_1): Call decode_env_path instead of
4869 doing its equivalent by hand.
4870 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4871 the code that sets Vexec_path run on MS-Windows.
4872
4873 * lread.c (init_lread): Add comments to #ifdef's.
4874
4875 * msdos.c (dos_set_window_size, IT_update_begin)
4876 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4877 instead of direct references.
4878
4879 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4880
4881 Export DEFAULT_REHASH_* to GDB.
4882 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4883 Now constants, not macros.
4884
4885 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4886
4887 Remove unnecessary casts involving pointers.
4888 These casts are no longer needed now that we assume C89 or later,
4889 since they involve casting to or from void *.
4890 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4891 (make_pure_float, make_pure_vector):
4892 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4893 * macros.c (Fstart_kbd_macro):
4894 * menu.c (find_and_return_menu_selection):
4895 * minibuf.c (read_minibuf_noninteractive):
4896 * sysdep.c (closedir):
4897 * xdisp.c (x_produce_glyphs):
4898 * xfaces.c (compare_fonts_by_sort_order):
4899 * xfns.c (x_real_positions, select_visual):
4900 * xselect.c (x_stop_queuing_selection_requests)
4901 (x_get_window_property, x_get_window_property_as_lisp_data):
4902 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4903 Remove unnecessary pointer casts.
4904 * alloc.c (record_xmalloc): New function.
4905 * lisp.h (record_xmalloc): New decl.
4906 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4907 more like a function. This is because the pointer cast is not
4908 needed. All uses changed.
4909 * print.c (print_string, print_error_message): Avoid length recalc.
4910
4911 Improve fix for macroexp crash with debugging (Bug#12118).
4912 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4913 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4914 not supposed to be invoked from the garbage collector.
4915 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4916 (gc_aset): New function, which is like ASET but can be
4917 used in the garbage collector.
4918 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4919 (set_hash_index): Use it instead of ASET.
4920
4921 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4922
4923 Support symlinks on latest versions of MS-Windows.
4924 * w32.c: Include winioctl.h and aclapi.h.
4925 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4926 (revert_to_self): Forward declarations of static functions.
4927 <static BOOL g_b_init_get_security_info>:
4928 <g_b_init_create_symbolic_link>: New static flags.
4929 (globals_of_w32): Initialize them to zero.
4930 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4931 (map_w32_filename): Improve commentary. Simplify switch.
4932 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4933 headers (most versions of MinGW w32api don't).
4934 (get_security_info, create_symbolic_link)
4935 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4936 New functions.
4937 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4938 in the argument file name.
4939 (sys_access): Call unc_volume_file_attributes only if
4940 GetFileAttributes fails with network-related error codes.
4941 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4942 have the required privileges.
4943 (get_file_security_desc_by_name): Rename from
4944 get_file_security_desc.
4945 (stat_worker): New function, with most of the guts of 'stat', and
4946 with addition of handling of symlinks and support for 'lstat'.
4947 If possible, get file's attributes and security information by
4948 handle, not by name. Produce S_IFLNK bit for symlinks, when
4949 called from 'lstat'.
4950 (stat, lstat): New functions, call 'stat_worker'.
4951 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4952 symlinks when the underlying filesystem supports them.
4953
4954 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4955
4956 Fix macroexp crash on Windows with debugging (Bug#12118).
4957 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4958 checking subscripts; problem introduced with the recent
4959 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4960 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4961 since it's used in non-static inline functions now.
4962
4963 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4964 Don't assume buffer size fits in 'int'. Remove unused local.
4965
4966 Use C99-style 'extern inline' if available.
4967 * buffer.h (BUFFER_INLINE):
4968 * category.h (CATEGORY_INLINE):
4969 * character.h (CHARACTER_INLINE):
4970 * charset.h (CHARSET_INLINE):
4971 * composite.h (COMPOSITE_INLINE):
4972 * dispextern.h (DISPEXTERN_INLINE):
4973 * lisp.h (LISP_INLINE):
4974 * systime.h (SYSTIME_INLINE):
4975 New macro, replacing 'static inline' in this header.
4976 * buffer.h, category.h, character.h, charset.h, composite.h:
4977 * dispextern.h, lisp.h, systime.h:
4978 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4979 * alloc.c (LISP_INLINE):
4980 * buffer.c (BUFFER_INLINE):
4981 * category.c (CATEGORY_INLINE):
4982 * character.c (CHARACTER_INLINE):
4983 * charset.c (CHARSET_INLINE):
4984 * composite.c (COMPOSITE_INLINE):
4985 * dispnew.c (DISPEXTERN_INLINE):
4986 * sysdep.c (SYSTIME_INLINE):
4987 Define to EXTERN_INLINE, so that the corresponding functions
4988 are compiled into code.
4989 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4990 (INLINE_HEADER_END): New macros.
4991 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4992 since it's used in non-static inline functions now.
4993 (VALMASK) [!USE_LSB_TAG]: Likewise.
4994
4995 2012-08-02 Glenn Morris <rgm@gnu.org>
4996
4997 * s/: Remove empty directory.
4998
4999 * s/ms-w32.h: Move to ../nt/inc.
5000 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
5001 Update for new ms-w32.h location.
5002
5003 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5004
5005 Port to Solaris 8.
5006 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
5007
5008 2012-08-02 Glenn Morris <rgm@gnu.org>
5009
5010 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
5011 hard-coding the path separator.
5012
5013 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5014
5015 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
5016 This how ASET and AREF are supposed to work, and makes
5017 it easier to think about future improvements. See
5018 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
5019 * charset.h (set_charset_attr): New function.
5020 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
5021 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
5022 (aref_addr): New function. All uses of &AREF(...) changed.
5023 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5024 (set_hash_index): New functions. All lvalue-style uses of
5025 HASH_KEY etc. changed.
5026 * keyboard.c (set_prop): New function. All lvalue-style uses
5027 of PROP changed.
5028
5029 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
5030
5031 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
5032 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
5033 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
5034 * nsfns.m (ns_set_name_as_filename): Likewise.
5035 * nsmenu.m (ns_update_menubar): Likewise.
5036 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
5037
5038 2012-08-01 Eli Zaretskii <eliz@gnu.org>
5039
5040 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
5041 Adapt to latest changes in field names of the corresponding Lisp
5042 objects.
5043
5044 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
5045
5046 2012-08-01 Glenn Morris <rgm@gnu.org>
5047
5048 * s/msdos.h: Remove file.
5049 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
5050 * Makefile.in (S_FILE): Remove.
5051 (config_h): Remove S_FILE.
5052
5053 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5054
5055 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5056 Remove; moved to nt/config.nt.
5057
5058 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5059
5060 Use INTERNAL_FIELD for conses and overlays.
5061 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5062 Remove obsolete comment.
5063 (MVAR): New macro.
5064 (struct Lisp_Overlay): Use INTERNAL_FIELD.
5065 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5066
5067 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5068
5069 Use INTERNAL_FIELD for symbols.
5070 * lisp.h (SVAR): New macro. Adjust users.
5071 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5072 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5073
5074 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5075
5076 Use INTERNAL_FIELD for processes.
5077 * process.h (PVAR): New macro. Adjust style.
5078 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5079 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5080
5081 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5082
5083 Use INTERNAL_FIELD for windows.
5084 * window.h (WVAR): New macro.
5085 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5086 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5087 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5088 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5089 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5090 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5091
5092 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5093
5094 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5095
5096 2012-08-01 Glenn Morris <rgm@gnu.org>
5097
5098 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5099 Move to configure.ac.
5100
5101 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5102
5103 * makefile.w32-in (CONFIG_H): Update dependencies.
5104 (CONF_POST_H): New macro.
5105
5106 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5107
5108 2012-07-31 Glenn Morris <rgm@gnu.org>
5109
5110 * Makefile.in (S_FILE): No longer set by configure.
5111
5112 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5113 is available.
5114 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5115
5116 * process.h (NULL_DEVICE):
5117 * emacs.c (SEPCHAR):
5118 * editfns.c (USER_FULL_NAME): Let configure set them.
5119
5120 * s/README, s/template.h: Remove files.
5121
5122 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5123
5124 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5125 Move to configure.ac.
5126
5127 2012-07-31 Eli Zaretskii <eliz@gnu.org>
5128
5129 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5130 resulting renaming of 'struct frame' members.
5131
5132 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5133
5134 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5135 after introduction of FVAR.
5136
5137 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5138
5139 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5140
5141 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5142 instead of compositeToPoint.
5143 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5144
5145 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5146
5147 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5148
5149 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5150 * lisp.h (INTERNAL_FIELD): New macro.
5151 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5152 (BVAR): Change to use INTERNAL_FIELD.
5153 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5154 (KVAR): Change to use INTERNAL_FIELD.
5155 * frame.h (FVAR): New macro.
5156 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5157 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5158 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5159 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5160 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5161
5162 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5163
5164 Miscellaneous fixes for non-default X toolkits.
5165 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5166 * xterm.c (x_frame_of_widget): Remove redundant prototype.
5167 Move under #ifdef USE_LUCID.
5168 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5169 definition and usage to avoid warnings.
5170
5171 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5172
5173 * nsterm.m (openFiles): Fix previous checkin.
5174
5175 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
5176
5177 * indent.c (compute_motion): Remove unused local.
5178
5179 2012-07-31 Glenn Morris <rgm@gnu.org>
5180
5181 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5182
5183 * conf_post.h [USG5_4]:
5184 Move remaining contents of s/usg5-4-common.h here.
5185 * s/usg5-4-common.h: Remove file.
5186
5187 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5188 * s/irix6-5.h: Remove file.
5189
5190 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5191 * s/darwin.h: Remove file.
5192
5193 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5194 * s/hpux10-20.h: Remove file, which is now empty.
5195
5196 2012-07-30 Glenn Morris <rgm@gnu.org>
5197
5198 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5199 * Makefile.in (config_h): Add conf_post.h.
5200 * makefile.w32-in (CONFIG_H): Add conf_post.h.
5201
5202 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
5203
5204 * nsterm.m (ns_do_open_file): New variable.
5205 (ns_term_init): Set ns_do_open_file to YES after run returns.
5206 (openFile, openTempFile, openFileWithoutUI, openFiles):
5207 Open files only if ns_do_open_file.
5208
5209 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5210
5211 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5212 This no-op macro hasn't been needed for many years.
5213 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5214
5215 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5216 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5217 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5218 gdb_make_enums_visible.
5219 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5220 (DIRECTORY_SEP): Now a constant, not a macro.
5221
5222 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5223
5224 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5225 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5226
5227 * w32term.c <w32_keyboard_codepage>: Renamed from
5228 keyboard_codepage and now external. All users changed.
5229
5230 * w32term.h: Add declaration of w32_keyboard_codepage.
5231
5232 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5233 the codepage to translate keys to Unicode. If this argument is
5234 -1, use the value returned by GetConsoleCP. All callers changed.
5235
5236 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5237
5238 Update .PHONY listings in makefiles.
5239 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5240 bootstrap-clean, distclean, maintainer-clean, versioclean,
5241 extraclean, frc.
5242
5243 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5244 This is a bit clearer. Fix some commentary typos.
5245
5246 2012-07-30 Glenn Morris <rgm@gnu.org>
5247
5248 * s/netbsd.h: Let configure include signal.h if needed.
5249 Remove file, which is now empty.
5250
5251 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5252 Let configure set them.
5253 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5254 No more need to undefine.
5255
5256 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5257
5258 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5259 non-single-byte char when adding meta modifier. (Bug#12090)
5260
5261 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5262
5263 Convert safe_call to use variable number of arguments.
5264 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5265 (safe_call2): Fix comment.
5266 * lisp.h (safe_call): Adjust prototype.
5267 * coding.c (encode_coding_object): Change to use safe_call2.
5268 * xfaces.c (merge_face_heights): Change to use safe_call1.
5269
5270 2012-07-30 Glenn Morris <rgm@gnu.org>
5271
5272 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5273 does that unconditionally. Remove file, which is now empty.
5274
5275 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5276 Remove empty files.
5277
5278 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5279
5280 Export to GDB most of lisp.h's remaining object-like macros.
5281 * lisp.h (min, max): Move earlier, because they're used earlier now.
5282 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5283 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5284 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5285 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5286 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5287 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5288 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5289 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5290 Now constants, for GDB. They need not be macros.
5291 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5292 Now constants, for GDB, as well as macros, for static initializers.
5293 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5294 Move to after the definition of struct Lisp_Char_Table,
5295 since the former now needs that type defined.
5296 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5297 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5298 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5299 New enums, for gdb_make_enums_visible.
5300 (GLYPH_MODE_LINE_FACE): Remove; unused.
5301 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5302 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5303 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5304 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5305 enum maxargs, enum MAX_ALLOCA.
5306 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5307 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5308 no longer needed, now that they are done in lisp.h.
5309
5310 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5311
5312 Cleanup string bytes checking.
5313 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5314 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5315 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5316 (check_sblock, compact_small_strings): Simplify.
5317
5318 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5319
5320 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5321 These macros are confusing and no longer need to be defined, as
5322 the enum values now suffice. All uses replaced with definiens.
5323 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5324
5325 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5326
5327 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5328 ($(BLD)/w32console.$(O)): Update dependencies.
5329
5330 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5331
5332 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5333 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5334 time. Adjust users.
5335 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5336
5337 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5338
5339 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5340 setting sitelisp (Bug#12010).
5341
5342 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5343
5344 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5345
5346 * w32heap.c (cache_system_info):
5347 * w32.c (sys_rename):
5348 * w32proc.c (find_child_console, sys_kill): All users changed.
5349
5350 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5351
5352 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5353
5354 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5355
5356 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5357
5358 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5359
5360 Cleanup statistics calculation in Fgarbage_collect.
5361 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5362 Fix zombies percentage calculation. Simplify elapsed time calculation.
5363
5364 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5365
5366 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5367 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5368 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5369 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5370 (replace_range, replace_range_2, del_range_2): Change to eassert.
5371 * marker.c (byte_char_debug_check): Adjust style.
5372
5373 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5374
5375 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5376 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5377 long-ago-commented-out code that talks about "WIN32".
5378 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5379 All uses changed.
5380
5381 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5382
5383 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5384 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5385 Simplify by using alignof.
5386 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5387 * lisp.h: Include <stdalign.h>.
5388 (GCALIGNMENT): New macro and constant.
5389 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5390 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5391 (stdalign): New macro, if not already defined.
5392
5393 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5394
5395 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5396 * w32inevt.c: Include w32inevt.h.
5397 (w32_read_console_input): New inline function, calls either
5398 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5399 w32_console_unicode_input.
5400 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5401 (w32_kbd_patch_key, key_event): Use the codepage returned by
5402 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5403 (key_event): use uChar.UnicodeChar only if
5404 w32_console_unicode_input is non-zero.
5405
5406 * w32console.c: Include w32heap.h.
5407 <w32_console_unicode_input>: New global variable.
5408 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5409 family of Windows, zero otherwise.
5410
5411 * w32inevt.h: Declare w32_console_unicode_input.
5412
5413 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5414 --without-x. (Bug#11742)
5415
5416 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5417
5418 Adjust GDB to reflect pvec_type changes (Bug#12036).
5419 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5420 2012-07-04 changes to pseudovector representation.
5421 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5422
5423 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5424
5425 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5426 bus address.
5427 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5428
5429 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5430
5431 * alloc.c (listn): Fix the order the arguments are consed onto the
5432 list.
5433
5434 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5435 enumeration constants, as PURE and HEAP are too general, and clash
5436 with other headers and sources, such as gmalloc.c and the
5437 MS-Windows system headers. All users changed.
5438
5439 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5440
5441 Revert last save_excursion_save and save_excursion_restore changes.
5442 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5443 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5444
5445 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5446
5447 Fix recently-introduced typos in Windows port.
5448 Reported by Martin Rudalics <rudalics@gmx.at>.
5449 * w32.c (init_environment): Replace comma with semicolon.
5450 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5451
5452 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5453
5454 Improve GDB symbol export (Bug#12036).
5455 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5456 arms of an 'if', not using conditional expressions; otherwise GDB
5457 complains about the types in the unevaluated arm when the argument
5458 is an integer literal.
5459 (xgetint): Simplify expression.
5460 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5461 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5462 Zaretskii in <http://bugs.gnu.org/12036#13>.
5463 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5464 needed now that we have gdb_make_enums_visible.
5465 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5466 (enum enum_USE_LSB_TAG):
5467 New enum types, packaging up enums that need to be exported to GDB.
5468
5469 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5470
5471 Utility function to make a list from specified amount of objects.
5472 * lisp.h (enum constype): New datatype.
5473 (listn): New prototype.
5474 * alloc.c (listn): New function.
5475 (Fmemory_use_count, syms_of_alloc): Use it.
5476 * buffer.c (syms_of_buffer): Likewise.
5477 * callint.c (syms_of_callint): Likewise.
5478 * charset.c (define_charset_internal): Likewise.
5479 * coding.c (syms_of_coding): Likewise.
5480 * keymap.c (syms_of_keymap): Likewise.
5481 * search.c (syms_of_search): Likewise.
5482 * syntax.c (syms_of_syntax): Likewise.
5483 * w32.c (init_environment): Likewise.
5484 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5485 * xdisp.c (syms_of_xdisp): Likewise.
5486 * xfns.c (syms_of_xfns): Likewise.
5487
5488 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5489
5490 Fast save_excursion_save and save_excursion_restore.
5491 * lisp.h (struct Lisp_Excursion): New data type.
5492 (PVEC_EXCURSION): New pseudovector type.
5493 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5494 to deal with it. Adjust comments.
5495 (init_marker, attach_marker): New prototype.
5496 (unchain_marker): Adjust prototype.
5497 * marker.c (attach_marker): Change to global.
5498 (init_marker): New function.
5499 * alloc.c (Fmake_marker, build_marker): Use it.
5500 (build_marker): More easserts.
5501 (mark_object): Handle struct Lisp_Excursion.
5502 * editfns.c (save_excursion_save, save_excursion_restore):
5503 Reimplement to use struct Lisp_Excursion. Add comments.
5504
5505 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5506
5507 Fix export of symbols to GDB (Bug#12036).
5508 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5509 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5510 emacs.c, as this is a more-suitable home. Had this been done earlier
5511 the fix for 12036 would have avoided some of the problems noted in
5512 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5513 would have been more obvious.
5514 * emacs.c: Do not include <verify.h>; no longer needed.
5515 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5516 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5517 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5518 Remove; now done in lisp.h.
5519 * lisp.h (PUBLISH_TO_GDB): New macro.
5520 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5521 (DATA_SEG_BITS): Use it.
5522 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5523 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5524 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5525 not be usable in #if. This simplifies things.
5526
5527 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5528
5529 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5530
5531 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5532
5533 Simplify export of symbols to GDB (Bug#12036).
5534 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5535 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5536 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5537 Adjust to changes in lisp.h and emacs.c, by using
5538 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5539 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5540 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5541 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5542 instead of gdb_valbits.
5543 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5544 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5545 instead of gdb_array_mark_flag.
5546 (xboolvector): Get size from $->size, not $->header.size.
5547 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5548 (xreload, hook-run, hookpost-run): Remove.
5549 * emacs.c: Include <verify.h>.
5550 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5551 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5552 Remove.
5553 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5554 (gdb_USE_LSB_TAG): New enum constants.
5555 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5556 Also define these as enum constants, so they're visible to GDB.
5557 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5558 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5559 as constants, so they're visible to GDB.
5560 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5561 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5562 Now enum constants, not macros, so they're visible to GDB.
5563 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5564 more convenient now. All uses changed.
5565 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5566 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5567
5568 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5569
5570 Explicitly free restriction data that are not needed anymore.
5571 * editfns.c (save_restriction_restore): Free restriction data.
5572
5573 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5574
5575 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5576 add argument, tune behavior, and adjust all callers.
5577
5578 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5579
5580 Use typedef for EMACS_INT, EMACS_UINT.
5581 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5582 than macros. This simplifies debugging in the usual case, since
5583 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5584 and it allows expressions involving EMACS_INT casts.
5585 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5586
5587 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5588
5589 * nsterm.m (ns_read_socket): Return early if there is a modal
5590 window (Bug#12043).
5591
5592 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5593
5594 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5595 that FOCUS-FRAME can be omitted.
5596
5597 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5598
5599 Adjust buffer text indirection counters at the end of Fkill_buffer.
5600 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5601 buffer is definitely dead. This should really fix an issue reported
5602 by Christoph Scholtes again. (Bug#12007).
5603 (init_buffer_once): Initialize indirection counters of
5604 buffer_defaults and buffer_local_symbols (for sanity and safety).
5605
5606 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5607
5608 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5609 and continuation glyphs on tooltip frames, leave them at zero.
5610 Avoids continued lines in tooltips. (Bug#11832)
5611
5612 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5613
5614 Simplify copy_overlay.
5615 * buffer.c (copy_overlay): Simplify. Use build_marker.
5616 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5617
5618 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5619
5620 * print.c (print_object): Don't crash when a frame's name is nil
5621 or invalid. (Bug#12025)
5622
5623 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5624 it signals an error when a tooltip frame is being created.
5625
5626 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5627
5628 Cleanup miscellaneous objects allocation and initialization.
5629 * alloc.c (allocate_misc): Change to static. Add argument to
5630 specify the subtype. Adjust comment and users.
5631 (build_overlay): New function.
5632 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5633 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5634 (allocate_misc): Remove prototype.
5635 (build_overlay): Add prototype.
5636
5637 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5638
5639 Swap buffer text indirection counters in Fbuffer_swap_text.
5640 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5641 This avoids crash reported by Christoph Scholtes at
5642 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5643
5644 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5645
5646 * nsmenu.m (Popdown_data): New struct.
5647 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5648 free Popdown_data.
5649 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5650 (initWithContentRect): Make imgView and contentView non-static
5651 and autorelease them. Also autorelease img and matrix (Bug#12005).
5652 (dealloc): Remove (Bug#12005).
5653
5654 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5655
5656 Adjust consing_since_gc when objects are explicitly freed.
5657 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5658 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5659 (free_cons, free_misc): Subtract object size from consing_since_gc.
5660
5661 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5662
5663 Simplify and cleanup markers positioning code.
5664 * marker.c (attach_marker): More useful eassert.
5665 (live_buffer, set_marker_internal): New function.
5666 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5667 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5668
5669 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5670
5671 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5672 as it's limited by the amount of memory, not by INT_MAX.
5673
5674 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5675
5676 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5677 in special-event-map. See the discussion at
5678 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5679 for the reasons.
5680
5681 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5682 info.dwItemData. Fixes crashes on 64-bit Windows.
5683 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5684
5685 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5686
5687 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5688 (conversationIdentifier): Return value is NSInteger.
5689 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5690
5691 2012-07-21 Chong Yidong <cyd@gnu.org>
5692
5693 * window.c (decode_any_window): Signal an error if the window is
5694 on a dead frame (Bug#11984).
5695
5696 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5697
5698 Add indirection counting to speed up Fkill_buffer.
5699 * buffer.h (struct buffer): New member.
5700 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5701 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5702 base buffer indirection counter.
5703 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5704 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5705 through buffer list if indirection counter is 0.
5706
5707 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5708
5709 Extend the value returned by Fgarbage_collect with heap statistics.
5710 * alloc.c (Qheap): New symbol.
5711 (syms_of_alloc): DEFSYM it.
5712 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5713 (Fmemory_free): Remove.
5714 (syms_of_alloc): Don't defsubr it.
5715 * buffer.c (Fcompact_buffer): Remove.
5716 (syms_of_buffer): Don't defsubr it.
5717
5718 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5719
5720 Make maybe_gc inline.
5721 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5722 * lisp.h (consing_since_gc, gc_relative_threshold)
5723 (memory_full_cons_threshold): Revert declaration.
5724 (maybe_gc): Remove prototype, define as inline.
5725 * alloc.c: Remove old commented-out code.
5726 (consing_since_gc, gc_relative_threshold)
5727 (memory_full_cons_threshold): Revert to global.
5728 (maybe_gc): Remove.
5729
5730 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5731
5732 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5733 * lisp.h (build_unibyte_string): New function.
5734 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5735 * sysdep.c, w32fns.c, xfns.c: Use it.
5736 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5737 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5738 Adjust users accordingly.
5739 * font.h (font_open_by_name): Adjust prototype.
5740
5741 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5742
5743 Cleanup calls to Fgarbage_collect.
5744 * lisp.h (maybe_gc): New prototype.
5745 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5746 Remove declarations.
5747 * alloc.c (maybe_gc): New function.
5748 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5749 Make them static.
5750 * bytecode.c (MAYBE_GC): Use maybe_gc.
5751 * eval.c (eval_sub, Ffuncall): Likewise.
5752 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5753 to avoid dependency from auto-save feature.
5754
5755 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5756
5757 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5758 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5759 'for_each_per_buffer_object_at'.
5760 All uses changed. It's better to use upper-case for macros that
5761 cannot be implemented as functions, to give the reader a clue
5762 that they're special.
5763
5764 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5765
5766 * alloc.c (Fgarbage_collect): Tweak docstring.
5767
5768 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5769
5770 Tweak the value returned from Fgarbage_collect again.
5771 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5772 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5773 Adjust documentation.
5774 (total_vector_bytes): Rename to total_vector_slots, adjust
5775 accounting.
5776 (total_free_vector_bytes): Rename to total_free_vector_slots,
5777 adjust accounting.
5778 (Qstring_bytes, Qvector_slots): New symbols.
5779 (syms_of_alloc): DEFSYM them.
5780
5781 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5782
5783 Buffer compaction primitive which may be used from Lisp.
5784 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5785 (syms_of_buffer): Register Fcompact_buffer.
5786 * alloc.c (Fgarbage_collect): Use compact_buffer.
5787 * buffer.h (compact_buffer): New prototype.
5788 (struct buffer_text): New member.
5789
5790 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5791
5792 New macro to iterate over all buffers, miscellaneous cleanups.
5793 * lisp.h (all_buffers): Remove declaration.
5794 * buffer.h (all_buffers): Add declaration, with comment.
5795 (for_each_buffer): New macro.
5796 * alloc.c (Fgarbage_collect, mark_object): Use it.
5797 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5798 (init_buffer): Likewise.
5799 * data.c (Fset_default): Likewise.
5800 * coding.c (code_conversion_restore): Remove redundant check
5801 for dead buffer.
5802 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5803
5804 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5805
5806 Fix bug that created negative-length intervals.
5807 * intervals.c (merge_interval_right, merge_interval_left):
5808 Do not zero out this interval if it is absorbed by its children,
5809 as this interval's total length doesn't change in that case. See
5810 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5811
5812 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5813
5814 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5815 when invoking (make-bool-vector N t) and N is a positive
5816 multiple of 8 -- the last 8 bits were mistakenly cleared.
5817
5818 Remove some struct layout assumptions in bool vectors.
5819 * alloc.c (bool_header_size): New constant.
5820 (header_size, word_size): Move earlier, as they're now used earlier.
5821 Use 'word_size' in a few more places, where it's appropriate.
5822 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5823 padding before the data member of a bool vector.
5824 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5825 than doing the check by hand with an abort ().
5826
5827 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5828
5829 * eval.c (Fdefvar): Don't check constants since we only set the var if
5830 it's not yet defined anyway (bug#11904).
5831
5832 * lisp.h (last_undo_boundary): Declare new var.
5833 * keyboard.c (command_loop_1): Set it.
5834 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5835 were auto-added by the command loop (bug#11774).
5836
5837 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5838
5839 * w32font.c (Qsymbol): Remove local definition.
5840 (syms_of_w32font): Don't DEFSYM it.
5841
5842 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5843
5844 Fix sweep_vectors to handle large bool vectors correctly.
5845 * alloc.c (sweep_vectors): Account total_vector_bytes for
5846 bool vectors larger than VBLOCK_BYTES_MAX.
5847
5848 2012-07-18 Chong Yidong <cyd@gnu.org>
5849
5850 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5851 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5852
5853 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5854
5855 Return more descriptive data from Fgarbage_collect.
5856 Suggested by Stefan Monnier in
5857 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5858 * alloc.c (bounded_number): New function.
5859 (total_buffers, total_vectors): New variable.
5860 (total_string_size): Rename to total_string_bytes, adjust users.
5861 (total_vector_size): Rename to total_vector_bytes, adjust users.
5862 (sweep_vectors): Account total_vectors and total_vector_bytes.
5863 (Fgarbage_collect): New return value. Adjust documentation.
5864 (gc_sweep): Account total_buffers.
5865 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5866 (VECTOR_SIZE): Remove.
5867 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5868 (Qinterval, Qmisc): New symbols.
5869 (syms_of_data): Initialize them.
5870 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5871 (Qcons, Qbuffer): New declarations.
5872
5873 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5874
5875 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5876 Round up, not down. Improve doc.
5877
5878 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5879
5880 Restore old code in allocate_string_data to avoid Faset breakage.
5881 Reported by Julien Danjou <julien@danjou.info> in
5882 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5883 * alloc.c (allocate_string_data): Restore old code with minor
5884 adjustments, fix comment to explain this subtle issue.
5885
5886 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5887
5888 Remove FILE_SYSTEM_CASE.
5889 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5890
5891 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5892 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5893 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5894 call-process-region passes it through expand-file-name.
5895
5896 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5897
5898 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5899
5900 Fix crash when creating indirect buffer (Bug#11917)
5901 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5902 Don't handle unbound variables specially if non-zero.
5903 (Fbuffer_local_variables): Pass zero.
5904 (clone_per_buffer_values): Pass non-zero.
5905
5906 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5907
5908 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5909 to make the loop interruptible.
5910
5911 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5912
5913 * gnutls.c (emacs_gnutls_handshake): Only retry if
5914 GNUTLS_E_INTERRUPTED.
5915
5916 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5917
5918 Cleanup and convert miscellaneous checks to eassert.
5919 * alloc.c (mark_interval): Fix comment, partially rephrase
5920 old comment from intervals.h (see below).
5921 * intervals.c (find_interval, adjust_intervals_for_insertion)
5922 (delete_interval, adjust_intervals_for_deletion)
5923 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5924 Convert to eassert.
5925 (adjust_intervals_for_insertion, make_new_interval):
5926 Remove obsolete and unused code.
5927 * intervals.h (struct interval): Remove obsolete comment.
5928 * textprotp.c (erase_properties): Remove unused code.
5929 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5930 (Fremove_list_of_text_properties): Convert to eassert.
5931
5932 2012-07-17 Chong Yidong <cyd@gnu.org>
5933
5934 * editfns.c (Finsert_char): Doc fix.
5935
5936 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5937
5938 Fix previous change to make Fmemory_free always accurate.
5939 * alloc.c (make_interval): Update total_free_intervals.
5940 (make_float): Likewise for total_free_floats.
5941 (free_cons, Fcons): Likewise for total_free_conses.
5942 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5943 Likewise for total_free_vector_bytes.
5944 (Fmake_symbol): Likewise for total_free_symbols.
5945 (bytes_free): Remove.
5946
5947 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5948
5949 Simple free memory accounting feature.
5950 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5951 (sweep_vectors): Accumulate size of free vectors.
5952 (Fgarbage_collect): Setup bytes_free.
5953 (Fmemory_free): New function.
5954 (syms_of_alloc): Register it.
5955
5956 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5957
5958 Cleanup overlays checking.
5959 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5960 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5961 eassert and OVERLAYP.
5962 (sort_overlays): Change to use OVERLAYP.
5963
5964 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5965
5966 * editfns.c (Finsert_char): Make it interactive, and make the
5967 second arg optional. Copy interactive spec and docstring from
5968 ucs-insert.
5969
5970 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5971
5972 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5973 Unlike the other wrapped functions, fabs has an unspecified
5974 effect on errno.
5975
5976 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5977
5978 * nsterm.m (keyDown): Interpret flags without left/right bits
5979 as the left key (Bug#11670).
5980
5981 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5982
5983 Remove empty and useless init functions.
5984 * lisp.h (init_character_once, init_fns, init_image)
5985 (init_filelock, init_sound): Remove prototype.
5986 * character.c (init_character_once): Remove.
5987 * filelock.c (init_filelock): Likewise.
5988 * fns.c (init_fns): Likewise.
5989 * image.c (init_image): Likewise.
5990 * sound.c (init_sound): Likewise.
5991 * emacs.c (main): Adjust accordingly.
5992
5993 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5994
5995 * gtkutil.h: Tiny cleanups.
5996 (use_old_gtk_file_dialog): Remove useless declaration.
5997 (xg_uses_old_file_dialog): Add suggested const attribute.
5998
5999 2012-07-15 Eli Zaretskii <eliz@gnu.org>
6000
6001 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
6002 (bidi_paragraph_init): Use it to limit search forward for a strong
6003 directional character in abnormally large paragraphs full of
6004 neutral or weak characters. (Bug#11943)
6005
6006 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
6007
6008 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
6009 the toolbar (Bug#9451).
6010 (xg_make_tool_item): Give the widget event box a transparent
6011 background.
6012
6013 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6014
6015 Cleanup basic allocation variables and functions.
6016 * alloc.c (ignore_warnings, init_intervals, init_float)
6017 (init_cons, init_symbol, init_marker): Remove.
6018 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
6019 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
6020 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
6021 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
6022 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
6023 (staticidx, init_alloc_once, init_strings, free_ablock):
6024 Remove redundant initialization.
6025 * fns.c (init_weak_hash_tables): Remove.
6026 * lisp.h (init_weak_hash_tables): Remove prototype.
6027
6028 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6029
6030 Use zero_vector where appropriate.
6031 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
6032 accordingly.
6033 * lisp.h (zero_vector): New declaration.
6034 * font.c (null_vector): Remove.
6035 (syms_of_font): Remove initialization and staticpro.
6036 (font_list_entities, font_find_for_lface): Change to use zero_vector.
6037 * keymap.c (Faccessible_keymaps): Likewise.
6038
6039 2012-07-15 Leo Liu <sdl.web@gmail.com>
6040
6041 * fringe.c: Fix typo in comments.
6042
6043 2012-07-14 Leo Liu <sdl.web@gmail.com>
6044
6045 * fringe.c: Add a new bitmap exclamation-mark.
6046
6047 2012-07-14 Eli Zaretskii <eliz@gnu.org>
6048
6049 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
6050
6051 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
6052 (HAVE_MENUS): Don't define, defined by editing config.in with
6053 msdos/sed2v2.inp.
6054 (GMALLOC_INHIBIT_VALLOC): Don't define.
6055 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6056
6057 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
6058
6059 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6060
6061 2012-07-14 Glenn Morris <rgm@gnu.org>
6062
6063 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6064 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6065 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6066
6067 2012-07-13 Glenn Morris <rgm@gnu.org>
6068
6069 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6070
6071 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6072 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6073
6074 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
6075
6076 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6077 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6078 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6079 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6080 where appropriate.
6081 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6082 as boolean expression.
6083 (x_set_window_size): Remove unused variable toolbar.
6084 (ns_get_color_default, ns_mod_to_lisp): Remove.
6085 (ns_mouse_position): Remove unused variables xchar and ychar.
6086 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6087 (ns_set_vertical_scroll_bar): Remove unused variable count.
6088 (ns_delete_terminal): Remove unused variable i.
6089 (ns_term_init): Remove unused variables r, g and b.
6090 (mouseDown): Remove unused variable window.
6091 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6092 (initFrameFromEmacs): Remove unused variable vbextra.
6093 (mouseEntered): Remove unused variables p and dpyinfo.
6094 (mouseExited): Remove unused variables p and r.
6095 (ns_define_frame_cursor, ns_clear_frame_area)
6096 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6097 (menuDown): Assign [sender tag] to variable and cast the variable.
6098
6099 * nsterm.h (menuDown): Add id as type to argument sender.
6100 (ns_display_info_for_name): Add Lisp_Object argument.
6101 (ns_term_init): Add Lisp_Object argument.
6102 (ns_map_event_to_object): Add void argument.
6103 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6104 prototype with arguments and only declare if __OBJC__.
6105 (nxatoms_of_nsselect): Add void argument.
6106 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6107 (ns_alloc_autorelease_pool): Add void argument.
6108 (ns_release_autorelease_pool): Add void* argument.
6109 (ns_get_defaults_value): Add const char* argument.
6110
6111 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6112 (initFromContents): Use SSDATA where appropriate.
6113 (ns_update_menubar): Add braces to ambigous if-else.
6114 (initWithTitle): Put () around assignment in if statement.
6115 (ns_menu_show): Remove unused variables window and keymap.
6116 (update_frame_tool_bar): Remove unused variable selected_p.
6117 (initWithContentRect): Remove unused variable this_cmd_name.
6118
6119 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6120 appropriate.
6121 (setXBMColor): Remove unused variable len.
6122 (setPixmapData): Put () around assignment in loop statement.
6123
6124 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6125 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6126 where appropriate.
6127 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6128 around assignment in loop statement.
6129 (nsfont_open): Remove unused variable i.
6130 (nsfont_open): Remove unused variable len.
6131 (nsfont_draw): Remove unused variable cs.
6132
6133 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6134 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6135 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6136 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6137 (Fns_font_name, Fns_perform_service)
6138 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6139 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6140 (ns_set_name): Remove unused variable view.
6141 (x_set_menu_bar_lines): Remove unused variable olines.
6142 (x_set_tool_bar_lines): Remove unused variable root_window.
6143 (Fns_list_colors): Put () around assignment in while statement.
6144 (Fns_perform_service): Remove unused variable len.
6145 (Fns_display_usable_bounds): Remove unused variable top.
6146 (syms_of_nsfns): Remove unused variable i.
6147
6148 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6149 memcpy (Bug#11907).
6150
6151 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
6152
6153 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6154 and free it with DestroyExceptionInfo (Bug#11558).
6155
6156 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
6157
6158 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6159 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6160 Set here, not in nt/config.nt.
6161
6162 2012-07-13 Eli Zaretskii <eliz@gnu.org>
6163
6164 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6165 cursor overflow into the last glyph on display line when the right
6166 fringe is off. (Bug#11832)
6167
6168 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
6169
6170 * xdisp.c (produce_special_glyphs): Now static.
6171 * dispextern.h (produce_special_glyphs): Remove decl.
6172
6173 2012-07-13 Glenn Morris <rgm@gnu.org>
6174
6175 * s/bsd-common.h, s/cygwin.h: Remove empty files.
6176 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6177
6178 * s/usg5-4-common.h (USG, USG5):
6179 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6180 * s/sol2-6.h (SOLARIS2):
6181 * s/irix6-5.h (IRIX6_5):
6182 * s/hpux10-20.h (USG, USG5, HPUX):
6183 * s/gnu-linux.h (USG, GNU_LINUX):
6184 * s/freebsd.h (BSD_SYSTEM):
6185 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6186 * s/cygwin.h (CYGWIN):
6187 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6188 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6189
6190 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
6191
6192 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6193
6194 2012-07-13 Glenn Morris <rgm@gnu.org>
6195
6196 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6197
6198 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6199
6200 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6201 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6202
6203 2012-07-12 Glenn Morris <rgm@gnu.org>
6204
6205 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6206
6207 * process.c (init_process_emacs): Rename from init_process.
6208 The old name is also the name of a Mach system call.
6209 * lisp.h, emacs.c: Update for this name change.
6210 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6211 longer needed.
6212
6213 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6214
6215 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6216 memmove call that removes glyphs covered by the left truncation
6217 glyph. Improve commentary.
6218 (display_line): Fix display of continuation glyphs on GUI frames
6219 when the right fringe is turned off and variable-size fonts are
6220 used in the window. Move the code that appends a stretch glyph to
6221 produce_special_glyphs, so that it could be used for truncation
6222 and continuation glyphs alike.
6223 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6224 glyph of a suitably computed width, to align the special glyphs at
6225 the window margin. Code moved from display_line. (Bug#11832)
6226
6227 2012-07-12 Glenn Morris <rgm@gnu.org>
6228
6229 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6230
6231 * s/gnu-linux.h, s/hpux10-20.h:
6232 Do not unconditionally define HAVE_XRMSETDATABASE.
6233
6234 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6235
6236 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6237
6238 Fix typos that broke OS X build.
6239 Reported by Randal L. Schwartz in
6240 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6241 * nsterm.m (ns_timeout): Add missing local decl.
6242 (ns_get_color): snprintf -> sprintf, to fix typo.
6243
6244 2012-07-12 Glenn Morris <rgm@gnu.org>
6245
6246 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6247 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6248 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6249 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6250
6251 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6252 Move PTY_OPEN to configure.
6253
6254 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6255 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6256 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6257
6258 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6259
6260 Use empty_unibyte_string where applicable.
6261 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6262 * lread.c (read1): Likewise.
6263 * xsettings.c (syms_of_xsettings): Likewise.
6264
6265 2012-07-12 Glenn Morris <rgm@gnu.org>
6266
6267 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6268 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6269 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6270 * s/hpux10-20.h (RUN_TIME_REMAP):
6271 * s/bsd-common.h (TABDLY): Move to configure.
6272
6273 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6274
6275 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6276
6277 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6278 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6279
6280 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6281
6282 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6283 * s/template.h: Move NARROWPROTO to configure.
6284
6285 2012-07-11 Glenn Morris <rgm@gnu.org>
6286
6287 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6288 unused since 2011-01-17 change to systty.h.
6289
6290 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6291 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6292 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6293
6294 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6295
6296 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6297
6298 2012-07-11 Glenn Morris <rgm@gnu.org>
6299
6300 * s/darwin.h, s/gnu-linux.h, s/template.h:
6301 Move INTERRUPT_INPUT to configure.
6302
6303 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6304
6305 Minor adjustments to interning code.
6306 * lisp.h (intern, intern_c_string): Redefine as static inline
6307 wrappers for intern_1 and intern_c_string_1, respectively.
6308 (intern_1, intern_c_string_1): Rename prototypes.
6309 * lread.c (intern_1, intern_c_string_1, oblookup):
6310 Simplify Vobarray checking.
6311 * font.c (font_intern_prop): Likewise. Adjust comment.
6312 * w32font.c (intern_font_name): Likewise.
6313
6314 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6315
6316 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6317
6318 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6319 of Fcar/Fcdr if possible.
6320 * font.c (check_otf_features): Likewise.
6321 * fontset.c (Fnew_fontset): Likewise.
6322 * gnutls.c (Fgnutls_boot): Likewise.
6323 * minibuf.c (read_minibuf): Likewise.
6324 * msdos.c (IT_set_frame_parameters): Likewise.
6325 * xmenu.c (Fx_popup_dialog): Likewise.
6326 * w32menu.c (Fx_popup_dialog): Likewise.
6327
6328 2012-07-11 Glenn Morris <rgm@gnu.org>
6329
6330 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6331 since nothing has defined it on these platforms.
6332
6333 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6334 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6335
6336 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6337 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6338 Move CLASH_DETECTION to configure.
6339
6340 * s/gnu.h: Remove file, which is now empty.
6341
6342 * s/gnu.h, s/gnu-linux.h:
6343 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6344
6345 2012-07-11 John Wiegley <johnw@newartisans.com>
6346
6347 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6348 function attribute, so we only use it if it exists in the
6349 compiler.
6350
6351 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6352
6353 Avoid call to strlen in fast_c_string_match_ignore_case.
6354 * search.c (fast_c_string_match_ignore_case): Change to use
6355 length argument. Adjust users accordingly.
6356 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6357
6358 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6359
6360 Assume mkdir, rmdir.
6361 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6362 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6363
6364 Assume rename.
6365 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6366
6367 Assume perror.
6368 * s/hpux10-20.h (HAVE_PERROR): Remove.
6369 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6370 Remove dummy definition, as this problem was obsolete long ago.
6371
6372 Assume strerror.
6373 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6374
6375 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6376
6377 Avoid calls to strlen in font processing functions.
6378 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6379 (font_open_by_name): Change to use length argument.
6380 Adjust users accordingly.
6381 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6382 Adjust prototypes.
6383 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6384 Change to return ptrdiff_t.
6385 (xfont_list_pattern, xfont_match): Use length returned by
6386 xfont_decode_coding_xlfd.
6387 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6388
6389 2012-07-11 Glenn Morris <rgm@gnu.org>
6390
6391 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6392 Move DONT_REOPEN_PTY to configure.
6393
6394 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6395 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6396
6397 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6398
6399 Remove "#define unix" that is no longer needed (Bug#11905).
6400 * s/aix4-2.h (unix): Remove; no longer needed.
6401
6402 EMACS_TIME simplification (Bug#11875).
6403 This replaces macros (which typically do not work in GDB)
6404 with functions, typedefs and enums, making the code easier to debug.
6405 The functional style also makes code easier to read and maintain.
6406 * systime.h: Include <sys/time.h> on all hosts, not just if
6407 WINDOWSNT, since 'struct timeval' is needed in general.
6408 (EMACS_TIME): Now a typedef, not a macro.
6409 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6410 not macros.
6411 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6412 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6413 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6414 (EMACS_TIME_LE): Now functions, not macros.
6415 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6416 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6417 which are not functions. All uses rewritten to use:
6418 (make_emacs_time): New function.
6419 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6420 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6421 not functions. All uses rewritten to use the following, respectively:
6422 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6423 (add_emacs_time, sub_emacs_time): New functions.
6424 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6425 * fileio.c (Fcopy_file):
6426 * xterm.c (XTflash): Get the current time closer to when it's used.
6427 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6428
6429 * bytecode.c (targets): Suppress -Woverride-init warnings.
6430
6431 Simplify by avoiding confusing use of strncpy etc.
6432 * doc.c (Fsnarf_documentation):
6433 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6434 * frame.c (Fmake_terminal_frame):
6435 * gtkutil.c (get_utf8_string):
6436 * lread.c (openp):
6437 * nsmenu.m (ns_update_menubar):
6438 * regex.c (regerror):
6439 Prefer memcpy to strncpy and strncat when either will do.
6440 * fileio.c (Fsubstitute_in_file_name):
6441 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6442 (menu_separator_name_p):
6443 * nsmenu.m (ns_update_menubar):
6444 Prefer memcmp to strncmp when either will do.
6445 * nsterm.m: Include <ftoastr.h>.
6446 (ns_get_color):
6447 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6448 Prefer snprintf to strncpy.
6449 * nsterm.m (ns_term_init):
6450 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6451 * nsterm.m (ns_term_init):
6452 Avoid the need for strncpy, by using build_string or
6453 make_unibyte_string directly. Use dtoastr, not snprintf.
6454 * process.c (Fmake_network_process): Diagnose service names that
6455 are too long, rather than silently truncating them or creating
6456 non-null-terminated names.
6457 (Fnetwork_interface_info): Likewise, for interface names.
6458 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6459 Prefer sprintf to strncat.
6460 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6461 Prefer vsnprintf to vsprintf + strncpy.
6462
6463 2012-07-10 Glenn Morris <rgm@gnu.org>
6464
6465 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6466 Clarify fallback case.
6467
6468 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6469
6470 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6471 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6472 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6473 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6474 where argument type is known to be a Lisp_Cons.
6475
6476 2012-07-10 Tom Tromey <tromey@redhat.com>
6477
6478 * bytecode.c (BYTE_CODE_THREADED): New macro.
6479 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6480 (enum byte_code_op): New type.
6481 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6482 (exec_byte_code): Use them. Use token threading when applicable.
6483
6484 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6485
6486 Optimize pure C strings initialization.
6487 * lisp.h (make_pure_string): Fix prototype.
6488 (build_pure_c_string): New function, defined as static inline. This
6489 provides a better opportunity to optimize away calls to strlen when
6490 the function is called with compile-time constant argument.
6491 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6492 argument, adjust users accordingly. Use build_pure_c_string where
6493 appropriate.
6494 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6495 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6496 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6497
6498 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6499
6500 Avoid calls to strlen in miscellaneous functions.
6501 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6502 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6503 * lread.c (openp): Likewise.
6504
6505 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6506
6507 Avoid calls to strlen in path processing functions.
6508 * fileio.c (file_name_as_directory): Add comment. Change to add
6509 srclen argument and return the length of result. Adjust users
6510 accordingly.
6511 (directory_file_name): Fix comment. Change to add srclen argument,
6512 swap 1st and 2nd arguments to obey the common convention.
6513 Adjust users accordingly.
6514 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6515
6516 2012-07-10 Glenn Morris <rgm@gnu.org>
6517
6518 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6519 Move PENDING_OUTPUT_COUNT definition to configure.
6520
6521 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6522 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6523 * s/gnu.h (DATA_START): Move definitions to configure.
6524
6525 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6526 We include usg5-4-common.h, which defines them both.
6527
6528 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6529 O_RDONLY already includes it).
6530
6531 Stop ns builds setting the EMACSLOADPATH environment variable.
6532 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6533 Now it does not set EMACSLOADPATH, just returns the load-path string.
6534 * nsterm.h: Update accordingly.
6535 * lread.c [HAVE_NS]: Include nsterm.h.
6536 (init_lread) [HAVE_NS]: Use ns_load_path.
6537 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6538
6539 2012-07-09 Glenn Morris <rgm@gnu.org>
6540
6541 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6542 since the included bsd-common.h does so.
6543
6544 Stop ns builds setting the EMACSPATH environment variable.
6545 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6546 (ns_init_paths): Do not set EMACSPATH.
6547 * nsterm.h (ns_exec_path): Add it.
6548 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6549 Use ns_exec_path.
6550
6551 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6552
6553 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6554
6555 * process.c (wait_reading_process_output): 'waitchannels' was unset
6556 when read_kbd || !NILP (wait_for_cell); fix this.
6557
6558 Add GCC-style 'const' attribute to functions that can use it.
6559 * character.h (char_resolve_modifier_mask):
6560 * keyboard.h (make_ctrl_char):
6561 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6562 (init_character_once, next_almost_prime, init_fns, init_image)
6563 (flush_pending_output, init_sound):
6564 * mem-limits.h (start_of_data):
6565 * menu.h (finish_menu_items):
6566 Add ATTRIBUTE_CONST.
6567 * emacs.c (DEFINE_DUMMY_FUNCTION):
6568 Declare the dummy function with ATTRIBUTE_CONST.
6569 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6570 Add decls with ATTRIBUTE_CONST.
6571
6572 Minor improvements to make_formatted_string.
6573 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6574 where int is good enough, as vsprintf returns an int.
6575 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6576
6577 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6578
6579 Use make_formatted_string to avoid double length calculation.
6580 * lisp.h (make_formatted_string): New prototype.
6581 * alloc.c (make_formatted_string): New function.
6582 * buffer.c (Fgenerate_new_buffer_name): Use it.
6583 * dbusbind.c (syms_of_dbusbind): Likewise.
6584 * editfns.c (Fcurrent_time_zone): Likewise.
6585 * filelock.c (get_boot_time): Likewise.
6586 * frame.c (make_terminal_frame, set_term_frame_name)
6587 (x_report_frame_params): Likewise.
6588 * image.c (gs_load): Likewise.
6589 * minibuf.c (get_minibuffer): Likewise.
6590 * msdos.c (dos_set_window_size): Likewise.
6591 * process.c (make_process): Likewise.
6592 * xdisp.c (ensure_echo_area_buffers): Likewise.
6593 * xsettings.c (apply_xft_settings): Likewise.
6594
6595 2012-07-09 Glenn Morris <rgm@gnu.org>
6596
6597 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6598 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6599 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6600 * nsterm.h (ns_etc_directory): Add it.
6601 * callproc.c [HAVE_NS]: Include nsterm.h.
6602 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6603
6604 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6605
6606 Move marker debugging code under MARKER_DEBUG.
6607 * marker.c (MARKER_DEBUG): Move marker debugging code under
6608 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6609 for bootstrap with --enable-checking (~3x slowdown reported
6610 by Juanma Barranquero <lekktu@gmail.com>).
6611 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6612
6613 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6614
6615 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6616 See <http://bugs.gnu.org/11825#29>.
6617
6618 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6619
6620 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6621 has no font, use the frame's font. (Bug#11813)
6622 (display_line): Add commentary about displaying truncation glyphs
6623 on GUI frames.
6624 (produce_special_glyphs): Move here from term.c.
6625
6626 * term.c (produce_special_glyphs): Move to xdisp.c.
6627
6628 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6629 section.
6630
6631 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6632
6633 * xdisp.c (display_line): Avoid warning about implicit declaration
6634 of FRAME_FONT.
6635
6636 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6637
6638 * lisp.h: Remove empty conditional.
6639
6640 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6641
6642 * lread.c (load_path_check): Now static.
6643
6644 Fix some minor --with-ns problems found by static checking.
6645 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6646 (x_set_font) [!HAVE_X_WINDOWS]:
6647 * image.c (xpm_load_image) [HAVE_NS]:
6648 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6649 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6650 Remove unused local.
6651 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6652 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6653 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6654 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6655 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6656 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6657 Fix pointer signedness problem.
6658 * xfaces.c (FRAME_X_FONT_TABLE):
6659 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6660
6661 2012-07-07 Glenn Morris <rgm@gnu.org>
6662
6663 * lread.c (load_path_check): New function, split from init_lread.
6664 (init_lread): Reorganize. Motivation:
6665 If EMACSLOADPATH is set, check/warn about that rather than the
6666 defaults, which we are not going to use. Hence we can remove
6667 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6668 Don't warn if site-lisp directories are missing.
6669 If not installed, start from a blank load-path, since
6670 PATH_LOADSEARCH refers to the eventual installation directories.
6671
6672 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6673
6674 Support truncation and continuation glyphs on GUI frames, when
6675 fringes are disabled. (Bug#11832)
6676 * xdisp.c (init_iterator): Get dimensions of truncation and
6677 continuation glyphs even if on GUI frames.
6678 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6679 or both, are absent.
6680 (start_display, move_it_in_display_line_to): Handle the case of a
6681 GUI frame without a fringe to display continuation or truncation
6682 glyphs.
6683 (insert_left_trunc_glyphs): Support GUI frames: make sure
6684 truncation glyphs overwrite enough glyphs from the current line to
6685 have sufficient space in pixels.
6686 (display_line): Support truncation and continuation glyphs on GUI
6687 frames. If some spare pixels are left on the line after inserting
6688 the truncation glyphs, fill that space with a stretch glyph of a
6689 suitably computed width.
6690
6691 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6692 produce_glyphs, to support GUI sessions.
6693
6694 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6695
6696 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6697
6698 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6699
6700 Do not require float-time's arg to fit in time_t (Bug#11825).
6701 This works better on hosts where time_t is unsigned, and where
6702 float-time is applied to the (negative) difference between two times.
6703 * editfns.c (decode_time_components): Last arg is now double *,
6704 not int *, and means to store all the result as a double, without
6705 worrying about whether the seconds part fits in time_t.
6706 All callers changed.
6707 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6708 All callers changed.
6709 (Ffloat_time): Do not fail merely because the specified time falls
6710 outside of time_t range.
6711
6712 2012-07-07 Glenn Morris <rgm@gnu.org>
6713
6714 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6715 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6716 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6717
6718 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6719
6720 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6721 Update dependencies.
6722
6723 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6724
6725 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6726
6727 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6728 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6729 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6730 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6731 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6732 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6733
6734 * xfont.c (compare_font_names): Redo to omit the need for casts.
6735
6736 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6737
6738 * xfns.c (Fx_change_window_property): Doc fix.
6739 * w32fns.c (Fx_change_window_property): Doc fix.
6740
6741 * w32fns.c (Fx_window_property): Accept the same arguments as the
6742 X Windows version. Doc fix.
6743 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6744
6745 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6746 Eli Zaretskii <eliz@gnu.org>
6747
6748 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6749 Windows-specific code from nt/config.nt moved here.
6750 Obsolete settings removed.
6751
6752 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6753
6754 * process.c: Avoid unnecessary calls to gettime.
6755 (wait_reading_process_output): Don't get the time of day
6756 when gobbling data immediately and not waiting, as there's no need
6757 for it in that case. This removes a FIXME.
6758
6759 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6760
6761 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6762 is defined (Bug#11768).
6763
6764 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6765
6766 Fix marker debugging code.
6767 * marker.c (byte_char_debug_check): Do not perform the check
6768 if buffer is not multibyte.
6769 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6770 Call byte_char_debug_check with correct arguments.
6771
6772 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6773
6774 Compile marker debugging code only if ENABLE_CHECKING is defined.
6775 * marker.c (byte_char_debug_check, count_markers):
6776 Use only if ENABLE_CHECKING is defined.
6777 (byte_debug_flag): Remove.
6778 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6779 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6780
6781 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6782
6783 Avoid code repetition in marker-related functions.
6784 * marker.c (attach_marker): New function.
6785 (Fset_marker, set_marker_restricted, set_marker_both)
6786 (set_marker_restricted_both): Use it.
6787 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6788 Consistently rename charno to charpos.
6789 (marker_position): Add eassert.
6790 (marker_byte_position): Convert to eassert.
6791
6792 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6793
6794 Simplify list operations in unchain_overlay and unchain_marker.
6795 * buffer.c (unchain_overlay): Simplify. Add comment.
6796 * marker.c (unchain_marker): Simplify. Fix comments.
6797
6798 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6799
6800 Introduce fast path for the widely used marker operation.
6801 * alloc.c (build_marker): New function.
6802 * lisp.h (build_marker): New prototype.
6803 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6804 * composite.c (autocmp_chars): Likewise.
6805 * editfns.c (buildmark): Remove.
6806 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6807 (save_restriction_save): Use build_marker.
6808 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6809 * window.c (save_window_save): Likewise.
6810
6811 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6812
6813 Do not use Fdelete_overlay in delete_all_overlays
6814 to avoid redundant calls to unchain_overlay.
6815 * buffer.c (drop_overlay): New function.
6816 (delete_all_overlays, Fdelete_overlay): Use it.
6817 * minibuf.c (get_minibuffer): Fix comment.
6818
6819 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6820
6821 Port to OpenBSD 5.1 amd64.
6822 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6823 This is needed for OpenBSD, and should be harmless on all BSD systems.
6824 Also, include <sys/sysctl.h>, as it should be available on all
6825 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6826 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6827 use p_pid member, not kp_proc.pid.
6828
6829 2012-07-06 Glenn Morris <rgm@gnu.org>
6830
6831 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6832
6833 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6834
6835 More xmalloc and related cleanup.
6836 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6837 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6838 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6839 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6840 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6841 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6842 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6843 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6844 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6845 * xterm.c:
6846 Omit needless casts involving void * pointers and allocation.
6847 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6848 as the former is more robust if P's type is changed.
6849 Prefer xzalloc to xmalloc + memset 0.
6850 Simplify malloc-or-realloc to realloc.
6851 Don't worry about xmalloc returning a null pointer.
6852 Prefer xstrdup to xmalloc + strcpy.
6853 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6854 growing it.
6855 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6856 alloca of a constant.
6857
6858 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6859
6860 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6861 hscroll is larger than the line width. Fixes long and futile
6862 looping inside extend_face_to_end_of_line (on a TTY) producing
6863 glyphs that are not needed and thrown away.
6864
6865 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6866
6867 * marker.c (set_marker_restricted_both): Simplify by using
6868 clip_to_bounds.
6869
6870 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6871
6872 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6873
6874 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6875
6876 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6877 not defined (Bug#11768).
6878 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6879 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6880 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6881 followed by gtk_box_set_homogeneous (Bug#11768).
6882 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6883 (update_theme_scrollbar_width, xg_create_scroll_bar):
6884 Use gtk_scrollbar_new (Bug#11768).
6885 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6886 (is_box_type): New function (Bug#11768).
6887 (xg_tool_item_stale_p): Call is_box_type.
6888 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6889 with default display (Bug#11768).
6890
6891 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6892
6893 * xdisp.c (window_hscroll_limited): New function.
6894 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6895 coordinates when window's hscroll is set to insanely large
6896 values. (Bug#11857)
6897
6898 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6899
6900 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6901 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6902
6903 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6904
6905 Cleanup xmalloc.
6906 * lisp.h (xzalloc): New prototype. Omit needless casts.
6907 * alloc.c (xzalloc): New function. Omit needless casts.
6908 * charset.c: Omit needless casts. Convert all calls to
6909 xmalloc with following memset to xzalloc.
6910 * dispnew.c: Likewise.
6911 * fringe.c: Likewise.
6912 * image.c: Likewise.
6913 * sound.c: Likewise.
6914 * term.c: Likewise.
6915 * w32fns.c: Likewise.
6916 * w32font.c: Likewise.
6917 * w32term.c: Likewise.
6918 * xfaces.c: Likewise.
6919 * xfns.c: Likewise.
6920 * xterm.c: Likewise.
6921 * atimer.c: Omit needless casts.
6922 * buffer.c: Likewise.
6923 * callproc.c: Likewise.
6924 * ccl.c: Likewise.
6925 * coding.c: Likewise.
6926 * composite.c: Likewise.
6927 * doc.c: Likewise.
6928 * doprnt.c: Likewise.
6929 * editfns.c: Likewise.
6930 * emacs.c: Likewise.
6931 * eval.c: Likewise.
6932 * filelock.c: Likewise.
6933 * fns.c: Likewise.
6934 * gtkutil.c: Likewise.
6935 * keyboard.c: Likewise.
6936 * lisp.h: Likewise.
6937 * lread.c: Likewise.
6938 * minibuf.c: Likewise.
6939 * msdos.c: Likewise.
6940 * print.c: Likewise.
6941 * process.c: Likewise.
6942 * region-cache.c: Likewise.
6943 * search.c: Likewise.
6944 * sysdep.c: Likewise.
6945 * termcap.c: Likewise.
6946 * terminal.c: Likewise.
6947 * tparam.c: Likewise.
6948 * w16select.c: Likewise.
6949 * w32.c: Likewise.
6950 * w32reg.c: Likewise.
6951 * w32select.c: Likewise.
6952 * w32uniscribe.c: Likewise.
6953 * widget.c: Likewise.
6954 * xdisp.c: Likewise.
6955 * xmenu.c: Likewise.
6956 * xrdb.c: Likewise.
6957 * xselect.c: Likewise.
6958
6959 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6960
6961 * fileio.c (time_error_value): Check the right error number.
6962 Problem reported by Troels Nielsen in
6963 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6964
6965 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6966
6967 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6968 This should be fixed in a better way; see Eli Zaretskii in
6969 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6970 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6971
6972 * fileio.c (time_error_value): Rename from special_mtime.
6973 The old name's problems were noted by Eli Zaretskii in
6974 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6975
6976 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6977 This variable's comment says Emacs needs at least one GDB-visible
6978 symbol of type enum pvec_type, to work around GDB problems.
6979 The symbol's value doesn't matter.
6980
6981 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6982 that causes compilation to fail on pre-C99 compilers.
6983
6984 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6985
6986 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6987 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6988
6989 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6990
6991 * buffer.c (init_buffer_once): Fix initialization of
6992 headers for buffer_defaults and buffer_local_symbols.
6993 Reported by Juanma Barranquero <lekktu@gmail.com>.
6994
6995 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6996
6997 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6998 * lisp.h (enum pvec_type): Use fewer bits.
6999 (PSEUDOVECTOR_SIZE_BITS): New constant.
7000 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
7001 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
7002 change in pvec_type.
7003 (PSEUDOVECTOR_TYPEP): New macro.
7004 (TYPED_PSEUDOVECTORP): Use it.
7005 * fns.c (internal_equal): Adapt code to extract pvectype.
7006 * emacs.c (gdb_pvec_type): Update type.
7007 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
7008 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
7009 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
7010 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
7011 (sweep_vectors): Use it. Use local var `total_bytes' instead of
7012 abusing vector->header.next.nbytes.
7013 (live_vector_p): Use PVEC_TYPE.
7014 (mark_object): Adapt code to extract pvectype. Use switch.
7015
7016 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7017
7018 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
7019 Tighten new eassert a bit.
7020
7021 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7022
7023 Fix compilation with --enable-gcc-warnings and -O1
7024 optimization level.
7025 * doprnt.c (doprnt): Change type of tem to int, initialize
7026 to avoid compiler warning. Add eassert.
7027 * search.c (simple_search): Initialize match_byte to avoid
7028 compiler warning. Add eassert.
7029
7030 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7031
7032 Avoid weird behavior with large horizontal scrolls.
7033 Without this change, for example, large hscroll values would
7034 mess up Emacs's display on Fedora 15 x86, presumably due to
7035 overflows in int calculations in the display code.
7036 Also, if buffers had long lines, Emacs would freeze.
7037 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
7038 (set_window_hscroll): New function, containing the old guts of
7039 Fset_window_hscroll. Return the clipped value.
7040 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
7041 This avoids the need to check against PTRDIFF_MAX.
7042
7043 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
7044
7045 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7046
7047 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
7048
7049 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7050
7051 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
7052 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
7053 since GCC 4.4.6 issues a bogus warning for them.
7054
7055 Fix bugs in file timestamp newness comparisons.
7056 * fileio.c (Ffile_newer_than_file_p):
7057 * lread.c (Fload): Use full timestamp resolution of files,
7058 not just the 1-second resolution, so that files that are only
7059 slightly newer still count as newer.
7060 * fileio.c (Ffile_newer_than_file_p): Don't assume file
7061 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7062
7063 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
7064
7065 * fileio.c: Improve handling of file time marker. (Bug#11852)
7066 (special_mtime): New function.
7067 (Finsert_file_contents, Fverify_visited_file_modtime):
7068 Use it to set special mtime values consistently.
7069
7070 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
7071
7072 * fileio.c (Finsert_file_contents): Properly handle st_mtime
7073 marker for non-existing file. (Bug#11852)
7074
7075 2012-07-03 Glenn Morris <rgm@gnu.org>
7076
7077 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7078 and did not make it into globals.h).
7079
7080 2012-07-03 Tom Tromey <tromey@redhat.com>
7081
7082 * window.c (Fset_window_margins, Fset_window_fringes)
7083 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7084 * textprop.c (Fprevious_property_change): No longer static.
7085 * syntax.c (Fsyntax_table_p): No longer static.
7086 * process.c (Fget_process, Fprocess_datagram_address): No longer
7087 static.
7088 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7089 * keyboard.c (Fcommand_execute): No longer static.
7090 Remove EXFUN.
7091 * insdel.c (Fcombine_after_change_execute): No longer static.
7092 * image.c (Finit_image_library): No longer static.
7093 * fileio.c (Fmake_symbolic_link): No longer static.
7094 * eval.c (Ffetch_bytecode): No longer static.
7095 * editfns.c (Fuser_full_name): No longer static.
7096 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7097 No longer static.
7098 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7099 static.
7100 * dired.c (Ffile_attributes): No longer static.
7101 * composite.c (Fcomposition_get_gstring): No longer static.
7102 * callproc.c (Fgetenv_internal): No longer static.
7103
7104 * ccl.h: Remove EXFUNs.
7105 * buffer.h: Remove EXFUNs.
7106 * dispextern.h: Remove EXFUNs.
7107 * intervals.h: Remove EXFUNs.
7108 * fontset.h: Remove EXFUN.
7109 * font.h: Remove EXFUNs.
7110 * dosfns.c (system_process_attributes): Remove EXFUN.
7111 * keymap.h: Remove EXFUNs.
7112 * lisp.h: Remove EXFUNs.
7113 * w32term.h: Remove EXFUNs.
7114 * window.h: Remove EXFUNs.
7115 * xsettings.h: Remove EXFUN.
7116 * xterm.h: Remove EXFUN.
7117
7118 2012-07-03 Glenn Morris <rgm@gnu.org>
7119
7120 * lisp.h (Frandom): Make it visible to C.
7121 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7122 buffer for invisible buffers. (Bug#1229)
7123
7124 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7125
7126 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7127 values which aren't power of 2.
7128 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7129 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
7130 accordingly.
7131
7132 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7133
7134 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7135
7136 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7137
7138 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7139
7140 * alloc.c (allocate_vector_block): Remove redundant
7141 calls to mallopt if DOUG_LEA_MALLOC is defined.
7142 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7143 avoid calls to mallopt if zero_vector is returned.
7144
7145 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7146
7147 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7148 is enabled, avoid dereferencing NULL current_sblock if
7149 running undumped.
7150
7151 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7152
7153 Cleanup basic buffer management.
7154 * buffer.h (struct buffer): Change layout to use generic vector
7155 marking code. Fix some comments. Change type of 'clip_changed'
7156 to bitfield. Remove unused #ifndef old.
7157 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7158 (GET_OVERLAYS_AT): Fix indentation.
7159 (for_each_per_buffer_object_at): New macro.
7160 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7161 (Fbuffer_local_variables): Use it.
7162 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7163 * alloc.c (allocate_buffer): Adjust to match new layout of
7164 struct buffer. Fix comment.
7165 (mark_overlay): New function.
7166 (mark_buffer): Use it. Use mark_vectorlike to mark normal
7167 Lisp area of struct buffer.
7168 (mark_object): Use it. Adjust marking of misc objects
7169 and related comments.
7170
7171 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
7172
7173 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7174 wrapper that is not needed because the wrapped code is a no-op (zero
7175 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7176 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7177
7178 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
7179
7180 * alloc.c (mark_buffer): Simplify. Remove prototype.
7181 (mark_object): Add comment. Reorganize marking of vector-like
7182 objects. Use CHECK_LIVE for all vector-like objects except buffers
7183 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7184 Avoid redundant calls to mark_vectorlike for bool vectors.
7185
7186 2012-06-30 Glenn Morris <rgm@gnu.org>
7187
7188 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7189
7190 * epaths.in (PATH_SITELOADSEARCH): New.
7191 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7192 This is rather than relying on --enable-locallisppath elements
7193 having "site-lisp" in their names. (Bug#10208#25, 11658)
7194
7195 2012-06-30 Eli Zaretskii <eliz@gnu.org>
7196
7197 * w32proc.c (sys_select): Accept and ignore one more argument.
7198
7199 * w32.c (emacs_gnutls_pull): Call select with one more argument.
7200
7201 * sysselect.h [DOS_NT]: Don't include sys/select.h.
7202 (pselect) [!MS_DOS]: Redirect to sys_select.
7203
7204 * sysdep.c: Don't include dos.h and dosfns.h.
7205
7206 * process.c (sys_select):
7207 * msdos.c (sys_select): Accept one more argument and ignore it.
7208
7209 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7210 adapt data types and code to that.
7211
7212 * dosfns.c:
7213 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7214 which clashes with the gnulib function of the same name.
7215
7216 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7217
7218 * font.c (font_style_to_value, font_style_symbolic)
7219 (font_prop_validate_style): Add type checks for values in
7220 font_style_table.
7221
7222 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7223 argument.
7224 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7225 uses.
7226
7227 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7228
7229 * xdisp.c (try_window_id): Undo last change.
7230
7231 * w32.c (getwd): Adjust commentary about startup_dir.
7232 (init_environment): Always call sys_access, even in non-MSVC
7233 builds. Don't chdir to the directory of the Emacs executable.
7234 This undoes code from 1997 which was justified by the need to
7235 "avoid conflicts when removing and renaming directories". But its
7236 downside was that every relative file name was being interpreted
7237 relative to the directory of the Emacs executable, which can never
7238 be TRT. In particular, it broke sys_access when called with
7239 relative file names.
7240 (sys_access): Map GetLastError to errno.
7241
7242 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7243
7244 * window.h (struct window): Change type of 'fringes_outside_margins'
7245 to bitfield. Fix comment. Adjust users accordingly.
7246 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7247 Adjust comment.
7248 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7249 to ptrdiff_t.
7250
7251 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
7252
7253 * gnutls.c (emacs_gnutls_handshake):
7254 Add QUIT to make the loop interruptible.
7255
7256 2012-06-29 Glenn Morris <rgm@gnu.org>
7257
7258 * charset.c (init_charset): Make lack of etc/charsets fatal.
7259
7260 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7261
7262 * editfns.c (region_limit): Fix type mismatch.
7263
7264 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7265
7266 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7267 undefined. Convert from xassert to eassert.
7268 * nsmenu.m: Convert from xassert to eassert.
7269 * nsterm.m: Likewise.
7270
7271 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7272
7273 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7274
7275 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7276
7277 Avoid integer overflow on scroll-left and scroll-right.
7278 * window.c (HSCROLL_MAX): New macro.
7279 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7280 overflow when requested scroll falls outside ptrdiff_t range.
7281
7282 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7283
7284 * window.h (struct window): Change type of 'hscroll',
7285 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7286 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7287 Adjust users accordingly.
7288 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7289 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7290 from EMACS_INT to ptrdiff_t.
7291 (make_window): Omit redundant initialization.
7292
7293 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
7294
7295 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7296
7297 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7298
7299 * window.h (struct window): Change type of 'use_time' and
7300 'sequence_number' from Lisp_Object to int.
7301 * frame.c (make_frame): Adjust users accordingly.
7302 * print.c (print_object): Likewise.
7303 * window.c (select_window, Fwindow_use_time, make_parent_window)
7304 (make_window): Likewise.
7305
7306 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7307
7308 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7309 enabled with --enable-checking=[all,glyphs] configure option.
7310 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7311 adjust comments accordingly.
7312 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7313 undefined, adjust comments accordingly.
7314 * image.c: Likewise.
7315 * scroll.c: Likewise.
7316 * w32fns.c: Likewise.
7317 * w32term.c: Likewise.
7318 * xdisp.c: Likewise.
7319 * xfaces.c: Likewise.
7320 * xfns.c: Likewise.
7321 * xterm.c: Likewise.
7322
7323 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7324
7325 Generalize run-time debugging checks.
7326 * dispextern.h (XASSERTS): Remove.
7327 * fontset.c (xassert): Remove.
7328 Convert from xassert to eassert.
7329 * alloc.c: Convert from xassert to eassert.
7330 * bidi.c: Likewise.
7331 * dispnew.c: Likewise.
7332 * fns.c: Likewise.
7333 * fringe.c: Likewise.
7334 * ftfont.c: Likewise.
7335 * gtkutil.c: Likewise.
7336 * image.c: Likewise.
7337 * keyboard.c: Likewise.
7338 * menu.c: Likewise.
7339 * process.c: Likewise.
7340 * scroll.c: Likewise.
7341 * sound.c: Likewise.
7342 * term.c: Likewise.
7343 * w32console.c: Likewise.
7344 * w32fns.c: Likewise.
7345 * w32term.c: Likewise.
7346 * window.c: Likewise.
7347 * xdisp.c: Likewise.
7348 * xfaces.c: Likewise.
7349 * xfns.c: Likewise.
7350 * xselect.c: Likewise.
7351 * xterm.c: Likewise.
7352
7353 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7354
7355 * fns.c (maybe_resize_hash_table): Output message when growing the
7356 purify-hashtable.
7357
7358 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7359
7360 * alloc.c (allocate_string_data): Remove dead code.
7361 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7362 avoid GCC warning about unused macro.
7363
7364 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7365
7366 * alloc.c (allocate_string): Omit intervals initialization.
7367 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7368 as in make_pure_string and make_pure_c_string.
7369
7370 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7371
7372 * alloc.c (allocate_string): Fix last change.
7373
7374 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7375
7376 * alloc.c (allocate_string): Remove two redundant calls
7377 to memset, add explicit initialization where appropriate.
7378
7379 2012-06-27 Glenn Morris <rgm@gnu.org>
7380
7381 * lisp.mk (lisp): Remove paths.elc.
7382
7383 2012-06-27 Chong Yidong <cyd@gnu.org>
7384
7385 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7386
7387 2012-06-26 John Wiegley <johnw@newartisans.com>
7388
7389 * unexmacosx.c (copy_data_segment): Add two section names used
7390 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7391
7392 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7393 when building with Clang.
7394
7395 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7396
7397 * eval.c (Fapply): Allow calling it with a single argument.
7398
7399 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7400
7401 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7402 _stricmp and _strnicmp.
7403 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7404
7405 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7406
7407 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7408 allocated window.
7409 (allocate_process): Likewise for new process.
7410 (allocate_terminal): Change to use offsetof.
7411 (allocate_frame): Likewise.
7412 * frame.c (make_frame): Omit redundant initialization.
7413 * window.c (make_parent_window): Use memset.
7414 (make_window): Omit redundant initialization.
7415 * process.c (make_process): Omit redundant initialization.
7416 * terminal.c (create_terminal): Likewise.
7417
7418 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7419
7420 * term.c (delete_tty): Remove redundant call to memset.
7421
7422 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7423
7424 * alloc.c: Remove build_string.
7425 * lisp.h: Define build_string as static inline. This provides
7426 a better opportunity to optimize away calls to strlen when the
7427 function is called with compile-time constant argument.
7428 * image.c (imagemagick_error): Convert to build_string.
7429 * w32proc.c (sys_spawnve): Likewise.
7430 * xterm.c (x_term_init): Likewise.
7431
7432 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7433
7434 Use sprintf return value instead of invoking strlen on result.
7435 In the old days this wasn't portable, since some sprintf
7436 implementations returned char *. But they died out years ago and
7437 Emacs already assumes sprintf returns int.
7438 Similarly for float_to_string.
7439 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7440 * ccl.c (ccl_driver):
7441 * character.c (string_escape_byte8):
7442 * data.c (Fnumber_to_string):
7443 * doprnt.c (doprnt):
7444 * print.c (print_object):
7445 * xdisp.c (message_dolog):
7446 * xfns.c (syms_of_xfns):
7447 Use sprintf or float_to_string result to avoid need to call strlen.
7448 * data.c (Fnumber_to_string):
7449 Use make_unibyte_string, since the string must be ASCII.
7450 * lisp.h, print.c (float_to_string): Now returns int length.
7451 * term.c (produce_glyphless_glyph):
7452 Use sprintf result rather than recomputing it.
7453
7454 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7455 * Makefile.in (ALL_CFLAGS):
7456 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7457 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7458
7459 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7460
7461 * dispextern.h (xstrcasecmp): Define to library function
7462 strcasecmp if available.
7463 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7464
7465 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7466
7467 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7468 Avoid comma operator.
7469 * menu.c (push_submenu_start, push_submenu_end)
7470 (push_left_right_boundary, push_menu_pane): Likewise.
7471 * msdos.c (dos_rawgetc): Likewise.
7472
7473 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7474
7475 * xfns.c (xic_create_fontsetname): Remove redundant calls
7476 to memset.
7477
7478 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7479
7480 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7481 sprintf already null-terminates its output.
7482
7483 * xfns.c (x_window): Remove redundant cast.
7484
7485 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7486
7487 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7488 `const char *' to `char *' to avoid compiler warning.
7489
7490 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7491
7492 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7493 instead of truncating it to 63 (admittedly a generous limit).
7494
7495 * process.c: Fix spelling and caps in comments.
7496
7497 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7498
7499 * emacs.c (setpgrp): Remove definition, unused.
7500 * sysdep.c (setpgrp): Remove definition, not used in this file.
7501
7502 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7503
7504 * makefile.w32-in: Update dependencies.
7505
7506 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7507
7508 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7509 (SYSTIME_H): Add nt/inc/sys/time.h.
7510
7511 * systime.h [WINDOWSNT]: Include sys/time.h.
7512
7513 * s/ms-w32.h (struct timespec): Definition moved from
7514 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7515
7516 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7517
7518 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7519 * buffer.h (buffer_slot_type_mismatch):
7520 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7521 * eval.c (unwind_to_catch):
7522 * image.c (my_png_error, my_error_exit):
7523 * keyboard.c (quit_throw_to_read_char, user_error)
7524 (Fexit_recursive_edit, Fabort_recursive_edit):
7525 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7526 (wrong_type_argument, buffer_overflow, __executable_start)
7527 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7528 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7529 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7530 (fatal):
7531 (child_setup) [!DOS_NT]:
7532 * lread.c (end_of_file_error, invalid_syntax):
7533 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7534 * puresize.h (pure_write_error):
7535 * search.c (matcher_overflow):
7536 * sound.c (sound_perror, alsa_sound_perror):
7537 * sysdep.c, syssignal.h (croak):
7538 * term.c (maybe_fatal, vfatal):
7539 * textprop.c (text_read_only):
7540 * undo.c (user_error):
7541 * unexmacosx.c (unexec_error):
7542 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7543 Use _Noreturn rather than NO_RETURN.
7544 No need for separate decl merely because of _Noreturn.
7545 * sound.c (sound_warning, parse_sound):
7546 Remove unnecessary forward decls.
7547
7548 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7549
7550 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7551 * lisp.h (WAIT_READING_MAX): New macro.
7552 * dispnew.c (Fsleep_for, sit_for):
7553 * keyboard.c (kbd_buffer_get_event):
7554 * process.c (Faccept_process_output):
7555 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7556 This improves on the previous patch, which introduced a bug
7557 when time_t is unsigned and as wide as intmax_t.
7558 See <http://bugs.gnu.org/9000#51>.
7559
7560 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7561
7562 * dispnew.c (sit_for, Fsleep_for):
7563 * keyboard.c (kbd_buffer_get_event):
7564 * process.c (Faccept_process_output): Avoid compiler warnings when
7565 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7566
7567 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7568
7569 * makefile.w32-in: Update dependencies.
7570
7571 * w32.c (ltime): Add return type and declare static.
7572 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7573
7574 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7575
7576 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7577 Privately reported by Herbert J. Skuhra.
7578 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7579 All uses changed.
7580 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7581 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7582
7583 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7584
7585 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7586 last argument of make_unibyte_string.
7587
7588 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7589 language ID in the event parameters.
7590
7591 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7592 event.code, not the obscure "character set ID".
7593
7594 2012-06-23 Chong Yidong <cyd@gnu.org>
7595
7596 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7597
7598 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7599
7600 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7601 * w32.c (fdutimens): New function.
7602
7603 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7604
7605 * s/ms-w32.h (pselect): Redirect to sys_select.
7606
7607 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7608
7609 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7610 in the logic of incrementing and decrementing the value of
7611 use_relocatable_buffers.
7612
7613 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7614
7615 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7616 Privately reported by Herbert J. Skuhra.
7617 [__FreeBSD__]: Remove "*/" typo after "#include".
7618 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7619 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7620 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7621 Don't assume EMACS_TIME and struct timeval are the same type.
7622
7623 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7624
7625 Support higher-resolution time stamps (Bug#9000).
7626 The time stamps are only nanosecond-resolution at the C level,
7627 since that's the best that any real-world system supports now.
7628 But they are picosecond-resolution at the Lisp level, as that's
7629 easy, and leaves room for future OS improvements.
7630
7631 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7632 (LIBES): Use it.
7633
7634 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7635 Don't get current time unless it's needed.
7636
7637 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7638 now provides it if it's absent.
7639 (start_atimer): Port to higher-res time stamps.
7640 Check for time stamp overflow. Don't get current time more
7641 often than is needed.
7642
7643 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7644 Include systime.h, not time.h.
7645 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7646
7647 * dired.c: Include stat-time.h.
7648 (Ffile-attributes): File times now have higher resolution.
7649
7650 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7651 (struct image): Timestamp now has higher resolution.
7652
7653 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7654 has at least microseconds now. All uses removed.
7655 (update_frame, update_single_window, update_window, update_frame_1)
7656 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7657 (duration_to_sec_usec): Remove; no longer needed.
7658
7659 * editfns.c (time_overflow): Now extern.
7660 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7661 (float-time, Fformat_time_string, Fcurrent_time_string)
7662 (Fcurrent_time_zone): Accept and generate higher-resolution
7663 time stamps.
7664 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7665 (decode_time_components, lisp_seconds_argument): New functions.
7666 (make_time): Now static.
7667 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7668 Report an error if the time is invalid, rather than having the caller
7669 do that.
7670
7671 * fileio.c: Include <stat-time.h>
7672 (Fcopy_file): Copy higher-resolution time stamps.
7673 Prefer to set the time stamp via a file descriptor if that works.
7674 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7675 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7676 (Fvisited_file_modtime, Fset_visited_file_modtime):
7677 Support higher-resolution time stamps.
7678
7679 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7680
7681 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7682
7683 * image.c (prepare_image_for_display, clear_image_cache)
7684 (lookup_image): Port to higer-resolution time stamps.
7685
7686 * keyboard.c (start_polling, bind_polling_period):
7687 Check for time stamp overflow.
7688 (read_char, kbd_buffer_get_event, timer_start_idle)
7689 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7690 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7691 Port to higher-resolution time stamps. Do not assume time_t is signed.
7692 (decode_timer): New function. Timers are now vectors of length 9,
7693 not 8, to accommodate the picosecond component.
7694 (timer_check_2): Use it.
7695
7696 * nsterm.m (select_timeout, timeval_subtract): Remove.
7697 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7698 as they're a bit more accurate and handle overflow better.
7699 (ns_select): Change prototype to be compatible with pselect.
7700 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7701 * nsterm.h (ns_select): Adjust prototype.
7702
7703 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7704 us-resolution time stamps.
7705 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7706
7707 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7708
7709 * lisp.h (time_overflow): New decl.
7710 (wait_reading_process_output): First arg is now intmax_t, not int,
7711 to accommodate larger waits.
7712
7713 * process.h (struct Lisp_Process.read_output_delay):
7714 Now counts nanoseconds, not microseconds.
7715 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7716 EMACS_HAS_USECS.
7717 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7718 (wait_reading_process_output):
7719 Port to ns-resolution time stamps.
7720 (Faccept_process_output, wait_reading_process_output):
7721 Check for time stamp overflow. Do not assume time_t is signed.
7722 (select_wrapper): Remove; we now use pselect.
7723 (Fprocess_attributes): Now generates ns-resolution time stamps.
7724
7725 * sysdep.c: Include utimens.h. Don't include utime.h
7726 or worry about struct utimbuf; gnulib does that for us now.
7727 (gettimeofday): Remove; gnulib provides a substitute.
7728 (make_timeval): New function.
7729 (set_file_times): Now sets ns-resolution time stamps.
7730 New arg FD; all uses changed.
7731 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7732 (system_process_attributes):
7733 Now returns ns-resolution time stamp. All uses changed.
7734 Check for time stamp overflow.
7735
7736 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7737 provides a substitute now.
7738
7739 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7740 since it guarantees struct timespec.
7741 (EMACS_TIME): Now struct timespec, so that we can support
7742 ns-resolution time stamps.
7743 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7744 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7745 (EMACS_USECS): Remove.
7746 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7747 so multiply the arg by 1000 before storing it.
7748 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7749 New macros.
7750 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7751 Port to ns-resolution time stamps.
7752 (EMACS_TIME_NEG_P): Remove; replaced by....
7753 (EMACS_TIME_SIGN): New macro.
7754 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7755 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7756 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7757 (make_timeval, make_lisp_time, decode_time_components): New decls.
7758 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7759 that it mishandled time_t overflow. You can't compare by subtracting!
7760 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7761 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7762
7763 * term.c: Include <sys/time.h>.
7764 (timeval_to_Time): New function, for proper overflow wraparound.
7765 (term_mouse_position, term_mouse_click): Use it.
7766
7767 * undo.c (record_first_change): Support higher-resolution time stamps
7768 in the undo buffer.
7769 (Fprimitive_undo): Use them when restoring time stamps.
7770
7771 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7772 (w32_get_internal_run_time):
7773 Port to higher-resolution Emacs time stamps.
7774 (ltime): Now accepts single 64-bit integer, as that's more convenient
7775 for callers.
7776
7777 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7778
7779 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7780 for compatibility with pselect. Support ns-resolution time stamps.
7781
7782 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7783
7784 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7785 Check for time stamp overflow, and support ns-resolution time stamps.
7786
7787 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7788 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7789 (timeval_subtract): Remove; no longer needed.
7790 (XTflash, XTring_bell, x_wait_for_event):
7791 Port to ns-resolution time stamps. Don't assume time_t is signed.
7792
7793 2012-06-22 Chong Yidong <cyd@gnu.org>
7794
7795 * xdisp.c (x_consider_frame_title): Revert last change.
7796
7797 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7798
7799 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7800 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7801 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7802 staticidx goes up to 1597 out of 1600 = 0x640.)
7803
7804 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7805
7806 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7807 Otherwise, the umask might be mistakenly 0 while handling input signals.
7808
7809 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7810
7811 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7812
7813 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7814
7815 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7816 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7817 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7818 access to `contents' member of Lisp_Vector objects with AREF and ASET
7819 where appropriate.
7820
7821 2012-06-19 Chong Yidong <cyd@gnu.org>
7822
7823 * frame.c (delete_frame): When selecting a frame on a different
7824 text terminal, do not alter the terminal's top-frame.
7825
7826 * xdisp.c (format_mode_line_unwind_data): Record the target
7827 frame's selected window and its terminal's top-frame.
7828 (unwind_format_mode_line): Restore them.
7829 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7830 Callers changed.
7831 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7832 since tty frames can be explicitly named.
7833 (prepare_menu_bars): Likewise.
7834
7835 * term.c (Ftty_top_frame): New function.
7836
7837 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7838
7839 Port byte-code-meter to modern targets.
7840 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7841 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7842 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7843 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7844 (METER_1, METER_2): Simplify.
7845
7846 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7847
7848 * data.c (Fdefalias): Return `symbol' (bug#11686).
7849
7850 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7851
7852 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7853 gets killed during executing of this function (Bug#11665).
7854 Try to always return Qt when the buffer has been actually killed.
7855 (Vkill_buffer_query_functions): In doc-string say that functions
7856 run by this hook should not change the current buffer.
7857
7858 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7859
7860 Fix recently-introduced process.c problems found by static checking.
7861 * process.c (write_queue_push, write_queue_pop, send_process):
7862 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7863 (write_queue_pop): Fix pointer signedness problem.
7864 (send_process): Remove unused local.
7865
7866 2012-06-17 Chong Yidong <cyd@gnu.org>
7867
7868 * xdisp.c (redisplay_internal): No need to redisplay terminal
7869 frames that are not on top.
7870
7871 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7872
7873 * process.c (make_process): Initialize write_queue.
7874 (write_queue_push, write_queue_pop): New functions.
7875 (send_process): Use them to maintain correct ordering of process
7876 writes (Bug#10815).
7877
7878 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7879
7880 * lisp.h (eassert): Assume C89 or later.
7881 This removes the need for CHECK.
7882 (CHECK): Remove. Its comments about always evaluating its
7883 argument were confusing, as 'eassert' typically does not evaluate
7884 its argument.
7885
7886 * coding.c (produce_chars): Use ptrdiff_t, not int.
7887
7888 * xterm.c (x_draw_underwave): Check for integer overflow.
7889 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7890
7891 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7892
7893 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7894 referenced (Bug#11583).
7895
7896 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7897
7898 Implement wave-style variant of underlining.
7899 * dispextern.h (face_underline_type): New enum.
7900 (face): Add field for underline type.
7901 * nsterm.m (ns_draw_underwave): New function.
7902 (ns_draw_text_decoration): Use it.
7903 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7904 New functions.
7905 (x_draw_glyph_string): Use them.
7906 * xfaces.c (Qline, Qwave): New Lisp objects.
7907 (check_lface_attrs, merge_face_ref)
7908 (Finternal_set_lisp_face_attribute, realize_x_face):
7909 Handle wave-style underline face attributes.
7910 * xterm.c (x_draw_underwave): New function.
7911 (x_draw_glyph_string): Use it.
7912
7913 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7914
7915 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7916 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7917 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7918 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7919 ($(BLD)/w32select.$(O)): Update dependencies.
7920
7921 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7922
7923 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7924 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7925 * character.c (_fetch_multibyte_char_p): Remove.
7926 * alloc.c: Include "character.h" before "buffer.h".
7927 * bidi.c: Likewise.
7928 * buffer.c: Likewise.
7929 * bytecode.c: Likewise.
7930 * callint.c: Likewise.
7931 * callproc.c: Likewise.
7932 * casefiddle.c: Likewise.
7933 * casetab.c: Likewise.
7934 * category.c: Likewise.
7935 * cmds.c: Likewise.
7936 * coding.c: Likewise.
7937 * composite.c: Likewise.
7938 * dired.c: Likewise.
7939 * dispnew.c: Likewise.
7940 * doc.c: Likewise.
7941 * dosfns.c: Likewise.
7942 * editfns.c: Likewise.
7943 * emacs.c: Likewise.
7944 * fileio.c: Likewise.
7945 * filelock.c: Likewise.
7946 * font.c: Likewise.
7947 * fontset.c: Likewise.
7948 * fringe.c: Likewise.
7949 * indent.c: Likewise.
7950 * insdel.c: Likewise.
7951 * intervals.c: Likewise.
7952 * keyboard.c: Likewise.
7953 * keymap.c: Likewise.
7954 * lread.c: Likewise.
7955 * macros.c: Likewise.
7956 * marker.c: Likewise.
7957 * minibuf.c: Likewise.
7958 * nsfns.m: Likewise.
7959 * nsmenu.m: Likewise.
7960 * print.c: Likewise.
7961 * process.c: Likewise.
7962 * regex.c: Likewise.
7963 * region-cache.c: Likewise.
7964 * search.c: Likewise.
7965 * syntax.c: Likewise.
7966 * term.c: Likewise.
7967 * textprop.c: Likewise.
7968 * undo.c: Likewise.
7969 * unexsol.c: Likewise.
7970 * w16select.c: Likewise.
7971 * w32fns.c: Likewise.
7972 * w32menu.c: Likewise.
7973 * window.c: Likewise.
7974 * xdisp.c: Likewise.
7975 * xfns.c: Likewise.
7976 * xmenu.c: Likewise.
7977 * xml.c: Likewise.
7978 * xselect.c: Likewise.
7979
7980 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7981
7982 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7983 If all the glyphs of the glyph row came from strings, and we have no
7984 cursor positioning clues, put the cursor on the first glyph of the
7985 row.
7986 (handle_face_prop): Use chunk-relative overlay string index when
7987 indexing into it->string_overlays array. (Bug#11653)
7988 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7989 the rightmost. (Bug#11720)
7990
7991 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7992
7993 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7994 (CATEGORY_MEMBER): Enforce 1/0 value.
7995 * category.c (_temp_category_set): Remove.
7996
7997 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7998
7999 * window.c (Fdelete_other_windows_internal)
8000 (Fdelete_window_internal): Don't access frame's mouse highlight
8001 info of the initial frame. (Bug#11677)
8002
8003 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
8004
8005 * .gdbinit (xgetint): Fix recently-introduced paren typo.
8006 Assume USE_2_TAGS_FOR_INTS.
8007 (xreload): Adjust $tagmask width to match recent lisp.h change.
8008
8009 Simplify lisp.h in minor ways that should not affect code.
8010 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
8011 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
8012 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
8013 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
8014 (INTTYPEBITS): New macro, for clarity.
8015 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
8016 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
8017 Simplify now that USE_LSB_TAG is always defined.
8018 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
8019 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
8020
8021 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
8022
8023 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
8024
8025 2012-06-13 Glenn Morris <rgm@gnu.org>
8026
8027 * s/bsd-common.h (BSD4_3):
8028 * s/usg5-4-common.h (USG5_4): No longer define; unused.
8029
8030 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
8031
8032 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
8033 instead of union.
8034 (XLI, XIL): Define.
8035 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
8036 Use them.
8037 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
8038 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
8039 * alloc.c (widen_to_Lisp_Object): Remove.
8040 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
8041 * frame.c (delete_frame): Remove outdated comment.
8042 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
8043 USE_LISP_UNION_TYPE.
8044 (Fw32_unregister_hot_key): Likewise.
8045 (Fw32_toggle_lock_key): Likewise.
8046 * w32menu.c (add_menu_item): Likewise.
8047 (w32_menu_display_help): Use XIL instead of checking
8048 USE_LISP_UNION_TYPE.
8049 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
8050 (init_heap): Likewise.
8051 * w32term.c (w32_read_socket): Update comment.
8052
8053 2012-06-13 Glenn Morris <rgm@gnu.org>
8054
8055 * s/usg5-4-common.h, src/s/unixware.h:
8056 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8057
8058 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8059
8060 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
8061
8062 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8063 * alloc.c (make_number) [!defined make_number]:
8064 Remove, as lisp.h always defines this now.
8065 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8066 (roundup_size): Verify that it is a power of 2.
8067 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8068 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8069 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8070 -DUSE_LSB_TAG=0, to override the automatically-selected default.
8071 USE_LSB_TAG now is always defined to be either 0 or 1.
8072 All uses changed.
8073 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8074 code works fine either way, and efficiency is not a concern here,
8075 as the union type is for debugging, not for production.
8076 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8077 Use an inline function on all platforms when using the union type,
8078 since this is simpler and 'static inline' can be used portably
8079 within Emacs now.
8080 (LISP_INITIALLY_ZERO): New macro.
8081 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8082 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8083
8084 2012-06-12 Glenn Morris <rgm@gnu.org>
8085
8086 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8087
8088 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8089
8090 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8091 Move BROKEN_SIGIO to configure.
8092
8093 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8094 Move NO_TERMIO to configure.
8095
8096 2012-06-12 Chong Yidong <cyd@gnu.org>
8097
8098 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8099 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8100 MagickExportImagePixels is undefined.
8101
8102 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8103
8104 * image.c (imagemagick_load_image): Remove unused label.
8105
8106 2012-06-11 Glenn Morris <rgm@gnu.org>
8107
8108 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8109 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8110 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8111 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8112
8113 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8114
8115 * alloc.c (make_byte_code): New function.
8116 (Fmake_byte_code): Use it. Don't purify here.
8117 * lread.c (read1): Use it as well to avoid extra allocation.
8118
8119 2012-06-11 Chong Yidong <cyd@gnu.org>
8120
8121 * image.c (imagemagick_load_image): Implement transparency.
8122
8123 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8124
8125 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8126 account for preceding backslashes. (Bug#11663)
8127
8128 2012-06-09 Chong Yidong <cyd@gnu.org>
8129
8130 * term.c: Support italics in capable terminals (Bug#9652).
8131 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8132 (turn_on_face): Output using TS_enter_italic_mode if available.
8133 Don't handle unused blinking and alt-charset cases.
8134 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8135 and tty_alt_charset_p cases.
8136 (tty_capable_p, init_tty): Support italics.
8137
8138 * termchar.h (struct tty_display_info): Add field for italics.
8139 Remove unused blink field.
8140
8141 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8142 Handle slant.
8143
8144 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8145 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8146 tty_alt_charset_p. Add tty_italic_p.
8147
8148 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
8149
8150 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8151 dbus_type_is_basic if available.
8152 (xd_extract_signed, xd_extract_unsigned): Rename from
8153 extract_signed and extract_unsigned, respectively. Adapt callers.
8154
8155 2012-06-09 Chong Yidong <cyd@gnu.org>
8156
8157 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8158
8159 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8160 case (Bug#9752).
8161
8162 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
8163
8164 * xdisp.c (vmessage): Treat frame message as multibyte.
8165 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8166 would generate the diagnostic "Making \302\247 buffer-local while
8167 let-bound!".
8168
8169 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8170
8171 * dispnew.c (showing_window_margins_p): Undo last change, which
8172 was done due to an inadvertent commit.
8173 (adjust_frame_glyphs_for_frame_redisplay): Do call
8174 showing_window_margins_p.
8175
8176 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8177
8178 * eval.c (Fmake_var_non_special): New primitive.
8179 (syms_of_eval): Defsubr it.
8180 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8181
8182 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
8183
8184 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8185 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8186
8187 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8188
8189 * alloc.c (allocate_vectorlike): Fix last change.
8190
8191 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
8192
8193 Block-based vector allocation of small vectors.
8194 * lisp.h (struct vectorlike_header): New field `nbytes',
8195 adjust comment accordingly.
8196 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8197 to denote vector blocks. Adjust users (live_vector_p,
8198 mark_maybe_pointer, valid_lisp_object_p) accordingly.
8199 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8200 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8201 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8202 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8203 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8204 (roundup_size): New constant.
8205 (struct vector_block): New data type.
8206 (vector_blocks, vector_free_lists, zero_vector): New variables.
8207 (all_vectors): Rename to `large_vectors'.
8208 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8209 (sweep_vectors): New functions.
8210 (allocate_vectorlike): Return `zero_vector' as the only vector of
8211 0 items. Allocate new vector from block if vector size is less than
8212 or equal to VBLOCK_BYTES_MAX.
8213 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8214 (init_alloc_once): Add call to init_vectors.
8215
8216 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8217
8218 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8219
8220 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8221
8222 * doprnt.c (doprnt): Truncate multibyte char correctly.
8223 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8224 would mishandle a string argument "Xc" if X was a multibyte
8225 character of length 2: it would truncate after X's first byte
8226 rather than including all of X.
8227
8228 2012-06-06 Chong Yidong <cyd@gnu.org>
8229
8230 * buffer.c (word_wrap): Doc fix.
8231
8232 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8233
8234 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8235
8236 2012-06-03 Glenn Morris <rgm@gnu.org>
8237
8238 * xdisp.c (tool-bar-style): Doc fix.
8239
8240 2012-06-03 Ulrich Müller <ulm@gentoo.org>
8241
8242 * Makefile.in (PAXCTL): Define.
8243 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8244 binary via PaX flags if the paxctl utility is available.
8245 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8246 Restore PaX flags to their default. (Bug#11398)
8247
8248 2012-06-03 Chong Yidong <cyd@gnu.org>
8249
8250 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8251 buffer (Bug#11226).
8252
8253 2012-06-03 Chong Yidong <cyd@gnu.org>
8254
8255 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8256 (note_mode_line_or_margin_highlight): If there is no help echo,
8257 use mode-line-default-help-echo. Handle the case where the mouse
8258 position is past the end of the mode line string.
8259
8260 * buffer.c (buffer_local_value_1): New function, split from
8261 Fbuffer_local_value; can return Qunbound.
8262 (Fbuffer_local_value): Use it.
8263 (Vmode_line_format): Docstring tweaks.
8264
8265 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8266
8267 * sysdep.c (system_process_attributes): Improve comment.
8268
8269 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8270
8271 * keyboard.c: Export real-this-command to Elisp.
8272 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8273 and DEFVAR it. Update all users.
8274
8275 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8276
8277 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8278
8279 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8280 Convert pctcpu and pctmem to Lisp float properly.
8281 Let the compiler fold better, as 100.0/0x8000 is exact.
8282
8283 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8284
8285 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8286 cons_block.
8287
8288 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8289
8290 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8291
8292 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8293
8294 For a 'struct window', replace some Lisp_Object fields to
8295 bitfields where appropriate, remove unused fields.
8296 * window.h (struct window): Remove unused 'last_mark_x' and
8297 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
8298 change its type from Lisp_Object to bitfield.
8299 Change type of 'force_start', 'optional_new_start',
8300 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8301 fields from Lisp_Object to bitfield. Adjust users accordingly.
8302
8303 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8304
8305 Pacify gcc -Wdouble-precision when using Xaw.
8306 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8307 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8308 Use 'float' consistently, rather than 'float' in most places
8309 and 'double' in a couple of places.
8310
8311 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8312
8313 * xdisp.c (handle_stop): Detect whether we have overlay strings
8314 loaded by testing it->current.overlay_string_index to be
8315 non-negative, instead of checking whether n_overlay_strings is
8316 positive. (Bug#11587)
8317
8318 2012-05-31 Chong Yidong <cyd@gnu.org>
8319
8320 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8321
8322 * doc.c (Fsubstitute_command_keys): Doc fix.
8323
8324 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8325
8326 * search.c (search_buffer): Remove calls to
8327 r_alloc_inhibit_buffer_relocation, as it is now called by
8328 maybe_unify_char, which was the cause of relocation of buffer text
8329 in bug#11519.
8330
8331 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8332
8333 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8334 for the duration of call to load_charset, to avoid problems with
8335 callers of maybe_unify_char that access buffer text through C
8336 pointers.
8337
8338 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8339 decrement the inhibition flag, instead of just setting or
8340 resetting it.
8341
8342 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8343
8344 Remove obsolete '#define static' cruft.
8345 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8346 This #undef was "temporary" in 2000; it is no longer needed
8347 now that '#define static' has gone away.
8348 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8349 (gray_bitmap_bits): Remove; no longer needed.
8350 All uses replaced with definiens.
8351 * xterm.c: Include "bitmaps/gray.xbm".
8352
8353 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8354
8355 Clean up __executable_start, monstartup when --enable-profiling.
8356 The following changes affect the code only when profiling.
8357 * dispnew.c (__executable_start): Rename from safe_bcopy.
8358 Define only on platforms that need it.
8359 * emacs.c: Include <sys/gmon.h> when profiling.
8360 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8361 (__executable_start): Remove decl, since lisp.h does it now.
8362 (safe_bcopy): Remove decl; no longer has that name.
8363 (main): Coalesce #if into single bit of code, for simplicity.
8364 Cast pointers to uintptr_t, since standard libraries want integers
8365 and not pointers.
8366 * lisp.h (__executable_start): New decl.
8367
8368 2012-05-31 Glenn Morris <rgm@gnu.org>
8369
8370 * image.c (Fimagemagick_types): Doc fix.
8371
8372 2012-05-30 Jim Meyering <meyering@redhat.com>
8373
8374 * callproc.c (Fcall_process_region): Include directory component
8375 in mkstemp error message (Bug#11586).
8376
8377 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8378
8379 * alloc.c, lisp.h (make_pure_vector): Now static.
8380
8381 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8382
8383 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8384 Move to byte-run.el.
8385 (Fautoload): Do the hash-doc more carefully.
8386 * data.c (Fdefalias): Purify definition, except for keymaps.
8387 (Qdefun): Move from eval.c.
8388 * lisp.h (Qdefun): Remove.
8389 * lread.c (read1): Tiny simplification.
8390
8391 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8392
8393 Do not create empty overlays with the evaporate property (Bug#9642).
8394 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8395 Bug#9642, but explicitly check that the buffer the overlay would
8396 be moved to is live and rearrange lines to make sure that errors
8397 will not put the overlay in an inconsistent state.
8398 (Fdelete_overlay): Cosmetics.
8399
8400 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8401
8402 * w32term.c (my_bring_window_to_top): New function.
8403 (x_raise_frame): Use handle returned by DeferWindowPos, which
8404 could be different from the original one.
8405 Call my_bring_window_to_top instead of my_set_foreground_window.
8406 (Bug#11513)
8407
8408 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8409 by calling BringWindowToTop.
8410
8411 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8412 (WM_EMACS_END): Increase by one.
8413
8414 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8415
8416 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8417 This avoids undefined behavior that might cause the eassert
8418 to not catch an out-of-range value.
8419
8420 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8421
8422 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8423 Update dependencies.
8424
8425 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8426
8427 * bidi.c (bidi_mirror_char): Fix last change.
8428
8429 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8430
8431 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8432 when referring to sectname field in printf format.
8433
8434 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8435
8436 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8437 Only r_alloc_inhibit_buffer_relocation needed to be added;
8438 the others were already declared.
8439
8440 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8441 before checking whether it's out of range. Put the check inside
8442 eassert. See
8443 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8444
8445 2012-05-27 Ken Brown <kbrown@cornell.edu>
8446
8447 * callproc.c (Fcall_process): Restore a line that was accidentally
8448 commented out in the 2011-02-13 change (bug#11547).
8449
8450 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8451
8452 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8453 defined on ralloc.c.
8454
8455 * buffer.c [REL_ALLOC]: Remove prototypes of
8456 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8457 they are now on lisp.h.
8458
8459 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8460
8461 * search.c (search_buffer): Use it to inhibit relocation of buffer
8462 text while re_search_2 is doing its job, because re_search_2 is
8463 passed C pointers to buffer text. (Bug#11519)
8464
8465 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8466 Update value to 24.
8467
8468 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8469 state after an additional call to move_it_in_display_line_to, keep
8470 the values of it->max_ascent and it->max_descent found for the
8471 entire line.
8472 (pos_visible_p): Revert the comparison against bottom_y to what it
8473 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8474 (Bug#11464)
8475
8476 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8477
8478 Fix coding-related core dumps with gcc -ftrapv.
8479 The code was computing A - B, where A and B are pointers, and B is
8480 random garbage. This can lead to core dumps on platforms that
8481 have special pointer registers, and it also leads to core dumps on
8482 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8483 A - B only when B is initialized properly.
8484 * coding.c (coding_set_source, coding_set_destination): Return void.
8485 (coding_change_source, coding_change_destinations): New functions,
8486 with the old behaviors of coding_set_source and coding_set_destination.
8487 All callers that need an offset changed to use these new functions.
8488
8489 2012-05-26 Glenn Morris <rgm@gnu.org>
8490
8491 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8492
8493 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8494
8495 Extend mouse support on W32 text-mode console.
8496 * xdisp.c (draw_row_with_mouse_face):
8497 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8498
8499 * w32console.c: Include window.h.
8500 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8501 New functions.
8502 (initialize_w32_display): Initialize mouse-highlight data.
8503
8504 * w32inevt.c: Include termchar.h and window.h.
8505 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8506 moves, call note_mouse_highlight. If help_echo changed, call
8507 gen_help_event to produce help-echo message in the echo area.
8508 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8509 highlight info.
8510
8511 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8512
8513 * lread.c (read1): Simplify slightly to avoid an overflow warning
8514 with GCC 4.7.0 on x86-64.
8515
8516 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8517
8518 * bidi.c (bidi_mirror_char): Revert last change: an int is
8519 definitely wide enough here.
8520
8521 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8522
8523 Fix integer width and related bugs (Bug#9874).
8524 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8525 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8526 (string_bytes, check_sblock, allocate_string_data):
8527 (compact_small_strings, Fmake_bool_vector, make_string)
8528 (make_unibyte_string, make_multibyte_string)
8529 (make_string_from_bytes, make_specified_string)
8530 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8531 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8532 (mark_vectorlike):
8533 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8534 (allocate_pseudovector):
8535 Use int, not EMACS_INT, where int is wide enough.
8536 (inhibit_garbage_collection, Fgarbage_collect):
8537 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8538 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8539 int might not be wide enough.
8540 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8541 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8542 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8543 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8544 (bidi_level_of_next_char, bidi_move_to_visually_next):
8545 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8546 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8547 (Fkill_buffer, Fset_buffer_major_mode)
8548 (advance_to_char_boundary, Fbuffer_swap_text)
8549 (Fset_buffer_multibyte, overlays_at, overlays_in)
8550 (overlay_touches_p, struct sortvec, record_overlay_string)
8551 (overlay_strings, recenter_overlay_lists)
8552 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8553 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8554 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8555 (Foverlay_recenter, last_overlay_modification_hooks_used)
8556 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8557 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8558 (validate_region): Omit unnecessary test for b <= e,
8559 since that's guaranteed by the previous test.
8560 (adjust_overlays_for_delete): Avoid pos + length overflow.
8561 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8562 (report_overlay_modification):
8563 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8564 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8565 Omit pointer cast, which isn't needed anyway, and doesn't work
8566 after the EMACS_INT -> ptrdiff_t change.
8567 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8568 * buffer.h: Adjust decls to match defn changes elsewhere.
8569 (struct buffer_text, struct buffer):
8570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8571 Use EMACS_INT, not int, where int might not be wide enough.
8572 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8573 not int, to avoid needless 32-bit limit on 64-bit hosts.
8574 (exec_byte_code): Use tighter memory-full test, one that checks
8575 for alloca overflow. Don't compute the address of the object just
8576 before an array, as that's not portable. Use EMACS_INT, not
8577 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8578 * callint.c (Fcall_interactively):
8579 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8580 * callproc.c (call_process_kill, Fcall_process):
8581 Don't assume pid_t fits into an Emacs fixnum.
8582 (call_process_cleanup, Fcall_process, child_setup):
8583 Don't assume pid_t fits into int.
8584 (call_process_cleanup, Fcall_process, delete_temp_file)
8585 (Fcall_process_region):
8586 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8587 (Fcall_process): Simplify handling of volatile integers.
8588 Use int, not EMACS_INT, where int will do.
8589 * casefiddle.c (casify_object, casify_region, operate_on_word)
8590 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8591 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8592 (casify_object): Avoid integer overflow when overallocating buffer.
8593 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8594 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8595 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8596 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8597 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8598 integers are now checked earlier. All uses replaced with XINT.
8599 (ccl_driver):
8600 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8601 For CCL_MapSingle, check that content and value are in int range.
8602 (ccl_driver, Fregister_code_conversion_map):
8603 Check that Vcode_version_map_vector is a vector.
8604 (resolve_symbol_ccl_program): Check that vector header is in range.
8605 Always copy the vector, so that we can check its contents reliably
8606 now rather than having to recheck each instruction as it's being
8607 executed. Check that vector words fit in 'int'.
8608 (ccl_get_compiled_code, Fregister_ccl_program)
8609 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8610 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8611 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8612 contents are in range.
8613 (Fccl_execute_on_string): Check that status is in range.
8614 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8615 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8616 Accept and return EMACS_INT, not int, because callers can pass values
8617 out of 'int' range.
8618 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8619 (multibyte_chars_in_text, parse_str_as_multibyte)
8620 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8621 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8622 (string_escape_byte8, Fget_byte):
8623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8624 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8625 avoid mishandling large integers.
8626 * character.h: Adjust decls to match defn changes elsewhere.
8627 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8628 (Ffind_charset_region):
8629 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8630 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8631 (load_charset_map_from_vector, Fdefine_charset_internal):
8632 Don't assume fixnum fits in int.
8633 (load_charset_map_from_vector, Fmap_charset_chars):
8634 Remove now-unnecessary CHECK_NATNUMs.
8635 (Fdefine_charset_internal): Check ranges here, more carefully.
8636 Don't rely on undefined behavior with signed left shift overflow.
8637 Don't assume unsigned int fits into fixnum, or that fixnum fits
8638 into unsigned int. Don't require max_code to be a valid fixnum;
8639 that's not true for gb10830 4-byte on a 32-bit host. Allow
8640 invalid_code to be a cons, for the same reason. Require code_offset
8641 to be a character. Avoid int overflow if max_char is close
8642 to INT_MAX.
8643 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8644 this is intended anyway and avoids some undefined behavior.
8645 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8646 INDEX_TO_CODE_POINT, as that's what it expects.
8647 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8648 * charset.h (DECODE_CHAR): Return int, not unsigned;
8649 this is what was intended anyway, and it avoids undefined behavior.
8650 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8651 integer-overflow issues.
8652 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8653 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8654 where the argument is EMACS_INT, and this behavior is not intended.
8655 * chartab.c (Fmake_char_table, Fset_char_table_range)
8656 (uniprop_get_decoder, uniprop_get_encoder):
8657 Don't assume fixnum fits in int.
8658 * cmds.c (move_point): New function, that does the gist of
8659 Fforward_char and Fbackward_char, but does so while checking
8660 for integer overflow more accurately.
8661 (Fforward_char, Fbackward_char): Use it.
8662 (Fforward_line, Fend_of_line, internal_self_insert)
8663 (internal_self_insert):
8664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8665 Fix a FIXME, by checking for integer overflow when calculating
8666 target_clm and actual_clm.
8667 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8668 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8669 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8670 (coding_alloc_by_making_gap, alloc_destination)
8671 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8672 (encode_coding_utf_16, detect_coding_emacs_mule)
8673 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8674 (detect_coding_iso_2022, decode_coding_iso_2022)
8675 (encode_invocation_designation, encode_designation_at_bol)
8676 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8677 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8678 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8679 (encode_coding_ccl, encode_coding_raw_text)
8680 (detect_coding_charset, decode_coding_charset)
8681 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8682 (produce_composition, produce_charset, produce_annotation)
8683 (decode_coding, handle_composition_annotation)
8684 (handle_charset_annotation, consume_chars, decode_coding_gap)
8685 (decode_coding_object, encode_coding_object, detect_coding_system)
8686 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8687 (code_convert_region, code_convert_string)
8688 (Fdefine_coding_system_internal)
8689 (coding_set_source, coding_set_destination):
8690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8691 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8692 (Fdefine_coding_system_internal):
8693 Don't assume fixnums fit in int.
8694 (decode_coding_gap, decode_coding_object, encode_coding_object)
8695 (Fread_coding_system, Fdetect_coding_region)
8696 (Funencodable_char_position, Fcheck_coding_systems_region)
8697 (get_translation, handle_composition_annotation, consume_chars):
8698 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8699 (consume_chars): Rewrite to not calculate an address outside buffer.
8700 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8701 Don't access memory outside of the args array.
8702 (Fdefine_coding_system_internal): Check for charset-id overflow.
8703 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8704 result of ENCODE_CHAR.
8705 * coding.h: Adjust decls to match defn changes elsewhere.
8706 (struct coding_system):
8707 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8708 * composite.c (get_composition_id, find_composition)
8709 (run_composition_function, update_compositions)
8710 (compose_text, composition_gstring_put_cache)
8711 (composition_gstring_p, composition_gstring_width)
8712 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8713 (composition_compute_stop_pos, composition_reseat_it)
8714 (composition_update_it, struct position_record)
8715 (find_automatic_composition, composition_adjust_point)
8716 (Fcomposition_get_gstring, Ffind_composition_internal):
8717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8718 (update_compositions):
8719 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8720 * composite.h: Adjust decls to match defn changes elsewhere.
8721 (struct composition):
8722 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8723 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8724 Do not attempt to compute the address of the object just before a
8725 buffer; this is not portable.
8726 (Faref, Faset):
8727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8728 (Faset): Use int, not EMACS_INT, where int is wide enough.
8729 (Fstring_to_number): Don't assume fixnums fit in int.
8730 (Frem): Don't assume arg is nonnegative.
8731 * dbusbind.c (xd_append_arg): Check for integers out of range.
8732 (Fdbus_call_method): Don't overflow the timeout int.
8733 (extract_signed, extract_unsigned): New functions.
8734 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8735 (xd_get_connection_references): Return ptrdiff_t, not int.
8736 All uses changed.
8737 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8738 (xd_read_message_1):
8739 Use int, not unsigned, where the dbus API uses int.
8740 (Fdbus_message_internal): Don't overflow mtype.
8741 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8742 * dired.c (directory_files_internal, file_name_completion, scmp)
8743 (file_name_completion_stat):
8744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8745 (file_name_completion): Don't overflow matchcount.
8746 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8747 * dispextern.h: Adjust decls to match defn changes elsewhere.
8748 (struct text_pos, struct glyph, struct bidi_saved_info)
8749 (struct bidi_string_data, struct bidi_it, struct composition_it)
8750 (struct it):
8751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8752 (struct display_pos, struct composition_it, struct it):
8753 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8754 * dispnew.c (increment_matrix_positions)
8755 (increment_row_positions, mode_line_string)
8756 (marginal_area_string):
8757 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8758 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8759 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8760 (duration_to_sec_usec): New function, to check for overflow better.
8761 (Fsleep_for, sit_for): Use it.
8762 * doc.c (get_doc_string, store_function_docstring):
8763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8764 (get_doc_string, Fsnarf_documentation):
8765 Use int, not EMACS_INT, where int is wide enough.
8766 (get_doc_string):
8767 Use SAFE_ALLOCA, not alloca.
8768 Check for overflow when converting EMACS_INT to off_t.
8769 * doprnt.c (doprnt):
8770 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8771 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8772 Don't assume uid_t fits into fixnum.
8773 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8774 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8775 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8776 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8777 (general_insert_function)
8778 (Finsert_char, make_buffer_string, make_buffer_string_both)
8779 (update_buffer_properties, Fbuffer_substring)
8780 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8781 (Fsubst_char_in_region, check_translation)
8782 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8783 (transpose_markers, Ftranspose_regions):
8784 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8785 (clip_to_bounds): Move to lisp.h as an inline function).
8786 (Fconstrain_to_field): Don't assume integers are nonnegative.
8787 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8788 (Fsubst_char_in_region, Fsave_restriction):
8789 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8790 (Femacs_pid): Don't assume pid_t fits into fixnum.
8791 (lo_time): Use int, not EMACS_INT, when int suffices.
8792 (lisp_time_argument): Check for usec out of range.
8793 (Fencode_time): Don't assume fixnum fits in int.
8794 (Fuser_login_name, Fuser_full_name): Signal an error
8795 if a uid argument is out of range, rather than relying on
8796 undefined behavior.
8797 (Fformat_time_string): Remove now-unnecessary check.
8798 lisp_time_argument checks for out-of-range usec now.
8799 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8800 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8801 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8802 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8803 (init_cmdargs, Fdump_emacs):
8804 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8805 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8806 the bottom (typically) 32 bits of the fixnum.
8807 * eval.c (specpdl_size, call_debugger):
8808 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8809 (when_entered_debugger, Fbacktrace_debug):
8810 Don't assume fixnum can fit in int.
8811 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8812 the object just before a buffer; this is not portable.
8813 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8814 (grow_specpdl, unbind_to):
8815 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8816 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8817 (grow_specpdl): Simplify allocation by using xpalloc.
8818 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8819 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8820 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8821 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8822 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8823 (a_write, e_write):
8824 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8825 (Fcopy_file, non_regular_nbytes, read_non_regular)
8826 (Finsert_file_contents):
8827 Use int, not EMACS_INT, where int is wide enough.
8828 (READ_BUF_SIZE): Verify that it fits in int.
8829 (Finsert_file_contents): Check that counts are in proper range,
8830 rather than assuming fixnums fit into ptrdiff_t etc.
8831 Don't assume fixnums fit into int.
8832 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8833 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8834 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8835 (string_char_to_byte, string_byte_to_char)
8836 (string_make_multibyte, string_to_multibyte)
8837 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8838 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8839 (substring_both, Fdelete, internal_equal, Ffillarray)
8840 (Fclear_string, mapcar1)
8841 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8842 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8843 (larger_vector, make_hash_table, maybe_resize_hash_table)
8844 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8845 (Fmaphash, secure_hash):
8846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8847 (concat): Check for string index and length overflow.
8848 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8849 (Frequire):
8850 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8851 (larger_vector): New API (vec, incr_min, size_max) replaces old
8852 one (vec, new_size, init). This catches size overflow.
8853 INIT was removed because it was always Qnil.
8854 All callers changed.
8855 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8856 the upper bound on a hash table index size.
8857 (make_hash_table, maybe_resize_hash_table): Use it.
8858 (secure_hash): Computer start_byte and end_byte only after
8859 they're known to be in ptrdiff_t range.
8860 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8861 (Ffont_get_glyphs, Ffont_at):
8862 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8863 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8864 (Flist_fonts, Fopen_font):
8865 Don't assume fixnum can fit in int.
8866 (check_gstring): Don't assume index can fit in int.
8867 (font_match_p): Check that fixnum is a character, not a nonnegative
8868 fixnum, since the later code needs to stuff it into an int.
8869 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8870 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8871 conversion overflow issues.
8872 (Fopen_font): Check for integer out of range.
8873 (Ffont_get_glyphs): Don't assume index can fit in int.
8874 * font.h: Adjust decls to match defn changes elsewhere.
8875 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8876 integer overflow.
8877 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8878 printmax_t, where ptrdiff_t is wide enough.
8879 (Finternal_char_font):
8880 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8881 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8882 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8883 (Fset_frame_position, x_set_frame_parameters)
8884 (x_set_line_spacing, x_set_border_width)
8885 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8886 Check that fixnums are in proper range for system types.
8887 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8888 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8889 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8890 Use SAFE_ALLOCA_LISP, not alloca.
8891 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8892 intptr_t is wide enough.
8893 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8894 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8895 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8896 Check for fixnum out of range.
8897 * ftfont.c (ftfont_list): Don't assume index fits in int.
8898 Check that fixnums are in proper range for system types.
8899 (ftfont_shape_by_flt):
8900 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8901 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8902 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8903 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8904 Check that fixnums are in proper range for system types.
8905 * gnutls.h: Adjust decls to match defn changes elsewhere.
8906 * gtkutil.c (xg_dialog_run):
8907 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8908 (update_frame_tool_bar):
8909 Check that fixnums are in proper range for system types.
8910 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8911 (lookup_image): Check that fixnums are in range for system types.
8912 * indent.c (last_known_column, last_known_column_point):
8913 (current_column_bol_cache):
8914 (skip_invisible, current_column, check_display_width):
8915 (check_display_width, scan_for_column, current_column_1)
8916 (Findent_to, Fcurrent_indentation, position_indentation)
8917 (indented_beyond_p, Fmove_to_column, compute_motion):
8918 (Fcompute_motion, Fvertical_motion):
8919 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8920 (last_known_column_modified): Use EMACS_INT, not int.
8921 (check_display_width):
8922 (Fcompute_motion):
8923 Check that fixnums and floats are in proper range for system types.
8924 (compute_motion): Don't assume index or fixnum fits in int.
8925 (compute_motion, Fcompute_motion):
8926 Use int, not EMACS_INT, when it is wide enough.
8927 (vmotion): Omit local var start_hpos that is always 0; that way
8928 we don't need to worry about overflow in expressions involving it.
8929 * indent.h: Adjust decls to match defn changes elsewhere.
8930 (struct position):
8931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8932 Use int, not EMACS_INT, where int is wide enough.
8933 Remove unused members ovstring_chars_done and tab_offset;
8934 all uses removed.
8935 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8936 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8937 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8938 (make_gap, copy_text, insert, insert_and_inherit)
8939 (insert_before_markers, insert_before_markers_and_inherit)
8940 (insert_1, count_combining_before, count_combining_after)
8941 (insert_1_both, insert_from_string)
8942 (insert_from_string_before_markers, insert_from_string_1)
8943 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8944 (adjust_after_replace, adjust_after_insert, replace_range)
8945 (replace_range_2, del_range, del_range_1, del_range_byte)
8946 (del_range_both, del_range_2, modify_region)
8947 (prepare_to_modify_buffer, signal_before_change)
8948 (signal_after_change, Fcombine_after_change_execute):
8949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8950 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8951 (balance_an_interval, split_interval_right, split_interval_left)
8952 (find_interval, next_interval, update_interval)
8953 (adjust_intervals_for_insertion, delete_node, delete_interval)
8954 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8955 (static_offset_intervals, offset_intervals)
8956 (merge_interval_right, merge_interval_left, make_new_interval)
8957 (graft_intervals_into_buffer, temp_set_point_both)
8958 (temp_set_point, set_point, adjust_for_invis_intang)
8959 (set_point_both, move_if_not_intangible, get_property_and_range)
8960 (get_local_map, copy_intervals, copy_intervals_to_string)
8961 (compare_string_intervals, set_intervals_multibyte_1):
8962 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8963 * intervals.h: Adjust decls to match defn changes elsewhere.
8964 (struct interval):
8965 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8966 * keyboard.c (this_command_key_count, this_single_command_key_start)
8967 (before_command_key_count, before_command_echo_length, echo_now)
8968 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8969 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8970 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8971 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8972 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8973 (last_non_minibuf_size, last_point_position, echo_truncate)
8974 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8975 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8976 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8977 (stuff_buffered_input):
8978 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8979 (last_auto_save, command_loop_1, read_char):
8980 Use EMACS_INT, not int, to avoid integer overflow.
8981 (record_char): Avoid overflow in total_keys computation.
8982 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8983 * keyboard.h: Adjust decls to match defn changes elsewhere.
8984 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8985 (Fkey_description, Fdescribe_vector, Flookup_key):
8986 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8987 (click_position): New function, to check that positions are in range.
8988 (Fcurrent_active_maps):
8989 (describe_command):
8990 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8991 (Faccessible_keymaps, Fkey_description):
8992 (preferred_sequence_p):
8993 Don't assume fixnum can fit into int.
8994 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8995 Check for integer overflow in size calculations.
8996 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8997 avoid mishandling large integers.
8998 * lisp.h: Adjust decls to match defn changes elsewhere.
8999 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
9000 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
9001 (struct Lisp_Marker):
9002 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9003 (clip_to_bounds): Now an inline function, moved here from editfns.c.
9004 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
9005 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
9006 All callers changed.
9007 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
9008 Assume the arg has valid form, since it always does.
9009 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
9010 unsigned integer system type.
9011 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
9012 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
9013 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9014 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
9015 (duration_to_sec_usec): New decl.
9016 * lread.c (read_from_string_index, read_from_string_index_byte)
9017 (read_from_string_limit, readchar, unreadchar, openp)
9018 (read_internal_start, read1, oblookup):
9019 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9020 (Fload, readevalloop, Feval_buffer, Feval_region):
9021 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9022 (openp): Check for out-of-range argument to 'access'.
9023 (read1): Use int, not EMACS_INT, where int is wide enough.
9024 Don't assume fixnum fits into int.
9025 Fix off-by-one error that can read outside a buffer.
9026 (read_filtered_event): Use duration_to_sec_usec
9027 to do proper overflow checking on durations.
9028 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
9029 in size calculation.
9030 (Fexecute_kbd_macro):
9031 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9032 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
9033 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
9034 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
9035 (set_marker_both, set_marker_restricted_both, marker_position)
9036 (marker_byte_position, Fbuffer_has_markers_at):
9037 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9038 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
9039 * menu.c (ensure_menu_items): Rename from grow_menu_items.
9040 It now merely ensures that the menu is large enough, without
9041 necessarily growing it, as this avoids some integer overflow issues.
9042 All callers changed.
9043 (keymap_panes, parse_single_submenu, Fx_popup_menu):
9044 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9045 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
9046 Use SAFE_ALLOCA_LISP, not alloca.
9047 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
9048 to EMACS_INT. Check that fixnums are in proper range for system types.
9049 * minibuf.c (minibuf_prompt_width, string_to_object)
9050 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
9051 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
9052 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9053 (get_minibuffer, read_minibuf_unwind):
9054 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9055 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9056 this simplifies overflow checking. All callers changed.
9057 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9058 (Ftest_completion):
9059 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9060 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9061 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9062 Check that fixnums are in proper range for system types.
9063 (Fx_create_frame, Fx_show_tip):
9064 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9065 * nsfont.m (ns_findfonts, nsfont_list_family):
9066 Don't assume fixnum fits in long.
9067 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9068 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9069 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9070 wide enough.
9071 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9072 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9073 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9074 (PRINTDECLARE, PRINTPREPARE):
9075 (strout, print_string):
9076 (print, print_preprocess, print_check_string_charset_prop)
9077 (print_object):
9078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9079 (PRINTDECLARE):
9080 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9081 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9082 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9083 (printchar, strout): Use xpalloc to catch size calculation overflow.
9084 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9085 (print_error_message): Use SAFE_ALLOCA, not alloca.
9086 (print_object): Use int, not EMACS_INT, where int is wide enough.
9087 (print_depth, new_backquote_output, print_number_index):
9088 Use ptrdiff_t, not int, where int might not be wide enough.
9089 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9090 (Fset_process_window_size, Fformat_network_address)
9091 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9092 (sigchld_handler):
9093 Check that fixnums are in proper range for system types.
9094 (Fsignal_process): Simplify by avoiding a goto.
9095 Check for process-ids out of pid_t range rather than relying on
9096 undefined behavior.
9097 (process_tick, update_tick): Use EMACS_INT, not int.
9098 (Fformat_network_address, read_process_output, send_process)
9099 (Fprocess_send_region, status_notify):
9100 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9101 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9102 (wait_reading_process_output, read_process_output, exec_sentinel):
9103 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9104 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9105 (Faccept_process_output): Use duration_to_sec_usec to do proper
9106 overflow checking on durations.
9107 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9108 Don't assume pid_t fits in int.
9109 * process.h (struct Lisp_Process): Members tick and update_tick
9110 are now of type EMACS_INT, not int.
9111 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9112 configured --with-wide-int.
9113 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9114 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9115 * search.c (looking_at_1, string_match_1):
9116 (fast_string_match, fast_c_string_match_ignore_case)
9117 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9118 (scan_newline, find_before_next_newline, search_command)
9119 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9120 (set_search_regs, wordify):
9121 (Freplace_match):
9122 (Fmatch_data):
9123 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9124 (string_match_1, search_buffer, set_search_regs):
9125 (Fmatch_data):
9126 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9127 (wordify): Check for overflow in size calculation.
9128 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9129 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9130 Check that fixnums are in proper range for system types.
9131 * sound.c (struct sound_device)
9132 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9134 (Fplay_sound_internal):
9135 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9136 * syntax.c (struct lisp_parse_state, find_start_modiff)
9137 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9138 (Fparse_partial_sexp):
9139 Don't assume fixnums can fit in int.
9140 (struct lisp_parse_state, find_start_pos, find_start_value)
9141 (find_start_value_byte, find_start_begv)
9142 (update_syntax_table, char_quoted, dec_bytepos)
9143 (find_defun_start, prev_char_comend_first, back_comment):
9144 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9145 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9147 (Finternal_describe_syntax_value): Check that match_lisp is a
9148 character, not an integer, since the code stuffs it into int.
9149 (scan_words, scan_sexps_forward):
9150 Check that fixnums are in proper range for system types.
9151 (Fforward_word):
9152 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9153 (scan_sexps_forward):
9154 Use CHARACTERP, not INTEGERP, since the value must fit into int.
9155 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9156 * syntax.h: Adjust decls to match defn changes elsewhere.
9157 (struct gl_state_s):
9158 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9159 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9160 MOST_POSITIVE_FIXNUM.
9161 * sysdep.c (wait_for_termination_1, wait_for_termination)
9162 (interruptible_wait_for_termination, mkdir):
9163 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9164 (emacs_read, emacs_write):
9165 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9166 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9167 and double all fit in int.
9168 * term.c (set_tty_color_mode):
9169 Check that fixnums are in proper range for system types.
9170 * termhooks.h (struct input_event):
9171 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9172 * textprop.c (validate_interval_range, interval_of)
9173 (Fadd_text_properties, set_text_properties_1)
9174 (Fremove_text_properties, Fremove_list_of_text_properties)
9175 (Ftext_property_any, Ftext_property_not_all)
9176 (copy_text_properties, text_property_list, extend_property_ranges)
9177 (verify_interval_modification):
9178 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9179 (Fnext_single_char_property_change)
9180 (Fprevious_single_char_property_change):
9181 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9182 (copy_text_properties):
9183 Check for integer overflow in index calculation.
9184 * undo.c (last_boundary_position, record_point, record_insert)
9185 (record_delete, record_marker_adjustment, record_change)
9186 (record_property_change):
9187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9188 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9189 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9190 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9191 (Fx_hide_tip, Fx_file_dialog):
9192 * w32menu.c (set_frame_menubar):
9193 Use ptrdiff_t, not int, for consistency with rest of code.
9194 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9195 (select_window, Fdelete_other_windows_internal)
9196 (window_scroll_pixel_based, window_scroll_line_based)
9197 (Frecenter, Fset_window_configuration):
9198 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9199 (Fset_window_hscroll, run_window_configuration_change_hook)
9200 (set_window_buffer, temp_output_buffer_show, scroll_command)
9201 (Fscroll_other_window, Frecenter):
9202 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9203 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9204 Don't assume fixnum fits in int.
9205 (Fset_window_scroll_bars):
9206 Check that fixnums are in proper range for system types.
9207 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9208 (string_pos, c_string_pos, number_of_chars, init_iterator)
9209 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9210 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9211 (compute_display_string_end, handle_face_prop)
9212 (face_before_or_after_it_pos, handle_invisible_prop)
9213 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9214 (display_prop_intangible_p, string_buffer_position_lim)
9215 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9216 (get_overlay_strings_1, get_overlay_strings)
9217 (iterate_out_of_display_property, forward_to_next_line_start)
9218 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9219 (get_next_display_element, set_iterator_to_next)
9220 (get_visually_first_element, compute_stop_pos_backwards)
9221 (handle_stop_backwards, next_element_from_buffer)
9222 (move_it_in_display_line_to, move_it_in_display_line)
9223 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9224 (add_to_log, message_dolog, message_log_check_duplicate)
9225 (message2, message2_nolog, message3, message3_nolog
9226 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9227 (current_message_1, truncate_echo_area, truncate_message_1)
9228 (set_message, set_message_1, store_mode_line_noprop)
9229 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9230 (text_outside_line_unchanged_p, check_point_in_composition)
9231 (reconsider_clip_changes)
9232 (redisplay_internal, set_cursor_from_row, try_scrolling)
9233 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9234 (redisplay_window, find_last_unchanged_at_beg_row)
9235 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9236 (trailing_whitespace_p, find_row_edges, display_line)
9237 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9238 (display_mode_element, store_mode_line_string)
9239 (pint2str, pint2hrstr, decode_mode_spec)
9240 (display_count_lines, display_string, draw_glyphs)
9241 (x_produce_glyphs, x_insert_glyphs)
9242 (rows_from_pos_range, mouse_face_from_buffer_pos)
9243 (fast_find_string_pos, mouse_face_from_string_pos)
9244 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9245 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9246 (safe_call, init_from_display_pos, handle_fontified_prop)
9247 (handle_single_display_spec, load_overlay_strings)
9248 (with_echo_area_buffer, setup_echo_area_for_printing)
9249 (display_echo_area, echo_area_display)
9250 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9251 (update_tool_bar, hscroll_window_tree, redisplay_internal)
9252 (redisplay_window, dump_glyph_row, display_mode_line)
9253 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9254 (handle_display_spec, display_prop_string_p):
9255 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9256 (handle_single_display_spec, build_desired_tool_bar_string)
9257 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9258 (get_specified_cursor_type):
9259 Check that fixnums are in proper range for system types.
9260 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9261 (Flookup_image_map):
9262 Don't assume fixnums fit in int.
9263 (compare_overlay_entries):
9264 Avoid mishandling comparisons due to subtraction overflow.
9265 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9266 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9267 (handle_tool_bar_click):
9268 Use int, not unsigned, since we prefer signed and the signedness
9269 doesn't matter here.
9270 (get_next_display_element, next_element_from_display_vector):
9271 Use int, not EMACS_INT, when int is wide enough.
9272 (start_hourglass): Use duration_to_sec_usec to do proper
9273 overflow checking on durations.
9274 * xfaces.c (Fbitmap_spec_p):
9275 Check that fixnums are in proper range for system types.
9276 (compare_fonts_by_sort_order):
9277 Avoid mishandling comparisons due to subtraction overflow.
9278 (Fx_family_fonts, realize_basic_faces):
9279 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9280 (Fx_family_fonts):
9281 Don't assume fixnum fits in int.
9282 Use SAFE_ALLOCA_LISP, not alloca.
9283 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9284 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9285 (face_at_buffer_position, face_for_overlay_string)
9286 (face_at_string_position):
9287 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9288 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9289 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9290 (Fx_show_tip):
9291 Check that fixnums are in proper range for system types.
9292 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9293 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9294 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9295 (Fx_change_window_property): Don't assume fixnums fit in int.
9296 * xfont.c (xfont_chars_supported):
9297 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9298 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9299 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9300 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9301 * xml.c (parse_region):
9302 * xrdb.c (magic_file_p):
9303 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9304 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9305 (x_get_local_selection, x_reply_selection_request)
9306 (x_handle_selection_request, wait_for_property_change):
9307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9308 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9309 short is wide enough.
9310 (x_send_client_event): Don't assume fixnum fits in int.
9311 * xterm.c (x_x_to_emacs_modifiers):
9312 Don't assume EMACS_INT overflows nicely into int.
9313 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9314 may come from Lisp.
9315 (handle_one_xevent): NATNUMP can eval its arg twice.
9316 (x_connection_closed):
9317 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9318 * xterm.h: Adjust decls to match defn changes elsewhere.
9319 (struct scroll_bar): Use struct vectorlike_header
9320 rather than rolling our own approximation.
9321 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9322
9323 2012-05-25 Glenn Morris <rgm@gnu.org>
9324
9325 * lisp.mk (lisp): Update for more files being compiled now.
9326
9327 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9328
9329 * lread.c: Remove `read_pure' which makes no difference.
9330 (read_pure): Remove var.
9331 (unreadpure): Remove function.
9332 (readevalloop): Don't call read_list with -1 flag.
9333 (read1, read_vector): Don't test read_pure any more.
9334 (read_list): Simplify.
9335
9336 * fileio.c, character.h: Minor style tweaks.
9337
9338 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9339
9340 * window.h (clip_changed): Remove useless declaration.
9341
9342 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9343
9344 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9345 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9346
9347 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9348
9349 Remove src/m/*.
9350 This directory predates autoconf and is no longer needed nowadays.
9351 Move its few remaining bits of functionality to where they're needed.
9352 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9353 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9354 * m/template.h: Remove.
9355 * Makefile.in (M_FILE): Remove. All uses removed.
9356 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9357 * lisp.h (USE_LSB_TAG):
9358 * mem-limits.h (EXCEEDS_LISP_PTR):
9359 Use VAL_MAX, not VALBITS, in #if.
9360 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9361 (EMACS_UINT): Define unconditionally now.
9362 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9363 (BITS_PER_EMACS_INT): New constants, replacing
9364 what used to be in config.h, but not useful in #if.
9365 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9366 define them any more.
9367 (VAL_MAX): New macro.
9368 (VALMASK): Use it.
9369 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9370 BITS_PER_EMACS_INT, in #if.
9371 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9372 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9373 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9374 * s/ms-w32.h (DATA_START):
9375 Move here from removed file m/intel386.h.
9376 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9377 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9378
9379 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9380
9381 Assume C89 or later.
9382 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9383 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9384 (xrealloc):
9385 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9386 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9387 * textprop.c, tparam.c (NULL): Remove.
9388 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9389 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9390 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9391 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9392 * xterm.c (input_signal_count): Assume volatile works.
9393
9394 2012-05-21 Ken Brown <kbrown@cornell.edu>
9395
9396 * xgselect.c (xg_select): Fix first argument in call to 'select'
9397 (bug#11508).
9398
9399 2012-05-20 Ken Brown <kbrown@cornell.edu>
9400
9401 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9402 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9403
9404 2012-05-19 Ken Brown <kbrown@cornell.edu>
9405
9406 * xfns.c (x_in_use): Remove `static' qualifier.
9407 * xterm.h (x_in_use): Declare.
9408 * xgselect.c: Include xterm.h.
9409 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9410 and `display_arg' (bug#9754).
9411
9412 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9413
9414 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9415
9416 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9417 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9418
9419 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9420
9421 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9422
9423 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9424 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9425
9426 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9427 reference to image_cache->refcount.
9428 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9429
9430 2012-05-17 Juri Linkov <juri@jurta.org>
9431
9432 * search.c (Fword_search_regexp, Fword_search_backward)
9433 (Fword_search_forward, Fword_search_backward_lax)
9434 (Fword_search_forward_lax): Move functions to isearch.el
9435 (bug#10145, bug#11381).
9436
9437 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9438
9439 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9440
9441 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9442
9443 * lread.c (init_obarray): Declare Qt and Qnil as special.
9444
9445 2012-05-14 Glenn Morris <rgm@gnu.org>
9446
9447 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9448 Put "libexec" before "bin", for the sake of init_callproc_1.
9449
9450 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9451
9452 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9453
9454 * unexaix.c: Port to more-recent AIX compilers.
9455 (report_error, report_error_1, make_hdr, copy_sym)
9456 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9457 Make arguments const char *, not char *, to avoid violations of C
9458 standard and to fix some AIX warnings reported by Gilles Pion.
9459
9460 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9461
9462 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9463 already have overlays loaded.
9464 (handle_single_display_spec): Before returning without displaying
9465 fringe bitmap, synchronize the bidi iterator with the main display
9466 iterator, by calling iterate_out_of_display_property.
9467 (iterate_out_of_display_property): Detect buffer iteration by
9468 testing that it->string is a Lisp string.
9469 (get_next_display_element): When the current object is exhausted,
9470 and there's something on it->stack, call set_iterator_to_next to
9471 proceed with what's on the stack, instead of returning zero.
9472 (set_iterator_to_next): If called at the end of a Lisp string,
9473 proceed to consider_string_end without incrementing string
9474 position. Don't increment display vector index past the end of
9475 the display vector. (Bug#11417)
9476 (pos_visible_p): Don't report a position visible when move_it_to
9477 stopped at the last line of window, which happens to be scanned
9478 backwards by the bidi iteration. (Bug#11464)
9479
9480 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9481
9482 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9483 and right-margin display specs even if the spec is invalid or we
9484 are on a TTY, and thus unable to display on the fringes.
9485 That's because the text with the property will not be displayed anyway,
9486 so we need to signal to the caller that this is a "replacing"
9487 display spec. This fixes display when the spec is invalid or we
9488 are on a TTY.
9489
9490 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9491
9492 * unexaix.c (make_hdr): Fix typo in prototype.
9493 This bug broke the build on AIX. Problem reported by Gilles Pion.
9494
9495 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9496
9497 * keyboard.c (kbd_buffer_get_event): Read special events also in
9498 batch mode. (Bug#11415)
9499
9500 2012-05-12 Glenn Morris <rgm@gnu.org>
9501
9502 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9503
9504 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9505
9506 * lisp.mk (lisp): Add newcomment.elc.
9507
9508 2012-05-12 Glenn Morris <rgm@gnu.org>
9509
9510 * Makefile.in (MKDIR_P): New, set by configure.
9511 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9512
9513 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9514
9515 Remove unused function hourglass_started.
9516 * dispextern.h (hourglass_started):
9517 * w32fns.c (hourglass_started):
9518 * xdisp.c (hourglass_started): Remove.
9519
9520 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9521
9522 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9523 Update dependencies.
9524
9525 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9526
9527 * xgselect.c (xg_select): Put maxfds+1 into a var.
9528 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9529
9530 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9531
9532 2012-05-10 Dave Abrahams <dave@boostpro.com>
9533
9534 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9535 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9536
9537 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9538
9539 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9540 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9541 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9542 Initialize xd_registered_buses.
9543
9544 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9545
9546 Untag more efficiently if USE_LSB_TAG.
9547 This is based on a proposal by YAMAMOTO Mitsuharu in
9548 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9549 For an admittedly artificial (nth 8000 longlist) benchmark on
9550 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9551 Emacs's overall text size by 1%.
9552 * lisp.h (XUNTAG): New macro.
9553 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9554 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9555 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9556 * eval.c (Fautoload):
9557 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9558 * frame.h (XFRAME): Use XUNTAG.
9559
9560 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9561 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9562 Remove unportable assumptions about print widths of types like
9563 dbus_uint32_t.
9564 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9565 intptr_t when converting between pointer and integer, to avoid GCC
9566 warnings about wrong width.
9567
9568 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9569
9570 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9571 stack for each reader_thread, instead of defaulting to 8MB
9572 determined by the linker. This avoids failures in creating
9573 subprocesses on Windows 7, see the discussion in this thread:
9574 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9575
9576 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9577
9578 Fix up display of the *Minibuf-0* buffer in the mini window.
9579 * keyboard.c (read_char): Don't clear the echo area if there's no
9580 message to clear.
9581 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9582 contents of *Minibuf-0*) if there's no message displayed in its stead.
9583
9584 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9585
9586 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9587 batch mode.
9588
9589 2012-05-06 Chong Yidong <cyd@gnu.org>
9590
9591 * lisp.mk (lisp): Update.
9592
9593 2012-05-05 Jim Meyering <meyering@redhat.com>
9594
9595 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9596
9597 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9598
9599 * data.c (PUT_ERROR): New macro.
9600 (syms_of_data): Use it. Add new error type `user-error'.
9601 * undo.c (user_error): New function.
9602 (Fprimitive_undo): Use it.
9603 * print.c (print_error_message): Adjust print style for `user-error'.
9604 * keyboard.c (user_error): New function.
9605 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9606
9607 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9608
9609 Do not limit current-time-string to years 1000..9999.
9610 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9611 (Fcurrent_time_string): Support any year that is supported by the
9612 underlying localtime representation. Don't use asctime, as it
9613 has undefined behavior for years outside the range -999..9999.
9614
9615 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9616
9617 Fix race conditions involving setenv, gmtime, localtime, asctime.
9618 Without this fix, interrupts could mess up code that uses these
9619 nonreentrant functions, since setting TZ invalidates existing
9620 tm_zone or tzname values, and since most of these functions return
9621 pointers to static storage.
9622 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9623 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9624 Grow the critical sections to include not just invoking
9625 localtime/gmtime, but also accessing these functions' results
9626 including their tm_zone values if any, and any related TZ setting.
9627 (format_time_string): Last arg is now struct tm *, not struct tm **,
9628 so that the struct tm is saved in the critical section.
9629 All callers changed. Simplify allocation of initial buffer, partly
9630 motivated by the fact that memory allocation needs to be outside
9631 the critical section.
9632
9633 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9634
9635 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9636 with RESET_INTERVAL.
9637
9638 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9639 Remove duplicated buffer name initialization.
9640
9641 2012-05-02 Jim Meyering <jim@meyering.net>
9642
9643 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9644
9645 * xfns.c (x_window): Use xstrdup (Bug#11375).
9646
9647 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9648
9649 * xdisp.c (pos_visible_p): If already at a newline from the
9650 display string before the 'while' loop, don't walk back the glyphs
9651 from it3.glyph_row. Solves assertion violation when the display
9652 string begins with a newline (egg.el). (Bug#11367)
9653
9654 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9655
9656 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9657 Move to simple.el.
9658
9659 2012-05-01 Glenn Morris <rgm@gnu.org>
9660
9661 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9662 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9663 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9664 All were removed before 23.1.
9665
9666 * dispnew.c: Remove HAVE_LIBNCURSES test;
9667 it is always true on relevant platforms.
9668
9669 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9670 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9671
9672 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9673
9674 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9675
9676 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9677 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9678 Remove.
9679
9680 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9681
9682 Do not avoid creating empty evaporating overlays (Bug#9642).
9683 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9684 That is, do not delete an evaporating overlay if it becomes
9685 empty after its bounds are adjusted to fit within its buffer.
9686 This fix caused other problems, and I'm reverting it until we get
9687 to the bottom of them.
9688
9689 2012-04-27 Chong Yidong <cyd@gnu.org>
9690
9691 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9692
9693 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9694
9695 * xdisp.c (pos_visible_p): If the window start position is beyond
9696 ZV, start the display from buffer beginning. Prevents assertion
9697 violation in init_iterator when the minibuffer window is scrolled
9698 via the scroll bar.
9699
9700 * window.c (window_scroll_pixel_based): Likewise.
9701
9702 2012-04-27 Chong Yidong <cyd@gnu.org>
9703
9704 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9705
9706 2012-04-27 Glenn Morris <rgm@gnu.org>
9707
9708 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9709 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9710
9711 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9712
9713 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9714 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9715
9716 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9717
9718 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9719 display element, check also the underlying string or buffer
9720 character. (Bug#11341)
9721
9722 * w32menu.c: Include w32heap.h.
9723 (add_menu_item): If the call to AppendMenuW (via
9724 unicode_append_menu) fails, disable Unicode menus only if we are
9725 running on Windows 9X/Me.
9726
9727 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9728
9729 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9730 (xgetint): Add missing shift for LSB tags.
9731
9732 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9733
9734 * keyboard.c (read_char): Don't wipe echo area for select window
9735 events: These might get delayed via `mouse-autoselect-window'
9736 (Bug#11304).
9737
9738 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9739
9740 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9741 manipulation of :loaded-from data.
9742
9743 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9744
9745 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9746 now a cons (bug#11311).
9747
9748 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9749
9750 Do not create empty overlays with the evaporate property (Bug#9642).
9751 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9752 if it becomes empty after its bounds are adjusted to fit within
9753 its buffer. Without this fix, in a nonempty buffer (let ((o
9754 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9755 yields an empty overlay that has the evaporate property, which is
9756 not supposed to happen.
9757
9758 Fix minor GTK3 problems found by static checking.
9759 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9760 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9761 (struct _EmacsFixedClass, emacs_fixed_get_type):
9762 Move decls here from emacsgtkfixed.h, since they needn't be public.
9763 (emacs_fixed_get_type): Now static.
9764 (emacs_fixed_class_init): Omit unused local.
9765 (emacs_fixed_child_type): Remove; unused.
9766 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9767 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9768 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9769 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9770 (EMACS_FIXED_GET_CLASS): Remove; unused.
9771 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9772
9773 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9774 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9775
9776 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9777
9778 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9779 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9780 (__malloc_size_t, __malloc_ptrdiff_t):
9781 Remove. All uses removed, replaced by the definiens if needed,
9782 since we can assume C89 or better now.
9783 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9784 (protect_malloc_state, align, get_contiguous_space)
9785 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9786 (malloc_atfork_handler_child, malloc_enable_thread)
9787 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9788 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9789 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9790 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9791 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9792 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9793 Define using prototypes, not old style.
9794 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9795 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9796 (align): Don't assume that signed integer overflow wraps around.
9797 Omit unused local var.
9798 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9799 (_free_internal_nolock, memalign, mallochook, reallochook):
9800 Omit no-longer-needed casts.
9801 (valloc): Use getpagesize, not __getpagesize.
9802 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9803 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9804
9805 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9806
9807 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9808
9809 Move functions from C to Lisp. Make non-blocking method calls
9810 the default. Implement further D-Bus standard interfaces.
9811
9812 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9813 (QCdbus_request_name_allow_replacement)
9814 (QCdbus_request_name_replace_existing)
9815 (QCdbus_request_name_do_not_queue)
9816 (QCdbus_request_name_reply_primary_owner)
9817 (QCdbus_request_name_reply_in_queue)
9818 (QCdbus_request_name_reply_exists)
9819 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9820 (QCdbus_registered_serial, QCdbus_registered_method)
9821 (QCdbus_registered_signal): New Lisp objects.
9822 (XD_DEBUG_MESSAGE): Use sizeof.
9823 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9824 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9825 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9826 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9827 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9828 (xd_signature, xd_append_arg): Allow float for integer types.
9829 (xd_get_connection_references): New function.
9830 (xd_get_connection_address): Rename from xd_initialize.
9831 Return cached address.
9832 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9833 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9834 level.
9835 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9836 Return number of refcounts.
9837 (Fdbus_get_unique_name): Make stronger parameter check.
9838 (Fdbus_message_internal): New defun.
9839 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9840 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9841 (Fdbus_send_signal, Fdbus_register_service)
9842 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9843 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9844 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9845 (Vdbus_compiled_version, Vdbus_runtime_version)
9846 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9847 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9848 (Vdbus_message_type_signal): New defvars.
9849 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9850 Adapt docstring.
9851
9852 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9853
9854 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9855 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9856 Do not assume ptrdiff_t is the same width as 'int'.
9857
9858 * alloc.c: Handle unusual debugging option combinations.
9859 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9860 since the two debugging options are incompatible.
9861 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9862 is defined.
9863 (mem_init, mem_insert, mem_insert_fixup):
9864 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9865 (NEED_MEM_INSERT): Remove; no longer needed.
9866
9867 2012-04-22 Leo Liu <sdl.web@gmail.com>
9868
9869 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9870
9871 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9872
9873 * sysdep.c [__FreeBSD__]: Minor cleanups.
9874 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9875 Use Emacs indenting style more consistently. Avoid some casts.
9876 Use 'double' consistently rather than mixing 'float' and 'double'.
9877
9878 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9879
9880 * sysdep.c (list_system_processes, system_process_attributes):
9881 Add implementation for FreeBSD (Bug#5243).
9882
9883 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9884
9885 * lisp.mk (lisp): Update.
9886
9887 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9888
9889 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9890 It is never used otherwise.
9891
9892 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9893
9894 * print.c (print_preprocess): Only check print_depth if print-circle
9895 is nil.
9896 (print_object): Check for cycles even when print-circle is nil and
9897 print-gensym is t, but only check print_depth if print-circle is nil.
9898
9899 2012-04-20 Chong Yidong <cyd@gnu.org>
9900
9901 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9902 set the status to "failed" and ensure that sentinel is run.
9903
9904 2012-04-20 Glenn Morris <rgm@gnu.org>
9905
9906 * process.c (Fset_process_inherit_coding_system_flag)
9907 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9908 (Fmake_network_process, Fmake_serial_process): Doc fix.
9909
9910 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9911
9912 * xdisp.c (string_buffer_position_lim): Limit starting position to
9913 BEGV.
9914 (set_cursor_from_row): If called for a mode-line or header-line
9915 row, return zero immediately.
9916 (try_cursor_movement): If inside continuation line, don't back up
9917 farther than the first row after the header line, if any.
9918 Don't consider the header-line row as "partially visible", even if
9919 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9920
9921 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9922
9923 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9924 (bug#11238).
9925
9926 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9927 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9928
9929 configure: new option --enable-gcc-warnings (Bug#11207)
9930 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9931 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9932 (ALL_CFLAGS): Use new macros rather than old.
9933 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9934 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9935 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9936 -Wunused-result, -Wunused-variable. This should go away once
9937 the Emacs and Gnulib regex code is merged.
9938 (xmalloc, xrealloc): Now static.
9939
9940 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9941
9942 * dired.c (Fsystem_groups): Remove unused local.
9943
9944 2012-04-17 Glenn Morris <rgm@gnu.org>
9945
9946 * dired.c (Fsystem_users): Doc fix.
9947
9948 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9949
9950 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9951 (syms_of_dired): Add them.
9952
9953 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9954
9955 Fix minor alloc.c problems found by static checking.
9956 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9957 New extern decls, to avoid calling undeclared functions.
9958 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9959 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9960 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9961 (NEED_MEM_INSERT): New macro.
9962 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9963 Remove one incorrect comment and fix another.
9964
9965 Fix minor ralloc.c problems found by static checking.
9966 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9967 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9968 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9969 (r_alloc_sbrk): Now static.
9970
9971 Improve ralloc.c interface checking.
9972 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9973 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9974 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9975 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9976 [REL_ALLOC]: ... to here, to check interface.
9977 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9978 Remove decls. This fixes an "It stinks!".
9979
9980 * alloc.c (which_symbols): Fix alignment issue / type clash.
9981
9982 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9983
9984 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9985 (struct Lisp_Misc_Any): Likewise.
9986 (struct Lisp_Free): Likewise.
9987 * alloc.c (union aligned_Lisp_Symbol): Define.
9988 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9989 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9990 (union aligned_Lisp_Misc): Define.
9991 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9992 aligned_Lisp_Misc instead of union Lisp_Misc.
9993 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9994
9995 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9996
9997 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9998 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9999 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
10000 * s/netbsd.h, s/sol2-6.h:
10001 Remove definition of GC_MARK_STACK, since the default now works.
10002 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
10003 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
10004 no longer the default.
10005 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
10006
10007 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10008
10009 * lread.c (lisp_file_lexically_bound_p):
10010 Fix hang at ";-*-\n" (bug#11238).
10011
10012 2012-04-14 Eli Zaretskii <eliz@gnu.org>
10013
10014 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
10015 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
10016
10017 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
10018
10019 * nsterm.m (constrainFrameRect): Always constrain when there is only
10020 one screen (Bug#10962).
10021
10022 2012-04-13 Ken Brown <kbrown@cornell.edu>
10023
10024 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
10025
10026 2012-04-13 Reuben Thomas <rrt@sc3d.org>
10027
10028 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
10029
10030 2012-04-11 Daniel Colascione <dancol@dancol.org>
10031
10032 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
10033 against is gone. It's better to use vfork now so that when Cygwin
10034 gains a new, working vfork, we use it automatically (bug#10398).
10035
10036 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10037
10038 * window.c (save_window_save): Obey window-point-insertion-type.
10039
10040 2012-04-11 Glenn Morris <rgm@gnu.org>
10041
10042 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
10043
10044 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10045
10046 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
10047
10048 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
10049
10050 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
10051 (force_quit_count): New var.
10052 (handle_interrupt): Use it.
10053
10054 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
10055
10056 * w32.c (w32_delayed_load): Record the full path of the library
10057 being loaded (bug#10424).
10058
10059 2012-04-09 Glenn Morris <rgm@gnu.org>
10060
10061 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10062 not just in the obarray, before snarfing them. (Bug#11036)
10063
10064 * Makefile.in ($(leimdir)/leim-list.el):
10065 Pass EMACS rather than BUILT_EMACS.
10066
10067 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
10068
10069 * process.c (make_process):
10070 * process.h: Add integer `gnutls_handshakes_tried' member to
10071 process struct.
10072
10073 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10074 Add convenience `GNUTLS_LOG2i' macro.
10075
10076 * gnutls.c (gnutls_log_function2i): Convenience log function.
10077 (emacs_gnutls_read): Use new log functions,
10078 `gnutls_handshakes_tried' process member, and
10079 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10080 attempts per process (connection).
10081
10082 2012-04-09 Chong Yidong <cyd@gnu.org>
10083
10084 * eval.c (Fuser_variable_p, user_variable_p_eh)
10085 (lisp_indirect_variable): Functions deleted.
10086 (Fdefvar): Caller changed.
10087
10088 * callint.c (Finteractive, Fcall_interactively):
10089 * minibuf.c (Fread_variable): Callers changed.
10090
10091 2012-04-09 Eli Zaretskii <eliz@gnu.org>
10092
10093 * xdisp.c (set_cursor_from_row): If the display string appears in
10094 the buffer at position that is closer to point than the position
10095 after the display string, display the cursor on the first glyph of
10096 the display string. Fixes cursor display when a 'display' text
10097 property immediately follows invisible text. (Bug#11094)
10098
10099 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10100
10101 composite.c: use 'double' consistently
10102 * composite.c (get_composition_id): Use 'double' consistently
10103 instead of converting 'float' to 'double' and vice versa; this is
10104 easier to understand and avoids a GCC warning.
10105
10106 2012-04-09 Glenn Morris <rgm@gnu.org>
10107
10108 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10109 preparation for dumping it with emacs. (Bug#4789)
10110 (leimdir): New variable.
10111 ($(leimdir)/leim-list.el): New rule.
10112 (emacs$(EXEEXT)): Depend on leim-list.el.
10113
10114 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10115 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10116 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10117
10118 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10119
10120 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10121 proper alignment.
10122
10123 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
10124
10125 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10126 Remove unused local variable.
10127
10128 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10129
10130 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10131 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10132 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10133 objects, as mark_maybe_pointer will catch them otherwise.
10134 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10135 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10136
10137 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10138
10139 Fix typo that broke non-Windows builds.
10140 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10141
10142 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10143
10144 Support building on MS-Windows with libxml2.
10145
10146 * makefile.w32-in (OBJ2): Add xml.$(O).
10147 (GLOBAL_SOURCES): Add xml.c.
10148 ($(BLD)/xml.$(O)): New dependency list.
10149
10150 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10151 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10152 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10153 [!WINDOWSNT]: New macros.
10154 (init_libxml2_functions, libxml2_loaded_p): New functions.
10155 (parse_region): Call fn_xmlCheckVersion instead of using the macro
10156 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
10157 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10158 Calls xmlCleanupParser only if libxml2 was loaded (or statically
10159 linked in).
10160 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10161 Call init_libxml2_functions before calling libxml2 functions.
10162 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10163
10164 * emacs.c: Don't include libxml/parser.h.
10165 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10166 xmlCleanupParser directly.
10167
10168 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10169
10170 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10171
10172 * indent.c (Fvertical_motion): If there is a display string at
10173 point, use it.vpos to compute how many lines to backtrack after
10174 move_it_to point. (Bug#11133)
10175
10176 2012-04-06 Eli Zaretskii <eliz@gnu.org>
10177
10178 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10179 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10180 about subtle differences between FETCH_CHAR* and STRING_CHAR*
10181 macros related to unification of CJK characters. For the details,
10182 see the discussion following the message here:
10183 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10184
10185 2012-04-04 Chong Yidong <cyd@gnu.org>
10186
10187 * keyboard.c (Vdelayed_warnings_list): Doc fix.
10188
10189 2012-04-01 Eli Zaretskii <eliz@gnu.org>
10190
10191 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10192 instead of alloca. (Bug#11138)
10193
10194 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
10195
10196 * w32menu.c (is_simple_dialog): Properly check lisp types.
10197 (Bug#11141)
10198
10199 2012-03-31 Eli Zaretskii <eliz@gnu.org>
10200
10201 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10202 position we get to after a call to move_it_to fails the
10203 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10204 only if we wind up in a string from display property. (Bug#11063)
10205
10206 * window.c (Fdelete_other_windows_internal): Invalidate the row
10207 and column information about mouse highlight, so that redisplay
10208 restores it after reallocating the glyph matrices. (Bug#7464)
10209
10210 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10211 string comes from a `display' text property, use the buffer
10212 position of that property as if we actually saw that position in
10213 the row's glyphs.
10214 (move_it_by_lines): Remove the assertion that
10215 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10216 violated when there's a before-string at the beginning of a line.
10217 (Bug#11063)
10218
10219 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10220
10221 * xdisp.c (append_space_for_newline): If the default face was
10222 remapped, use the remapped face for the appended newline.
10223 (extend_face_to_end_of_line): Use the remapped default face for
10224 extending the face to the end of the line.
10225 (display_line): Call extend_face_to_end_of_line when the default
10226 face was remapped. (Bug#11068)
10227
10228 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10229
10230 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10231
10232 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10233
10234 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10235
10236 2012-03-27 Glenn Morris <rgm@gnu.org>
10237
10238 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10239 Doc fixes.
10240
10241 2012-03-26 Kenichi Handa <handa@m17n.org>
10242
10243 * dispextern.h (struct glyph): Fix previous change. Change the
10244 bit length of glyphless.ch to 25 (Bug#11082).
10245
10246 2012-03-26 Chong Yidong <cyd@gnu.org>
10247
10248 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10249 (command_loop_1): Use it; inhibit selection update for
10250 handle-select-window too (Bug#8996).
10251
10252 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10253
10254 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10255
10256 2012-03-25 Kenichi Handa <handa@m17n.org>
10257
10258 * dispextern.h (struct glyph): Change the bit length of
10259 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10260
10261 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10262
10263 * s/ms-w32.h (tzname): Include time.h before redirecting to
10264 _tzname. Fixes the MSVC build. (Bug#9960)
10265
10266 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10267
10268 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10269 characters.
10270
10271 * xterm.c (XTread_socket): Only modify handling_signal if
10272 !SYNC_INPUT. (Bug#11080)
10273
10274 2012-03-23 Eli Zaretskii <eliz@gnu.org>
10275
10276 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10277 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10278 when fetching a multibyte character consumes more bytes than
10279 CHAR_BYTES returns, due to unification of CJK characters in
10280 string_char. (Bug#11073)
10281
10282 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10283
10284 * process.c (wait_reading_process_output): Handle pty disconnect
10285 by refraining from sending oneself a SIGCHLD (bug#10933).
10286
10287 2012-03-22 Chong Yidong <cyd@gnu.org>
10288
10289 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10290
10291 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10292 Mark string as coming from a prefix property.
10293 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10294 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10295
10296 2012-03-21 Chong Yidong <cyd@gnu.org>
10297
10298 * xfaces.c (Vface_remapping_alist): Doc fix.
10299
10300 2012-03-20 Eli Zaretskii <eliz@gnu.org>
10301
10302 * w32proc.c (Fw32_set_console_codepage)
10303 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10304 Doc fixes.
10305
10306 2012-03-20 Chong Yidong <cyd@gnu.org>
10307
10308 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10309 to reflect default non-nil value of redisplay-dont-pause.
10310
10311 2012-03-19 Kenichi Handa <handa@m17n.org>
10312
10313 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10314 it fit in a valid range (Bug#11003).
10315
10316 2012-03-18 Eli Zaretskii <eliz@gnu.org>
10317
10318 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10319 that is not from display property, accept the row as a "cursor
10320 row" if one of the string's character has a non-nil `cursor'
10321 property. Fixes cursor positioning when there are newlines in
10322 overlay strings, e.g. in icomplete.el. (Bug#11035)
10323
10324 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10325
10326 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10327
10328 2012-03-12 Chong Yidong <cyd@gnu.org>
10329
10330 * eval.c (inhibit_lisp_code): Rename from
10331 inhibit_window_configuration_change_hook; move from window.c.
10332
10333 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10334 * window.c (run_window_configuration_change_hook)
10335 (syms_of_window): Callers changed.
10336
10337 2012-03-11 Chong Yidong <cyd@gnu.org>
10338
10339 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10340
10341 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10342
10343 2012-03-10 Chong Yidong <cyd@gnu.org>
10344
10345 * frame.c (other_visible_frames): Don't assume the selected frame
10346 is visible (Bug#10955).
10347
10348 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10349
10350 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10351
10352 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10353
10354 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10355 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10356 zero (Bug#10954).
10357
10358 2012-03-03 Glenn Morris <rgm@gnu.org>
10359
10360 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10361
10362 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10363
10364 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10365 position past the first glyph_row that ends at ZV. (Bug#10902)
10366 (redisplay_window, next_element_from_string): Fix typos in
10367 comments.
10368 (redisplay_window): Pass to move_it_vertically the margin in
10369 pixels, not in screen lines.
10370
10371 2012-03-02 Glenn Morris <rgm@gnu.org>
10372
10373 * buffer.c (buffer-list-update-hook): Doc fix.
10374
10375 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10376
10377 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10378 push_it before setting up the iterator for the first overlay
10379 string, even if we have an empty string loaded.
10380 (next_overlay_string): If there's an empty string on the iterator
10381 stack, pop the stack. (Bug#10903)
10382
10383 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10384
10385 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10386 Suggested by Stefan Monnier in
10387 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10388 * alloc.c (widen_to_Lisp_Object): New static function.
10389 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10390 and widening them to Lisp_Objects. This would work even if
10391 USE_LSB_TAG is defined and wide integers are used, which might
10392 happen in a future version of Emacs.
10393
10394 2012-02-25 Chong Yidong <cyd@gnu.org>
10395
10396 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10397 Doc fix.
10398
10399 * xselect.c (Fx_selection_exists_p): Doc fix.
10400 (x_clipboard_manager_save_all): Print an informative message
10401 before saving to clipboard manager.
10402
10403 2012-02-24 Chong Yidong <cyd@gnu.org>
10404
10405 * keyboard.c (process_special_events): Handle all X selection
10406 requests in kbd_buffer, not just the next one (Bug#8869).
10407
10408 2012-02-23 Chong Yidong <cyd@gnu.org>
10409
10410 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10411 call when setting menu-bar-lines and tool-bar-lines parameters.
10412 (unwind_create_frame_1): New helper function.
10413
10414 * window.c (inhibit_window_configuration_change_hook): New var.
10415 (run_window_configuration_change_hook): Obey it.
10416 (syms_of_window): Initialize it.
10417
10418 2012-02-22 Chong Yidong <cyd@gnu.org>
10419
10420 * xterm.c (x_draw_image_relief): Add missing type check for
10421 Vtool_bar_button_margin (Bug#10743).
10422
10423 2012-02-21 Chong Yidong <cyd@gnu.org>
10424
10425 * fileio.c (Vfile_name_handler_alist): Doc fix.
10426
10427 * buffer.c (Fget_file_buffer): Protect against invalid file
10428 handler return value.
10429
10430 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10431
10432 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10433 when computing $valmask.
10434
10435 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10436 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10437 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10438 It's useless in that case, and it can cause problems on hosts
10439 that allocate halves of EMACS_INT values separately.
10440 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10441 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10442 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10443 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10444 it avoids undefined behavior on hosts where shifting right by more
10445 than the word width has undefined behavior.
10446
10447 2012-02-19 Chong Yidong <cyd@gnu.org>
10448
10449 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10450 (Funhandled_file_name_directory, Ffile_name_as_directory)
10451 (Fdirectory_file_name, Fexpand_file_name)
10452 (Fsubstitute_in_file_name): Protect against invalid file handler
10453 return values (Bug#10845).
10454
10455 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10456
10457 * .gdbinit (pitx): Fix incorrect references to fields of the
10458 iterator stack.
10459
10460 2012-02-17 Chong Yidong <cyd@gnu.org>
10461
10462 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10463
10464 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10465
10466 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10467 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10468
10469 2012-02-15 Chong Yidong <cyd@gnu.org>
10470
10471 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10472 marked as special. Also, starting docstrings with * is obsolete.
10473
10474 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10475
10476 * gnutls.c (emacs_gnutls_write): Fix last change.
10477
10478 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10479
10480 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10481 send_process.
10482
10483 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10484
10485 * keymap.c (Fsingle_key_description): Handle char ranges.
10486
10487 2012-02-12 Chong Yidong <cyd@gnu.org>
10488
10489 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10490 as that creates a dangerous corner case.
10491
10492 * window.c (Fdelete_window_internal): Invalidate the mouse
10493 highlight (Bug#9904).
10494
10495 2012-02-12 Glenn Morris <rgm@gnu.org>
10496
10497 * xselect.c (Fx_own_selection_internal)
10498 (Fx_get_selection_internal, Fx_disown_selection_internal)
10499 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10500 * nsselect.m (Fx_own_selection_internal)
10501 (Fx_disown_selection_internal, Fx_selection_exists_p)
10502 (Fx_selection_owner_p, Fx_get_selection_internal):
10503 Sync docs and argument specs with the xselect.c versions.
10504
10505 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10506
10507 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10508
10509 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10510
10511 * w32select.c (Fx_selection_exists_p): Sync doc string and
10512 argument list with xselect.c. (Bug#10783)
10513
10514 * w16select.c (Fx_selection_exists_p): Sync doc string and
10515 argument list with xselect.c. (Bug#10783)
10516
10517 2012-02-10 Glenn Morris <rgm@gnu.org>
10518
10519 * fns.c (Fsecure_hash): Doc fix.
10520
10521 2012-02-09 Kenichi Handa <handa@m17n.org>
10522
10523 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10524
10525 2012-02-07 Chong Yidong <cyd@gnu.org>
10526
10527 * buffer.c (Fbuffer_local_variables)
10528 (buffer_lisp_local_variables): Handle unbound vars correctly;
10529 don't let Qunbound leak into Lisp.
10530
10531 2012-02-07 Glenn Morris <rgm@gnu.org>
10532
10533 * image.c (Fimagemagick_types): Doc fix.
10534
10535 * image.c (imagemagick-render-type): Change it from a lisp object
10536 to an integer. Move the doc here from the lisp manual.
10537 Treat all values not equal to 0 the same.
10538
10539 2012-02-06 Chong Yidong <cyd@gnu.org>
10540
10541 * doc.c (store_function_docstring): Avoid applying docstring of
10542 alias to base function (Bug#2603).
10543
10544 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10545
10546 * .gdbinit (pp1, pv1): Remove redundant defines.
10547 (pr): Use pp.
10548
10549 2012-02-04 Chong Yidong <cyd@gnu.org>
10550
10551 * nsterm.m: Declare a global (Bug#10694).
10552
10553 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10554
10555 * w32.c (get_emacs_configuration_options):
10556 Include --enable-checking, if specified, in the return value.
10557
10558 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10559
10560 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10561 after rounding frame sizes. (Bug#9723)
10562
10563 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10564
10565 * keyboard.c (adjust_point_for_property): Don't position point
10566 before BEGV. (Bug#10696)
10567
10568 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10569
10570 Handle overflow when computing char display width (Bug#9496).
10571 * character.c (char_width): Return EMACS_INT, not int.
10572 (char_width, c_string_width): Check for overflow when
10573 computing the width; this is possible now that individual
10574 characters can have unbounded width. Problem introduced
10575 by merge from Emacs 23 on 2012-01-19.
10576
10577 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10578
10579 * dbusbind.c (Fdbus_register_method): Mention the return value
10580 :ignore in the docstring.
10581
10582 2012-02-02 Glenn Morris <rgm@gnu.org>
10583
10584 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10585
10586 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10587 Unconditionally set to t. (Bug#10673)
10588 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10589 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10590 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10591
10592 2012-02-02 Kenichi Handa <handa@m17n.org>
10593
10594 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10595 0, do not call append_composite_glyph.
10596
10597 2012-02-02 Kenichi Handa <handa@m17n.org>
10598
10599 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10600 NULL (Bug#6988).
10601 (x_produce_glyphs): If the component of a composition is a null
10602 string, set it->pixel_width to 1 to avoid zero-width glyph.
10603
10604 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10605
10606 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10607 first 2 arguments are identical. This makes inserting large
10608 output from a subprocess an order of magnitude faster on
10609 MS-Windows, where all sbrk'ed memory is always contiguous.
10610
10611 2012-01-31 Glenn Morris <rgm@gnu.org>
10612
10613 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10614 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10615 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10616
10617 2012-01-29 Glenn Morris <rgm@gnu.org>
10618
10619 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10620
10621 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10622
10623 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10624
10625 2012-01-28 Chong Yidong <cyd@gnu.org>
10626
10627 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10628
10629 2012-01-26 Chong Yidong <cyd@gnu.org>
10630
10631 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10632
10633 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10634 repeat counts (Bug#10507).
10635
10636 2012-01-26 Glenn Morris <rgm@gnu.org>
10637
10638 * lread.c (syms_of_lread): Doc fix.
10639
10640 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10641
10642 * coding.c (encode_designation_at_bol): Change return value to
10643 EMACS_INT.
10644
10645 2012-01-25 Chong Yidong <cyd@gnu.org>
10646
10647 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10648
10649 2012-01-21 Chong Yidong <cyd@gnu.org>
10650
10651 * floatfns.c (Fcopysign): Make the second argument non-optional,
10652 since nil is not allowed anyway.
10653
10654 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10655
10656 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10657 (send_process): Likewise.
10658
10659 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10660
10661 * window.c (save_window_save, Fcurrent_window_configuration)
10662 (Vwindow_persistent_parameters): Do not use Qstate.
10663 Rewrite doc-strings.
10664
10665 2012-01-19 Kenichi Handa <handa@m17n.org>
10666
10667 * character.c (char_width): New function.
10668 (Fchar_width, c_string_width, lisp_string_width):
10669 Use char_width (Bug#9496).
10670
10671 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10672
10673 * window.c (Vwindow_persistent_parameters): New variable.
10674 (Fset_window_configuration, save_window_save): Handle persistent
10675 window parameters.
10676
10677 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10678
10679 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10680 thrashing the stack of the thread. (Bug#9087)
10681
10682 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10683
10684 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10685
10686 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10687
10688 * xdisp.c (rows_from_pos_range): Handle the case where the
10689 highlight ends on a newline. (Bug#10464)
10690 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10691 he end column for display of highlight that ends on a newline
10692 before a R2L line.
10693
10694 2012-01-11 Glenn Morris <rgm@gnu.org>
10695
10696 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10697 from load-path also when installation-directory is nil. (Bug#10208)
10698
10699 2012-01-10 Glenn Morris <rgm@gnu.org>
10700
10701 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10702
10703 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10704 Update template values to be closer to their typical values these days.
10705
10706 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10707
10708 * xdisp.c (rows_from_pos_range): Accept additional argument
10709 DISP_STRING, and accept any glyph in a row whose object is that
10710 string as eligible for mouse highlight. Fixes mouse highlight of
10711 display strings from overlays. (Bug#10464)
10712
10713 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10714
10715 emacs: fix an auto-save permissions race condition (Bug#10400)
10716 * fileio.c (auto_saving_dir_umask): New static var.
10717 (Fmake_directory_internal): Use it.
10718 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10719 creating the directory. The old code temporarily assigns
10720 too-generous permissions to the directory.
10721 (do_auto_save_eh): Clear it.
10722 (Fdo_auto_save): Catch all errors, not just file errors, so
10723 that the var is always cleared.
10724
10725 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10726
10727 * search.c (scan_buffer): Pass character positions to
10728 know_region_cache, not byte positions. (Bug#6540)
10729
10730 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10731
10732 * w32.c (sys_rename): Report EXDEV when rename of a directory
10733 fails because the target is on another logical disk. (Bug#10284)
10734
10735 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10736
10737 * xterm.c (x_embed_request_focus): New function.
10738
10739 * xterm.h: Add prototype.
10740
10741 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10742
10743 2012-01-05 Glenn Morris <rgm@gnu.org>
10744
10745 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10746
10747 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10748
10749 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10750 Load gnutls_transport_set_lowat only if GnuTLS version is below
10751 2.11.1.
10752 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10753 GnuTLS versions below 2.11.1.
10754
10755 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10756
10757 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10758 to the doc string advising against its use for altering the way
10759 windows are scrolled.
10760
10761 2011-12-28 Kenichi Handa <handa@m17n.org>
10762
10763 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10764 coding-system ASCII compatible only when it does not produce BOM
10765 on encoding (Bug#10383).
10766
10767 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10768
10769 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10770 can scroll.
10771 (create_and_show_popup_menu): Always use menu_position_func for
10772 Gtk3 (Bug#10361).
10773
10774 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10775
10776 * callint.c (Fcall_interactively): Don't truncate prompt string.
10777
10778 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10779
10780 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10781 property that ends at ZV, so that the bidi iteration could be
10782 resumed from there (after widening). (Bug#10360)
10783
10784 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10785
10786 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10787
10788 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10789
10790 * nsterm.m (x_free_frame_resources):
10791 Release f->output_data.ns->miniimage.
10792 (ns_index_color): Fix indentation. Do not retain
10793 color_table->colors[i].
10794
10795 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10796 before returning.
10797
10798 * nsfns.m (x_set_background_color): Assign return value from
10799 ns_index_color to face-background instead of NSColor*.
10800 (ns_implicitly_set_icon_type): Fix indentation.
10801 Change assignment in for loop to comparison.
10802
10803 * emacs.c (ns_pool): New variable.
10804 (main): Assign ns_pool.
10805 (Fkill_emacs): Call ns_release_autorelease_pool.
10806
10807 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10808 autorelease fdesc, release fdAttrs and tdict.
10809 (ns_get_covering_families): Release charset.
10810 (ns_findfonts): Release NSFontDescriptor created with new.
10811 (ns_uni_to_glyphs): Fix indentation.
10812 (setString): Release attrStr before assigning new value.
10813
10814 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10815
10816 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10817 and NS_IMPL_COCOA.
10818 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10819 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10820
10821 2011-12-18 David Reitter <reitter@cmu.edu>
10822
10823 * nsterm.m (ns_term_init): Subscribe for notifications
10824 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10825 to method trackingNotification in EmacsMenu.
10826
10827 * nsmenu.m (trackingMenu): New variable.
10828 (trackingNotification): New method (from Aquamacs).
10829 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10830 from Aquamacs (Bug#7030).
10831
10832 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10833
10834 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10835 (symbol_to_nsstring): Fix indentation.
10836 (ns_symbol_to_pb): New function.
10837 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10838 (Fns_rotate_cut_buffers_internal): Remove.
10839 (Fns_store_selection_internal): Rename from
10840 Fns_store_cut_buffer_internal.
10841 (ns_get_foreign_selection, Fx_own_selection_internal)
10842 (Fx_disown_selection_internal, Fx_selection_exists_p)
10843 (Fns_get_selection_internal, Fns_store_selection_internal):
10844 Use ns_symbol_to_pb and check if return value is nil.
10845 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10846 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10847 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10848 renamed to Sns_store_selection_internal.
10849 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10850 and remove this function.
10851 (ns_handle_selection_clear): Remove, never used.
10852 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10853 here.
10854
10855 2011-12-17 Ken Brown <kbrown@cornell.edu>
10856
10857 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10858 GID is unknown (Bug#10257).
10859
10860 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10861
10862 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10863 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10864 which caused a build failure on GNU/Linux IA-64. This problem was
10865 introduced by my 2011-10-07 patch.
10866
10867 2011-12-15 Juri Linkov <juri@jurta.org>
10868
10869 * image.c (imagemagick_error): New function. (Bug#10112)
10870 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10871 Use `imagemagick_error' where ImageMagick functions return
10872 `MagickFalse'.
10873 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10874 proper order.
10875
10876 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10877
10878 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10879 fill background (Bug#8992).
10880
10881 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10882
10883 * window.c (Vwindow_combination_resize)
10884 (Vwindow_combination_limit): Use t instead of non-nil in
10885 doc-strings.
10886 (Vrecenter_redisplay): Add first sentence of doc-string on
10887 separate line.
10888 (Frecenter): Fix doc-string typo.
10889
10890 2011-12-11 Kenichi Handa <handa@m17n.org>
10891
10892 * coding.c (Funencodable_char_position): Pay attention to the
10893 buffer text relocation (Bug#9389).
10894
10895 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10896
10897 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10898 gtk_init (Bug#10100).
10899
10900 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10901
10902 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10903 IT->string is nil. (Bug#10263)
10904
10905 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10906
10907 * nsterm.h (x_free_frame_resources): Declare.
10908
10909 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10910 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10911
10912 * nsterm.h (ns_get_defaults_value): Declare.
10913
10914 * nsterm.m (ns_default): Call ns_get_defaults_value.
10915
10916 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10917
10918 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10919 (Bug#10170)
10920
10921 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10922
10923 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10924 that where the value of an _OBJC_* symbol points to is in the .bss
10925 section (Bug#10240).
10926
10927 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10928
10929 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10930 after the loop to call ccl_driver at least once (Bug#8619).
10931
10932 2011-12-08 Kenichi Handa <handa@m17n.org>
10933
10934 * ftfont.c (get_adstyle_property): Fix previous change
10935 (Bug#10233).
10936
10937 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10938
10939 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10940 dirs from the default value of EMACSLOADPATH (bug#10208).
10941
10942 2011-12-07 Glenn Morris <rgm@gnu.org>
10943
10944 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10945 installation and source directories as well. (Bug#10208)
10946
10947 2011-12-06 Chong Yidong <cyd@gnu.org>
10948
10949 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10950
10951 2011-12-06 Glenn Morris <rgm@gnu.org>
10952
10953 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10954 as an error, not just -1. (Bug#10217)
10955
10956 2011-12-05 Chong Yidong <cyd@gnu.org>
10957
10958 * keyboard.c (process_special_events): New function.
10959 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10960
10961 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10962
10963 * coding.c (encode_designation_at_bol): Don't use uninitialized
10964 local variable (Bug#9318).
10965
10966 2011-12-05 Kenichi Handa <handa@m17n.org>
10967
10968 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10969 return Qnil (Bug#8046, Bug#10193).
10970
10971 2011-12-05 Kenichi Handa <handa@m17n.org>
10972
10973 * coding.c (encode_designation_at_bol): New args charbuf_end and
10974 dst. Return the number of produced bytes. Callers changed.
10975 (coding_set_source): Return how many bytes coding->source was
10976 relocated.
10977 (coding_set_destination): Return how many bytes
10978 coding->destination was relocated.
10979 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10980 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10981
10982 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10983
10984 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10985 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10986 macro (Bug#9318).
10987
10988 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10989
10990 The following changes are to fix Bug#9318.
10991
10992 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10993 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10994 (encode_coding_iso_2022, encode_coding_sjis)
10995 (encode_coding_big5, encode_coding_charset): Use the above macros.
10996
10997 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10998
10999 * lisp.h (process_quit_flag): Fix external declaration.
11000
11001 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
11002
11003 Don't macro-inline non-performance-critical code.
11004 * eval.c (process_quit_flag): New function.
11005 * lisp.h (QUIT): Use it.
11006
11007 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
11008
11009 * nsfns.m (get_geometry_from_preferences): New function.
11010 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
11011
11012 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
11013
11014 * emacs.c (Qkill_emacs): Define.
11015 (syms_of_emacs): Initialize it.
11016 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
11017 Qquit_flag to `kill-emacs' instead.
11018 (quit_throw_to_read_char): Add parameter `from_signal'.
11019 All callers changed. Call Fkill_emacs if requested and safe.
11020 * lisp.h (QUIT): Call Fkill_emacs if requested.
11021
11022 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
11023
11024 * widget.c (update_wm_hints): Return if wmshell is null.
11025 (widget_update_wm_size_hints): New function.
11026
11027 * widget.h (widget_update_wm_size_hints): Declare.
11028
11029 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
11030 widget_update_wm_size_hints (Bug#10104).
11031
11032 2011-12-03 Eli Zaretskii <eliz@gnu.org>
11033
11034 * xdisp.c (handle_invisible_prop): If the invisible text ends just
11035 before a newline, prepare the bidi iterator for consuming the
11036 newline, and keep the current paragraph direction. (Bug#10183)
11037 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
11038
11039 2011-12-02 Juri Linkov <juri@jurta.org>
11040
11041 * search.c (Fword_search_regexp): New Lisp function created from
11042 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
11043 (Fword_search_backward, Fword_search_forward)
11044 (Fword_search_backward_lax, Fword_search_forward_lax):
11045 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
11046 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
11047
11048 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
11049
11050 * fileio.c (Finsert_file_contents): Move after-change-function call
11051 to before the "handled:" label, since all "goto handled" appear in
11052 cases where the *-change-functions have already been properly called
11053 (bug#10117).
11054
11055 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
11056
11057 * keyboard.c (interrupt_signal): Don't call kill-emacs when
11058 waiting for input. (Bug#10169)
11059
11060 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11061
11062 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11063 verifies glyph row's hash code--we have just reallocated the
11064 glyphs, so their contents can be complete garbage. (Bug#10164)
11065
11066 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
11067
11068 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11069
11070 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11071
11072 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11073 attributes are tested _before_ calling verify_row_hash, to protect
11074 against GCC re-ordering of the tests. (Bug#10164)
11075
11076 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
11077
11078 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11079
11080 * xterm.c (handle_one_xevent): Only set async_visible and friends
11081 if net_wm_state_hidden_seen is non-zero (Bug#10002)
11082 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11083 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11084
11085 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11086
11087 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11088 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11089 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11090 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11091 All uses changed to use GCPRO1 etc.
11092 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11093 Revert to old implementation (i.e., before 2011-03-11).
11094
11095 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11096
11097 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11098 of scroll runs so as to avoid assigning disabled bogus rows and
11099 unnecessary graphics copy operations.
11100
11101 2011-11-27 Eli Zaretskii <eliz@gnu.org>
11102
11103 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11104 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11105 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11106 (malloc, free, realloc, calloc): Redirect to e_* only when
11107 compiling Emacs.
11108
11109 * lisp.h (GCTYPEBITS): Move before first use.
11110 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11111 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11112 this macro definition.
11113
11114 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11115 _MSC_VER.
11116
11117 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11118
11119 * gtkutil.c (xg_create_frame_widgets):
11120 Call gtk_window_set_has_resize_grip (FALSE) if that function is
11121 present with Gtk+ 2.0.
11122
11123 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11124
11125 * fileio.c (Finsert_file_contents): Undo previous change; see
11126 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11127
11128 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11129
11130 Rename locals to avoid shadowing.
11131 * fileio.c (Finsert_file_contents):
11132 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11133 * process.c (wait_reading_process_output):
11134 Rename inner 'proc' to 'p' to avoid shadowing.
11135 Indent for consistency with usual Emacs style.
11136
11137 2011-11-25 Eli Zaretskii <eliz@gnu.org>
11138
11139 * xdisp.c (redisplay_window): If cursor row is not fully visible
11140 after recentering, and scroll-conservatively is set to a large
11141 number, scroll window by a few more lines to make the cursor fully
11142 visible and out of scroll-margin. (Bug#10105)
11143 (start_display): Don't move to the next line if the display should
11144 start at a newline that is part of a display vector or an overlay
11145 string. (Bug#10119)
11146
11147 2011-11-24 Juri Linkov <juri@jurta.org>
11148
11149 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11150 after the `MagickPingImage' call. (Bug#10112)
11151
11152 2011-11-23 Chong Yidong <cyd@gnu.org>
11153
11154 * window.c (Fcoordinates_in_window_p): Accept only live windows.
11155
11156 2011-11-23 Martin Rudalics <rudalics@gmx.at>
11157
11158 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11159 making another buffer current. (Bug#10114)
11160
11161 2011-11-23 Glenn Morris <rgm@gnu.org>
11162
11163 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
11164
11165 2011-11-23 Chong Yidong <cyd@gnu.org>
11166
11167 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11168 using it (Bug#5984).
11169
11170 2011-11-22 Eli Zaretskii <eliz@gnu.org>
11171
11172 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11173 and header-lines, as they don't have one computed for them.
11174 (Bug#10098)
11175
11176 * .gdbinit (prow): Make displayed values more self-explaining.
11177 Add row's hash code.
11178
11179 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
11180
11181 * process.c (wait_reading_process_output): Fix asynchrounous
11182 GnuTLS socket handling on some versions of the GnuTLS library.
11183 (wait_reading_process_output): Add comment and URL.
11184
11185 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
11186
11187 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11188
11189 2011-11-21 Chong Yidong <cyd@gnu.org>
11190
11191 * window.c (Fnext_window, Fprevious_window): Doc fix.
11192
11193 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11194
11195 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11196
11197 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11198
11199 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11200
11201 2011-11-20 Martin Rudalics <rudalics@gmx.at>
11202
11203 * window.c (Fset_window_combination_limit): Rename argument
11204 STATUS to LIMIT.
11205 (Vwindow_combination_limit): Remove "status" from doc-string.
11206
11207 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11208
11209 * m/ibms390.h: Remove.
11210 * m/ibms390x.h: Don't include "ibms390.h".
11211
11212 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11213
11214 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11215 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11216
11217 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11218
11219 * casetab.c (Fset_case_table):
11220 * charset.c (Fcharset_after): Fix typos.
11221
11222 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11223
11224 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11225 Otherwise, valgrind does not work on some platforms.
11226 Problem reported by Andreas Schwab in
11227 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11228 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11229 is set, removing the need for VIRT_ADDRESS_VARIES.
11230 (PURE_P): Use a more-efficient implementation that needs just one
11231 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11232 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11233 to 4 (xorl, subq, cmpq, setbe).
11234 * alloc.c (pure): Always extern now, since that's the
11235 VIRT_ADDR_VARIES behavior.
11236 (PURE_POINTER_P): Use a single comparison, not two, for
11237 consistency with the new puresize.h.
11238 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11239 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11240 Remove VIRT_ADDR_VARIES no longer needed.
11241
11242 2011-11-19 Eli Zaretskii <eliz@gnu.org>
11243
11244 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11245 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11246 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11247 behave as if the cursor position were at the window margin.
11248
11249 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11250 and the cursor position is out of bounds, behave as if the cursor
11251 position were at the window margin. (Bug#10075)
11252
11253 2011-11-18 Chong Yidong <cyd@gnu.org>
11254
11255 * window.c (Fwindow_combination_limit): Make first argument
11256 non-optional, since it is meaningless for live windows like the
11257 selected window.
11258
11259 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11260
11261 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11262
11263 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11264
11265 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11266 (graft_intervals_into_buffer): Simplify.
11267
11268 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11269
11270 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11271 hash values of the two rows.
11272 (copy_row_except_pointers): Preserve the used[] arrays and the
11273 hash values of the two rows. (Bug#10035)
11274 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11275
11276 * xdisp.c (row_hash): New function, body extracted from
11277 compute_line_metrics.
11278 (compute_line_metrics): Call row_hash, instead of computing the
11279 hash code inline.
11280
11281 * dispnew.c (verify_row_hash): Call row_hash for computing the
11282 hash code of a row, instead of duplicating code from xdisp.c.
11283
11284 * dispextern.h (row_hash): Add prototype.
11285
11286 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11287
11288 * frame.c (delete_frame): Don't delete the terminal when the last
11289 X frame is closed if emacs is built with GTK toolkit.
11290
11291 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
11292
11293 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11294
11295 2011-11-17 Martin Rudalics <rudalics@gmx.at>
11296
11297 * window.c (Vwindow_splits): Rename to
11298 Vwindow_combination_resize. Suggested by Juri Linkov.
11299 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11300 of Vwindow_splits.
11301
11302 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
11303
11304 * nsfns.m (Fns_font_name):
11305 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11306
11307 2011-11-16 Martin Rudalics <rudalics@gmx.at>
11308
11309 * window.h (window): Rename slot "nest" to "combination_limit".
11310 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11311 (Fset_window_nest): Rename to Fset_window_combination_limit.
11312 (Vwindow_nest): Rename to Vwindow_combination_limit.
11313 (recombine_windows, make_parent_window, make_window)
11314 (Fsplit_window_internal, saved_window)
11315 (Fset_window_configuration, save_window_save): Rename all
11316 occurrences of window_nest to window_combination_limit.
11317
11318 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
11319
11320 * image.c (imagemagick_load_image): Fix typo.
11321
11322 2011-11-14 Eli Zaretskii <eliz@gnu.org>
11323
11324 * xdisp.c (display_line): Move the call to
11325 highlight_trailing_whitespace before the call to
11326 compute_line_metrics, since the latter needs to see the final
11327 faces of all the glyphs to compute ROW's hash value.
11328 Fixes assertion violations in row_equal_p. (Bug#10035)
11329
11330 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11331
11332 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11333 just return (bug#10044).
11334
11335 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11336
11337 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11338 with user-defined heap size. Bump the default size of the temacs
11339 heap to 27MB, to avoid memory warning when running temacs.
11340 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11341
11342 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11343 current_matrix and desired_matrix. (Bug#9990)
11344 (verify_row_hash) [XASSERTS]: New function.
11345 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11346 that the hash value of glyph rows is correct.
11347
11348 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11349
11350 * window.h (window): Remove splits slot.
11351 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11352 (Fdelete_other_windows_internal, make_parent_window)
11353 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11354 (Fset_window_configuration, save_window_save): Don't deal with
11355 split status of windows.
11356 (saved_window): Remove splits slot.
11357 (Vwindow_splits): Rewrite doc-string.
11358
11359 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11360
11361 * xfns.c (unwind_create_frame):
11362 * nsfns.m (unwind_create_frame):
11363 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11364 Vframe_list (Bug#9999).
11365
11366 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11367
11368 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11369
11370 2011-11-11 Kenichi Handa <handa@m17n.org>
11371
11372 * callproc.c (Fcall_process): Set the member dst_multibyte of
11373 process_coding.
11374
11375 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11376
11377 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11378 avoid a crash (bug#9496).
11379
11380 2011-11-09 Chong Yidong <cyd@gnu.org>
11381
11382 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11383 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11384
11385 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11386
11387 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11388
11389 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11390
11391 Avoid some portability problems by eschewing 'extern inline' functions.
11392 The trivial performance wins aren't worth the portability hassles; see
11393 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11394 et seq.
11395 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11396 (window_box_width, window_box_left, window_box_left_offset)
11397 (window_box_right, window_box_right_offset): Undo previous change,
11398 by removing the "extern"s.
11399 * intervals.c (adjust_intervals_for_insertion)
11400 (adjust_intervals_for_deletion): Undo previous change,
11401 making these static again.
11402 (offset_intervals, temp_set_point_both, temp_set_point)
11403 (copy_intervals_to_string): No longer inline.
11404 * xdisp.c (window_text_bottom_y, window_box_width)
11405 (window_box_height, window_box_left_offset)
11406 (window_box_right_offset, window_box_left, window_box_right)
11407 (window_box): No longer inline.
11408
11409 2011-11-08 Chong Yidong <cyd@gnu.org>
11410
11411 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11412 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11413 Signal an error if not a live window.
11414 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11415 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11416
11417 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11418
11419 * lisp.h (syms_of_abbrev): Remove declaration.
11420 Reported by CHENG Gao <chenggao@royau.me>.
11421
11422 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11423
11424 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11425 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11426 of temacs in GUI mode.
11427
11428 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11429
11430 * window.h: Declare delete_all_child_windows instead of
11431 delete_all_subwindows.
11432 * window.c (Fwindow_nest, Fset_window_nest)
11433 (Fset_window_new_total, Fset_window_new_normal)
11434 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11435 (delete_all_subwindows): Rename to delete_all_child_windows.
11436 (Fdelete_other_windows_internal, Fset_window_configuration):
11437 Call delete_all_child_windows instead of delete_all_subwindows.
11438 * frame.c (delete_frame): Call delete_all_child_windows instead
11439 of delete_all_subwindows.
11440
11441 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11442
11443 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11444 This is also needed for porting to any host where GC_MARK_STACK is
11445 not GC_MAKE_GCPROS_NOOPS.
11446 (which_symbols): Use it.
11447
11448 2011-11-07 Kenichi Handa <handa@m17n.org>
11449
11450 * coding.c (coding_set_destination): Check coding->src_pos only
11451 when coding->src_object is a buffer (bug#9910).
11452
11453 * process.c (send_process): Set the member src_multibyte of coding
11454 to 0 (bug#9911) when sending a unibyte text.
11455
11456 * callproc.c (Fcall_process): Set the member src_multibyte of
11457 process_coding to 0 (bug#9912).
11458
11459 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11460
11461 * xmenu.c (cleanup_widget_value_tree): New function.
11462 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11463 calling free_menubar_widget_value_tree directly (Bug#9830).
11464
11465 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11466
11467 Fix some portability problems with 'inline'.
11468 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11469 (window_box_width, window_box_left, window_box_left_offset)
11470 (window_box_right, window_box_right_offset): Declare extern.
11471 Otherwise, these inline functions do not conform to C99 and
11472 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11473 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11474 * intervals.c (adjust_intervals_for_insertion)
11475 (adjust_intervals_for_deletion): Now extern, because otherwise the
11476 extern inline functions 'offset_intervals' couldn't refer to it.
11477 (static_offset_intervals): Remove.
11478 (offset_intervals): Rewrite using the old contents of
11479 static_offset_intervals. The old version didn't conform to C99
11480 because an extern inline function contained a reference to an
11481 identifier with static linkage.
11482
11483 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11484
11485 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11486 GC.
11487
11488 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11489
11490 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11491 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11492 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11493 return Qleft_to_right.
11494
11495 2011-11-06 Chong Yidong <cyd@gnu.org>
11496
11497 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11498 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11499 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11500 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11501 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11502 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11503 (Fwindow_vscroll): Doc fix.
11504 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11505 argument, since it makes no sense to pass a live window and for
11506 consistency with window-child.
11507
11508 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11509
11510 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11511 support MSVC.
11512
11513 2011-11-05 Jason Rumney <jasonr@gnu.org>
11514
11515 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11516 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11517 fonts (Bug#6029).
11518 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11519 bitwise arithmetic preventing use of unicode-sip and non-truetype
11520 opentype fonts.
11521
11522 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11523
11524 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11525 "emacs"-only part.
11526
11527 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11528 initialization code to keep similarity to xfns.c after changes
11529 from 2011-11-05.
11530
11531 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11532
11533 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11534 (unwind_create_frame): New function (Bug#9943).
11535 (Fx_create_frame): Restructure code to be more similar to the one in
11536 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11537 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11538 Move terminal->reference_count++ just before making the frame official
11539 (Bug#9943).
11540
11541 * nsterm.m (x_free_frame_resources): New function.
11542 (x_destroy_window): Move code to x_free_frame_resources.
11543
11544 * xfns.c (unwind_create_frame): Fix comment.
11545 (Fx_create_frame, x_create_tip_frame):
11546 Move terminal->reference_count++ just before making the frame
11547 official. Move initialization of image_cache_refcount and
11548 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11549
11550 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11551
11552 Support MSVC build with newer versions of Visual Studio.
11553 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11554 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11555 nt/gmake.defs.
11556
11557 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11558 which are not supported by MSVC.
11559 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11560 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11561 bitfields.
11562 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11563 types in bitfields.
11564 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11565
11566 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11567
11568 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11569
11570 Support MSVC build with newer versions of Visual Studio.
11571 * w32.c: Don't include w32api.h for MSVC.
11572 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11573
11574 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11575 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11576 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11577 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11578 e_* cousins.
11579 (alloca) [_MSC_VER]: Define to _alloca.
11580
11581 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11582
11583 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11584
11585 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11586
11587 * xdisp.c (note_mouse_highlight): If either of
11588 previous/next-single-property-change returns nil, treat that as
11589 the beginning or the end of the buffer. (Bug#9955)
11590
11591 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11592
11593 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11594 label is not null (Bug#9951).
11595 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11596 may be NULL.
11597
11598 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11599
11600 * window.c (Fwindow_body_size): Mention in the doc string that the
11601 return value is in frame's canonical units. (Bug#9949)
11602
11603 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11604
11605 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11606
11607 * w32fns.c (unwind_create_frame): If needed, free the glyph
11608 matrices of the partially constructed frame. (Bug#9943)
11609 * xfns.c (unwind_create_frame): Likewise.
11610
11611 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11612
11613 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11614 Don't stop backward scan on the continuation glyph, even though
11615 its CHARPOS is positive.
11616 (mouse_face_from_buffer_pos, note_mouse_highlight):
11617 Rename cover_string to disp_string.
11618
11619 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11620
11621 * window.c (temp_output_buffer_show): Don't use
11622 Vtemp_buffer_show_specifiers.
11623 (Vtemp_buffer_show_specifiers): Remove unused variable.
11624
11625 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11626
11627 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11628 past the beginning of the current glyph matrix.
11629
11630 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11631
11632 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11633 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11634 HAVE_GTK3 (Bug#9869).
11635
11636 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11637 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11638
11639 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11640
11641 * xterm.c: Declare x_handle_net_wm_state to return int.
11642 (handle_one_xevent): Check if we are iconified but don't have
11643 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11644 (get_current_wm_state): Return non-zero if not hidden,
11645 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11646 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11647 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11648 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11649
11650 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11651
11652 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11653 so that this new function doesn't get optimized away by a
11654 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11655
11656 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11657
11658 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11659
11660 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11661
11662 Fix the `xbytecode' command.
11663 * .gdbinit (xprintbytestr): New command.
11664 (xwhichsymbols): Rename from `which'; all callers changed.
11665 (xbytecode): Print the byte-code string as well.
11666
11667 2011-10-29 Kim Storm <storm@cua.dk>
11668
11669 * alloc.c (which_symbols): New function.
11670
11671 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11672
11673 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11674 line. (Bug#9903)
11675
11676 2011-10-29 Glenn Morris <rgm@gnu.org>
11677
11678 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11679 Not clear what it was for, and it causes various bugs. (Bug#9839)
11680
11681 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11682
11683 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11684 possible random value that matches one of those tested as
11685 condition to clear the mouse face.
11686
11687 2011-10-28 Chong Yidong <cyd@gnu.org>
11688
11689 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11690
11691 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11692
11693 * window.c (make_window): Initialize phys_cursor_on_p.
11694
11695 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11696
11697 * lisp.h (struct Lisp_Symbol): Update comments.
11698
11699 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11700
11701 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11702
11703 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11704
11705 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11706 <oslsachem@gmail.com> for helping to debug this.
11707
11708 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11709 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11710 (g_b_init_get_glyph_outline_w): New static variables.
11711 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11712 (GetGlyphOutlineW_Proc): New typedefs.
11713 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11714 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11715 New functions.
11716 (w32font_open_internal, compute_metrics):
11717 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11718 instead of calling the "wide" APIs directly.
11719
11720 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11721
11722 * w32.h (syms_of_w32font): Add prototype.
11723
11724 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11725
11726 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11727 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11728 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11729 (Fmove_to_window_line): Doc fix.
11730
11731 2011-10-27 Chong Yidong <cyd@gnu.org>
11732
11733 * process.c (make_process): Set gnutls_state to NULL.
11734
11735 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11736 non-NULL, regardless of GNUTLS_INITSTAGE.
11737 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11738 an error. Set process slots as soon as we allocate them.
11739
11740 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11741
11742 2011-10-27 Chong Yidong <cyd@gnu.org>
11743
11744 * gnutls.c (emacs_gnutls_deinit): New function.
11745 Deallocate credentials structures as well as calling gnutls_deinit.
11746 (Fgnutls_deinit, Fgnutls_boot): Use it.
11747
11748 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11749 (deactivate_process): Call emacs_gnutls_deinit.
11750
11751 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11752
11753 * image.c (x_create_x_image_and_pixmap):
11754 * w32.c (sys_rename, w32_delayed_load):
11755 * w32font.c (fill_in_logfont):
11756 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11757
11758 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11759
11760 * w32fns.c (w32_default_color_map): New function,
11761 extracted from Fw32_default_color_map.
11762 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11763
11764 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11765
11766 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11767
11768 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11769
11770 * keyboard.c (test_undefined): New function (bug#9751).
11771 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11772
11773 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11774
11775 * sysdep.c (init_sys_modes): Fix the check for the controlling
11776 terminal (Bug#6649).
11777
11778 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11779
11780 * dispextern.h (struct bidi_it): New member next_en_type.
11781
11782 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11783 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11784 current character, check also for next_en_type being WEAK_EN.
11785 (bidi_resolve_weak): Don't enter the expensive loop if the current
11786 position is before next_en_pos. Record the bidi type of the first
11787 non-ET, non-BN character we find, in addition to its position.
11788 (bidi_level_of_next_char): Invalidate next_en_type when
11789 next_en_pos is over-stepped.
11790
11791 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11792
11793 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11794 * editfns.c: Rewrite current-time-zone so that it invokes
11795 the equivalent of (format-time-string "%Z") to get the time zone name.
11796 This fixes a bug when the time zone name contains characters that
11797 need converting from the system time locale to Emacs internal format.
11798 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11799 that patch fixed format-time-string to do the conversion, but
11800 I forgot to fix current-time-zone.
11801 (format_time_string): New function, containing most of
11802 what Fformat_time_string used to contain.
11803 (Fformat_time_string): Rewrite in terms of format_time_string.
11804 This doesn't change this function's behavior.
11805 (current-time-zone): Rewrite to use format_time_string.
11806 This fixes the bug reported by Michael Schierl in
11807 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11808 Jason Rumney's 2007-06-07 change worked around this bug, but
11809 didn't fix it.
11810 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11811
11812 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11813
11814 * xdisp.c (start_display): If the character at POS is displayed
11815 via a display vector, reset IT->current.dpvec_index to zero.
11816 (try_window_reusing_current_matrix): If a line ends in a display
11817 vector or the next line starts in a display vector, continue
11818 redrawing the window even though the character position of
11819 start_row was reached.
11820 (Bug#9771, part 2)
11821
11822 2011-10-18 Chong Yidong <cyd@gnu.org>
11823
11824 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11825 with nobreak-char-display too.
11826
11827 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11828
11829 Fix part 3 of bug#9771.
11830 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11831 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11832 non-neutral characters if the current character is a paragraph
11833 separator (a.k.a. Newline). This avoids running the same
11834 expensive loop twice, once when we consume the preceding newline
11835 and the other time when the line actually needs to be displayed.
11836 Avoid the loop when we see neutrals on the base embedding level
11837 following a character whose directionality is the same as the
11838 paragraph's. This avoids running the expensive loop when a line
11839 ends in a long sequence of neutrals, like control characters.
11840 Add assertion against STRONG_AL type. Slightly rearrange code
11841 that determines the type of a neutral given the first non-neutral
11842 that follows it.
11843 (bidi_level_of_next_char): Set next_en_pos to zero when
11844 invalidating its info.
11845
11846 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11847
11848 * xdisp.c (push_display_prop): Determine whether to record string
11849 or buffer position by IT->string, not by IT->method. Allow
11850 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11851 (move_it_vertically_backward): Don't look for character position
11852 immediately after the newline when in a continuation line.
11853 (Bug#9771, part 1)
11854
11855 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11856
11857 * window.c (coordinates_in_window): Rewrite and delabelize
11858 vertical border check. (Bug#5357) (Bug#9618)
11859
11860 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11861
11862 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11863 errors in XSetWindowBorder (bug#9310).
11864
11865 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11866
11867 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11868 avoid crash when xmalloc overrun checking is enabled.
11869
11870 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11871
11872 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11873 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11874 cursor motion with <left> and <right> arrow keys.
11875
11876 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11877 some callers set that themselves.
11878
11879 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11880
11881 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11882 display string and the previous row comes from the same string and
11883 is empty. (Bug#9739) (Bug#9738)
11884
11885 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11886
11887 * doc.c (get_doc_string): Encode file name (bug#9735).
11888
11889 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11890
11891 * bidi.c (bidi_level_of_next_char):
11892 * xdisp.c (get_visually_first_element): Remove old incorrect
11893 comments regarding the Unicode Line Separator character.
11894
11895 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11896
11897 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11898
11899 * alloc.c (Fgc_status): Do not access beyond zombies array
11900 boundary if nzombies > MAX_ZOMBIES.
11901 * alloc.c (dump_zombies): Add missing format specifier.
11902
11903 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11904
11905 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11906 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11907
11908 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11909 Some packages use them to denote characters with modifiers.
11910
11911 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11912
11913 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11914 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11915 matching a pp-number. Rename parameter var to var1.
11916
11917 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11918
11919 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11920
11921 2011-10-08 Glenn Morris <rgm@gnu.org>
11922
11923 * callint.c (Fcall_interactively): Give a more explicit error for the
11924 'c' case with a non-character input. (Bug#8479)
11925
11926 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11927
11928 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11929 lines.
11930 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11931 lines that are hscrolled on the left.
11932
11933 * dispnew.c (buffer_posn_from_coords): Account for a possible
11934 presence of header-line. (Bug#4426)
11935
11936 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11937
11938 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11939 Don't advertise functionality which we discourage or doesn't work.
11940
11941 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11942
11943 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11944 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11945 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11946 this makes Emacs dump core during garbage collection on rare
11947 occasions. sizeof is obviously inferior to offsetof here, so
11948 stick with offsetof.
11949 (GC_POINTER_ALIGNMENT): New macro.
11950 (mark_memory): Omit 3rd (offset) arg; caller changed.
11951 Don't assume EMACS_INT alignment is the same as pointer alignment.
11952
11953 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11954
11955 * keyboard.c (read_key_sequence_remapped): New var.
11956 (read_key_sequence): Compute remapping in the right buffer.
11957 (command_loop_1): Use read_key_sequence's remapping directly.
11958
11959 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11960
11961 * dired.c (file_name_completion): Don't expand file name.
11962 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11963 before checking file name handler.
11964
11965 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11966 they've been requested explicitly (bug#9591).
11967
11968 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11969
11970 * keymap.c (Fsingle_key_description): Use make_specified_string
11971 instead of build_string to build string from push_key_description.
11972 (Bug#5193)
11973
11974 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11975
11976 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11977 This fixes a Y2038 bug on 64-bit hosts.
11978 * buffer.c (reset_buffer):
11979 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11980 (Fclear_buffer_auto_save_failure):
11981 Use 0, not -1, to represent an unset failure time, since time_t
11982 might not be signed.
11983
11984 Remove dependency on glibc malloc internals.
11985 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11986 Move back here from lisp.h, but with their new implementations.
11987 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11988 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11989 * charset.c (charset_table_init): New static var.
11990 (syms_of_charset): Use it instead of xmalloc. This removes a
11991 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11992 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11993 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11994 Move back to alloc.c.
11995 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11996 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11997
11998 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11999
12000 * nsterm.m (windowDidResize): Call x_set_window_size only when
12001 ns_in_resize is true. Otherwise set pixelwidth/height and
12002 call change_frame_size (Bug#9628).
12003
12004 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12005
12006 Port --enable-checking=all to Fedora 14 x86-64.
12007 * charset.c (syms_of_charset): Also account for glibc malloc's
12008 internal overhead when calculating the initial malloc maximum.
12009
12010 Port --enable-checking=all to Fedora 14 x86.
12011 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12012 Move to lisp.h.
12013 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
12014 (overrun_check_realloc, overrun_check_free):
12015 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
12016 That way, xmalloc returns a properly-aligned pointer even if
12017 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
12018 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
12019 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
12020 into account when calculating the initial malloc maximum.
12021 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12022 Move here from alloc.c, so that charset.c can use it too.
12023 Properly align; the old code wasn't right for common 32-bit hosts
12024 when configured with --enable-checking=all.
12025 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12026 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
12027
12028 2011-09-29 Eli Zaretskii <eliz@gnu.org>
12029
12030 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
12031 use EDOM.
12032
12033 2011-09-28 Eli Zaretskii <eliz@gnu.org>
12034
12035 * xdisp.c (compute_display_string_end): If there's no display
12036 string at CHARPOS, return -1.
12037
12038 * bidi.c (bidi_fetch_char): When compute_display_string_end
12039 returns a negative value, treat the character as a normal
12040 character not covered by a display string. (Bug#9624)
12041
12042 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
12043
12044 * lread.c (Fread_from_string): Fix typo in docstring.
12045
12046 2011-09-27 Eli Zaretskii <eliz@gnu.org>
12047
12048 * xdisp.c (handle_invisible_prop): If invisible text ends on a
12049 newline, reseat the iterator instead of bidi-iterating there one
12050 character at a time. (Bug#9610)
12051 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
12052 TO_CHARPOS if the bidi iterator is at base embedding level.
12053
12054 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
12055
12056 * lread.c (readevalloop): Use correct code for NBSP.
12057 (read1): Likewise. (Bug#9608)
12058
12059 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
12060
12061 * dbusbind.c (Fdbus_register_signal): When service is not
12062 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
12063
12064 2011-09-25 Glenn Morris <rgm@gnu.org>
12065
12066 * buffer.c (truncate-lines): Doc fix.
12067
12068 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
12069
12070 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12071 (Fset_window_next_buffers): Doc fix.
12072
12073 2011-09-24 Glenn Morris <rgm@gnu.org>
12074
12075 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
12076
12077 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
12078
12079 Fix minor problems found by static checking.
12080 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12081 * indent.c (Fvertical_motion): Fix == vs = typo.
12082
12083 2011-09-24 Eli Zaretskii <eliz@gnu.org>
12084
12085 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12086 Default value is now t. Doc fix.
12087
12088 * indent.c (Fvertical_motion): Compute and apply the overshoot
12089 logic when moving up, not only when moving down. Fix the
12090 confusing name and values of the it_overshoot_expected variable;
12091 logic changes accordingly. (Bug#9254) (Bug#9549)
12092
12093 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12094 CHARPOS is covered by a display string which includes newlines.
12095 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12096 is covered by a display string with embedded newlines.
12097
12098 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
12099
12100 * dbusbind.c (Fdbus_register_signal): Add match rule to
12101 Vdbus_registered_objects_table. (Bug#9581)
12102 (Fdbus_register_method, Vdbus_registered_objects_table):
12103 Fix docstring.
12104
12105 2011-09-24 Jim Meyering <meyering@redhat.com>
12106
12107 do not ignore write error for any output size
12108 The previous change was incomplete.
12109 While it makes emacs --batch detect the vast majority of stdout
12110 write failures, errors were still ignored whenever the output size is
12111 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12112 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12113 && echo FAIL: ignored write error
12114 FAIL: ignored write error
12115 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12116 && echo FAIL: ignored write error
12117 FAIL: ignored write error
12118 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12119
12120 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12121
12122 * emacs.c (Fkill_emacs): In noninteractive mode exit
12123 non-successfully if a write error occurred on stdout. (Bug#9574)
12124
12125 2011-09-21 Eli Zaretskii <eliz@gnu.org>
12126
12127 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12128 the xassert test.
12129
12130 * dispextern.h (struct it): Update the comment documenting what
12131 can it->OBJECT be.
12132
12133 2011-09-20 Eli Zaretskii <eliz@gnu.org>
12134
12135 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12136 a display string, extend search for cursor position to end of row.
12137 (find_row_edges): If the row ends in a newline from a display
12138 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12139 Handle the case of a display string with multiple newlines.
12140 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12141 non-empty line. Fixes confusing cursor motion with arrow keys at
12142 the beginning of a line that starts with whitespace.
12143
12144 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12145
12146 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12147 (bug#9493).
12148
12149 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
12150
12151 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12152 boolean (Bug#9154).
12153
12154 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12155
12156 * xdisp.c (display_line): Record maximum and minimum buffer
12157 positions even if no glyphs were produced (e.g., by a zero-width
12158 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
12159 buffer positions that will be removed from the glyph row because
12160 they don't fit.
12161 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12162 column is beyond frame width: don't subtract 1 "pixel" when
12163 computing width of the stretch.
12164 (reseat_at_next_visible_line_start): Undo the change made on
12165 2011-09-17 that saved paragraph information and restored it after
12166 the call to `reseat'. (Bug#9545)
12167
12168 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12169
12170 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12171 and turn window cursor on if cleared (Bug#9415).
12172
12173 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
12174
12175 * search.c (boyer_moore): Take unibyte characters from pattern
12176 literally. (Bug#9458)
12177
12178 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12179
12180 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12181
12182 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
12183
12184 Fix minor problem found by static checking.
12185 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12186 initialized, to pacify gcc -Wuninitialized.
12187
12188 * fileio.c: Report proper errno when syscall falls.
12189 (Finsert_file_contents): Save and restore errno,
12190 so that report_file_error outputs the correct diagnostic.
12191 (Fwrite_region) [CLASH_DETECTION]: Likewise.
12192
12193 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12194
12195 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12196
12197 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12198
12199 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12200 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
12201
12202 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12203
12204 * xdisp.c (reseat_at_next_visible_line_start): Keep information
12205 about the current paragraph and restore it after the call to reseat.
12206
12207 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12208 (bidi_find_paragraph_start): Search back for paragraph beginning
12209 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12210 (bidi_move_to_visually_next): Only trigger paragraph-related
12211 computations when the last character is a newline or at EOB, not
12212 just any NEUTRAL_B. (Bug#9470)
12213
12214 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12215 truncated lines if point is covered by a display string. (Bug#9524)
12216
12217 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12218
12219 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12220 (cons_to_x_long): New function.
12221 (lisp_data_to_selection_data): Use it. Correct the test for
12222 short-versus-long data; it was negated. Break out of vector
12223 loop, for efficiency, when a long datum is discovered.
12224
12225 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12226
12227 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12228
12229 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12230
12231 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12232 GCC PR/17406) by declaring this function with external scope.
12233
12234 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12235
12236 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12237 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12238
12239 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12240
12241 * editfns.c (Fformat): Correctly handle text properties on "%%".
12242
12243 2011-09-15 Eli Zaretskii <eliz@gnu.org>
12244
12245 * xterm.c (x_draw_composite_glyph_string_foreground):
12246 * w32term.c (x_draw_composite_glyph_string_foreground):
12247 * term.c (encode_terminal_code):
12248 * composite.c (composition_update_it, get_composition_id):
12249 * xdisp.c (get_next_display_element)
12250 (fill_composite_glyph_string): Add comments about special meaning
12251 of TAB characters in a composition.
12252
12253 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12254
12255 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12256 This occurs when processing a multibyte format.
12257 Problem reported by Wolfgang Jenker.
12258
12259 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12260
12261 * xdisp.c (try_cursor_movement): Only check for exact match if
12262 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12263
12264 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12265
12266 Remove unused external symbols.
12267 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12268 * xdisp.c (calc_pixel_width_or_height): Now static.
12269 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12270 * indent.c (check_display_width):
12271 * w32term.c: Fix comment to match code.
12272 * xterm.c, xterm.h (x_catching_errors): Remove.
12273
12274 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12275
12276 * xselect.c: Use signed conversions more consistently (Bug#9498).
12277 (selection_data_to_lisp_data): Assume incoming selection data are
12278 signed integers, not unsigned. This is to be consistent with
12279 outgoing selection data, which was modified to use signed integers
12280 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12281 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12282 expects long, not unsigned long.
12283
12284 2011-09-14 Eli Zaretskii <eliz@gnu.org>
12285
12286 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12287 computation of loop end. Reported by Johan Bockgård
12288 <bojohan@gnu.org>.
12289
12290 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
12291
12292 * frame.c (Fother_visible_frames_p): Function deleted.
12293
12294 2011-09-12 Eli Zaretskii <eliz@gnu.org>
12295
12296 * indent.c (compute_motion): Process display vector front to back
12297 rather than the other way around. (Bug#2496)
12298
12299 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12300
12301 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12302
12303 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
12304
12305 * minibuf.c (Fread_from_minibuffer): Doc fix.
12306
12307 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12308
12309 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12310 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12311
12312 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12313
12314 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12315 value for non-existent files.
12316
12317 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12318
12319 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12320 set its "size" to -1. This will set the modtime_size field of
12321 the corresponding buffer to -1, which is what
12322 verify-visited-file-modtime expects for files that do not exist.
12323 (Bug#9139)
12324
12325 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12326
12327 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12328 here ...
12329 * lisp.h: ... from here. push_key_description is no longer
12330 defined in keyboard.c, so its declaration should not be in
12331 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12332 logically belongs with push_key_description.
12333
12334 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12335
12336 * buffer.h: Include <sys/types.h> instead of <time.h>.
12337 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12338 Problem reported by Herbert J. Skuhra.
12339
12340 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12341
12342 * xml.c (parse_region): Make the parsing work for
12343 non-comment-starting XML files again (bug#9144).
12344
12345 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12346
12347 * image.c (gif_load): Fix calculation of bottom and right corner.
12348 (Bug#9468)
12349
12350 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12351
12352 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12353 redisplay in small windows.
12354
12355 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12356
12357 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12358
12359 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12360
12361 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12362 Operate on live windows only.
12363
12364 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12365
12366 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12367
12368 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12369
12370 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12371 only under bidi iteration.
12372
12373 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12374
12375 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12376
12377 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12378
12379 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12380 Without this fix, the command to link temacs failed due to an
12381 undefined symbol __builtin_isnan. This is because
12382 /usr/include/iso/math_c99.h #defines isnan(x) to
12383 __builtin_isnan(x), but the bundled gcc, which identifies itself
12384 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12385 a __builtin_isnan.
12386 * floatfns.c (isnan): #undef, and then #define to a clone of
12387 what's in data.c.
12388 (Fisnan): Always define, since it's always available now.
12389 (syms_of_floatfns): Always define isnan at the Lisp level.
12390
12391 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12392
12393 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12394
12395 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12396
12397 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12398 The previous code assumed that file offsets (off_t values) fit in
12399 EMACS_INT variables, which is not true on typical 32-bit hosts.
12400 The code messed up by falsely reporting buffer overflow in cases
12401 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12402 when "big" contains more than 2**29 bytes, even though this
12403 inserts just one byte and does not overflow the buffer.
12404 (Finsert_file_contents): Store file offsets as off_t
12405 values, not as EMACS_INT values. Check for overflow when
12406 converting between EMACS_INT and off_t. When checking for
12407 buffer overflow or for overlap, take the offsets into account.
12408 Don't use EMACS_INT for small values where int suffices.
12409 When checking for overlap, fix a typo: ZV was used where
12410 ZV_BYTE was intended.
12411 (Fwrite_region): Don't assume off_t fits into 'long'.
12412 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12413
12414 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12415
12416 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12417
12418 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12419
12420 sprintf-related integer and memory overflow issues (Bug#9412).
12421
12422 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12423 (esprintf, exprintf, evxprintf): New functions.
12424 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12425 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12426 (modify_event_symbol): Do not assume that the length of
12427 name_alist_or_stem is safe to alloca and fits in int.
12428 (Fexecute_extended_command): Likewise for function name and binding.
12429 (Frecursion_depth): Wrap around reliably on integer overflow.
12430 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12431 since some callers pass EMACS_INT values.
12432 (Fsingle_key_description): Don't crash if symbol name contains more
12433 than MAX_ALLOCA bytes.
12434 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12435 (get_minibuffer): Arg is now EMACS_INT, not int.
12436 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12437 (esprintf, exprintf, evxprintf): New decls.
12438 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12439
12440 * dbusbind.c (signature_cat): New function.
12441 (xd_signature, Fdbus_register_signal):
12442 Do not overrun buffer; instead, report string overflow.
12443
12444 * dispnew.c (add_window_display_history): Don't overrun buffer.
12445 Truncate instead; this is OK since it's just a log.
12446
12447 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12448 even if the time zone offset is outlandishly large.
12449 Don't mishandle offset == INT_MIN.
12450
12451 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12452 when creating daemon; the previous buffer-overflow check was incorrect.
12453
12454 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12455 which has the guts of the old verror function.
12456
12457 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12458 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12459
12460 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12461 (font_unparse_xlfd): Don't blindly alloca long strings.
12462 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12463 fits in int, when using sprintf. Use single snprintf to count
12464 length of string rather than counting it via multiple sprintfs;
12465 that's simpler and more reliable.
12466 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12467 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12468 sprintf, in case result does not fit in int.
12469
12470 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12471 (fontset_from_font): Print it.
12472
12473 * frame.c (tty_frame_count): Now printmax_t, not int.
12474 (make_terminal_frame, set_term_frame_name): Print it.
12475 (x_report_frame_params): In X, window IDs are unsigned long,
12476 not signed long, so print them as unsigned.
12477 (validate_x_resource_name): Check for implausibly long names,
12478 and don't assume name length fits in 'int'.
12479 (x_get_resource_string): Don't blindly alloca invocation name;
12480 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12481 not fit in int.
12482
12483 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12484 (xg_check_special_colors, xg_set_geometry):
12485 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12486
12487 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12488 Use esprintf, not sprintf, in case result does not fit in int.
12489
12490 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12491 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12492 it as a large positive number.
12493 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12494 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12495
12496 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12497 in case result does not fit in int.
12498
12499 * print.c (float_to_string): Detect width overflow more reliably.
12500 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12501 buffer overrun. Don't assume list length fits in 'int'. Treat
12502 print length of 0 as 0, not as infinity; to be consistent with other
12503 uses of print length in this function. Don't overflow print length
12504 index. Don't assume hash table size fits in 'long', or that
12505 vectorlike size fits in 'unsigned long'.
12506
12507 * process.c (make_process): Use printmax_t, not int, to format
12508 process-name gensyms.
12509
12510 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12511
12512 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12513 to avoid potential buffer overrun.
12514
12515 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12516 if X resource line is longer than 512 bytes.
12517
12518 * xfns.c (x_window): Make sprintf buffer a bit bigger
12519 to avoid potential buffer overrun.
12520
12521 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12522
12523 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12524
12525 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12526
12527 Integer overflow fixes for scrolling, etc.
12528 Without these, Emacs silently mishandles large integers sometimes.
12529 For example, "C-u 4294967297 M-x recenter" was treated as if
12530 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12531
12532 * xdisp.c (try_window_id): Check Emacs fixnum range before
12533 converting to 'int'.
12534
12535 * window.c (window_scroll_line_based, Frecenter):
12536 Check that an Emacs fixnum is in range before assigning it to 'int'.
12537 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12538 values converted from Emacs fixnums.
12539 (Frecenter): Don't wrap around a line count if it is out of 'int'
12540 range; instead, treat it as an extreme value.
12541 (Fset_window_configuration, compare_window_configurations):
12542 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12543
12544 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12545 that can exceed INT_MAX. Check that EMACS_INT value is in range
12546 before assigning it to the (possibly-narrower) index.
12547 (match_limit): Don't assume that a fixnum can fit in 'int'.
12548
12549 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12550 exceed INT_MAX.
12551
12552 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12553 (Fvertical_motion): Don't wrap around LINES values that don't fit
12554 in 'int'. Instead, treat them as extreme values. This is good
12555 enough for windows, which can't have more than INT_MAX lines anyway.
12556
12557 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12558
12559 * Require libxml/parser.h to avoid compilation warning.
12560
12561 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12562
12563 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12564 since this reportedly can destroy thread storage.
12565
12566 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12567
12568 * syntax.c (find_defun_start): Update all cache variables if
12569 exiting early (Bug#9401).
12570
12571 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12572
12573 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12574
12575 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12576 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12577 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12578
12579 * term.c (tty_append_glyph): New function.
12580 (produce_stretch_glyph): Static function and its prototype deleted.
12581
12582 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12583 Add prototypes.
12584
12585 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12586
12587 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12588 when checking :margin (Bug#9390).
12589 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12590 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12591 so that the name doesn't mislead. All uses changed.
12592
12593 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12594
12595 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12596 set_tty_hooks.
12597
12598 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12599
12600 * xdisp.c (move_it_to): Don't bail out early when reaching
12601 position beyond to_charpos, if we are scanning backwards.
12602 (move_it_vertically_backward): When DY == 0, make sure we get to
12603 the first character in the line after the newline.
12604
12605 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12606
12607 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12608 (ccl_driver): Do not generate an out-of-range pointer.
12609 (Fccl_execute_on_string): Remove unnecessary check for
12610 integer overflow, noted by Stefan Monnier in
12611 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12612 Remove a FIXME that didn't need fixing.
12613 Simplify the newly-introduced buffer reallocation code.
12614
12615 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12616
12617 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12618
12619 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12620
12621 Integer and memory overflow issues (Bug#9196).
12622
12623 * doc.c (get_doc_string): Rework so that
12624 get_doc_string_buffer_size is the actual buffer size, rather than
12625 being 1 less than the actual buffer size; this makes xpalloc more
12626 convenient.
12627
12628 * image.c (x_allocate_bitmap_record, cache_image):
12629 * xselect.c (Fx_register_dnd_atom):
12630 Simplify previous changes by using xpalloc.
12631
12632 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12633 since either will do and ptrdiff_t is convenient with xpalloc.
12634
12635 * charset.c (charset_table_size)
12636 (struct charset_sort_data.priority): Now ptrdiff_t.
12637 (charset_compare): Don't overflow if priorities differ greatly.
12638 (Fsort_charsets): Don't assume list length fits in int.
12639 Check for size-calculation overflow when allocating sort data.
12640 (syms_of_charset): Allocate an initial charset table that is
12641 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12642
12643 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12644
12645 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12646 The actual value is always <= INT_MAX, and leaving it unsigned made
12647 overflow checking harder.
12648
12649 * dispextern.h (struct glyph_matrix.rows_allocated)
12650 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12651 with xpalloc. The values are still always <= INT_MAX.
12652
12653 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12654
12655 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12656 (SAFE_NALLOCA): New macro.
12657
12658 * region-cache.c (struct boundary.pos, find_cache_boundary)
12659 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12660 (set_cache_region, invalidate_region_cache)
12661 (revalidate_region_cache, know_region_cache, region_cache_forward)
12662 (region_cache_backward, pp_cache):
12663 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12664 so that ptrdiff_t * can be passed to xpalloc.
12665 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12666 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12667 (pp_cache): Don't assume cache_len fits in int.
12668 * region-cache.h: Adjust extern decls to match.
12669
12670 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12671 EMACS_INT, since either will do, for xpalloc.
12672
12673 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12674 (xnmalloc, xnrealloc, xpalloc): New functions.
12675
12676 * bidi.c (bidi_shelve_header_size): New constant.
12677 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12678 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12679
12680 * bidi.c (bidi_cache_shrink):
12681 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12682 (overlay_strings):
12683 Don't update size of array until after memory allocation succeeds,
12684 because xmalloc/xrealloc may not return.
12685 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12686 now that we have proper integer overflow checking.
12687 (record_overlay_string, overlay_strings): Catch overflows when
12688 calculating size of overlay_str_buf.
12689
12690 * callproc.c (Fcall_process): Check for size overflow when
12691 calculating size of args2.
12692 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12693 Normally we prefer signed values, but sticking with ptrdiff_t would
12694 require adding more-complicated checks.
12695
12696 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12697 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12698 Redo buffer-overflow calculations to avoid integer overflow.
12699 Add a FIXME comment where memory seems to be over-allocated.
12700
12701 * character.c (Fstring): Check for size-calculation overflow.
12702
12703 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12704 unnecessary integer overflow. Check for size overflow.
12705 (encode_coding_object): Don't update size until xmalloc succeeds.
12706
12707 * composite.c (get_composition_id): Check for overflow in glyph
12708 length calculations.
12709
12710 Integer and memory overflow fixes for display code.
12711 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12712 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12713 (scrolling_window): Check for overflow in size calculations.
12714 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12715 Don't assume glyph table len fits in int.
12716 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12717 (row_table_size): Now ptrdiff_t, not int.
12718 (scrolling_window): Avoid overflow in size calculations.
12719 Don't update size until allocation succeeds.
12720 * fns.c (concat): Check for overflow in size calculations.
12721 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12722 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12723 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12724
12725 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12726 (get_doc_string): Check for size calculation overflow.
12727 Don't update size until allocation succeeds.
12728 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12729 EMACS_INT, where ptrdiff_t will do.
12730 (Fsubstitute_command_keys): Check for string overflow.
12731
12732 * editfns.c (set_time_zone_rule): Don't assume environment length
12733 fits in int.
12734 (message_length): Now ptrdiff_t, not int.
12735 (Fmessage_box): Don't update size until allocation succeeds.
12736 Don't assume message length fits in int.
12737 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12738
12739 * emacs.c (main): Do not reallocate argv, since there is a null at
12740 the end that can be overwritten, and this way there's no need to
12741 worry about size-calculation overflow.
12742 (sort_args): Check for size-calculation overflow.
12743
12744 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12745 alloc succeeds.
12746 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12747
12748 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12749 (x_set_scroll_bar_width, x_figure_window_size):
12750 Check for integer overflow.
12751 (x_set_alpha): Do not assume XINT fits in int.
12752
12753 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12754 This is for the members text_lines, text_cols, total_lines, total_cols,
12755 where the system imposes an 'int' limit.
12756
12757 * fringe.c (Fdefine_fringe_bitmap):
12758 Don't update size until alloc works.
12759
12760 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12761 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12762
12763 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12764 Check for size-calculation overflow.
12765 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12766 do, as we prefer signed integers.
12767 (id_to_widget.max_size, id_to_widget.used)
12768 (xg_store_widget_in_map, xg_remove_widget_from_map)
12769 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12770 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12771 Use and return ptrdiff_t, not int.
12772 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12773 * gtkutil.h: Change prototypes to match the above.
12774
12775 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12776 are duplicate now that they've been promoted to lisp.h.
12777 (x_allocate_bitmap_record, x_alloc_image_color)
12778 (make_image_cache, cache_image, xpm_load):
12779 Don't update size until alloc is done.
12780 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12781 (x_detect_edges):
12782 Check for size calculation overflow.
12783 (ct_colors_allocated_max): New constant.
12784 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12785 overflow.
12786
12787 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12788 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12789 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12790 Use ptrdiff_t, not int, to count maps.
12791 (read_char_minibuf_menu_prompt): Check for overflow in size
12792 calculations. Don't update size until allocation succeeds.
12793 Redo calculations to avoid overflow.
12794 * keyboard.h: Change prototypes to match the above.
12795
12796 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12797 to count maps.
12798 (current_minor_maps): Check for size calculation overflow.
12799 * keymap.h: Change prototypes to match the above.
12800
12801 * lread.c (read1, init_obarray): Don't update size until alloc done.
12802
12803 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12804 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12805
12806 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12807 Now ptrdiff_t, not int.
12808 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12809 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12810
12811 * process.c (Fnetwork_interface_list): Check for overflow
12812 in size calculation.
12813
12814 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12815
12816 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12817 overflow. Don't bother calling xmalloc when xrealloc will do.
12818
12819 * search.c (Freplace_match): Check for size calculation overflow.
12820 (Fset_match_data): Don't assume list lengths fit in 'int'.
12821
12822 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12823 for command line length. Do not attempt to address one before the
12824 beginning of an array, as that's not portable.
12825
12826 * term.c (max_frame_lines): Remove; unused.
12827 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12828 not int.
12829 (encode_terminal_code, calculate_costs): Check for size
12830 calculation overflow.
12831 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12832 table lengths and related sizes. Don't update size until alloc
12833 done. Redo calculations to avoid overflow.
12834 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12835
12836 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12837 subtracting pointers.
12838 (gobble_line): Check for overflow more carefully. Don't update size
12839 until alloc done.
12840
12841 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12842 Don't update size until alloc done.
12843 Redo size calculations to avoid overflow.
12844 Check for size calculation overflow.
12845 (main) [DEBUG]: Fix typo in invoking tparam1.
12846
12847 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12848 Use ptrdiff_t, not int, for sizes.
12849 (store_mode_line_noprop_char): Don't update size until alloc done.
12850
12851 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12852 Use ptrdiff_t, not int, for sizes.
12853 (Finternal_make_lisp_face, cache_face):
12854 Check for size calculation overflow.
12855 (cache_face): Treat size calculation overflows as if they were
12856 memory exhaustion (the usual treatment), rather than aborting.
12857
12858 * xfns.c (x_encode_text, x_set_name_internal)
12859 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12860 sizes, since they can exceed INT_MAX in size. Check for size
12861 calculation overflow.
12862
12863 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12864 (xg_select): Check for size calculation overflow.
12865 Don't update size until alloc done.
12866
12867 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12868 as sprintf is limited to int lengths.
12869
12870 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12871 (X_LONG_MIN): New macros.
12872 Use them to make the following changes clearer.
12873 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12874 This change doesn't affect the value now, but it may help remind
12875 future maintainers not to raise the value too much later.
12876 (SELECTION_QUANTUM): Remove, replacing with ...
12877 (selection_quantum): ... new function, which avoids overflow.
12878 All uses changed.
12879 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12880 assumption that selection length fits in 'int'.
12881 (x_reply_selection_request, x_handle_selection_request)
12882 (x_get_window_property, receive_incremental_selection)
12883 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12884 (lisp_data_to_selection_data, clean_local_selection_data):
12885 Use ptrdiff_t, not int, to record length of selection.
12886 (x_reply_selection_request, x_get_window_property)
12887 (receive_incremental_selection, x_property_data_to_lisp):
12888 Redo calculations to avoid overflow.
12889 (x_reply_selection_request): When sending hint, ceiling it at
12890 X_LONG_MAX rather than relying on wraparound overflow to send
12891 something.
12892 (x_get_window_property, receive_incremental_selection)
12893 (lisp_data_to_selection_data, x_property_data_to_lisp):
12894 Check for size-calculation overflow.
12895 (x_get_window_property, receive_incremental_selection)
12896 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12897 Don't store size until memory allocation succeeds.
12898 (x_get_window_property): Plug memory leak on memory exhaustion.
12899 Don't double-block input; malloc is safe here. Don't assume 2**34
12900 - 4 fits in unsigned long. Add an xassert to check
12901 XGetWindowProperty overflow. Be more careful about overflow
12902 calculations, and distinguish size from memory overflow better.
12903 (receive_incremental_selection): When tracing, don't assume
12904 unsigned int is less than INT_MAX.
12905 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12906 harmful) conversions of unsigned short to int.
12907 (lisp_data_to_selection_data): Don't assume that integers
12908 in the range -65535 through -1 fit in an X unsigned short.
12909 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12910 result parameters unless successful. Rely on cons_to_unsigned
12911 to report problems with elements; the old code wasn't right anyway.
12912 (x_check_property_data): Check for int overflow; we cannot use
12913 a wider type due to X limits.
12914 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12915
12916 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12917
12918 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12919 (x_term_init): Check for size calculation overflow.
12920 (x_color_cells): Don't store size until memory allocation succeeds.
12921 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12922 Don't assume alloca size is less than MAX_ALLOCA.
12923 (x_term_init): Don't assume length fits in int (sprintf is limited
12924 to int size).
12925
12926 Use ptrdiff_t for composition IDs.
12927 * character.c (lisp_string_width):
12928 * composite.c (composition_table_size, n_compositions)
12929 (get_composition_id, composition_gstring_from_id):
12930 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12931 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12932 * window.c (Frecenter):
12933 Use ptrdiff_t, not int, for composition IDs.
12934 * composite.c (get_composition_id): Check for integer overflow.
12935 * composite.h: Adjust prototypes to match the above changes.
12936
12937 Use ptrdiff_t for hash table indexes.
12938 * category.c (hash_get_category_set):
12939 * ccl.c (ccl_driver):
12940 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12941 * coding.c (coding_system_charset_list, detect_coding_system):
12942 * coding.h (struct coding_system.id):
12943 * composite.c (get_composition_id, gstring_lookup_cache):
12944 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12945 * image.c (xpm_get_color_table_h):
12946 * lisp.h (hash_lookup, hash_put):
12947 * minibuf.c (Ftest_completion):
12948 Use ptrdiff_t for hash table indexes, not int (which is too
12949 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12950 32-bit --with-wide-int hosts).
12951
12952 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12953 Add a FIXME comment about memory leaks.
12954 (syms_of_charset): Don't assume xmalloc returns.
12955
12956 Don't assume that stated character widths fit in int.
12957 * character.c (Fchar_width, c_string_width, lisp_string_width):
12958 * character.h (CHAR_WIDTH):
12959 * indent.c (MULTIBYTE_BYTES_WIDTH):
12960 Use sanitize_char_width to avoid undefined and/or bad behavior
12961 with outlandish widths.
12962 * character.h (sanitize_tab_width): Rename from sanitize_width,
12963 now that we have two such functions. All uses changed.
12964 (sanitize_char_width): New inline function.
12965
12966 Don't assume that tab-width fits in int.
12967 * character.h (sanitize_width): New inline function.
12968 (SANE_TAB_WIDTH): New macro.
12969 (ASCII_CHAR_WIDTH): Use it.
12970 * indent.c (sane_tab_width): Remove. All uses replaced by
12971 SANE_TAB_WIDTH (current_buffer).
12972 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12973
12974 * fileio.c: Integer overflow issues with file modes.
12975 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12976
12977 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12978 Remove unreachable code.
12979 (read_hex, load_charset_map_from_file): Check for integer overflow.
12980
12981 * xterm.c: Don't go over XClientMessageEvent limit.
12982 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12983 (x_send_scroll_bar_event): Likewise. Check that the size does not
12984 exceed limits imposed by XClientMessageEvent, as well as the usual
12985 ptrdiff_t and size_t limits.
12986
12987 * keyboard.c: Overflow, signedness and related fixes.
12988 (make_lispy_movement): Use same integer type in forward decl
12989 that is used in the definition.
12990 (read_key_sequence, keyremap_step):
12991 Change bufsize argument back to int, undoing my 2011-03-30 change.
12992 We prefer signed types, and int is wide enough here.
12993 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12994 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12995 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12996 length, not size_t. Use ptrdiff_t for index, not int.
12997 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12998 possibility of integer overflow.
12999
13000 Overflow, signedness and related fixes for images.
13001
13002 * dispextern.h (struct it.stack[0].u.image.image_id)
13003 (struct_it.image_id, struct image.id, struct image_cache.size)
13004 (struct image_cache.used, struct image_cache.ref_count):
13005 * gtkutil.c (update_frame_tool_bar):
13006 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
13007 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
13008 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
13009 * nsmenu.m (update_frame_tool_bar):
13010 * xdisp.c (calc_pixel_width_or_height):
13011 * xfns.c (image_cache_refcount):
13012 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
13013 on typical 64-bit hosts.
13014
13015 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13016 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
13017 Omit unnecessary casts to int.
13018 (parse_image_spec): Check that integers fall into 'int' range
13019 when the callers expect that.
13020 (image_ascent): Redo ascent calculation to avoid int overflow.
13021 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
13022 (lookup_image): Remove unnecessary tests.
13023 (xbm_image_p): Locals are now of int, not EMACS_INT,
13024 since parse_image_check makes sure they fit into int.
13025 (png_load, gif_load, svg_load_image):
13026 Prefer int to unsigned where either will do.
13027 (tiff_handler): New function, combining the cores of the
13028 old tiff_error_handler and tiff_warning_handler.
13029 This function is rewritten to use vsnprintf and thereby avoid
13030 stack buffer overflows. It uses only the features of vsnprintf
13031 that are common to both POSIX and native Microsoft.
13032 (tiff_error_handler, tiff_warning_handler): Use it.
13033 (tiff_load, gif_load, imagemagick_load_image):
13034 Don't assume :index value fits in 'int'.
13035 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
13036 (imagemagick_load_image): Check that crop parameters fit into
13037 the integer types that MagickCropImage accepts. Don't assume
13038 Vimagemagick_render_type has a nonnegative value. Don't assume
13039 size_t fits in 'long'.
13040 (gs_load): Use printmax_t to print the widest integers possible.
13041 Check for integer overflow when computing image height and width.
13042
13043 2011-08-26 Eli Zaretskii <eliz@gnu.org>
13044
13045 * xdisp.c (redisplay_window): Don't force window start if point
13046 will be invisible in the resulting window. (Bug#9324)
13047
13048 2011-08-25 Eli Zaretskii <eliz@gnu.org>
13049
13050 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
13051 the display spec is of the form `(space ...)'.
13052 (handle_display_spec): Return the value returned by
13053 handle_single_display_spec, not just 1 or zero.
13054 (handle_single_display_spec): If the display spec is of the form
13055 `(space ...)', and specifies display in the text area, return 2
13056 rather than 1.
13057 (try_cursor_movement): Check for the need to scroll more
13058 accurately, and prefer exact match for point under bidi.
13059 Don't advance `row' beyond the last row of the window.
13060
13061 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13062 into disp_prop; all users changed.
13063
13064 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13065 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13066 for the text covered by the display property.
13067
13068 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
13069
13070 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13071 Change return value to nil.
13072 (Frecord_buffer): Delete unused function.
13073
13074 2011-08-24 Eli Zaretskii <eliz@gnu.org>
13075
13076 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13077 buffers, return left-to-right.
13078 (set_cursor_from_row): Consider candidate row a win if its glyph
13079 represents a newline and point is on that newline. Fixes cursor
13080 positioning on the newline at EOL of R2L text within L2R
13081 paragraph, and vice versa.
13082 (try_cursor_movement): Check continued rows, in addition to
13083 continuation rows. Fixes unwarranted scroll when point enters a
13084 continued line of R2L text within an L2R paragraph, or vice versa.
13085 (cursor_row_p): Consider the case of point being equal to
13086 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13087 from the end of a short line to the beginning of a continued line
13088 of R2L text within L2R paragraph.
13089 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13090 composed characters.
13091
13092 * bidi.c (bidi_check_type): Use xassert.
13093 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13094 members.
13095
13096 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13097
13098 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13099 a character.
13100
13101 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
13102
13103 * nsfont.m (ns_otf_to_script): Fix typo.
13104
13105 2011-08-22 Kenichi Handa <handa@m17n.org>
13106
13107 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13108 extra slot even if the purpose is char-code-property-table.
13109
13110 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13111
13112 * xdisp.c (redisplay_window): When computing centering_position,
13113 account for the height of the header line. (Bug#8874)
13114
13115 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13116 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13117 candidate is selected by the mouse, and that candidate has a
13118 composed character under the mouse.
13119
13120 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13121 coordinates reported by pos-visible-in-window-p for a composed
13122 character in column zero.
13123
13124 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13125
13126 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13127
13128 2011-08-22 Eli Zaretskii <eliz@gnu.org>
13129
13130 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13131 consider it a hit if to_charpos is anywhere in the range of the
13132 composed buffer positions.
13133
13134 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
13135
13136 * image.c (gif_load): Don't assume that each subimage has the same
13137 dimensions as the base image. Handle disposal method that is
13138 "undefined" by the gif spec (Bug#9335).
13139
13140 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
13141
13142 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13143 (Fcondition_case): Document `debug' symbol in error handler.
13144
13145 2011-08-19 Eli Zaretskii <eliz@gnu.org>
13146
13147 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13148 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13149 from an Org mode buffer to a Speedbar frame.
13150
13151 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13152 a composition, take its buffer position from IT->cmp_it.charpos.
13153 Fixes cursor positioning at the beginning of a line that begins
13154 with a composed character.
13155
13156 2011-08-18 Eli Zaretskii <eliz@gnu.org>
13157
13158 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13159 character bidirectional type, use STRONG_L instead. Fixes crashes
13160 in a buffer produced by `describe-categories'.
13161
13162 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13163 members before the level stack, so they would be saved and
13164 restored when copying iterator state. Fixes incorrect reordering
13165 around TABs covered by display properties.
13166
13167 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
13168
13169 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13170
13171 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
13172
13173 * eval.c (internal_condition_case, internal_condition_case_1)
13174 (internal_condition_case_2, internal_condition_case_n):
13175 Remove unnecessary aborts (Bug#9081).
13176
13177 2011-08-17 Eli Zaretskii <eliz@gnu.org>
13178
13179 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13180 has no `load' handler, try opening the file locally. (Bug#9311)
13181
13182 2011-08-16 Ken Brown <kbrown@cornell.edu>
13183
13184 * gmalloc.c: Expand comment.
13185
13186 2011-08-16 Eli Zaretskii <eliz@gnu.org>
13187
13188 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13189 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
13190
13191 2011-08-16 Ken Brown <kbrown@cornell.edu>
13192
13193 Fix memory allocation problems in Cygwin build (Bug#9273).
13194
13195 * unexcw.c ( __malloc_initialized): Declare external variable.
13196 (fixup_executable): Force the dumped emacs to reinitialize malloc.
13197
13198 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13199 New variables.
13200 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13201 dumped emacs.
13202 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13203 in the static heap.
13204 [CYGWIN] (special_realloc): New function.
13205 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13206 requests to realloc storage in the static heap.
13207
13208 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13209
13210 * bidi.c (bidi_initialize): Remove unused local.
13211
13212 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13213
13214 * bidimirror.h:
13215 * biditype.h: Remove file.
13216 * makefile.w32-in ($(BLD)/bidi.$(O)):
13217 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13218
13219 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13220
13221 * chartab.c: Improve commentary for the uniprop_table API.
13222
13223 * bidi.c (bidi_paragraph_init): Support zero value of
13224 bidi_ignore_explicit_marks_for_paragraph_level.
13225 (bidi_initialize): Use uniprop_table instead of including
13226 biditype.h and bidimirror.h.
13227
13228 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13229 coordinates of the iterator when restoring from ppos_it.
13230 (Bug#9296)
13231
13232 2011-08-14 Kenichi Handa <handa@m17n.org>
13233
13234 * process.c (create_process): Call setup_process_coding_systems
13235 after the pid of the process is set to -1 (Bug#8162).
13236
13237 2011-08-14 Eli Zaretskii <eliz@gnu.org>
13238
13239 * xdisp.c (move_it_in_display_line_to): Don't invoke
13240 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13241 ppos_it. Fixes vertical cursor motion when line beginning is
13242 covered by an image. (Bug#9296)
13243
13244 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13245
13246 * nsterm.h (ns_run_ascript): Declare.
13247 (NSAPP_DATA2_RUNASSCRIPT): Define.
13248
13249 * nsfns.m (as_script, as_result, as_status): New static variables.
13250 (ns_run_ascript): New function.
13251 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
13252 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13253 the event loop. Get status from as_status (Bug#7276).
13254
13255 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13256 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13257 the event loop (Bug#7276).
13258
13259 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13260
13261 * gnutls.c (QCgnutls_bootprop_priority)
13262 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13263 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13264 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13265 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13266 (QCgnutls_bootprop_verify_hostname_error)
13267 (QCgnutls_bootprop_callbacks_verify): Rename from
13268 Qgnutls_bootprop_..., all uses changed.
13269
13270 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13271 uses changed.
13272
13273 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13274
13275 * xfaces.c (Qframe_set_background_mode): Now static.
13276 * dispextern.h (Qframe_set_background_mode): Remove decl.
13277
13278 * process.c (Fnetwork_interface_info): Declare local only if needed.
13279
13280 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13281
13282 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13283 (Fnetwork_interface_list): Allocate in increments of bytes instead
13284 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13285 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13286 sockaddr.
13287 (struct ifflag_def): notrailers is smart on OSX.
13288 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13289 Get hardware address with getifaddrs if available.
13290
13291 2011-08-12 Eli Zaretskii <eliz@gnu.org>
13292
13293 * xdisp.c (iterate_out_of_display_property): xassert that
13294 IT->position is set to within IT->object's boundaries. Break from
13295 the loop as soon as EOB is reached; avoids infloops in redisplay
13296 when IT->position is set up wrongly due to some bug.
13297 Set IT->current to match the bidi iterator unconditionally.
13298 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13299 entry. Force push_it to save on the stack the current
13300 buffer/string position, to be restored by pop_it. Fix flags in
13301 the iterator structure wrt the object coming from a display
13302 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13303 properties. (Bug#9284)
13304
13305 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
13306
13307 * fontset.c (fontset_get_font_group): Add proper type checks.
13308 (Bug#9172)
13309
13310 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13311
13312 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13313 and LC_VERSION_MIN_MACOSX.
13314 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13315 (dump_it) [LC_FUNCTION_STARTS]: Use it.
13316
13317 2011-08-08 Eli Zaretskii <eliz@gnu.org>
13318
13319 * xdisp.c (forward_to_next_line_start): Allow to use the
13320 no-display-properties-and-no-overlays under bidi display.
13321 Set disp_pos in the bidi iterator to avoid searches for display
13322 properties and overlays.
13323
13324 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
13325
13326 * editfns.c (Fset_time_zone_rule): Document relationship with the
13327 setenv function.
13328
13329 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13330 the font entity extracted from the cache (Bug#8109).
13331
13332 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13333
13334 * composite.c (autocmp_chars): Don't reset point. That is done by
13335 restore_point_unwind (Bug#5984).
13336
13337 2011-08-07 Juri Linkov <juri@jurta.org>
13338
13339 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13340 to show the arg `TIME' instead of `TIMEVAL'.
13341
13342 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13343
13344 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13345 display property strides EOL and includes a newline, as in
13346 longlines-mode. (Bug#9254)
13347 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13348 word-wrap under bidirectional display. (Bug#9224)
13349
13350 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13351 is non-zero, even if the data buffer is NULL. Fixes a crash in
13352 vertical-motion with longlines-mode. (Bug#9254)
13353
13354 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13355
13356 * bidi.c <bidi_cache_total_alloc>: Now static.
13357 (bidi_initialize): Initialize bidi_cache_total_alloc.
13358
13359 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13360 cache. (Bug#9221)
13361
13362 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13363 amount allocated this far in `bidi_cache_total_alloc'.
13364 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13365 non-zero, only free the data buffer without restoring the cache
13366 contents. All callers changed.
13367
13368 * dispextern.h (bidi_unshelve_cache): Update prototype.
13369
13370 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13371 (move_it_in_display_line, move_it_to)
13372 (move_it_vertically_backward, move_it_by_lines): Replace the call
13373 to xfree to an equivalent call to bidi_unshelve_cache.
13374 (move_it_in_display_line_to): Fix logic of returning
13375 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13376
13377 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13378
13379 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13380 came from a string character with a `cursor' property. (Bug#9229)
13381
13382 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13383
13384 * Makefile.in (LIB_PTHREAD): New variable.
13385 (LIBES): Add LIB_PTHREAD (Bug#9216).
13386
13387 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13388 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13389
13390 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13391
13392 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13393
13394 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13395
13396 * xterm.c (x_find_topmost_parent): New function.
13397 (x_set_frame_alpha): Find topmost parent window with
13398 x_find_topmost_parent and set the property there also (bug#9181).
13399 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13400
13401 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13402
13403 * callproc.c (Fcall_process): Avoid vfork clobbering
13404 the local vars buffer, coding_systems, current_dir.
13405
13406 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13407
13408 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13409
13410 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13411
13412 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13413 so that it is not optimized away.
13414
13415 * xdisp.c (compute_display_string_pos): Remove unused local.
13416
13417 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13418
13419 Fix slow cursor motion and scrolling in large buffers with
13420 selective display, like Org Mode buffers. (Bug#9218)
13421
13422 * dispextern.h (struct bidi_it): New member disp_prop_p.
13423
13424 * xdisp.c: Remove one-slot cache of display string positions.
13425 (compute_display_string_pos): Accept an additional argument
13426 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13427 for a display string or property. If found, set DISP_PROP_P
13428 non-zero.
13429
13430 * bidi.c (bidi_fetch_char): Accept an additional argument
13431 DISP_PROP_P, and pass it to compute_display_string_pos.
13432 Only handle text covered by a display string if DISP_PROP_P is returned
13433 non-zero. All callers of bidi_fetch_char changed.
13434
13435 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13436
13437 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13438
13439 2010-12-03 Don March <don@ohspite.net>
13440
13441 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13442 last character M-[char] is translated to ESC [char] (bug#7541).
13443
13444 2011-08-02 Kenichi Handa <handa@m17n.org>
13445
13446 * lisp.h (uniprop_table): Extern it.
13447
13448 * chartab.c (uniprop_table): Make it non-static.
13449
13450 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13451
13452 * xdisp.c (forward_to_next_line_start): Accept additional argument
13453 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13454 on the newline.
13455 (reseat_at_next_visible_line_start): Use the bidi iterator state
13456 returned by forward_to_next_line_start to restore the state of
13457 it->bidi_it after backing up to previous newline. (Bug#9212)
13458
13459 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13460
13461 * regex.c (re_comp): Protoize.
13462 (re_exec): Fix return type.
13463 (regexec): Fix type of `ret'. (Bug#9203)
13464
13465 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13466
13467 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13468 This is needed if max-image-size is a floating-point number.
13469
13470 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13471
13472 * print.c (print_object): Print empty symbol as ##.
13473
13474 * lread.c (read1): Read ## as empty symbol.
13475
13476 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13477
13478 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13479 setting frame foreground color (Bug#9175).
13480 (x_set_background_color): Likewise.
13481
13482 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13483 contents (Bug#9176).
13484 (EmacsTooltip -init): Remove bezels and add shadows to
13485 tooltip windows.
13486
13487 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13488 or scroll bar (Bug#8470).
13489
13490 * nsfont.m (nsfont_open): Remove assignment to voffset and
13491 unnecessary vars hshink, expand, hd, full_height, min_height.
13492 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13493
13494 * nsterm.h (nsfont_info): Remove voffset field.
13495
13496 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13497
13498 Implement strike-through and overline on NextStep (Bug#8863).
13499
13500 * nsfont.m (nsfont_open): Use underline position provided by font,
13501 instead of hard-coded value of 2.
13502 (nsfont_draw): Call ns_draw_text_decoration instead.
13503
13504 * nsterm.h: Add declaration for ns_draw_text_decoration.
13505
13506 * nsterm.m (ns_draw_text_decoration): New function for drawing
13507 underline, overline, and strike-through.
13508 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13509 ns_draw_text_decoration. Change treatment of cursor drawing to
13510 accommodate underlining, etc.
13511
13512 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13513
13514 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13515 default.
13516
13517 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13518
13519 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13520 Without this fix, if a signal arrives just after memory fills up,
13521 'malloc' might be invoked reentrantly.
13522
13523 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13524 In other words, assume that every image size is allowed, on non-X
13525 hosts. This assumption is probably wrong, but it lets Emacs compile.
13526
13527 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13528
13529 * regex.c (re_iswctype): Convert return values to boolean.
13530
13531 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13532
13533 * xdisp.c (compute_display_string_pos): Don't use cached display
13534 string position if the buffer had its restriction changed.
13535 (Bug#9184)
13536
13537 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13538
13539 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13540
13541 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13542
13543 Integer signedness and overflow and related fixes. (Bug#9079)
13544
13545 * bidi.c: Integer size and overflow fixes.
13546 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13547 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13548 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13549 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13550 (bidi_find_other_level_edge):
13551 Use ptrdiff_t instead of EMACS_INT where either will do.
13552 This works better on 32-bit hosts configured --with-wide-int.
13553 (bidi_cache_ensure_space): Check for size-calculation overflow.
13554 Use % rather than repeated addition, for better worst-case speed.
13555 Don't set bidi_cache_size until after xrealloc returns, because it
13556 might not return.
13557 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13558 (bidi_cache_ensure_space): Also check that the bidi cache size
13559 does not exceed that of the largest Lisp string or buffer. See Eli
13560 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13561
13562 * alloc.c (__malloc_size_t): Remove.
13563 All uses replaced by size_t. See Andreas Schwab's note
13564 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13565
13566 * image.c: Improve checking for integer overflow.
13567 (check_image_size): Assume that f is nonnull, since
13568 it is always nonnull in practice. This is one less thing to
13569 worry about when checking for integer overflow later.
13570 (x_check_image_size): New function, which checks for integer
13571 overflow issues inside X.
13572 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13573 This removes the need for a memory_full check.
13574 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13575 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13576 (xbm_read_bitmap_data): Change locals back to 'int', since
13577 their values must fit in 'int'.
13578 (xpm_load_image, png_load, tiff_load):
13579 Invoke x_create_x_image_and_pixmap earlier,
13580 to avoid much needless work if the image is too large.
13581 (tiff_load): Treat overly large images as if
13582 x_create_x_image_and_pixmap failed, not as malloc failures.
13583 (gs_load): Use x_check_image_size.
13584
13585 * gtkutil.c: Omit integer casts.
13586 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13587 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13588
13589 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13590
13591 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13592 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13593 would wrongly return t on a 64-bit host.
13594
13595 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13596 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13597 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13598 and therefore cause GCC to emit a bogus diagnostic in some cases.
13599
13600 * image.c: Integer signedness and overflow and related fixes.
13601 This is not an exhaustive set of fixes, but it's time to
13602 record what I've got.
13603 (lookup_pixel_color, check_image_size): Remove redundant decls.
13604 (check_image_size): Don't assume that arbitrary EMACS_INT values
13605 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13606 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13607 (tiff_load, imagemagick_load_image):
13608 Check for overflow in size calculations.
13609 (x_create_x_image_and_pixmap): Remove unnecessary test for
13610 xmalloc returning NULL; that can't happen.
13611 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13612 (xpm_color_bucket): Use better integer hashing function.
13613 (xpm_cache_color): Don't possibly over-allocate memory.
13614 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13615 (gif_memory_source):
13616 Use ptrdiff_t, not int or size_t, to record sizes.
13617 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13618 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13619 either works, as we prefer signed integers.
13620 (tiff_read_from_memory, tiff_write_from_memory):
13621 Return tsize_t, not size_t, since that's what the TIFF API wants.
13622 (tiff_read_from_memory): Don't fail simply because the read would
13623 go past EOF; instead, return a short read.
13624 (tiff_load): Omit no-longer-needed casts.
13625 (Fimagemagick_types): Don't assume size fits into 'int'.
13626
13627 Improve hashing quality when configured --with-wide-int.
13628 * fns.c (hash_string): New function, taken from sxhash_string.
13629 Do not discard information about ASCII character case; this
13630 discarding is no longer needed.
13631 (sxhash-string): Use it. Change sig to match it. Caller changed.
13632 * lisp.h: Declare it.
13633 * lread.c (hash_string): Remove, since we now use fns.c's version.
13634 The fns.c version returns a wider integer if --with-wide-int is
13635 specified, so this should help the quality of the hashing a bit.
13636
13637 * emacs.c: Integer overflow minor fix.
13638 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13639 Define only if GNU_LINUX.
13640 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13641
13642 * dispnew.c: Integer signedness and overflow fixes.
13643 Remove unnecessary forward decls, that were a maintenance hassle.
13644 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13645 All uses changed.
13646 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13647 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13648 (prepare_desired_row, line_draw_cost):
13649 Use int, not unsigned, where either works.
13650 (save_current_matrix, restore_current_matrix):
13651 Use ptrdiff_t, not size_t, where either works.
13652 (init_display): Check for overflow more accurately, and without
13653 relying on undefined behavior.
13654
13655 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13656 Remove, replacing with the new symbols in lisp.h. All uses changed.
13657 * fileio.c (make_temp_name):
13658 * filelock.c (lock_file_1, lock_file):
13659 * xdisp.c (message_dolog):
13660 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13661 Use pMd etc. instead.
13662 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13663 replacing the pWIDE etc. symbols removed from editfns.c.
13664
13665 * keyboard.h (num_input_events): Now uintmax_t.
13666 This is (very slightly) less likely to mess up due to wraparound.
13667 All uses changed.
13668
13669 * buffer.c: Integer signedness fixes.
13670 (alloc_buffer_text, enlarge_buffer_text):
13671 Use ptrdiff_t rather than size_t when either will do, as we prefer
13672 signed integers.
13673
13674 * alloc.c: Integer signedness and overflow fixes.
13675 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13676 (__malloc_size_t): Default to size_t, not to int.
13677 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13678 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13679 Prefer ptrdiff_t to size_t when either would do, as we prefer
13680 signed integers.
13681 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13682 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13683 Now const. Initialize with values that are in range even if char
13684 is signed.
13685 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13686 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13687 These functions do the right thing with sizes > 2**32.
13688 (check_depth): Now ptrdiff_t, not int.
13689 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13690 Adjust to new way of storing sizes. Check for size overflow bugs
13691 in rest of code.
13692 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13693 slightly wrong anyway, as it missed one instance of
13694 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13695 (refill_memory_reserve): Omit needless cast to size_t.
13696 (mark_object_loop_halt): Mark as externally visible.
13697
13698 * xselect.c: Integer signedness and overflow fixes.
13699 (Fx_register_dnd_atom, x_handle_dnd_message):
13700 Use ptrdiff_t, not size_t, since we prefer signed.
13701 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13702 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13703 x_dnd_atoms_size and x_dnd_atoms_length.
13704
13705 * doprnt.c: Prefer signed to unsigned when either works.
13706 * eval.c (verror):
13707 * doprnt.c (doprnt):
13708 * lisp.h (doprnt):
13709 * xdisp.c (vmessage):
13710 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13711 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13712 prefer signed arithmetic to avoid comparison confusion.
13713 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13714 but is a bit tricky.
13715
13716 Assume freestanding C89 headers, string.h, stdlib.h.
13717 * data.c, doprnt.c, floatfns.c, print.c:
13718 Include float.h unconditionally.
13719 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13720 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13721 * regex.c: Likewise for stddef.h, string.h.
13722 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13723 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13724 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13725 (STDC_HEADERS): Remove obsolete defines.
13726 * sysdep.c: Include limits.h unconditionally.
13727
13728 Assume support for memcmp, memcpy, memmove, memset.
13729 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13730 * regex.c (memcmp, memcpy):
13731 Remove; we assume C89 now.
13732
13733 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13734 (__malloc_safe_bcopy): Remove; no longer needed.
13735
13736 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13737 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13738 well either way, and we prefer signed to unsigned.
13739
13740 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13741
13742 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13743 closes the connection while we're reading (bug#9182).
13744
13745 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13746
13747 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13748 are specified (Bug#9168).
13749
13750 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13751
13752 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13753 Found by GCC static checking and --with-wide-int on a 32-bit host.
13754
13755 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13756
13757 * xdisp.c (compute_display_string_pos): Fix logic of caching
13758 previous display string position. Initialize cached_prev_pos to
13759 -1. Fixes slow-down at the beginning of a buffer.
13760
13761 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13762
13763 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13764 for attrs[LFACE_FONTSET_INDEX].
13765
13766 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13767
13768 * xml.c (parse_region): Remove unused local
13769 that was recently introduced.
13770
13771 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13772
13773 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13774 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13775
13776 * xdisp.c (move_it_in_display_line_to): Record the best matching
13777 position for TO_CHARPOS while scanning the line, and restore it on
13778 exit if none of the characters scanned was an exact match.
13779 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13780 when exact match is impossible due to invisible text, and the
13781 lines are truncated.
13782
13783 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13784
13785 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13786 for OSX >= 10.7.
13787
13788 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13789
13790 Fix a significant slow-down of cursor motion with C-n, C-p,
13791 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13792 auto-repeat under bidi redisplay in fontified buffers.
13793 * xdisp.c (compute_stop_pos_backwards): New function.
13794 (next_element_from_buffer): Call compute_stop_pos_backwards to
13795 find a suitable prev_stop when we find ourselves before
13796 base_level_stop.
13797 (reseat): Don't look for prev_stop, as that could mean a very long
13798 run.
13799 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13800 <cached_disp_overlay_modiff>: Cache for last found display string
13801 position.
13802 (compute_display_string_pos): Return the cached position if asked
13803 about the same buffer in the same area of character positions, and
13804 the buffer wasn't changed since the time the display string
13805 position was cached.
13806
13807 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13808
13809 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13810 is an integer, which is important for empty lines. (Bug#9149)
13811
13812 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13813
13814 * frame.c (Fmodify_frame_parameters): In tty case, update the
13815 default face if necessary (Bug#4238).
13816
13817 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13818
13819 * editfns.c (Fstring_to_char): No need to explain what a character
13820 is in the docstring (Bug#6576).
13821
13822 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13823
13824 * xml.c (parse_region): Make sure we always return a tree.
13825
13826 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13827
13828 * xml.c (parse_region): If a document contains only comments,
13829 return that, too.
13830
13831 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13832
13833 * xml.c (make_dom): Return comments, too.
13834
13835 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13836
13837 Port to OpenBSD.
13838 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13839 and the surrounding thread.
13840 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13841 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13842 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13843 timer goes off.
13844 * s/openbsd.h (BROKEN_SIGIO): Define.
13845 * unexelf.c (unexec) [__OpenBSD__]:
13846 Don't update the .mdebug section of the Alpha COFF symbol table.
13847
13848 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13849
13850 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13851 (bug#8460).
13852
13853 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13854
13855 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13856 This fixes some race conditions on the permissions of any newly
13857 created file.
13858
13859 * alloc.c (valid_pointer_p): Use pipe, not open.
13860 This fixes some permissions issues when debugging.
13861
13862 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13863 If fchown fails to set both uid and gid, try to set just gid,
13864 as that is sometimes allowed. Adjust the file's mode to eliminate
13865 setuid or setgid bits that are inappropriate if fchown fails.
13866
13867 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13868
13869 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13870 to compare Lisp_Objects.
13871 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13872 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13873 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13874
13875 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13876
13877 * lread.c (read_integer): Unread even EOF character.
13878 (read1): Likewise. Properly record start position of symbol.
13879
13880 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13881 symbol character follows.
13882
13883 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13884
13885 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13886 This works around a problem with the previous change to Fcopy_file.
13887 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13888 and without this change, GCC might complain about discarding
13889 fchown's return value.
13890
13891 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13892
13893 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13894
13895 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13896
13897 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13898
13899 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13900
13901 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13902 it's used from the C level.
13903
13904 * process.c: Use the same condition for POLL_FOR_INPUT in both
13905 keyboard.c and process.c (bug#1858).
13906
13907 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13908
13909 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13910 (Fgnutls_boot): Use it.
13911
13912 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13913
13914 * doc.c (Fsubstitute_command_keys): Revert last change.
13915
13916 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13917
13918 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13919 quotes the next character, and doesn't affect other longer
13920 sequences (bug#8935).
13921
13922 * lread.c (syms_of_lread): Clarify that is isn't only
13923 `eval-buffer' and `eval-defun' that's affected by
13924 `lexical-binding' (bug#8460).
13925
13926 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13927
13928 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13929 bidi redisplay when a line includes both an image and is truncated.
13930
13931 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13932
13933 Fix minor problems found by static checking.
13934 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13935 (elsz): Now a signed constant, not a size_t var. We prefer signed
13936 types to unsigned, to avoid integer comparison confusion. Without
13937 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13938 "cannot optimize loop, the loop counter may overflow", a symptom
13939 of the confusion.
13940 * indent.c (Fvertical_motion): Mark locals as initialized.
13941 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13942
13943 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13944
13945 * search.c (Fre_search_backward): Mention `case-fold-search' in
13946 all the re_search_* functions (bug#8138).
13947
13948 * keyboard.c (Fopen_dribble_file): Document when the file is
13949 closed (bug#8056).
13950
13951 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13952
13953 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13954 bidi_cache_idx.
13955
13956 Support bidi reordering of display and overlay strings.
13957 * xdisp.c (compute_display_string_pos)
13958 (compute_display_string_end): Accept additional argument STRING.
13959 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13960 (reseat_to_string): Initialize bidi_it->string.s and
13961 bidi_it->string.schars.
13962 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13963 NULL (avoids a crash in bidi_paragraph_init).
13964 Initialize itb.string.lstring.
13965 (init_iterator): Call bidi_init_it only of a valid
13966 buffer position was specified. Initialize paragraph_embedding to
13967 L2R.
13968 (reseat_to_string): Initialize the bidi iterator.
13969 (display_string): If we need to ignore text properties of
13970 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13971 original value of -1 will not work with bidi.)
13972 (compute_display_string_pos): First arg is now struct
13973 `text_pos *'; all callers changed. Support display properties on
13974 Lisp strings.
13975 (compute_display_string_end): Support display properties on Lisp
13976 strings.
13977 (init_iterator, reseat_1, reseat_to_string): Initialize the
13978 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13979 when iterating on a string not from display properties).
13980 (compute_display_string_pos, compute_display_string_end):
13981 Fix calculation of the object to scan. Fixes an error when using
13982 arrow keys.
13983 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13984 base_level_stop; instead, set base_level_stop to BEGV.
13985 Fixes crashes in vertical-motion.
13986 (next_element_from_buffer): Improve commentary for when
13987 the iterator is before prev_stop.
13988 (init_iterator): Initialize bidi_p from the default value of
13989 bidi-display-reordering, not from buffer-local value. Use the
13990 buffer-local value only if initializing for buffer iteration.
13991 (handle_invisible_prop): Support invisible properties on strings
13992 that are being bidi-reordered.
13993 (set_iterator_to_next): Support bidi reordering of C strings and
13994 Lisp strings.
13995 (next_element_from_string): Support bidi reordering of Lisp
13996 strings.
13997 (handle_stop_backwards): Support Lisp strings as well.
13998 (display_string): Support display of R2L glyph rows.
13999 Use IT_STRING_CHARPOS when displaying from a Lisp string.
14000 (init_iterator): Don't initialize it->bidi_p for strings
14001 here.
14002 (reseat_to_string): Initialize it->bidi_p for strings here.
14003 (next_element_from_string, next_element_from_c_string)
14004 (next_element_from_buffer): Add xassert's for correspondence
14005 between IT's object being iterated and it->bidi_it.string
14006 structure.
14007 (face_before_or_after_it_pos): Support bidi iteration.
14008 (next_element_from_c_string): Handle the case of the first string
14009 character that is not the first one in the visual order.
14010 (get_visually_first_element): New function, refactored from common
14011 parts of next_element_from_buffer, next_element_from_string, and
14012 next_element_from_c_string.
14013 (tool_bar_lines_needed, redisplay_tool_bar)
14014 (display_menu_bar): Force left-to-right direction. Add a FIXME
14015 comment for making that be controlled by a user option.
14016 (push_it, pop_it): Save and restore the state of the
14017 bidi iterator. Save and restore the bidi_p flag.
14018 (pop_it): Iterate out of display property for string iteration as
14019 well.
14020 (iterate_out_of_display_property): Support iteration over strings.
14021 (handle_single_display_spec): Set up it->bidi_it for iteration
14022 over a display string, and call bidi_init_it.
14023 (handle_single_display_spec, next_overlay_string)
14024 (get_overlay_strings_1, push_display_prop): Set up the bidi
14025 iterator for displaying display or overlay strings.
14026 (forward_to_next_line_start): Don't use the shortcut if
14027 bidi-iterating.
14028 (back_to_previous_visible_line_start): If handle_display_prop
14029 pushed the iterator stack, restore the internal state of the bidi
14030 iterator by calling bidi_pop_it same number of times.
14031 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
14032 and we are bidi-iterating, don't decrement the iterator position;
14033 instead, set the first_elt flag in the bidi iterator, to produce
14034 the same effect.
14035 (reseat_1): Remove redundant setting of string_from_display_prop_p.
14036 (push_display_prop): xassert that we are iterating a buffer.
14037 (push_it, pop_it): Save and restore paragraph_embedding member.
14038 (handle_single_display_spec, next_overlay_string)
14039 (get_overlay_strings_1, reseat_1, reseat_to_string)
14040 (push_display_prop): Set up the `unibyte' member of bidi_it.string
14041 correctly. Don't assume unibyte strings are not bidi-reordered.
14042 (compute_display_string_pos)
14043 (compute_display_string_end): Fix handling the case of C string.
14044 (push_it, pop_it): Save and restore from_disp_prop_p.
14045 (handle_single_display_spec, push_display_prop): Set the
14046 from_disp_prop_p flag.
14047 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
14048 (pop_it): Call iterate_out_of_display_property only if we are
14049 popping after iteration over a string that came from a display
14050 property. Fix a typo in popping stretch info. Add an assertion
14051 for verifying that the iterator position is in sync with the bidi
14052 iterator.
14053 (handle_single_display_spec, get_overlay_strings_1)
14054 (push_display_prop): Fix initialization of paragraph direction for
14055 string when that of the parent object is not yet determined.
14056 (reseat_1): Call bidi_init_it to resync the bidi
14057 iterator with IT's position. (Bug#7616)
14058 (find_row_edges): If ROW->start.pos gives position
14059 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
14060 (handle_stop, back_to_previous_visible_line_start, reseat_1):
14061 Reset the from_disp_prop_p flag.
14062 (SAVE_IT, RESTORE_IT): New macros.
14063 (pos_visible_p, face_before_or_after_it_pos)
14064 (back_to_previous_visible_line_start)
14065 (move_it_in_display_line_to, move_it_in_display_line)
14066 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14067 (try_scrolling, redisplay_window, display_line): Use them when
14068 saving a temporary copy of the iterator and restoring it back.
14069 (back_to_previous_visible_line_start, reseat_1)
14070 (init_iterator): Empty the bidi cache "stack".
14071 (move_it_in_display_line_to): If iterator ended up at
14072 EOL, but we never saw any buffer positions smaller than
14073 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
14074 motion in bidi-reordered lines.
14075 (move_it_in_display_line_to): Record prev_method and prev_pos
14076 immediately before the call to set_iterator_to_next. Fixes cursor
14077 motion in bidi-reordered lines with stretch glyphs and strings
14078 displayed in margins. (Bug#8133) (Bug#8867)
14079 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14080 TO_CHARPOS.
14081 (pos_visible_p): Support positions in bidi-reordered lines.
14082 Save and restore bidi cache.
14083
14084 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14085 (bidi_paragraph_info): Delete unused struct.
14086 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14087 (bidi_cache_start): New variable.
14088 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14089 to zero.
14090 (bidi_cache_fetch_state, bidi_cache_search)
14091 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14092 (bidi_cache_find, bidi_peek_at_next_level)
14093 (bidi_level_of_next_char, bidi_find_other_level_edge)
14094 (bidi_move_to_visually_next): Compare cache index with
14095 bidi_cache_start rather than with zero.
14096 (bidi_fetch_char): Accept new argument STRING; all callers
14097 changed. Support iteration over a string. Support strings with
14098 display properties. Support unibyte strings. Fix the type of
14099 `len' according to what STRING_CHAR_AND_LENGTH expects.
14100 (bidi_paragraph_init, bidi_resolve_explicit_1)
14101 (bidi_resolve_explicit, bidi_resolve_weak)
14102 (bidi_level_of_next_char, bidi_move_to_visually_next):
14103 Support iteration over a string.
14104 (bidi_set_sor_type, bidi_resolve_explicit_1)
14105 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14106 can now be zero (for strings); special values 0 and -1 were
14107 changed to -1 and -2, respectively.
14108 (bidi_char_at_pos): New function.
14109 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14110 Call it instead of FETCH_MULTIBYTE_CHAR.
14111 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14112 initialized to valid values.
14113 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14114 values.
14115 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14116 the test for valid cached positions. Fix the logic for looking up
14117 the sentinel state in the cache. GCPRO the Lisp string we are
14118 iterating.
14119 (bidi_push_it, bidi_pop_it): New functions.
14120 (bidi_initialize): Initialize the bidi cache start stack pointer.
14121 (bidi_cache_ensure_space): New function, refactored from part of
14122 bidi_cache_iterator_state. Don't assume the required size is just
14123 one BIDI_CACHE_CHUNK away.
14124 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14125 (bidi_count_bytes, bidi_char_at_pos): New functions.
14126 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14127 always valid if bidi_cache_idx is valid.
14128 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14129 is valid if it's going to be used.
14130 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14131 (bidi_cache_fetch_state, bidi_cache_search)
14132 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14133 (bidi_cache_iterator_state, bidi_cache_find)
14134 (bidi_find_other_level_edge, bidi_cache_start_stack):
14135 All variables related to cache indices are now EMACS_INT.
14136
14137 * dispextern.h (struct bidi_string_data): New structure.
14138 (struct bidi_it): New member `string'. Make flag members be 1-bit
14139 fields, and put them last in the struct.
14140 (compute_display_string_pos, compute_display_string_end):
14141 Update prototypes.
14142 (bidi_push_it, bidi_pop_it): Add prototypes.
14143 (struct iterator_stack_entry): New members bidi_p,
14144 paragraph_embedding, and from_disp_prop_p.
14145 (struct it): Member bidi_p is now a bit field 1 bit wide.
14146 (bidi_shelve_cache, bidi_unshelve_cache):
14147 Declare prototypes.
14148
14149 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14150 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14151 and vector-like objects.
14152
14153 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14154 cache around display iteration.
14155
14156 * window.c (Fwindow_end, window_scroll_pixel_based)
14157 (displayed_window_lines, Frecenter): Save and restore the bidi
14158 cache around display iteration.
14159
14160 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14161
14162 * editfns.c (Fdelete_region): Clarify the use of the named
14163 parameters (bug#6788).
14164
14165 2011-07-14 Martin Rudalics <rudalics@gmx.at>
14166
14167 * indent.c (Fvertical_motion): Set and restore w->pointm when
14168 saving and restoring the window's buffer (Bug#9006).
14169
14170 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
14171
14172 * editfns.c (Fstring_to_char): Clarify just what is returned
14173 (bug#6576). Text by Eli Zaretskii.
14174
14175 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
14176
14177 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14178
14179 2011-07-13 Eli Zaretskii <eliz@gnu.org>
14180
14181 * buffer.c (mmap_find): Fix a typo.
14182
14183 2011-07-13 Johan Bockgård <bojohan@gnu.org>
14184
14185 Fix execution of x selection hooks.
14186 * xselect.c (Qx_lost_selection_functions)
14187 (Qx_sent_selection_functions): New vars.
14188 (syms_of_xselect): DEFSYM them.
14189 (x_handle_selection_request): Pass Qx_sent_selection_functions
14190 rather than Vx_sent_selection_functions to Frun_hook_with_args.
14191 (x_handle_selection_clear,x_clear_frame_selections):
14192 Pass Qx_lost_selection_functions rather than
14193 Vx_lost_selection_functions to Frun_hook_with_args.
14194
14195 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
14196
14197 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14198 The old code sometimes used this field without initializing it.
14199
14200 * alloc.c (gc_sweep): Don't read past end of array.
14201 In theory, the old code could also have corrupted Emacs internals,
14202 though it'd be very unlikely.
14203
14204 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
14205
14206 * character.c (Fcharacterp): Don't advertise optional ignored
14207 argument. (Bug#4026)
14208
14209 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14210
14211 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14212 key" (bug#4257).
14213
14214 * window.c (Fset_window_start): Doc fix (bug#4199).
14215 (Fset_window_hscroll): Ditto.
14216
14217 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14218
14219 Fix minor new problems caught by GCC 4.6.1.
14220 * term.c (init_tty): Remove unused local.
14221 * xsettings.c (store_monospaced_changed): Define this function only
14222 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14223 not used otherwise.
14224
14225 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14226
14227 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14228
14229 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14230
14231 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14232 are the mini-buffer and the echo area (bug#3320).
14233
14234 * term.c (init_tty): Remove support for supdup, c10 and perq
14235 terminals, which are no longer supported (bug#1482).
14236
14237 2011-07-10 Johan Bockgård <bojohan@gnu.org>
14238
14239 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14240
14241 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14242
14243 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14244 for non-popups (Bug#3642).
14245
14246 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14247
14248 * alloc.c (reset_malloc_hooks): Protoize.
14249 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14250 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14251 * cm.c (losecursor): Likewise.
14252 * data.c (fmod): Likewise.
14253 * dispnew.c (swap_glyphs_in_rows): Likewise.
14254 * emacs.c (memory_warning_signal): Likewise.
14255 * floatfns.c (float_error): Likewise.
14256 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14257 (otf_open, font_otf_capability, generate_otf_features)
14258 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14259 Likewise.
14260 * image.c (pbm_read_file): Likewise.
14261 * indent.c (string_display_width): Likewise.
14262 * intervals.c (check_for_interval, search_for_interval)
14263 (inc_interval_count, count_intervals, root_interval)
14264 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14265 * lread.c (defalias): Likewise.
14266 * ralloc.c (r_alloc_check): Likewise.
14267 * regex.c (set_image_of_range_1, set_image_of_range)
14268 (regex_grow_registers): Likewise.
14269 * sysdep.c (strerror): Likewise.
14270 * termcap.c (valid_filename_p, tprint, main): Likewise.
14271 * tparam.c (main): Likewise.
14272 * unexhp9k800.c (run_time_remap, save_data_space)
14273 (update_file_ptrs, read_header, write_header, calculate_checksum)
14274 (copy_file, copy_rest, display_header): Likewise.
14275 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14276 Likewise.
14277 * xdisp.c (check_it): Likewise.
14278 * xfaces.c (register_color, unregister_color, unregister_colors):
14279 Likewise.
14280 * xfns.c (print_fontset_result): Likewise.
14281 * xrdb.c (member, fatal, main): Likewise.
14282
14283 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14284
14285 Fix minor problems found by static checking (Bug#9031).
14286 * chartab.c (char_table_set_range, map_sub_char_table):
14287 Remove unused locals.
14288 (uniprop_table): Now static.
14289 * composite.c (_work_char): Remove unused static var.
14290
14291 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
14292
14293 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14294
14295 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14296
14297 * gtkutil.c (qttip_cb): Remove code without function.
14298
14299 2011-07-09 Eli Zaretskii <eliz@gnu.org>
14300
14301 * w32.c (pthread_sigmask): New stub.
14302
14303 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
14304
14305 Use pthread_sigmask, not sigprocmask (Bug#9010).
14306 sigprocmask is portable only for single-threaded applications, and
14307 Emacs can be multi-threaded when it uses GTK.
14308 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14309 (LIBES): Use it.
14310 * callproc.c (Fcall_process):
14311 * process.c (create_process):
14312 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14313 Use pthread_sigmask, not sigprocmask.
14314
14315 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14316
14317 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14318 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14319 wrong (Bug#8591).
14320
14321 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14322
14323 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14324 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14325 (xg_hide_tooltip): Fix comment.
14326
14327 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14328 in registerServicesMenuSendTypes.
14329 (validRequestorForSendType): Don't check ns_return_types.
14330
14331 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14332 ns_return_type.
14333
14334 2011-07-08 Jason Rumney <jasonr@gnu.org>
14335
14336 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14337 SH_SHOW for hidden windows (Bug#5482).
14338
14339 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14340 frame struct members of non-existent frames (Bug#6284).
14341
14342 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14343
14344 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14345 variable firstTime not needed on OSX >= 10.6.
14346 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14347 >= 10.5. Use setKnobProportion, setDoubleValue.
14348
14349 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14350 (MAC_OS_X_VERSION_10_5): Define if not defined.
14351 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14352 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14353 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14354
14355 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14356 cString and lossyCString on OSX >= 10.4.
14357
14358 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14359 sizeToFit on OSX >= 10.2.
14360
14361 * nsimage.m (allocInitFromFile): Don't use deprecated method
14362 bestRepresentationForDevice on OSX >= 10.6.
14363
14364 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14365 to avoid warning.
14366
14367 * emacs.c: Declare unexec_init_emacs_zone.
14368
14369 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14370
14371 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14372
14373 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14374 on svcsMenu (Bug#8842).
14375
14376 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14377 ns_return_types.
14378 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14379
14380 * nsterm.m (QUTF8_STRING): Declare.
14381 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14382 (validRequestorForSendType): Return type is (id).
14383 Change indexOfObjectIdenticalTo to indexOfObject.
14384 Check if we have local selection before returning self (Bug#8842).
14385 (writeSelectionToPasteboard): Put local selection into paste board
14386 if we have a local selection (Bug#8842).
14387 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14388
14389 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14390 (ns_get_local_selection): Declare.
14391
14392 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14393
14394 * keymap.c (describe_map_tree): Don't insert a double newline at
14395 the end of the buffer (bug#1169) and return whether we inserted
14396 something.
14397
14398 * callint.c (Fcall_interactively): Change "reading args" to
14399 "providing args" to try to clarify what it does (bug#1010).
14400
14401 2011-07-07 Kenichi Handa <handa@m17n.org>
14402
14403 * composite.c (composition_compute_stop_pos): Ignore a static
14404 composition starting before CHARPOS (Bug#8915).
14405
14406 * xdisp.c (handle_composition_prop): Likewise.
14407
14408 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14409
14410 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14411 (Bug#9015)
14412
14413 2011-07-07 Kenichi Handa <handa@m17n.org>
14414
14415 * character.h (unicode_category_t): New enum type.
14416
14417 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14418 (Qchar_code_property_table): New variable.
14419 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14420 (UNIPROP_COMPRESSED_FORM_P): New macros.
14421 (char_table_ascii): Uncompress the compressed values.
14422 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14423 Uncompress the compressed values.
14424 (sub_char_table_ref_and_range): Likewise.
14425 (char_table_ref_and_range): Uncompress the compressed values.
14426 (sub_char_table_set): New arg is_uniprop. Callers changed.
14427 Uncompress the compressed values.
14428 (sub_char_table_set_range): Args changed. Callers changed.
14429 (char_table_set_range): Adjuted for the above change.
14430 (map_sub_char_table): Delete args default_val and parent. Add arg
14431 top. Give decoded values to a Lisp function.
14432 (map_char_table): Adjust for the above change. Give decoded
14433 values to a Lisp function. Gcpro more variables.
14434 (uniprop_table_uncompress)
14435 (uniprop_decode_value_run_length): New functions.
14436 (uniprop_decoder, uniprop_decoder_count): New variables.
14437 (uniprop_get_decoder, uniprop_encode_value_character)
14438 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14439 New functions.
14440 (uniprop_encoder, uniprop_encoder_count): New variables.
14441 (uniprop_get_encoder, uniprop_table)
14442 (Funicode_property_table_internal, Fget_unicode_property_internal)
14443 (Fput_unicode_property_internal): New functions.
14444 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14445 Sunicode_property_table_internal, Sget_unicode_property_internal,
14446 and Sput_unicode_property_internal. Defvar_lisp
14447 char-code-property-alist.
14448
14449 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14450 Vunicode_category_table.
14451
14452 * font.c (font_range): Adjust for the change of
14453 Vunicode_category_table.
14454
14455 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14456
14457 * m/iris4d.h: Remove file, move contents ...
14458 * s/irix6-5.h: ... here.
14459
14460 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14461
14462 Remove unportable assumption about struct layout (Bug#8884).
14463 * alloc.c (mark_buffer):
14464 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14465 (clone_per_buffer_values): Don't assume that
14466 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14467 This isn't true in general, and it's particularly not true
14468 if Emacs is configured with --with-wide-int.
14469 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14470 New macros, used in the buffer.c change.
14471
14472 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14473
14474 * xsettings.c: Use both GConf and GSettings if both are available.
14475 (store_config_changed_event): Add comment.
14476 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14477 (store_tool_bar_style_changed): New functions.
14478 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14479 (struct xsettings): Move font inside HAVE_XFT.
14480 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14481 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14482 Move inside HAVE_XFT.
14483 (something_changed_gsettingsCB): Rename from something_changedCB.
14484 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14485 also.
14486 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14487 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14488 (something_changed_gconfCB): Rename from something_changedCB.
14489 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14490 (parse_settings): Move check for font inside HAVE_XFT.
14491 (read_settings, apply_xft_settings): Add comment.
14492 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14493 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14494 call store_font_name_changed.
14495 (xft_settings_event): Add comment.
14496 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14497 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14498 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14499 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14500 (xsettings_initialize): Call init_gsettings last.
14501 (xsettings_get_system_font, xsettings_get_system_normal_font):
14502 Add comment.
14503
14504 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14505
14506 Random fixes. E.g., (random) never returned negative values.
14507 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14508 subseconds part to the entropy, as that's a bit more random.
14509 Prefer signed to unsigned, since the signedness doesn't matter and
14510 in general we prefer signed. When given a limit, use a
14511 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14512 latter isn't right if USE_2_TAGS_FOR_INTS.
14513 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14514 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14515
14516 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14517
14518 * textprop.c (text_property_stickiness):
14519 Obey Vtext_property_default_nonsticky.
14520 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14521 * w32fns.c (syms_of_w32fns):
14522 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14523
14524 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14525
14526 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14527 This is more efficient than Ffile_directory_p and avoids a minor race.
14528
14529 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14530
14531 * buffer.c (Foverlay_put): Say what the return value is
14532 (bug#7835).
14533
14534 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14535 is a directory before asking whether to use the file name
14536 (bug#7564).
14537 (barf_or_query_if_file_exists): Make the "File is a directory"
14538 error be more correct.
14539
14540 * fns.c (Frequire): Remove the mention of the .gz files, since
14541 that's installation-specific, but keep the mention of
14542 `get-load-suffixes'.
14543
14544 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14545
14546 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14547 Report string overflow if the output is too long.
14548
14549 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14550
14551 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14552 (syms_of_gnutls): Remove duplicate DEFSYM for
14553 Qgnutls_bootprop_verify_hostname_error, an error for
14554 Qgnutls_bootprop_verify_error (which is no longer used).
14555
14556 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14557 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14558 Also (re)move comments that are misplaced or no longer relevant.
14559
14560 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14561
14562 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14563
14564 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14565
14566 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14567 and background color parameters if they have been changed.
14568
14569 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14570
14571 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14572
14573 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14574
14575 * xsettings.c (SYSTEM_FONT): Define only when used.
14576 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14577
14578 * keymap.c (access_keymap_1): Now static.
14579
14580 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14581
14582 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14583 leave any prefix arg for the up event (Bug#1586).
14584
14585 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14586
14587 * lread.c (syms_of_lread): Mention single symbols defined by
14588 `defvar' or `defconst' (bug#7154).
14589
14590 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14591 (Frequire): Mention get-load-suffixes.
14592
14593 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14594
14595 * window.h (window): Remove clone_number slot.
14596 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14597 Remove.
14598 (make_parent_window, make_window, saved_window)
14599 (Fset_window_configuration, save_window_save): Don't deal with
14600 clone numbers.
14601 * buffer.c (Qclone_number): Remove declaration.
14602 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14603
14604 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14605
14606 Add multiple inheritance to keymaps.
14607 * keymap.c (Fmake_composed_keymap): New function.
14608 (Fset_keymap_parent): Simplify.
14609 (fix_submap_inheritance): Remove.
14610 (access_keymap_1): New function extracted from access_keymap to handle
14611 embedded parents and handle lists of maps.
14612 (access_keymap): Use it.
14613 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14614 (Fcopy_keymap): Handle embedded parents.
14615 (Fcommand_remapping, define_as_prefix): Simplify.
14616 (Fkey_binding): Simplify.
14617 (syms_of_keymap): Move minibuffer-local-completion-map,
14618 minibuffer-local-filename-completion-map,
14619 minibuffer-local-must-match-map, and
14620 minibuffer-local-filename-must-match-map to Elisp.
14621 (syms_of_keymap): Defsubr make-composed-keymap.
14622 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14623 (parse_menu_item): Trivial simplification.
14624
14625 2011-07-01 Glenn Morris <rgm@gnu.org>
14626
14627 * Makefile.in (SETTINGS_LIBS): Fix typo.
14628
14629 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14630
14631 * coding.c (Fencode_coding_string): Record the last coding system
14632 used, as the function doc string says (bug#8738).
14633
14634 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14635
14636 * xsettings.c (store_monospaced_changed): Take new font as arg and
14637 check for change against current_mono_font.
14638 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14639 (emacs_settings_constructor, emacs_settings_get_property)
14640 (emacs_settings_set_property, emacs_settings_class_init)
14641 (emacs_settings_init, gsettings_obj): Remove.
14642 (something_changedCB): New function for HAVE_GSETTINGS.
14643 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14644 with value as argument.
14645 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14646 g_settings_new (Bug#8967). Do not create gsettings_obj.
14647 Remove calls to g_settings_bind. Connect something_changedCB to
14648 "changed".
14649
14650 * xgselect.c: Add defined (HAVE_GSETTINGS).
14651 (xgselect_initialize): Ditto.
14652
14653 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14654 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14655 xg_select.
14656
14657 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14658
14659 * eval.c (struct backtrace): Simplify and port the data structure.
14660 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14661 signed bit field, as this assumption is not portable and it makes
14662 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14663 "char debug_on_exit : 1" as this is not portable either; instead,
14664 use the portable "unsigned int debug_on_exit : 1". Remove unused
14665 member evalargs. Remove obsolete comments about cc bombing out.
14666
14667 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14668
14669 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14670 Let HAVE_GSETTINGS override HAVE_GCONF.
14671 (store_monospaced_changed): New function.
14672 (EMACS_SETTINGS): A new type derived from GObject to handle
14673 GSettings notifications.
14674 (emacs_settings_constructor, emacs_settings_get_property)
14675 (emacs_settings_set_property, emacs_settings_class_init):
14676 New functions.
14677 (gsettings_client, gsettings_obj): New variables.
14678 (GSETTINGS_SCHEMA): New define.
14679 (something_changedCB): Call store_monospaced_changed.
14680 (init_gsettings): New function.
14681 (xsettings_initialize): Call init_gsettings.
14682 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14683 to NULL.
14684
14685 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14686 GCONF_CFLAGS/LIBS.
14687
14688 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14689
14690 * window.c (resize_root_window, grow_mini_window)
14691 (shrink_mini_window): Rename Qresize_root_window to
14692 Qwindow_resize_root_window and Qresize_root_window_vertically to
14693 Qwindow_resize_root_window_vertically.
14694
14695 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14696
14697 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14698
14699 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14700
14701 * makefile.w32-in: Redesign dependencies so they reflect more
14702 clearly which files are directly included by each source file,
14703 and not through other includes.
14704
14705 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14706
14707 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14708 (sort_overlays, overlay_strings): When an overlay's clone number
14709 matches the window's clone number process the overlay even if
14710 the overlay's window property doesn't match the current window.
14711
14712 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14713 (Fwindow_hchild): Rename to Fwindow_left_child.
14714 (Fwindow_next): Rename to Fwindow_next_sibling.
14715 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14716 (resize_window_check): Rename to window_resize_check.
14717 (resize_window_apply): Rename to window_resize_apply.
14718 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14719 (Fdelete_other_windows_internal, resize_frame_windows)
14720 (Fsplit_window_internal, Fdelete_window_internal)
14721 (grow_mini_window, shrink_mini_window)
14722 (Fresize_mini_window_internal): Fix callers accordingly.
14723
14724 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14725
14726 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14727 (emacs_fixed_set_min_size): Remove.
14728 (emacs_fixed_new): Take frame as argument.
14729
14730 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14731 (_EmacsFixedPrivate): Remove minwidth/height.
14732 Add struct frame *f.
14733 (emacs_fixed_init): Initialize priv->f.
14734 (get_parent_class, emacs_fixed_set_min_size): Remove.
14735 (emacs_fixed_new): Set priv->f to argument.
14736 (emacs_fixed_get_preferred_width)
14737 (emacs_fixed_get_preferred_height): Use min_width/height from
14738 frames size_hint to set minimum and natural (Bug#8919).
14739 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14740 and use min_width/height from frames size_hint to set
14741 min_width/height (Bug#8919).
14742
14743 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14744 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14745 Fix indentation.
14746
14747 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14748
14749 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14750 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14751 called at ZV.
14752
14753 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14754
14755 * process.c (wait_reading_process_output): Bypass select if
14756 waiting for a cell while ignoring keyboard input, and input is
14757 pending. Suggested by Jan Djärv (Bug#8869).
14758
14759 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14760
14761 Use gnulib's dup2 module instead of rolling our own.
14762 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14763
14764 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14765
14766 * dispnew.c (scrolling_window): Before scrolling, turn off a
14767 mouse-highlight in the window being scrolled.
14768
14769 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14770
14771 Move DEFSYM to lisp.h and use everywhere.
14772
14773 * character.h (DEFSYM): Move declaration...
14774 * lisp.h (DEFSYM): ...here.
14775
14776 * gnutls.c:
14777 * minibuf.c:
14778 * w32menu.c:
14779 * w32proc.c:
14780 * w32select.c: Don't include character.h.
14781
14782 * alloc.c (syms_of_alloc):
14783 * buffer.c (syms_of_buffer):
14784 * bytecode.c (syms_of_bytecode):
14785 * callint.c (syms_of_callint):
14786 * casefiddle.c (syms_of_casefiddle):
14787 * casetab.c (init_casetab_once):
14788 * category.c (init_category_once, syms_of_category):
14789 * ccl.c (syms_of_ccl):
14790 * cmds.c (syms_of_cmds):
14791 * composite.c (syms_of_composite):
14792 * dbusbind.c (syms_of_dbusbind):
14793 * dired.c (syms_of_dired):
14794 * dispnew.c (syms_of_display):
14795 * doc.c (syms_of_doc):
14796 * editfns.c (syms_of_editfns):
14797 * emacs.c (syms_of_emacs):
14798 * eval.c (syms_of_eval):
14799 * fileio.c (syms_of_fileio):
14800 * fns.c (syms_of_fns):
14801 * frame.c (syms_of_frame):
14802 * fringe.c (syms_of_fringe):
14803 * insdel.c (syms_of_insdel):
14804 * keymap.c (syms_of_keymap):
14805 * lread.c (init_obarray, syms_of_lread):
14806 * macros.c (syms_of_macros):
14807 * msdos.c (syms_of_msdos):
14808 * print.c (syms_of_print):
14809 * process.c (syms_of_process):
14810 * search.c (syms_of_search):
14811 * sound.c (syms_of_sound):
14812 * syntax.c (init_syntax_once, syms_of_syntax):
14813 * terminal.c (syms_of_terminal):
14814 * textprop.c (syms_of_textprop):
14815 * undo.c (syms_of_undo):
14816 * w32.c (globals_of_w32):
14817 * window.c (syms_of_window):
14818 * xdisp.c (syms_of_xdisp):
14819 * xfaces.c (syms_of_xfaces):
14820 * xfns.c (syms_of_xfns):
14821 * xmenu.c (syms_of_xmenu):
14822 * xsettings.c (syms_of_xsettings):
14823 * xterm.c (syms_of_xterm): Use DEFSYM.
14824
14825 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14826
14827 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14828
14829 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14830
14831 Integer and buffer overflow fixes (Bug#8873).
14832
14833 * print.c (printchar, strout): Check for string overflow.
14834 (PRINTPREPARE, printchar, strout):
14835 Don't set size unless allocation succeeds.
14836
14837 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14838 for sizes. Check for string overflow more accurately.
14839 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14840
14841 * macros.c: Integer and buffer overflow fixes.
14842 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14843 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14844 Use ptrdiff_t, not int, for sizes.
14845 Don't increment bufsize until after realloc succeeds.
14846 Check for size-calculation overflow.
14847 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14848
14849 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14850
14851 * lread.c: Integer overflow fixes.
14852 (read_integer): Radix is now EMACS_INT, not int,
14853 to improve quality of diagnostics for out-of-range radices.
14854 Calculate buffer size correctly for out-of-range radices.
14855 (read1): Check for integer overflow in radices, and in
14856 read-circle numbers.
14857 (read_escape): Avoid int overflow.
14858 (Fload, openp, read_buffer_size, read1)
14859 (substitute_object_recurse, read_vector, read_list, map_obarray):
14860 Use ptrdiff_t, not int, for sizes.
14861 (read1): Use EMACS_INT, not int, for sizes.
14862 Check for size overflow.
14863
14864 * image.c (cache_image): Check for size arithmetic overflow.
14865
14866 * lread.c: Integer overflow issues.
14867 (saved_doc_string_size, saved_doc_string_length)
14868 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14869 Now ptrdiff_t, not int.
14870 (read1): Don't assume doc string length fits in int. Check for
14871 out-of-range doc string lengths.
14872 (read_list): Don't assume file position fits in int.
14873 (read_escape): Check for hex character overflow.
14874
14875 2011-06-22 Leo Liu <sdl.web@gmail.com>
14876
14877 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14878 Move to minibuffer.el.
14879
14880 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14881
14882 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14883 The following patches are for when GLYPH_DEBUG && !XASSERT.
14884 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14885 * dispnew.c (flush_stdout):
14886 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14887 Mark as externally visible.
14888 * dispnew.c (check_window_matrix_pointers): Now static.
14889 * dispnew.c (window_to_frame_vpos):
14890 * xfns.c (unwind_create_frame):
14891 * xterm.c (x_check_font): Remove unused local.
14892 * scroll.c (CHECK_BOUNDS):
14893 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14894 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14895 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14896 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14897 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14898 Now static.
14899 (debug_method_add): Use va_list and vsprintf rather than relying
14900 on undefined behavior with wrong number of arguments.
14901 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14902 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14903 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14904 since we're not interested in debugging glyphs with old libraries.
14905 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14906 GCC 4.6.0's static checking.
14907
14908 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14909
14910 Integer overflow and signedness fixes (Bug#8873).
14911 A few related buffer overrun fixes, too.
14912
14913 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14914
14915 * dispextern.h (struct face.stipple):
14916 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14917 (x_bitmap_mask, x_allocate_bitmap_record)
14918 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14919 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14920 (x_create_bitmap_from_xpm_data):
14921 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14922 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14923 (.bitmaps_last):
14924 * xfaces.c (load_pixmap):
14925 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14926 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14927 (.bitmaps_last, struct x_output.icon_bitmap):
14928 Use ptrdiff_t, not int, for bitmap indexes.
14929 (x_allocate_bitmap_record): Check for size overflow.
14930 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14931
14932 Use ptrdiff_t, not int, for overlay counts.
14933 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14934 * editfns.c (overlays_around, get_pos_property):
14935 * textprop.c (get_char_property_and_overlay):
14936 * xdisp.c (next_overlay_change, note_mouse_highlight):
14937 * xfaces.c (face_at_buffer_position):
14938 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14939 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14940 (Fnext_overlay_change, Fprevious_overlay_change)
14941 (mouse_face_overlay_overlaps, Foverlays_in):
14942 Use ptrdiff_t, not int, for sizes.
14943 (overlays_at, overlays_in): Check for size-calculation overflow.
14944
14945 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14946
14947 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14948 (x_session_initialize): Do not assume string length fits in int.
14949
14950 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14951 This is unlikely, but can occur if DPI is outlandish.
14952
14953 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14954 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14955
14956 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14957 * xrdb.c (magic_file_p, search_magic_path):
14958 Omit last arg SUFFIX; it was always 0. All callers changed.
14959 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14960
14961 * xfont.c (xfont_match): Avoid need for strlen.
14962
14963 * xfns.c: Don't assume strlen fits in int.
14964 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14965
14966 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14967 not unsigned long, as we prefer signed integers. All callers changed.
14968 Detect integer overflow in repeat count.
14969 (message_dolog): Don't assume print length fits in 39 bytes.
14970 (display_mode_element): Don't assume strlen fits in int.
14971
14972 * termcap.c: Don't assume sizes fit in int and never overflow.
14973 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14974 (gobble_line): Check for size-calculation overflow.
14975
14976 * minibuf.c (Fread_buffer):
14977 * lread.c (intern, intern_c_string):
14978 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14979 Don't assume string length fits in int.
14980
14981 * keyboard.c (parse_tool_bar_item):
14982 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14983
14984 * font.c: Don't assume string length fits in int.
14985 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14986 Use ptrdiff_t, not int.
14987 (font_intern_prop): Don't assume string length fits in int.
14988 Don't assume integer property fits in fixnum.
14989 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14990
14991 * filelock.c: Fix some buffer overrun and integer overflow issues.
14992 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14993 Reformulate so as not to need the command string.
14994 Invoke gzip -cd rather than gunzip, as it's more portable.
14995 (lock_info_type, lock_file_1, lock_file):
14996 Don't assume pid_t and time_t fit in unsigned long.
14997 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14998 (current_lock_owner): Prefer signed type for sizes.
14999 Use memcpy, not strncpy, where memcpy is what is really wanted.
15000 Don't assume (via atoi) that time_t and pid_t fit in int.
15001 Check for time_t and/or pid_t out of range, e.g., via a network share.
15002 Don't alloca where an auto var works fine.
15003
15004 * fileio.c: Fix some integer overflow issues.
15005 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
15006 Don't assume string length fits in int.
15007 (directory_file_name): Don't assume string length fits in long.
15008 (make_temp_name): Don't assume pid fits in int, or that its print
15009 length is less than 20.
15010
15011 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
15012
15013 * coding.c (make_subsidiaries): Don't assume string length fits in int.
15014
15015 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
15016
15017 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
15018 We prefer signed integers, even for size calculations.
15019
15020 * emacs.c: Don't assume string length fits in 'int'.
15021 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
15022 (main): Don't invoke strlen when not needed.
15023
15024 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
15025 (XD_DEBUG_MESSAGE): Don't waste a byte.
15026
15027 * callproc.c (getenv_internal_1, getenv_internal)
15028 (Fgetenv_internal):
15029 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
15030
15031 * lread.c (invalid_syntax): Omit length argument.
15032 All uses changed. This doesn't fix a bug, but it simplifies the
15033 code away from its former Hollerith-constant appearance, and it's
15034 one less 'int' to worry about when looking at integer-overflow issues.
15035 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
15036
15037 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
15038 This didn't break anything, but it didn't help either.
15039 It's confusing to put a bogus integer in a place where the actual
15040 value does not matter.
15041 (LIST_END_P): Remove unused macro and its bogus comment.
15042 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
15043
15044 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
15045 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
15046 implementation.
15047 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
15048 We prefer signed types, and the value cannot exceed the EMACS_INT
15049 range anyway (because otherwise the length would not be representable).
15050 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
15051 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
15052 This avoids a GCC warning when WIDE_EMACS_INT.
15053
15054 * indent.c (sane_tab_width): New function.
15055 (current_column, scan_for_column, Findent_to, position_indentation)
15056 (compute_motion): Use it. This is just for clarity.
15057 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
15058
15059 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
15060
15061 * lisp.h (lint_assume): New macro.
15062 * composite.c (composition_gstring_put_cache):
15063 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15064
15065 * editfns.c, insdel.c:
15066 Omit unnecessary forward decls, to simplify future changes.
15067
15068 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15069
15070 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15071
15072 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15073 Use much-faster test for byte-length change.
15074 Don't assume string byte-length fits in 'int'.
15075 Check that character arg fits in 'int'.
15076 (mapcar1): Declare byte as byte, for clarity.
15077
15078 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15079
15080 * fns.c (concat): Catch string overflow earlier.
15081 Do not rely on integer wraparound.
15082
15083 * dispextern.h (struct it.overlay_strings_charpos)
15084 (struct it.selective): Now EMACS_INT, not int.
15085 * xdisp.c (forward_to_next_line_start)
15086 (back_to_previous_visible_line_start)
15087 (reseat_at_next_visible_line_start, next_element_from_buffer):
15088 Don't arbitrarily truncate the value of 'selective' to int.
15089
15090 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15091
15092 * composite.c: Don't truncate sizes to 'int'.
15093 (composition_gstring_p, composition_reseat_it)
15094 (composition_adjust_point): Use EMACS_INT, not int.
15095 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15096 not EMACS_UINT, for indexes.
15097
15098 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15099
15100 * buffer.c: Include <verify.h>.
15101 (struct sortvec.priority, struct sortstr.priority):
15102 Now EMACS_INT, not int.
15103 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15104 (struct sortstr.size, record_overlay_string)
15105 (struct sortstrlist.size, struct sortlist.used):
15106 Don't truncate size to int.
15107 (record_overlay_string): Check for size-calculation overflow.
15108 (init_buffer_once): Check at compile-time, not run-time.
15109
15110 2011-06-22 Jim Meyering <meyering@redhat.com>
15111
15112 Don't leak an XBM-image-sized buffer
15113 * image.c (xbm_load): Free the image buffer after using it.
15114
15115 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15116
15117 Port to Sun C.
15118 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15119 that Sun C diagnosed.
15120 * fns.c (secure_hash): Fix pointer signedness issue.
15121 * intervals.c (static_offset_intervals): New function.
15122 (offset_intervals): Use it.
15123
15124 2011-06-21 Leo Liu <sdl.web@gmail.com>
15125
15126 * deps.mk (fns.o):
15127 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15128 sha512.h.
15129
15130 * fns.c (secure_hash): Rename from crypto_hash_function and change
15131 the first arg to accept symbols.
15132 (Fsecure_hash): New primitive.
15133 (syms_of_fns): New symbols.
15134
15135 2011-06-20 Deniz Dogan <deniz@dogan.se>
15136
15137 * process.c (Fset_process_buffer): Clarify return value in
15138 docstring.
15139
15140 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
15141
15142 * dispnew.c (add_window_display_history): Use BVAR.
15143
15144 * xdisp.c (debug_method_add): Use BVAR.
15145 (check_window_end, dump_glyph_matrix, dump_glyph)
15146 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15147
15148 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15149 Likewise.
15150
15151 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15152 check till after the cache is created in init_frame_faces.
15153
15154 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
15155
15156 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15157
15158 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
15159
15160 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15161 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15162 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15163
15164 Improve buffer-overflow checking (Bug#8873).
15165 * fileio.c (Finsert_file_contents):
15166 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15167 Remove the old (too-loose) buffer overflow checks.
15168 They weren't needed, since make_gap checks for buffer overflow.
15169 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15170 The old code merely checked for Emacs fixnum overflow, and relied
15171 on undefined (wraparound) behavior. The new code avoids undefined
15172 behavior, and also checks for ptrdiff_t and/or size_t overflow.
15173
15174 * editfns.c (Finsert_char): Don't dump core with very negative counts.
15175 Tune. Don't use wider integers than needed. Don't use alloca.
15176 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
15177
15178 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15179
15180 * insdel.c, lisp.h (buffer_overflow): New function.
15181 (insert_from_buffer_1, replace_range, replace_range_2):
15182 * insdel.c (make_gap_larger):
15183 * editfns.c (Finsert_char):
15184 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15185
15186 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15187
15188 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
15189
15190 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15191
15192 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15193 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15194
15195 * fileio.c: Don't assume EMACS_INT fits in off_t.
15196 (emacs_lseek): New static function.
15197 (Finsert_file_contents, Fwrite_region): Use it.
15198 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15199
15200 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15201
15202 * fns.c: Don't overflow int when computing a list length.
15203 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15204 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15205 truncation on 64-bit hosts. Check for QUIT every
15206 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15207 faster and is responsive enough.
15208 (Flength): Report an error instead of overflowing an integer.
15209 (Fsafe_length): Return a float if the value is not representable
15210 as a fixnum. This shouldn't happen except in contrived situations.
15211 (Fnthcdr, Fsort): Don't assume list length fits in int.
15212 (Fcopy_sequence): Don't assume vector length fits in int.
15213
15214 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15215 (header_size, word_size): New constants.
15216 (allocate_vectorlike): Don't check size overflow here.
15217 (allocate_vector): Check it here instead, since this is the only
15218 caller of allocate_vectorlike that could cause overflow.
15219 Check that the new vector's length is representable as a fixnum.
15220
15221 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15222 The previous code was bogus. For example, next_almost_prime (32)
15223 returned 39, which is undesirable as it is a multiple of 3; and
15224 next_almost_prime (24) returned 25, which is a multiple of 5 so
15225 why was the code bothering to check for multiples of 7?
15226
15227 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15228
15229 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15230
15231 Variadic C functions now count arguments with ptrdiff_t.
15232 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15233 Back then I didn't know that the Emacs coding style prefers signed int.
15234 Also, in the meantime I found a few more instances where arguments
15235 were being counted with int, which may truncate counts on 64-bit
15236 machines, or EMACS_INT, which may be unnecessarily wide.
15237 * lisp.h (struct Lisp_Subr.function.aMANY)
15238 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15239 Arg counts are now ptrdiff_t, not size_t.
15240 All variadic functions and their callers changed accordingly.
15241 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15242 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15243 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15244 * callint.c (Fcall_interactively): Check arg count for overflow,
15245 to avoid potential buffer overrun. Use signed char, not 'int',
15246 for 'varies' array, so that we needn't bother to check its size
15247 calculation for overflow.
15248 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15249 * eval.c (apply_lambda):
15250 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15251 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15252 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15253
15254 * callint.c (Fcall_interactively): Don't use index var as event count.
15255
15256 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15257 * mem-limits.h (SIZE): Remove; no longer used.
15258
15259 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15260
15261 Remove unnecessary casts.
15262 * xterm.c (x_term_init):
15263 * xfns.c (x_set_border_pixel):
15264 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15265 These aren't needed now that we assume ANSI C.
15266
15267 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15268 It's more likely to cause problems (due to unsigned overflow)
15269 than to cure them.
15270
15271 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15272
15273 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15274
15275 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15276
15277 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15278
15279 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15280
15281 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15282
15283 GLYPH_CODE_FACE returns EMACS_INT, not int.
15284 * dispextern.h (merge_faces):
15285 * xfaces.c (merge_faces):
15286 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15287 Don't assume EMACS_INT fits in int.
15288
15289 * character.h (CHAR_VALID_P): Remove unused parameter.
15290 * fontset.c, lisp.h, xdisp.c: All uses changed.
15291
15292 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15293
15294 * fns.c (concat): Minor tuning based on overflow analysis.
15295 This doesn't fix any bugs. Use int to hold character, instead
15296 of constantly refetching from Emacs object. Use XFASTINT, not
15297 XINT, for value known to be a character. Don't bother comparing
15298 a single byte to 0400, as it's always less.
15299
15300 * floatfns.c (Fexpt):
15301 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15302
15303 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15304 for characters.
15305
15306 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15307
15308 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15309 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15310 incorrectly succeed when S was a string, because 4294967386 was
15311 truncated before it was used.
15312
15313 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15314 Otherwise, an out-of-range integer could cause undefined behavior
15315 on a 64-bit host.
15316
15317 * composite.c: Use int, not EMACS_INT, for characters.
15318 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15319 EMACS_INT, for values that are known to be in character range.
15320 This doesn't fix any bugs but is the usual style inside Emacs and
15321 may generate better code on 32-bit machines.
15322
15323 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15324 This is for reasons similar to the recent CHAR_STRING fix.
15325 * charset.c (Fencode_char): Check that character arg is actually
15326 a character. Pass an int to ENCODE_CHAR.
15327 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15328 wider than 'int', as a compile-time check to prevent future regressions
15329 in this area.
15330
15331 * character.c (char_string): Remove unnecessary casts.
15332
15333 Make sure a 64-bit char is never passed to CHAR_STRING.
15334 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15335 by silently ignoring the top 32 bits, allowing some values
15336 that were far too large to be valid characters.
15337 * character.h: Include <verify.h>.
15338 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15339 arguments are no wider than unsigned, as a compile-time check
15340 to prevent future regressions in this area.
15341 * data.c (Faset):
15342 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15343 (Fsubst_char_in_region):
15344 * fns.c (concat):
15345 * xdisp.c (decode_mode_spec_coding):
15346 Adjust to CHAR_STRING's new requirement.
15347 * editfns.c (Finsert_char, Fsubst_char_in_region):
15348 * fns.c (concat): Check that character args are actually
15349 characters. Without this test, these functions did the wrong
15350 thing with wildly out-of-range values on 64-bit hosts.
15351
15352 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15353 These casts should not be needed on 32-bit hosts, either.
15354 * keyboard.c (read_char):
15355 * lread.c (Fload): Remove casts to unsigned.
15356
15357 * lisp.h (UNSIGNED_CMP): New macro.
15358 This fixes comparison bugs on 64-bit hosts.
15359 (ASCII_CHAR_P): Use it.
15360 * casefiddle.c (casify_object):
15361 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15362 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15363 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15364 * dispextern.h (FACE_FROM_ID):
15365 * keyboard.c (read_char): Use UNSIGNED_CMP.
15366
15367 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15368 not to EMACS_INT, to avoid GCC warning.
15369
15370 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15371
15372 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15373 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15374 isn't needed on 32-bit machines.
15375
15376 * buffer.c (Fgenerate_new_buffer_name):
15377 Use EMACS_INT for count, not int.
15378 (advance_to_char_boundary): Return EMACS_INT, not int.
15379
15380 * data.c (Qcompiled_function): Now static.
15381
15382 * window.c (window_body_lines): Now static.
15383
15384 * image.c (gif_load): Rename local to avoid shadowing.
15385
15386 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15387 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15388 * alloc.c (make_save_value): Integer argument is now of type
15389 ptrdiff_t, not int.
15390 (mark_object): Use ptrdiff_t, not int.
15391 * lisp.h (pD): New macro.
15392 * print.c (print_object): Use it.
15393
15394 * alloc.c: Use EMACS_INT, not int, to count objects.
15395 (total_conses, total_markers, total_symbols, total_vector_size)
15396 (total_free_conses, total_free_markers, total_free_symbols)
15397 (total_free_floats, total_floats, total_free_intervals)
15398 (total_intervals, total_strings, total_free_strings):
15399 Now EMACS_INT, not int. All uses changed.
15400 (Fgarbage_collect): Compute overall total using a double, so that
15401 integer overflow is less likely to be a problem. Check for overflow
15402 when converting back to an integer.
15403 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15404 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15405 These were 'int' variables that could overflow on 64-bit hosts;
15406 they were never used, so remove them instead of repairing them.
15407 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15408 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15409 Previously, this ceilinged at INT_MAX, but that doesn't work on
15410 64-bit machines.
15411 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15412
15413 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15414 (allocate_vectorlike): Check for ptrdiff_t overflow.
15415 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15416 when a (possibly-narrower) signed value would do just as well.
15417 We prefer using signed arithmetic, to avoid comparison confusion.
15418
15419 * alloc.c: Catch some string size overflows that we were missing.
15420 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15421 for convenience in STRING_BYTES_MAX.
15422 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15423 The definition here is exact; the one in lisp.h was approximate.
15424 (allocate_string_data): Check for string overflow. This catches
15425 some instances we weren't catching before. Also, it catches
15426 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15427 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15428 and ptrdiff_t and EMACS_INT are both 64 bits.
15429
15430 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15431 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15432 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15433
15434 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15435
15436 * alloc.c (Fmake_string): Check for out-of-range init.
15437
15438 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15439
15440 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15441
15442 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15443
15444 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15445 xg_get_default_scrollbar_width.
15446
15447 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15448 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15449 (style_changed_cb): Call update_theme_scrollbar_width and call
15450 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15451 all frames (Bug#8505).
15452 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15453 Call gtk_window_set_resizable if HAVE_GTK3.
15454 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15455 and height if HAVE_GTK3 (Bug#8505).
15456 (scroll_bar_width_for_theme): New variable.
15457 (update_theme_scrollbar_width): New function.
15458 (xg_get_default_scrollbar_width): Move code to
15459 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15460 (xg_initialize): Call update_theme_scrollbar_width.
15461
15462 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15463
15464 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15465
15466 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15467
15468 * frame.c (make_frame): Call other_buffer_safely instead of
15469 other_buffer.
15470
15471 * window.c (temp_output_buffer_show): Call display_buffer with
15472 second argument Vtemp_buffer_show_specifiers and reset latter
15473 immediately after the call.
15474 (Vtemp_buffer_show_specifiers): New variable.
15475 (auto_window_vscroll_p, next_screen_context_lines)
15476 (Vscroll_preserve_screen_position): Remove leading asterisks from
15477 doc-strings.
15478
15479 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15480
15481 Fix minor problems found by GCC 4.6.0 static checking.
15482 * buffer.c (Qclone_number): Remove for now, as it's unused.
15483 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15484 (record_buffer): Remove unused local.
15485 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15486 (set_frame_buffer_list): Remove; unused.
15487 * frame.h (other_visible_frames): Remove decl.
15488 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15489 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15490 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15491 if HAVE_GPM.
15492 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15493 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15494 Define only if HAVE_GPM.
15495 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15496 (update_hints_inhibit): Remove; never set. All uses removed.
15497 * widgetprv.h (emacsFrameClassRec): Remove decl.
15498 * window.c (delete_deletable_window): Now returns void, since it
15499 wasn't returning anything.
15500 (compare_window_configurations): Remove unused locals.
15501 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15502 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15503 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15504 the same widths as pointers. This follows up on the 2011-05-06 patch.
15505 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15506 * xterm.h: Likewise.
15507 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15508
15509 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15510
15511 * makefile.w32-in: Update dependencies.
15512 (LISP_H): Add lib/intprops.h.
15513
15514 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15515
15516 * image.c (gif_load): Add animation frame delay to the metadata.
15517 (syms_of_image): Use DEFSYM. New symbol `delay'.
15518
15519 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15520
15521 * window.c (delete_deletable_window): Re-add.
15522 (Fset_window_configuration): Rewrite to handle dead buffers and
15523 consequently deletable windows.
15524 (window_tree, Fwindow_tree): Remove. Supply functionality in
15525 window.el.
15526 (compare_window_configurations): Simplify code.
15527
15528 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15529
15530 * image.c (imagemagick_load_image): Fix type mismatch.
15531 (Fimagemagick_types): Likewise.
15532
15533 * window.h (replace_buffer_in_windows): Declare.
15534
15535 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15536
15537 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15538 Qclone_number. Remove external declaration of Qdelete_window.
15539 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15540 code.
15541 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15542 Run Qbuffer_list_update_hook if allowed.
15543 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15544 buffer list implementation.
15545 (other_buffer_safely): New function.
15546 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15547 calls to replace_buffer_in_windows and
15548 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15549 if allowed.
15550 (record_buffer): Inhibit quitting and rewrite using quittable
15551 functions. Run Qbuffer_list_update_hook if allowed.
15552 (Frecord_buffer, Funrecord_buffer): New functions.
15553 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15554 Move switch-to-buffer to window.el.
15555 (bury-buffer): Move to window.el.
15556 (Vbuffer_list_update_hook): New variable.
15557
15558 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15559 section.
15560
15561 * window.h (resize_frame_windows): Move up in code.
15562 (Fwindow_frame): Remove EXFUN.
15563 (replace_buffer_in_all_windows): Remove prototype.
15564 (replace_buffer_in_windows_safely): Add prototype.
15565
15566 * window.c: Declare Qdelete_window static again. Move down
15567 declaration of select_count.
15568 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15569 (Fother_window): Move to window.el.
15570 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15571 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15572 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15573 window.el.
15574 (replace_buffer_in_windows): Implement by calling
15575 Qreplace_buffer_in_windows.
15576 (replace_buffer_in_all_windows): Remove with some functionality
15577 moved into replace_buffer_in_windows_safely.
15578 (replace_buffer_in_windows_safely): New function.
15579 (select_window_norecord, select_frame_norecord): Move in front
15580 of run_window_configuration_change_hook. Remove now obsolete
15581 declarations.
15582 (Fset_window_buffer): Rewrite doc-string.
15583 Call Qrecord_window_buffer.
15584 (keys_of_window): Move binding for other-window to window.el.
15585
15586 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15587
15588 * dispextern.h (struct image): Replace data member, whose int_val
15589 and ptr_val fields were not used by anything, with a single
15590 lisp_val object.
15591
15592 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15593 (gif_clear_image, gif_load, imagemagick_load_image)
15594 (gs_clear_image, gs_load): Callers changed.
15595
15596 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15597
15598 * buffer.h: Include <time.h>, for time_t.
15599 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15600
15601 Fix minor problems found by static checking.
15602
15603 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15604
15605 Make identifiers static if they are not used in other modules.
15606 * data.c (Qcompiled_function, Qframe, Qvector):
15607 * image.c (QimageMagick, Qsvg):
15608 * minibuf.c (Qmetadata):
15609 * window.c (resize_window_check, resize_root_window): Now static.
15610 * window.h (resize_window_check, resize_root_window): Remove decls.
15611
15612 * window.c (window_deletion_count, delete_deletable_window):
15613 Remove; unused.
15614 (window_body_lines): Now static.
15615 (Fdelete_other_windows_internal): Mark vars as initialized.
15616 Make sure 'resize_failed' is initialized.
15617 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15618 (resize_window_apply): Remove unused local.
15619 * window.h (delete_deletable_window): Remove decl.
15620
15621 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15622 (imagemagick_load_image): Fix pointer signedness problem by changing
15623 last arg from unsigned char * to char *. All uses changed.
15624 Also, fix a local for similar reasons.
15625 Remove unused locals. Remove locals to avoid shadowing.
15626 (fn_rsvg_handle_free): Remove; unused.
15627 (svg_load, svg_load_image): Fix pointer signedness problem.
15628 (imagemagick_load_image): Don't use garbage pointer image_wand.
15629
15630 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15631
15632 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15633
15634 * image.c (gif_load): Fix omitted cast error introduced by
15635 2011-06-06 change.
15636
15637 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15638
15639 * window.h (resize_proportionally, orig_total_lines)
15640 (orig_top_line): Remove from window structure.
15641 (set_window_height, set_window_width, change_window_heights)
15642 (Fdelete_window): Remove prototypes.
15643 (resize_frame_windows): Remove duplicate declaration.
15644
15645 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15646
15647 * window.h (resize_frame_windows, resize_window_check)
15648 (delete_deletable_window, resize_root_window)
15649 (resize_frame_windows): Declare prototypes.
15650
15651 * window.c (resize_window_apply): Make definition be "static" to
15652 match the prototype.
15653
15654 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15655
15656 * window.c: Remove declarations of Qwindow_size_fixed,
15657 window_min_size_1, window_min_size_2, window_min_size,
15658 size_window, window_fixed_size_p, enlarge_window, delete_window.
15659 Remove static from declaration of Qdelete_window, it's
15660 temporarily needed by Fbury_buffer.
15661 (replace_window): Don't assign orig_top_line and
15662 orig_total_lines.
15663 (Fdelete_window, delete_window): Remove. Window deletion is
15664 handled by window.el.
15665 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15666 Replace Fdelete_window calls with calls to Qdelete_window.
15667 (Fdelete_other_windows): Remove. Deleting other windows is
15668 handled by window.el.
15669 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15670 handled in window.el.
15671 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15672 Window minimum sizes are handled in window.el.
15673 (shrink_windows, size_window, set_window_height)
15674 (set_window_width, change_window_heights, window_height)
15675 (window_width, CURBEG, CURSIZE, enlarge_window)
15676 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15677 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15678 handled in window.el.
15679 (make_dummy_parent): Rename to make_parent_window and give it a
15680 second argument horflag.
15681 (make_window): Don't set resize_proportionally any more.
15682 (Fsplit_window): Remove. Windows are split in window.el.
15683 (save_restore_action, save_restore_orig_size)
15684 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15685 Resize mini windows in window.el.
15686 (grow_mini_window, shrink_mini_window): Implement by calling
15687 Qresize_root_window_vertically, resize_window_check and
15688 resize_window_apply.
15689 (saved_window, Fset_window_configuration, save_window_save):
15690 Do not handle orig_top_line, orig_total_lines, and
15691 resize_proportionally.
15692 (window_min_height, window_min_width): Move to window.el.
15693 (keys_of_window): Move bindings for delete-other-windows,
15694 split-window, delete-window and enlarge-window to window.el.
15695
15696 * buffer.c: Temporarily extern Qdelete_window.
15697 (Fbury_buffer): Temporarily call Qdelete_window instead of
15698 Fdelete_window (Fbury_buffer will move to window.el soon).
15699
15700 * frame.c (set_menu_bar_lines_1): Remove code handling
15701 orig_top_line and orig_total_lines.
15702
15703 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15704 set_window_height but set heights directly.
15705 (change_frame_size_1): Use resize_frame_windows.
15706
15707 * xdisp.c (init_xdisp): Don't use set_window_height but set
15708 heights directly.
15709
15710 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15711 Use resize_frame_windows instead of change_window_heights and run
15712 run_window_configuration_change_hook.
15713
15714 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15715 instead of change_window_heights and run
15716 run_window_configuration_change_hook.
15717
15718 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15719
15720 * window.c (replace_window): Rename second argument REPLACEMENT to
15721 NEW. New third argument SETFLAG. Rewrite.
15722 (delete_window, make_dummy_parent): Call replace_window with
15723 third argument 1.
15724 (window_list_1): Move down in code.
15725 (run_window_configuration_change_hook): Move set_buffer part
15726 before select_frame_norecord part in order to unwind correctly.
15727 Rename count1 to count.
15728 (recombine_windows, delete_deletable_window, resize_root_window)
15729 (Fdelete_other_windows_internal)
15730 (Frun_window_configuration_change_hook, make_parent_window)
15731 (resize_window_check, resize_window_apply, Fresize_window_apply)
15732 (resize_frame_windows, Fsplit_window_internal)
15733 (Fdelete_window_internal, Fresize_mini_window_internal):
15734 New functions.
15735 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15736
15737 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15738
15739 * window.h (window): Add some new members to window structure -
15740 normal_lines, normal_cols, new_total, new_normal, clone_number,
15741 splits, nest, prev_buffers, next_buffers.
15742 (WINDOW_TOTAL_SIZE): Move here from window.c.
15743 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15744
15745 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15746 Remove.
15747 (make_dummy_parent): Set new members of windows structure.
15748 (make_window): Move down in code. Handle new members of window
15749 structure.
15750 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15751 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15752 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15753 (Fset_window_prev_buffers, Fwindow_next_buffers)
15754 (Fset_window_next_buffers, Fset_window_clone_number):
15755 New functions.
15756 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15757 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15758 Doc-string fixes.
15759 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15760 Argument WINDOW can be now internal window too.
15761 (Fwindow_use_time): Move up in code.
15762 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15763 Rewrite doc-string.
15764 (Fset_window_configuration, saved_window)
15765 (Fcurrent_window_configuration, save_window_save): Handle new
15766 members of window structure.
15767 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15768 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15769 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15770 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15771 Qget_mru_window, Qresize_root_window,
15772 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15773 Qauto_buffer_name; staticpro them.
15774
15775 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15776
15777 * window.c (Fwindow_total_size, Fwindow_left_column)
15778 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15779 (Fwindow_list_1): New functions.
15780 (window_box_text_cols): Replace with window_body_cols.
15781 (Fwindow_width, Fscroll_left, Fscroll_right):
15782 Use window_body_cols instead of window_box_text_cols.
15783 (delete_window, Fset_window_configuration):
15784 Call delete_all_subwindows with window as argument.
15785 (delete_all_subwindows): Take a window as argument and not a
15786 structure. Rewrite.
15787 (window_loop): Remove handling of GET_LRU_WINDOW and
15788 GET_LARGEST_WINDOW.
15789 (Fget_lru_window, Fget_largest_window): Move to window.el.
15790
15791 * window.h: Extern window_body_cols instead of
15792 window_box_text_cols. delete_all_subwindows now takes a
15793 Lisp_Object as argument.
15794
15795 * indent.c (compute_motion, Fcompute_motion):
15796 Use window_body_cols instead of window_box_text_cols.
15797
15798 * frame.c (delete_frame): Call delete_all_subwindows with root
15799 window as argument.
15800
15801 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15802
15803 * fns.c (Fputhash): Document return value.
15804
15805 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15806
15807 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15808
15809 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15810
15811 Cons<->int and similar integer overflow fixes (Bug#8794).
15812
15813 Check for overflow when converting integer to cons and back.
15814 * charset.c (Fdefine_charset_internal, Fdecode_char):
15815 Use cons_to_unsigned to catch overflow.
15816 (Fencode_char): Use INTEGER_TO_CONS.
15817 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15818 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15819 * data.c (long_to_cons, cons_to_long): Remove.
15820 (cons_to_unsigned, cons_to_signed): New functions.
15821 These signal an error for invalid or out-of-range values.
15822 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15823 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15824 * font.c (Ffont_variation_glyphs):
15825 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15826 * lisp.h: Include <intprops.h>.
15827 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15828 (cons_to_signed, cons_to_unsigned): New decls.
15829 (long_to_cons, cons_to_long): Remove decls.
15830 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15831 (Fprimitive_undo): Use CONS_TO_INTEGER.
15832 * xfns.c (Fx_window_property): Likewise.
15833 * xselect.c: Include <limits.h>.
15834 (x_own_selection, selection_data_to_lisp_data):
15835 Use INTEGER_TO_CONS.
15836 (x_handle_selection_request, x_handle_selection_clear)
15837 (x_get_foreign_selection, Fx_disown_selection_internal)
15838 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15839 (lisp_data_to_selection_data): Use cons_to_unsigned.
15840 (x_fill_property_data): Use cons_to_signed.
15841 Report values out of range.
15842
15843 Check for buffer and string overflow more precisely.
15844 * buffer.h (BUF_BYTES_MAX): New macro.
15845 * lisp.h (STRING_BYTES_MAX): New macro.
15846 * alloc.c (Fmake_string):
15847 * character.c (string_escape_byte8):
15848 * coding.c (coding_alloc_by_realloc):
15849 * doprnt.c (doprnt):
15850 * editfns.c (Fformat):
15851 * eval.c (verror):
15852 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15853 since they may not be the same number.
15854 * editfns.c (Finsert_char):
15855 * fileio.c (Finsert_file_contents):
15856 Likewise for BUF_BYTES_MAX.
15857
15858 * image.c: Use ptrdiff_t, not int, for sizes.
15859 (slurp_file): Switch from int to ptrdiff_t.
15860 All uses changed.
15861 (slurp_file): Check that file size fits in both size_t (for
15862 malloc) and ptrdiff_t (for sanity and safety).
15863
15864 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15865 if b->modtime has its maximal value.
15866
15867 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15868
15869 Don't assume time_t can fit into int.
15870 * buffer.h (struct buffer.modtime): Now time_t, not int.
15871 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15872 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15873
15874 Minor fixes for signed vs unsigned integers.
15875 * character.h (MAYBE_UNIFY_CHAR):
15876 * charset.c (maybe_unify_char):
15877 * keyboard.c (read_char, reorder_modifiers):
15878 XINT -> XFASTINT, since the integer must be nonnegative.
15879 * ftfont.c (ftfont_spec_pattern):
15880 * keymap.c (access_keymap, silly_event_symbol_error):
15881 XUINT -> XFASTINT, since the integer must be nonnegative.
15882 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15883 since it makes no difference and we prefer signed.
15884 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15885 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15886 nonnegative.
15887
15888 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15889
15890 * window.h (Fwindow_frame): Declare.
15891
15892 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15893
15894 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15895 (SPARE_MEMORY): Always define.
15896 (LARGE_REQUEST): Remove.
15897 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15898
15899 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15900
15901 * lisp.h: Move EXFUNS for Fframe_root_window,
15902 Fframe_first_window and Fset_frame_selected_window to window.h.
15903
15904 * window.h: Move EXFUNS for Fframe_root_window,
15905 Fframe_first_window and Fset_frame_selected_window here from
15906 lisp.h.
15907
15908 * frame.c (Fwindow_frame, Fframe_first_window)
15909 (Fframe_root_window, Fframe_selected_window)
15910 (Fset_frame_selected_window): Move to window.c.
15911 (Factive_minibuffer_window): Move to minibuf.c.
15912 (Fother_visible_frames_p): New function.
15913
15914 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15915
15916 * window.c (decode_window, decode_any_window): Move up in code.
15917 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15918 (inhibit_frame_unsplittable): Remove unused variable.
15919 (Fwindow_buffer): Move up and rewrite doc-string.
15920 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15921 (Fwindow_prev): New functions.
15922 (Fwindow_frame): Move here from frame.c. Accept any window as
15923 argument.
15924 (Fframe_root_window, Fframe_first_window)
15925 (Fframe_selected_window): Move here from frame.c. Accept frame
15926 or arbitrary window as argument. Update doc-strings.
15927 (Fminibuffer_window): Move up in code.
15928 (Fwindow_minibuffer_p): Move up in code and simplify.
15929 (Fset_frame_selected_window): Move here from frame.c.
15930 Marginal rewrite.
15931 (Fselected_window, select_window, Fselect_window): Move up in
15932 code. Minor doc-string fixes.
15933
15934 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15935
15936 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15937 Do not assume that spare memory exists; that assumption is valid
15938 only if SYSTEM_MALLOC.
15939 (LARGE_REQUEST): New macro, so that the issue of large requests
15940 is separated from the issue of spare memory.
15941
15942 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15943
15944 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15945 format. (Bug#8806)
15946
15947 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15948
15949 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15950 before statements.
15951
15952 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15953
15954 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15955
15956 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15957
15958 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15959 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15960
15961 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15962
15963 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15964
15965 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15966
15967 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15968 (x_clipboard_manager_save): Add return value.
15969 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15970 New error handlers.
15971 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15972 Obey Vx_select_enable_clipboard_manager. Catch errors in
15973 x_clipboard_manager_save (Bug#8779).
15974 (Vx_select_enable_clipboard_manager): New variable.
15975 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15976
15977 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15978
15979 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15980
15981 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15982
15983 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15984 in the current matrix if keep_current_p is non-zero.
15985
15986 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15987
15988 * bidi.c (bidi_level_of_next_char): Fix last change.
15989
15990 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15991
15992 Support bidi reordering of text covered by display properties.
15993
15994 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15995 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15996 (bidi_cache_search, bidi_cache_iterator_state)
15997 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15998 (bidi_level_of_next_char, bidi_move_to_visually_next):
15999 Support character positions inside a run of characters covered by a
16000 display string.
16001 (bidi_paragraph_init, bidi_resolve_explicit_1)
16002 (bidi_level_of_next_char): Call bidi_fetch_char and
16003 bidi_fetch_char_advance instead of FETCH_CHAR and
16004 FETCH_CHAR_ADVANCE.
16005 (bidi_init_it): Initialize new members.
16006 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
16007 definitions.
16008 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
16009 instead of using explicit *_CHAR codes.
16010 (bidi_resolve_explicit, bidi_resolve_weak):
16011 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
16012 bidirectional text is supported only in multibyte buffers.
16013 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
16014 it to initialize the frame_window_p member of struct bidi_it.
16015 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
16016 (bidi_resolve_explicit, bidi_resolve_weak)
16017 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
16018 bidi_it->nchars is non-positive.
16019 (bidi_level_of_next_char): Don't try to lookup the cache for the
16020 next/previous character if nothing is cached there yet, or if we
16021 were just reseat()'ed to a new position.
16022
16023 * xdisp.c (set_cursor_from_row): Set start and stop points
16024 according to the row's direction when priming the loop that looks
16025 for the glyph on which to display cursor.
16026 (single_display_spec_intangible_p): Function deleted.
16027 (display_prop_intangible_p): Reimplement to call
16028 handle_display_spec instead of single_display_spec_intangible_p.
16029 Accept 3 additional arguments needed by handle_display_spec.
16030 This fixes incorrect cursor motion across display property with complex
16031 values: lists, `(when COND...)' forms, etc.
16032 (single_display_spec_string_p): Support property values that are
16033 lists with the argument STRING its top-level element.
16034 (display_prop_string_p): Fix the condition for processing a
16035 property that is a list to be consistent with handle_display_spec.
16036 (handle_display_spec): New function, refactored from the
16037 last portion of handle_display_prop.
16038 (compute_display_string_pos): Accept additional argument
16039 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
16040 value of a `display' property is a "replacing spec".
16041 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
16042 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
16043 the display property, but just return a value indicating whether
16044 the display property will replace the characters it covers.
16045 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
16046 frame_window_p members of struct bidi_it.
16047 (compute_display_string_pos, compute_display_string_end):
16048 New functions.
16049 (push_it): Accept second argument POSITION, where pop_it should
16050 jump to continue iteration.
16051 (reseat_1): Initialize bidi_it.disp_pos.
16052
16053 * keyboard.c (adjust_point_for_property): Adjust the call to
16054 display_prop_intangible_p to its new signature.
16055
16056 * dispextern.h (struct bidi_it): New member frame_window_p.
16057 (bidi_init_it): Update prototypes.
16058 (display_prop_intangible_p): Update prototype.
16059 (compute_display_string_pos, compute_display_string_end):
16060 Declare prototypes.
16061 (struct bidi_it): New members nchars and disp_pos. ch_len is now
16062 EMACS_INT.
16063
16064 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
16065
16066 Malloc failure behavior now depends on size of allocation.
16067 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16068 * lisp.h: Change signatures accordingly.
16069 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16070 All callers changed. (Bug#8762)
16071
16072 * gnutls.c: Use Emacs's memory allocators.
16073 Without this change, the gnutls library would invoke malloc etc.
16074 directly, which causes problems on non-SYNC_INPUT hosts, and which
16075 runs afoul of improving memory_full behavior. (Bug#8761)
16076 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16077 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16078 xfree instead of the default malloc, realloc, free.
16079 (Fgnutls_boot): No need to check for memory allocation failure,
16080 since xmalloc does that for us.
16081
16082 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
16083 * category.c (hash_get_category_set):
16084 * ccl.c (ccl_driver):
16085 * charset.c (Fdefine_charset_internal):
16086 * charset.h (struct charset.hash_index):
16087 * composite.c (get_composition_id, gstring_lookup_cache)
16088 (composition_gstring_put_cache):
16089 * composite.h (struct composition.hash_index):
16090 * dispextern.h (struct image.hash):
16091 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16092 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16093 (hashfn_equal, hashfn_user_defined, make_hash_table)
16094 (maybe_resize_hash_table, hash_lookup, hash_put)
16095 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16096 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16097 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16098 * image.c (make_image, search_image_cache, lookup_image)
16099 (xpm_put_color_table_h):
16100 * lisp.h (struct Lisp_Hash_Table):
16101 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16102 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16103 for hashes and hash indexes, instead of 'unsigned' and 'int'.
16104 * alloc.c (allocate_vectorlike):
16105 Check for overflow in vector size calculations.
16106 * ccl.c (ccl_driver):
16107 Check for overflow when converting EMACS_INT to int.
16108 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16109 need to be updated by these changes.
16110 * fns.c (make_hash_table, maybe_resize_hash_table):
16111 Check for integer overflow with large hash tables.
16112 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16113 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16114 (SXHASH_REDUCE): New macro.
16115 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16116 Use it instead of discarding useful hash info with large hash values.
16117 (sxhash_float): New function.
16118 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16119 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16120 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16121 Rewrite to use FIXNUM_BITS, as this simplifies things.
16122 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16123 Adjust signatures to match updated version of code.
16124 (consing_since_gc): Now EMACS_INT, since a single hash table can
16125 use more than INT_MAX bytes.
16126
16127 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16128
16129 Make it possible to build with GCC-4.6+ -O2 -flto.
16130
16131 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16132
16133 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16134
16135 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16136 Call minibuffer-inactive-mode.
16137
16138 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
16139
16140 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16141 Update dependencies.
16142
16143 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16144
16145 * data.c (init_data): Remove code for UTS, this system is not
16146 supported anymore.
16147
16148 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16149
16150 Don't force ./temacs to start in terminal mode.
16151
16152 * frame.c (make_initial_frame): Initialize faces in all cases, not
16153 only when CANNOT_DUMP is defined.
16154 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16155
16156 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16157
16158 * dispnew.c (add_window_display_history): Use const for the string
16159 pointer. Remove declaration, not needed.
16160
16161 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16162
16163 Use 'inline', not 'INLINE'.
16164 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16165 * alloc.c, fontset.c (INLINE): Remove.
16166 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16167 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16168 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16169 * gmalloc.c (register_heapinfo): Use inline unconditionally.
16170 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16171
16172 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16173
16174 Make it possible to run ./temacs.
16175
16176 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16177 syms_of_callproc does the same thing. Remove test for
16178 "initialized", do it in the caller.
16179 * emacs.c (main): Avoid calling set_initial_environment when dumping.
16180
16181 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
16182
16183 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16184 (read_minibuf): Use get_minibuffer.
16185 (syms_of_minibuf): Use DEFSYM.
16186 (Qmetadata): New var.
16187 * data.c (Qbuffer): Don't make it static.
16188 (syms_of_data): Use DEFSYM.
16189
16190 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16191
16192 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
16193 (CCL_CODE_MIN): New macro.
16194
16195 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
16196
16197 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16198
16199 * eval.c (Qdebug): Now static.
16200 * lisp.h (Qdebug): Remove decl. This reverts a part of the
16201 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16202 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16203
16204 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16205
16206 * image.c: Various fixes to ImageMagick code comments.
16207 (Fimagemagick_types): Doc fix.
16208
16209 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16210
16211 Minor fixes prompted by GCC 4.6.0 warnings.
16212
16213 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16214
16215 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16216 (x_clipboard_manager_save_all): Move extern decl to ...
16217 * xterm.h: ... here, so that it can be checked for consistency.
16218
16219 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16220
16221 * xselect.c (x_clipboard_manager_save_frame)
16222 (x_clipboard_manager_save_all): New functions.
16223 (Fx_clipboard_manager_save): Lisp function deleted.
16224
16225 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16226 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16227
16228 * xterm.h: Update prototype.
16229
16230 2011-05-28 William Xu <william.xwl@gmail.com>
16231
16232 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16233 exiting (Bug#8239).
16234
16235 2011-05-28 Jim Meyering <meyering@redhat.com>
16236
16237 Avoid a sign-extension bug in crypto_hash_function.
16238 * fns.c (to_uchar): Define.
16239 (crypto_hash_function): Use it to convert some newly-signed
16240 variables to unsigned, to avoid sign-extension bugs. For example,
16241 without this change, (md5 "truc") would evaluate to
16242 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16243 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
16244 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16245
16246 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16247
16248 Integer overflow fixes.
16249
16250 * dbusbind.c: Serial number integer overflow fixes.
16251 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16252 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16253 to hold a serial number that is too large for a fixnum.
16254 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16255 Check for serial numbers out of range. Decode any serial number
16256 that was so large that it became a float. (Bug#8722)
16257
16258 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16259 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16260 Use XFASTINT rather than XUINT when numbers are nonnegative.
16261 (xd_append_arg, Fdbus_method_return_internal):
16262 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16263 arguments, check that Lisp number is nonnegative, rather than
16264 silently wrapping negative numbers around. (Bug#8722)
16265 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16266 (Bug#8722)
16267
16268 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16269
16270 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16271
16272 ccl: Add integer overflow checks.
16273 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16274 (IN_INT_RANGE): New macros.
16275 (ccl_driver): Use them to check for integer overflow when
16276 decoding a CCL program. Many of the new checks are whether XINT (x)
16277 fits in int; it doesn't always, on 64-bit hosts. The new version
16278 doesn't catch all possible integer overflows, but it's an
16279 improvement. (Bug#8719)
16280
16281 * alloc.c (make_event_array): Use XINT, not XUINT.
16282 There's no need for unsigned here.
16283
16284 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16285 This follows up to the 2011-05-06 change that substituted uintptr_t
16286 for EMACS_INT. This case wasn't caught back then.
16287
16288 Rework Fformat to avoid integer overflow issues.
16289 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16290 now (part of C89). Include <verify.h>.
16291 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16292 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16293 (Fformat): Avoid the prepass trying to compute sizes; it was only
16294 approximate and thus did not catch overflow reliably. Instead, walk
16295 through the format just once, formatting and computing sizes as we go,
16296 checking for integer overflow at every step, and allocating a larger
16297 buffer as needed. Keep track separately whether the format is
16298 multibyte. Keep only the most-recently calculated precision, rather
16299 than them all. Record whether each argument has been converted to
16300 string. Use EMACS_INT, not int, for byte and char and arg counts.
16301 Support field widths and precisions larger than INT_MAX. Avoid
16302 sprintf's undefined behavior with conversion specifications such as %#d
16303 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16304 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16305 formatting out-of-range floating point numbers with int
16306 formats. (Bug#8668)
16307
16308 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16309
16310 * data.c: Avoid integer truncation in expressions involving floats.
16311 * data.c: Include <intprops.h>.
16312 (arith_driver): When there's an integer overflow in an expression
16313 involving floating point, convert the integers to floating point
16314 so that the resulting value does not suffer from catastrophic
16315 integer truncation. For example, on a 64-bit host (* 4
16316 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16317 Do not rely on undefined behavior after integer overflow.
16318
16319 merge count_size_as_multibyte, parse_str_to_multibyte
16320 * character.c, character.h (count_size_as_multibyte):
16321 Rename from parse_str_to_multibyte; all uses changed.
16322 Check for integer overflow.
16323 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16324 since it's now a duplicate of the other. This is more of
16325 a character than a buffer op, so better that it's in character.c.
16326 * fns.c, print.c: Adjust to above changes.
16327
16328 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16329
16330 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16331
16332 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16333
16334 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16335 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16336 (x_clipboard_manager_save): Now static.
16337 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16338
16339 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16340 (crypto_hash_function): Now static.
16341 Fix pointer signedness problems. Avoid unnecessary initializations.
16342
16343 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16344
16345 * termhooks.h (Vselection_alist): Make it terminal-local.
16346
16347 * terminal.c (create_terminal): Initialize it.
16348
16349 * xselect.c: Support for clipboard managers.
16350 (Vselection_alist): Move to termhooks.h as terminal-local var.
16351 (LOCAL_SELECTION): New macro.
16352 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16353 (symbol_to_x_atom): Remove gratuitous arg.
16354 (x_handle_selection_request, lisp_data_to_selection_data)
16355 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16356 (x_own_selection, x_get_local_selection, x_convert_selection):
16357 New arg, specifying work frame. Use terminal-local Vselection_alist.
16358 (some_frame_on_display): Delete unused function.
16359 (Fx_own_selection_internal, Fx_get_selection_internal)
16360 (Fx_disown_selection_internal, Fx_selection_owner_p)
16361 (Fx_selection_exists_p): New optional frame arg.
16362 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16363 (x_handle_selection_clear): Don't treat other terminals with the
16364 same keyboard specially. Use the terminal-local Vselection_alist.
16365 (x_clear_frame_selections): Use Frun_hook_with_args.
16366
16367 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16368
16369 * xterm.h: Add support for those atoms.
16370
16371 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16372
16373 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16374 (converted_selections, conversion_fail_tag): New global variables.
16375 (x_selection_request_lisp_error): Free the above.
16376 (x_get_local_selection): Remove unnecessary code.
16377 (x_reply_selection_request): Args changed; handle arbitrary array
16378 of converted selections stored in converted_selections.
16379 Separate the XChangeProperty and SelectionNotify steps.
16380 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16381 (x_convert_selection): New function.
16382 (x_handle_selection_event): Simplify.
16383 (x_get_foreign_selection): Don't ignore incoming requests while
16384 waiting for an answer; this will fail when we implement
16385 SAVE_TARGETS, and seems unnecessary anyway.
16386 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16387 (Vx_sent_selection_functions): Doc fix.
16388
16389 2011-05-26 Leo Liu <sdl.web@gmail.com>
16390
16391 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16392
16393 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16394
16395 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16396
16397 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16398 for fringe update if it has periodic bitmap.
16399 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16400 and fringe_bitmap_periodic_p.
16401
16402 * fringe.c (get_fringe_bitmap_data): New function.
16403 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16404 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16405 row. Mark glyph row for fringe update if periodicity changed.
16406
16407 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16408 for fringe update unless it has periodic bitmap.
16409
16410 2011-05-25 Kenichi Handa <handa@m17n.org>
16411
16412 * xdisp.c (get_next_display_element): Set correct it->face_id for
16413 a static composition.
16414
16415 2011-05-24 Leo Liu <sdl.web@gmail.com>
16416
16417 * deps.mk (fns.o):
16418 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16419
16420 * fns.c (crypto_hash_function, Fsha1): New function.
16421 (Fmd5): Use crypto_hash_function.
16422 (syms_of_fns): Add Ssha1.
16423
16424 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16425
16426 * gnutls.c: Remove unused macros.
16427 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16428 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16429 Remove macros that are defined and never used.
16430 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16431
16432 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16433
16434 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16435 (Fx_get_selection_internal): Minor cleanup.
16436 (Fx_own_selection_internal): Rename arguments for consistency with
16437 select.el.
16438
16439 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16440
16441 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16442
16443 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16444
16445 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16446
16447 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16448
16449 * dispnew.c (scrolling_window): Don't exclude the case that the
16450 last enabled row in the desired matrix touches the bottom boundary.
16451
16452 2011-05-21 Glenn Morris <rgm@gnu.org>
16453
16454 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16455 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16456 and add some more files.
16457
16458 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16459
16460 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16461 report_file_error introduced by the change from 2011-05-07.
16462
16463 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16464
16465 * systime.h (Time): Define only if emacs is defined.
16466 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16467 where the include path doesn't have X11/X.h by default. See
16468 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16469
16470 2011-05-20 Kenichi Handa <handa@m17n.org>
16471
16472 * composite.c (find_automatic_composition): Fix previous change.
16473
16474 2011-05-20 Glenn Morris <rgm@gnu.org>
16475
16476 * lisp.mk: New file, split from Makefile.in.
16477 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16478 (shortlisp): Remove.
16479 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16480
16481 2011-05-19 Glenn Morris <rgm@gnu.org>
16482
16483 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16484 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16485 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16486 (lisp): Set the order to that of loadup.el.
16487 (shortlisp): Make it a copy of $lisp.
16488 (SOME_MACHINE_LISP): Remove.
16489 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16490 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16491
16492 2011-05-18 Kenichi Handa <handa@m17n.org>
16493
16494 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16495 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16496 (find_automatic_composition): Mostly rewrite for efficiency.
16497
16498 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16499
16500 * makefile.w32-in: Update dependencies.
16501
16502 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16503
16504 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16505 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16506
16507 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16508
16509 Fix some integer overflow issues, such as string length overflow.
16510
16511 * insdel.c (count_size_as_multibyte): Check for string overflow.
16512
16513 * character.c (lisp_string_width): Check for string overflow.
16514 Use EMACS_INT, not int, for string indexes and lengths; in
16515 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16516 the resulting string length overflows an EMACS_INT; instead,
16517 report a string overflow if no precision given. When checking for
16518 precision exhaustion, use a check that cannot possibly have
16519 integer overflow. (Bug#8675)
16520 * character.h (lisp_string_width): Adjust to new signature.
16521
16522 * alloc.c (string_overflow): New function.
16523 (Fmake_string): Use it. This doesn't change behavior, but saves
16524 a few bytes and will simplify future changes.
16525 * character.c (string_escape_byte8): Likewise.
16526 * lisp.h (string_overflow): New decl.
16527
16528 Fixups, following up to the user-interface timestamp change.
16529 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16530 for UI timestamps, instead of unsigned long.
16531 * msdos.c (mouse_get_pos): Likewise.
16532 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16533 * w32gui.h (Time): Define by including "systime.h" rather than by
16534 declaring it ourselves. (Bug#8664)
16535
16536 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16537 * image.c (clear_image_cache): Likewise.
16538
16539 * term.c (term_mouse_position): Don't assume time_t wraparound.
16540
16541 Be more systematic about user-interface timestamps.
16542 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16543 and sometimes 'EMACS_UINT', to represent these timestamps.
16544 This change causes it to use 'Time' uniformly, as that's what X uses.
16545 This makes the code easier to follow, and makes it easier to catch
16546 integer overflow bugs such as Bug#8664.
16547 * frame.c (Fmouse_position, Fmouse_pixel_position):
16548 Use Time, not unsigned long, for user-interface timestamps.
16549 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16550 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16551 * keyboard.h (last_event_timestamp): Likewise.
16552 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16553 * menu.h (xmenu_show): Likewise.
16554 * term.c (term_mouse_position): Likewise.
16555 * termhooks.h (struct input_event.timestamp): Likewise.
16556 (struct terminal.mouse_position_hook): Likewise.
16557 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16558 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16559 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16560 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16561 what it was before.
16562 * menu.h, termhooks.h: Include "systime.h", for Time.
16563
16564 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16565 Don't assume that the difference between two unsigned long values
16566 can fit into an integer. At this point, we know button_down_time
16567 <= event->timestamp, so the difference must be nonnegative, so
16568 there's no need to cast the result if double-click-time is
16569 nonnegative, as it should be; check that it's nonnegative, just in
16570 case. This bug is triggered when events are more than 2**31 ms
16571 apart (about 25 days). (Bug#8664)
16572
16573 * xselect.c (last_event_timestamp): Remove duplicate decl.
16574 (x_own_selection): Remove needless cast to unsigned long.
16575
16576 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16577 that always fit in int. Use a sentinel instead of a counter, to
16578 avoid a temp and to allay GCC's concerns about possible int overflow.
16579 * frame.h (struct frame): Use int for menu_bar_items_used
16580 instead of EMACS_INT, since it always fits in int.
16581
16582 * menu.c (grow_menu_items): Check for int overflow.
16583
16584 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16585
16586 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16587 Before, the code was not consistent. These values cannot exceed
16588 2**31 - 1 so there's no need to make them unsigned.
16589 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16590 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16591 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16592 as modifiers.
16593 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16594
16595 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16596 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16597 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16598 presumably because the widths might not match.
16599
16600 * window.c (size_window): Avoid needless test at loop start.
16601
16602 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16603
16604 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16605
16606 2011-05-12 Drew Adams <drew.adams@oracle.com>
16607
16608 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16609
16610 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16611
16612 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16613 `width' to `bar_area_x' and `bar_area_width', respectively.
16614 (x_scroll_run): Take account of fringe background extension.
16615
16616 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16617 Rename local vars `left' and `width' to `bar_area_x' and
16618 `bar_area_width', respectively.
16619 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16620 background extension.
16621
16622 2011-05-10 Jim Meyering <meyering@redhat.com>
16623
16624 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16625
16626 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16627
16628 * image.c (Finit_image_library): Return t for built-in image types,
16629 like pbm and xbm. (Bug#8640)
16630
16631 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16632
16633 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16634
16635 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16636
16637 * w32console.c (Fset_screen_color): Doc fix.
16638 (Fget_screen_color): New function.
16639 (syms_of_ntterm): Defsubr it.
16640
16641 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16642 unlink the temporary file if Fcall_process didn't create it in the
16643 first place.
16644 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16645 child process will be redirected to a file specified with `:file'.
16646 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16647 cue to call_process_cleanup not to close that handle.
16648
16649 2011-05-07 Ben Key <bkey76@gmail.com>
16650
16651 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16652 one of two shell specific rules, either bootstrap-temacs-CMD or
16653 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16654 to the previous implementation of the bootstrap-temacs rule.
16655 The bootstrap-temacs-CMD rule is similar to the previous
16656 implementation of the bootstrap-temacs rule except that it
16657 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16658 variable.
16659
16660 These changes, along with some changes to nt/configure.bat,
16661 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16662 earlier fix to add support for --cflags and --ldflags options
16663 that include quotes so that it works whether make uses cmd or
16664 sh as the shell.
16665
16666 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16667
16668 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16669 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16670 is a constant.
16671 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16672 a string. Handle both cases.
16673 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16674 (Fdbus_register_method): Use Qinvalid_function.
16675
16676 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16677
16678 * makefile.w32-in: Update dependencies.
16679 (LISP_H): Add inttypes.h and stdin.h.
16680 (PROCESS_H): Add unistd.h.
16681
16682 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16683
16684 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16685 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16686
16687 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16688
16689 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16690
16691 * term.c (vfatal): Remove stray call to va_end.
16692 It's not needed and the C Standard doesn't allow it here anyway.
16693
16694 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16695 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16696
16697 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16698 bytes.
16699
16700 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16701
16702 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16703
16704 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16705
16706 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16707
16708 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16709
16710 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16711 * charset.c (Fdefine_charset_internal): Don't initialize
16712 charset.code_space[15]. The value was garbage, on hosts with
16713 32-bit int (Bug#8600).
16714
16715 * lread.c (read_integer): Be more consistent with string-to-number.
16716 Use string_to_number to do the actual conversion; this avoids
16717 rounding errors and fixes some other screwups. Without this fix,
16718 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16719 (digit_to_number): Move earlier, for benefit of read_integer.
16720 Return -1 if the digit is out of range for the base, -2 if it is
16721 not a digit in any supported base. (Bug#8602)
16722
16723 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16724
16725 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16726 to match comment at start of function. This also removes a
16727 GCC warning about overflow in a 32+64-bit port.
16728
16729 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16730
16731 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16732 Reported by Stefan Monnier in
16733 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16734 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16735 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16736
16737 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16738 (EMACS_UINTPTR): Likewise, with uintptr_t.
16739
16740 * lisp.h: Prefer 64-bit EMACS_INT if available.
16741 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16742 on 32-bit hosts that have 64-bit int, so that they can access
16743 large files.
16744 However, temporarily disable this change unless the temporary
16745 symbol WIDE_EMACS_INT is defined.
16746
16747 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16748
16749 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16750 This removes an assumption that EMACS_INT and long are the same
16751 width as pointers. The assumption is true for Emacs porting targets
16752 now, but we want to make other targets possible.
16753 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16754 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16755 In the rest of the code, change types of integers that hold casted
16756 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16757 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16758 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16759 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16760 No need to cast type when ORing.
16761 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16762 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16763 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16764 assume EMACS_INT is the same width as char *.
16765 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16766 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16767 Remove no-longer-needed casts.
16768 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16769 (xg_tool_bar_help_callback, xg_make_tool_item):
16770 Use EMACS_INTPTR to hold an integer
16771 that will be cast to void *; this can avoid a GCC warning
16772 if EMACS_INT is not the same width as void *.
16773 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16774 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16775 (current_message_1, set_message_1):
16776 Use a local to convert to proper width without a cast.
16777 * xmenu.c (dialog_selection_callback): Likewise.
16778
16779 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16780 Also, don't assume VALBITS / RAND_BITS is less than 5,
16781 and don't rely on undefined behavior when shifting a 1 left into
16782 the sign bit.
16783 * lisp.h (get_random): Change signature to match.
16784
16785 * lread.c (hash_string): Use size_t, not int, for hash computation.
16786 Normally we prefer signed values; but hashing is special, because
16787 it's better to use unsigned division on hash table sizes so that
16788 the remainder is nonnegative. Also, size_t is the natural width
16789 for hashing into memory. The previous code used 'int', which doesn't
16790 retain enough info to hash well into very large tables.
16791 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16792
16793 * dbusbind.c: Don't possibly lose pointer info when converting.
16794 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16795 Use XPNTR rather than XHASH, so that the high-order bits of
16796 the pointer aren't lost when converting through void *.
16797
16798 * eval.c (Fautoload): Don't double-shift a pointer.
16799
16800 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16801
16802 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16803
16804 * gnutls.c (DEF_GNUTLS_FN):
16805 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16806
16807 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16808
16809 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16810 marker. (Bug#8610)
16811
16812 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16813
16814 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16815 New version that can reserve upto 2GB of heap space.
16816
16817 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16818
16819 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16820
16821 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16822
16823 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16824 `gnutls_certificate_set_x509_key_file'.
16825
16826 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16827
16828 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16829 Update dependencies.
16830
16831 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16832
16833 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16834 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16835 Remove unused parameter `fildes'.
16836 * process.c (read_process_output, send_process): Don't pass it.
16837
16838 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16839
16840 Fix previous change: the library cache is defined in w32.c.
16841 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16842 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16843
16844 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16845
16846 Implement dynamic loading of GnuTLS on Windows.
16847
16848 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16849 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16850 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16851 Declare.
16852
16853 * gnutls.c (Qgnutls_dll): Define.
16854 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16855 (gnutls_*): Declare function pointers.
16856 (init_gnutls_functions): New function to initialize function pointers.
16857 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16858 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16859 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16860 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16861 (emacs_gnutls_write, emacs_gnutls_read)
16862 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16863 (Fgnutls_available_p): New function.
16864 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16865 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16866 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16867
16868 * image.c: Include w32.h.
16869 (Vimage_type_cache): Delete.
16870 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16871 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16872 (w32_delayed_load): Move to w32.c.
16873
16874 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16875
16876 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16877 (w32_delayed_load): Move from image.c. When loading a library, record
16878 its filename in the :loaded-from property of the library id.
16879 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16880 Initialize and staticpro them.
16881 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16882
16883 * process.c: Include lisp.h before w32.h, not after.
16884 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16885 instead of gnutls_record_check_pending.
16886
16887 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16888
16889 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16890
16891 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16892 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16893 as passed in.
16894
16895 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16896
16897 * xterm.c (x_set_frame_alpha): Do not set property on anything
16898 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16899
16900 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16901
16902 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16903
16904 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16905
16906 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16907 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16908 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16909 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16910 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16911 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16912 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16913 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16914 (Qgnutls_bootprop_callbacks_verify): Make static.
16915
16916 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16917
16918 * callproc.c: Indentation fixup.
16919
16920 * sysdep.c (wait_for_termination_1): Make static.
16921 (wait_for_termination, interruptible_wait_for_termination):
16922 Move after wait_for_termination_1.
16923
16924 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16925
16926 * sysdep.c (interruptible_wait_for_termination): New function
16927 which is like wait_for_termination, but allows keyboard
16928 interruptions.
16929
16930 * callproc.c (Fcall_process): Add (:file "file") as an option for
16931 the STDOUT buffer.
16932 (Fcall_process_region): Ditto.
16933
16934 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16935
16936 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16937 rather than `XVECTOR (FOO)->size'.
16938
16939 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16940 inttypes.h, as a gnulib replacement is used if it not available in
16941 system headers.
16942
16943 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16944
16945 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16946 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16947 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16948
16949 * coding.c (coding_alloc_by_realloc): Error out if destination
16950 will grow beyond MOST_POSITIVE_FIXNUM.
16951 (decode_coding_emacs_mule): Abort if there isn't enough place in
16952 charbuf for the composition carryover bytes. Reserve an extra
16953 space for up to 2 characters produced in a loop.
16954 (decode_coding_iso_2022): Abort if there isn't enough place in
16955 charbuf for the composition carryover bytes.
16956
16957 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16958
16959 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16960 aborting when %lld or %lll format is passed.
16961 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16962 %llo or %llx format is passed. (Bug#8545)
16963
16964 * window.c (window_scroll_line_based): Use a marker instead of
16965 simple variables to record original value of point. (Bug#7952)
16966
16967 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16968 produced by %s or %c overflows available buffer space. (Bug#8545)
16969
16970 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16971
16972 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16973 (SIZE_MAX): Move defn after all includes, as they might #define it.
16974
16975 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16976
16977 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16978
16979 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16980
16981 * keyboard.c (Qdelayed_warnings_hook): Define.
16982 (command_loop_1): Run `delayed-warnings-hook'
16983 if Vdelayed_warnings_list is non-nil.
16984 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16985 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16986
16987 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16988
16989 * doprnt.c (doprnt): Don't return value smaller than the buffer
16990 size if the message was truncated. (Bug#8545).
16991
16992 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16993
16994 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16995 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16996
16997 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16998
16999 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
17000
17001 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
17002
17003 * makefile.w32-in: Update dependencies.
17004
17005 2011-04-27 Eli Zaretskii <eliz@gnu.org>
17006
17007 Improve `doprnt' and its usage. (Bug#8545)
17008 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
17009 `format_end'. Remove support for %l as a conversion specifier.
17010 Don't use xrealloc. Improve diagnostics when the %l size modifier
17011 is used. Update the commentary.
17012
17013 * eval.c (verror): Simplify calculation of size_t.
17014
17015 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
17016 messages.
17017
17018 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
17019
17020 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
17021 change.
17022
17023 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17024
17025 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
17026 This makes this file independent of the recent pseudovector change.
17027
17028 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
17029
17030 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
17031
17032 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
17033 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
17034 Remove unused local.
17035 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
17036
17037 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
17038 GCC 4.6.0 optimizes based on type-based alias analysis.
17039 For example, if b is of type struct buffer * and v of type struct
17040 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
17041 != &v->size, and therefore "v->size = 1; b->size = 2; return
17042 v->size;" must therefore return 1. This assumption is incorrect
17043 for Emacs, since it type-puns struct Lisp_Vector * with many other
17044 types. To fix this problem, this patch adds a new type struct
17045 vectorlike_header that documents the constraints on layout of vectors
17046 and pseudovectors, and helps optimizing compilers not get fooled
17047 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
17048 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
17049 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
17050 the size member.
17051 (XSETPVECTYPE): Rewrite in terms of new macro.
17052 (XSETPVECTYPESIZE): New macro, specifying both type and size.
17053 This is a bit clearer, and further avoids the possibility of
17054 undesirable aliasing.
17055 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
17056 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
17057 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17058 since Lisp_Subr is a special case (no "next" field).
17059 (ASIZE): Now uses header.size rather than size.
17060 All previous uses of XVECTOR (foo)->size replaced to use this macro,
17061 to avoid the hassle of writing XVECTOR (foo)->header.size.
17062 (struct vectorlike_header): New type.
17063 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17064 object, to help avoid aliasing.
17065 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17066 (SUBRP): Likewise, since Lisp_Subr is a special case.
17067 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17068 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17069 (struct Lisp_Hash_Table): Combine first two members into a single
17070 struct vectorlike_header member. All uses of "size" and "next" members
17071 changed to be "header.size" and "header.next".
17072 * buffer.h (struct buffer): Likewise.
17073 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17074 * frame.h (struct frame): Likewise.
17075 * process.h (struct Lisp_Process): Likewise.
17076 * termhooks.h (struct terminal): Likewise.
17077 * window.c (struct save_window_data, struct saved_window): Likewise.
17078 * window.h (struct window): Likewise.
17079 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17080 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17081 * buffer.c (init_buffer_once): Likewise.
17082 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17083 special case.
17084 * process.c (Fformat_network_address): Use local var for size,
17085 for brevity.
17086
17087 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17088
17089 Make the Lisp reader and string-to-float more consistent (Bug#8525)
17090 * data.c (atof): Remove decl; no longer used or needed.
17091 (digit_to_number): Move to lread.c.
17092 (Fstring_to_number): Use new string_to_number function, to be
17093 consistent with how the Lisp reader treats infinities and NaNs.
17094 Do not assume that floating-point numbers represent EMACS_INT
17095 without losing information; this is not true on most 64-bit hosts.
17096 Avoid double-rounding errors, by insisting on integers when
17097 parsing non-base-10 numbers, as the documentation specifies.
17098 * lisp.h (string_to_number): New decl, replacing ...
17099 (isfloat_string): Remove.
17100 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17101 (read1): Do not accept +. and -. as integers; this
17102 appears to have been a coding error. Similarly, do not accept
17103 strings like +-1e0 as floating point numbers. Do not report
17104 overflow for integer overflows unless the base is not 10 which
17105 means we have no simple and reliable way to continue.
17106 Break out the floating-point parsing into a new
17107 function string_to_number, so that Fstring_to_number parses
17108 floating point numbers consistently with the Lisp reader.
17109 (digit_to_number): Move here from data.c. Make it static inline.
17110 (E_CHAR, EXP_INT): Remove, replacing with ...
17111 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17112 (string_to_number): New function, replacing isfloat_string.
17113 This function checks for valid syntax and produces the resulting
17114 Lisp float number too. Rework it so that string-to-number
17115 no longer mishandles examples like "1.0e+". Use strtoumax,
17116 so that overflow for non-base-10 numbers is reported only when
17117 there's no portable and simple way to convert to floating point.
17118
17119 * textprop.c (set_text_properties_1): Rewrite for clarity,
17120 and to avoid GCC warning about integer overflow.
17121
17122 * intervals.h (struct interval): Use EMACS_INT for members
17123 where EMACS_UINT might cause problems. See
17124 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17125 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17126 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17127 All uses changed.
17128 (offset_intervals): Tell GCC not to worry about length overflow
17129 when negating a negative length.
17130
17131 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17132 (overrun_check_free): Likewise.
17133
17134 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17135 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17136 word size.
17137
17138 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17139 (gnutls_make_error): Rename local to avoid shadowing.
17140 (gnutls_emacs_global_deinit): ifdef out; not used.
17141 (Fgnutls_boot): Use const for pointer to readonly storage.
17142 Comment out unused local. Fix pointer signedness problems.
17143
17144 * lread.c (openp): Don't stuff size_t into an 'int'.
17145 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17146 about possible signed overflow.
17147
17148 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17149 (GDK_KEY_g): Don't define if already defined.
17150 (xg_prepare_tooltip): Avoid pointer signedness problem.
17151 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17152
17153 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17154 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
17155
17156 * xfns.c (Fx_window_property): Simplify a bit,
17157 to make a bit faster and to avoid GCC 4.6.0 warning.
17158 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17159
17160 * fns.c (internal_equal): Don't assume size_t fits in int.
17161
17162 * alloc.c (compact_small_strings): Tighten assertion a little.
17163
17164 Replace pEd with more-general pI, and fix some printf arg casts.
17165 * lisp.h (pI): New macro, generalizing old pEd macro to other
17166 conversion specifiers. For example, use "...%"pI"d..." rather
17167 than "...%"pEd"...".
17168 (pEd): Remove. All uses replaced with similar uses of pI.
17169 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17170 * alloc.c (check_pure_size): Don't overflow by converting size to int.
17171 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17172 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17173 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17174 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17175 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17176 64-bit hosts.
17177 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17178 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17179 * print.c (safe_debug_print, print_object): Likewise.
17180 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17181 to int.
17182 Use pI instead of if-then-else-abort. Use %p to avoid casts,
17183 avoiding the 0 flag, which is not portable.
17184 * process.c (Fmake_network_process): Use pI to avoid cast.
17185 * region-cache.c (pp_cache): Likewise.
17186 * xdisp.c (decode_mode_spec): Likewise.
17187 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17188 behavior on 64-bit hosts with printf arg.
17189 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17190 (x_stop_queuing_selection_requests): Likewise.
17191 (x_get_window_property): Don't truncate byte count to an 'int'
17192 when tracing.
17193
17194 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17195 here, since it parses constructs like leading '-' and spaces,
17196 which are not wanted; and it overflows with large numbers.
17197 Instead, simply match F[0-9]+, which is what is wanted anyway.
17198
17199 * alloc.c: Remove unportable assumptions about struct layout.
17200 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17201 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17202 (allocate_vectorlike, make_pure_vector): Use the new macros,
17203 plus offsetof, to remove unportable assumptions about struct layout.
17204 These assumptions hold on all porting targets that I know of, but
17205 they are not guaranteed, they're easy to remove, and removing them
17206 makes further changes easier.
17207
17208 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17209 This doesn't fix a bug but makes the code clearer.
17210 (string_overrun_cookie): Now const. Use initializers that
17211 don't formally overflow signed char, to avoid warnings.
17212 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17213 can cause Emacs to crash when string overrun checking is enabled.
17214 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17215 multiple of sizeof (EMACS_INT); it need not be, if
17216 alignof(EMACS_INT) < sizeof (EMACS_INT).
17217 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17218
17219 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17220
17221 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17222
17223 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17224
17225 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17226 supposed to be handshaking. (Bug#8556)
17227 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17228
17229 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17230
17231 * lisp.h (Qdebug): List symbol.
17232 * eval.c (Qdebug): Restore global linkage.
17233 * keyboard.c (debug-on-event): New variable.
17234 (handle_user_signal): Break into debugger when debug-on-event
17235 matches the current signal symbol.
17236
17237 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17238
17239 * alloc.c (check_sblock, check_string_bytes)
17240 (check_string_free_list): Convert to standard C.
17241
17242 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17243
17244 * w32.c (emacs_gnutls_push): Fix typo.
17245
17246 2011-04-25 Eli Zaretskii <eliz@gnu.org>
17247
17248 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17249 "cast to pointer from integer of different size".
17250
17251 Improve doprnt and its use in verror. (Bug#8545)
17252 * doprnt.c (doprnt): Document the set of format control sequences
17253 supported by the function. Use SAFE_ALLOCA instead of always
17254 using `alloca'.
17255
17256 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17257 is one byte too soon. Don't use xrealloc; instead xfree and
17258 xmalloc anew.
17259
17260 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17261
17262 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17263 callbacks stage.
17264
17265 * gnutls.c: Renamed global_initialized to
17266 gnutls_global_initialized. Added internals for the
17267 :verify-hostname-error, :verify-error, and :verify-flags
17268 parameters of `gnutls-boot' and documented those parameters in the
17269 docstring. Start callback support.
17270 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17271 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17272 on error. Return error code.
17273 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17274 (emacs_gnutls_read): Likewise.
17275 (Fgnutls_boot): Return handshake error code.
17276 (emacs_gnutls_handle_error): New function.
17277 (wsaerror_to_errno): Likewise.
17278
17279 * w32.h (emacs_gnutls_pull): Add prototype.
17280 (emacs_gnutls_push): Likewise.
17281
17282 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17283 (emacs_gnutls_push): Likewise.
17284
17285 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17286
17287 * process.c (wait_reading_process_output): Check if GnuTLS
17288 buffered some data internally if no FDs are set for TLS
17289 connections.
17290
17291 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17292 (LIBS): Link to USER_LIBS.
17293 ($(BLD)/gnutls.$(0)): New target.
17294
17295 2011-04-24 Eli Zaretskii <eliz@gnu.org>
17296
17297 * xdisp.c (handle_single_display_spec): Rename the
17298 display_replaced_before_p argument into display_replaced_p, to
17299 make it consistent with the commentary. Fix typos in the
17300 commentary.
17301
17302 * textprop.c (syms_of_textprop): Remove dead code.
17303 (copy_text_properties): Delete obsolete commentary about an
17304 interface that was deleted long ago. Fix typos in the description
17305 of arguments.
17306
17307 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17308 to changes in oldXMenu/XMenu.h from 2011-04-16.
17309 <menu_help_message, prev_menu_help_message>: Constify.
17310 (IT_menu_make_room): menu->help_text is now `const char **';
17311 adjust.
17312
17313 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17314 to changes in oldXMenu/XMenu.h from 2011-04-16.
17315 (struct XMenu): Declare `help_text' `const char **'.
17316
17317 * xfaces.c <Qunspecified>: Make extern again.
17318
17319 * syntax.c: Include sys/types.h before including regex.h, as
17320 required by POSIX.
17321
17322 * doc.c (get_doc_string): Improve the format passed to `error'.
17323
17324 * doprnt.c (doprnt): Improve commentary.
17325
17326 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17327
17328 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17329 them with etags.
17330
17331 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17332 changes in globals.h immediately force recompilation.
17333 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17334 $(CURDIR)/s/ms-w32.h.
17335 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17336
17337 * character.c (Fchar_direction): Function deleted.
17338 (syms_of_character): Don't defsubr it.
17339 <char-direction-table>: Deleted.
17340
17341 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17342
17343 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17344 * doprnt.c: Include limits.h.
17345 (SIZE_MAX): New macro.
17346 (doprnt): Return a size_t value. 2nd arg is now size_t.
17347 Many local variables are now size_t instead of int or unsigned.
17348 Improve overflow protection. Support `l' modifier for integer
17349 conversions. Support %l conversion. Don't assume an EMACS_INT
17350 argument for integer conversions and for %c.
17351
17352 * lisp.h (doprnt): Restore prototype.
17353
17354 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17355 $(SRC)/character.h.
17356
17357 * Makefile.in (base_obj): Add back doprnt.o.
17358
17359 * deps.mk (doprnt.o): Add back prerequisites.
17360 (callint.o): Depend on character.h.
17361
17362 * eval.c (internal_lisp_condition_case): Include the handler
17363 representation in the error message.
17364 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17365 when breaking from the loop.
17366
17367 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17368
17369 * callint.c (Fcall_interactively): When displaying error message
17370 about invalid control letter, pass the character's codepoint, not
17371 a pointer to its multibyte form. Improve display of the character
17372 in octal and display also its hex code.
17373
17374 * character.c (char_string): Use %x to display the (unsigned)
17375 codepoint of an invalid character, to avoid displaying a bogus
17376 negative value.
17377
17378 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17379 `error', not SYMBOL_NAME itself.
17380
17381 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17382 character arguments to `error'.
17383
17384 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17385 to `error' in error message about FINAL_CHAR argument. Make sure
17386 FINAL_CHAR is a character, and use %c when it is passed as
17387 argument to `error'.
17388
17389 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17390
17391 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17392
17393 * w32.c: Include <time.h>.
17394 (sys_localtime): New function.
17395
17396 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17397
17398 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17399
17400 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17401
17402 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17403
17404 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17405 zombies (Bug#8467).
17406
17407 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17408
17409 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17410 gl_state.e_property when gl_state.object is Qt.
17411
17412 * insdel.c (make_gap_larger): Remove limitation of buffer size
17413 to <= INT_MAX.
17414
17415 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17416
17417 * xdisp.c (lookup_glyphless_char_display)
17418 (produce_glyphless_glyph): Handle cons cell entry in
17419 glyphless-char-display.
17420 (Vglyphless_char_display): Document it.
17421
17422 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17423 glyphless-char-display.
17424
17425 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17426
17427 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17428
17429 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17430
17431 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17432 definition for no-X builds.
17433
17434 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17435
17436 Static checks with GCC 4.6.0 and non-default toolkits.
17437
17438 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17439
17440 * process.c (keyboard_bit_set): Define only if SIGIO.
17441 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17442 (send_process): Repair possible setjmp clobbering.
17443
17444 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17445
17446 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17447
17448 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17449
17450 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17451 Define only if needed.
17452
17453 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17454 by pacifying GCC about it. Maybe it's time to retire it?
17455 * xfaces.c (USG, __TIMEVAL__): Likewise.
17456
17457 * dispextern.h (struct redisplay_interface): Rename param
17458 to avoid shadowing.
17459 * termhooks.h (struct terminal): Likewise.
17460 * xterm.c (xembed_send_message): Likewise.
17461
17462 * insdel.c (make_gap_smaller): Define only if
17463 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17464
17465 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17466 it.
17467
17468 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17469 so that we aren't warned about unused symbols.
17470
17471 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17472
17473 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17474
17475 * xfns.c (x_real_positions): Mark locals as initialized.
17476
17477 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17478
17479 * xterm.c: Fix problems found by static analysis with other toolkits.
17480 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17481 (x_dispatch_event): Declare static if USE_GTK, and
17482 define if USE_GTK || USE_X_TOOLKIT.
17483 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17484 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17485 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17486 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17487
17488 * xmenu.c (menu_help_callback): Pointer type fixes.
17489 Use const pointers when pointing at readonly data. Avoid pointer
17490 signedness clashes.
17491 (FALSE): Remove unused macro.
17492 (update_frame_menubar): Remove unused decl.
17493
17494 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17495
17496 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17497 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17498 (single_menu_item): Rename local to avoid shadowing.
17499
17500 * keyboard.c (make_lispy_event): Remove unused local var.
17501
17502 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17503 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17504
17505 * bitmaps: Change bitmaps from unsigned char back to the X11
17506 compatible char. Avoid the old compiler warnings about
17507 out-of-range initializers by using, for example, '\xab' rather
17508 than 0xab.
17509
17510 * xgselect.c (xgselect_initialize): Check vs interface
17511 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17512
17513 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17514
17515 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17516 to read-only memory.
17517
17518 * fns.c (vector): Remove; this old hack is no longer needed.
17519
17520 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17521 Remove unused var.
17522 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17523
17524 * xrdb.c (x_load_resources): Omit unused local.
17525
17526 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17527 (x_window): Rename locals to avoid shadowing.
17528 (USG): Use the kludged USG macro, to pacify gcc.
17529
17530 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17531 (x_term_init): Remove local to avoid shadowing.
17532
17533 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17534
17535 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17536 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17537
17538 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17539
17540 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17541
17542 Fix regex.c, syntax.c and friends for buffers > 2GB.
17543 * syntax.h (struct gl_state_s): Declare character position members
17544 EMACS_INT.
17545
17546 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17547
17548 * textprop.c (verify_interval_modification, interval_of):
17549 Declare arguments EMACS_INT.
17550
17551 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17552 EMACS_INT.
17553
17554 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17555
17556 * indent.c (Fvertical_motion): Local variable it_start is now
17557 EMACS_INT.
17558
17559 * regex.c (re_match, re_match_2, re_match_2_internal)
17560 (bcmp_translate, regcomp, regexec, print_double_string)
17561 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17562 (re_compile_pattern, re_exec): Declare arguments and local
17563 variables `size_t' and `ssize_t' and return values `regoff_t', as
17564 appropriate.
17565 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17566 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17567 <compile_stack_type>: `size' and `avail' are now `size_t'.
17568
17569 * regex.h <regoff_t>: Use ssize_t, not int.
17570 (re_search, re_search_2, re_match, re_match_2): Arguments that
17571 specify buffer/string position and length are now ssize_t and
17572 size_t. Return type is regoff_t.
17573
17574 2011-04-16 Ben Key <bkey76@gmail.com>
17575
17576 * nsfont.m: Fixed bugs in ns_get_family and
17577 ns_descriptor_to_entity that were caused by using free to
17578 deallocate memory blocks that were allocated by xmalloc (via
17579 xstrdup). This caused Emacs to crash when compiled with
17580 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17581 --enable-checking=xmallocoverrun). xfree is now used to
17582 deallocate these memory blocks.
17583
17584 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17585
17586 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17587
17588 emacs_write: Accept and return EMACS_INT for sizes.
17589 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17590 et seq.
17591 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17592 Accept and return EMACS_INT.
17593 (emacs_gnutls_write): Return the number of bytes written on
17594 partial writes.
17595 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17596 (emacs_read, emacs_write): Remove check for negative size, as the
17597 Emacs source code has been audited now.
17598 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17599 (emacs_read, emacs_write): Use it.
17600 * process.c (send_process): Adjust to the new signatures of
17601 emacs_write and emacs_gnutls_write. Do not attempt to store
17602 a byte offset into an 'int'; it might overflow.
17603 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17604
17605 * sound.c: Don't assume sizes fit in 'int'.
17606 (struct sound_device.period_size, alsa_period_size):
17607 Return EMACS_INT, not int.
17608 (struct sound_device.write, vox_write, alsa_write):
17609 Accept EMACS_INT, not int.
17610 (wav_play, au_play): Use EMACS_INT to store sizes and to
17611 record read return values.
17612
17613 2011-04-15 Ben Key <bkey76@gmail.com>
17614
17615 * keyboard.c (Qundefined): Don't declare static since it is used
17616 in nsfns.m.
17617 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17618 static since they are used in nsfont.m.
17619
17620 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17621
17622 * process.c (Qprocessp): Don't declare static.
17623 * lisp.h (Qprocessp): Declare again.
17624
17625 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17626
17627 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17628
17629 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17630
17631 Improve C-level modularity by making more things 'static'.
17632
17633 Don't publish debugger-only interfaces to other modules.
17634 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17635 (verify_bytepos, count_markers): Move decls to the only modules
17636 that need them.
17637 * region-cache.h (pp_cache): Likewise.
17638 * window.h (check_all_windows): Likewise.
17639 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17640
17641 * sysdep.c (croak): Now static, if
17642 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17643 * syssignal.h (croak): Declare only if not static.
17644
17645 * alloc.c (refill_memory_reserve): Now static if
17646 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17647 * lisp.h (refill_memory_reserve): Declare only if not static.
17648
17649 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17650 Define only if USE_LUCID.
17651
17652 * xrdb.c (x_customization_string, x_rm_string): Now static.
17653
17654 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17655 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17656
17657 * xdisp.c (draw_row_with_mouse_face): Now static.
17658 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17659
17660 * window.h (check_all_windows): Mark externally visible.
17661
17662 * window.c (window_deletion_count): Now static.
17663
17664 * undo.c: Make symbols static if they're not exported.
17665 (last_undo_buffer, last_boundary_position, pending_boundary):
17666 Now static.
17667
17668 * textprop.c (interval_insert_behind_hooks): Now static.
17669 (interval_insert_in_front_hooks): Likewise.
17670
17671 * term.c: Make symbols static if they're not exported.
17672 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17673 (max_frame_lines, tty_set_terminal_modes):
17674 (tty_reset_terminal_modes, tty_turn_off_highlight):
17675 (get_tty_terminal): Now static.
17676 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17677 * termhooks.h (term_mouse_moveto): Do not declare if
17678 HAVE_WINDOW_SYSTEM.
17679 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17680 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17681
17682 * sysdep.c: Make symbols static if they're not exported.
17683 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17684 Now static.
17685 (sigprocmask_set, full_mask): Remove; unused.
17686 (wait_debugging): Mark as visible.
17687 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17688 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17689
17690 * syntax.c (syntax_temp): Define only if !__GNUC__.
17691
17692 * sound.c (current_sound_device, current_sound): Now static.
17693
17694 * search.c (searchbufs, searchbuf_head): Now static.
17695
17696 * scroll.c (scroll_cost): Remove; unused.
17697 * dispextern.h (scroll_cost): Remove decl.
17698
17699 * region-cache.h (pp_cache): Mark as externally visible.
17700
17701 * process.c: Make symbols static if they're not exported.
17702 (process_tick, update_tick, create_process, chan_process):
17703 (Vprocess_alist, proc_buffered_char, datagram_access):
17704 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17705 (deactivate_process): Mark defn as static, as well as decl.
17706 * lisp.h (create_process): Remove decl.
17707 * process.h (chan_process, Vprocess_alist): Remove decls.
17708
17709 * print.c: Make symbols static if they're not exported.
17710 (print_depth, new_backquote_output, being_printed, print_buffer):
17711 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17712 (print_interval, print_number_index, initial_stderr_stream):
17713 Now static.
17714 * lisp.h (Fprinc): Remove decl.
17715 (debug_output_compilation_hack): Mark as externally visible.
17716
17717 * sysdep.c (croak): Move decl from here to syssignal.h.
17718 * syssignal.h (croak): Put it here, so the API can be checked when
17719 'croak' is called from dissociate_if_controlling_tty.
17720
17721 * minibuf.c: Make symbols static if they're not exported.
17722 (minibuf_save_list, choose_minibuf_frame): Now static.
17723 * lisp.h (choose_minibuf_frame): Remove decl.
17724
17725 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17726
17727 * lread.c: Make symbols static if they're not exported.
17728 (read_objects, initial_obarray, oblookup_last_bucket_number):
17729 Now static.
17730 (make_symbol): Remove; unused.
17731 * lisp.h (initial_obarray, make_symbol): Remove decls.
17732
17733 * keyboard.c: Make symbols static if they're not exported.
17734 (single_kboard, recent_keys_index, total_keys, recent_keys):
17735 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17736 (this_single_command_key_start, echoing, last_auto_save):
17737 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17738 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17739 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17740 (Vlispy_mouse_stem, double_click_count):
17741 Now static.
17742 (force_auto_save_soon): Define only if SIGDANGER.
17743 (ignore_mouse_drag_p): Now static if
17744 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17745 (print_help): Remove; unused.
17746 (stop_character, last_timer_event): Mark as externally visible.
17747 * keyboard.h (ignore_mouse_drag_p): Declare only if
17748 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17749 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17750 * lisp.h (echoing): Remove decl.
17751 (force_auto_save_soon): Declare only if SIGDANGER.
17752 * xdisp.c (redisplay_window): Simplify code, to make it more
17753 obvious that ignore_mouse_drag_p is not accessed if !defined
17754 USE_GTK && !defined HAVE_NS.
17755
17756 * intervals.c: Make symbols static if they're not exported.
17757 (merge_properties_sticky, merge_interval_right, delete_interval):
17758 Now static.
17759 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17760
17761 * insdel.c: Make symbols static if they're not exported.
17762 However, leave prepare_to_modify_buffer alone. It's never
17763 called from outside this function, but that appears to be a bug.
17764 (combine_after_change_list, combine_after_change_buffer):
17765 (adjust_after_replace, signal_before_change): Now static.
17766 (adjust_after_replace_noundo): Remove; unused.
17767 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17768 (signal_before_change): Remove decls.
17769
17770 * indent.c (val_compute_motion, val_vmotion): Now static.
17771
17772 * image.c: Make symbols static if they're not exported.
17773 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17774 if USE_GTK.
17775 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17776 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17777
17778 * fringe.c (standard_bitmaps): Now static.
17779 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17780
17781 * frame.c: Make symbols static if they're not exported.
17782 (x_report_frame_params, make_terminal_frame): Now static.
17783 (get_frame_param): Now static, unless HAVE_NS.
17784 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17785 (x_get_resource_string): Remove; not used.
17786 * frame.h (make_terminal_frame, x_report_frame_params):
17787 (x_get_resource_string); Remove decls.
17788 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17789 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17790
17791 * font.c, fontset.c: Make symbols static if they're not exported.
17792 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17793 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17794 * font.c (font_close_object): Now static.
17795 * font.h (font_close_object): Remove.
17796 * fontset.c (FONTSET_OBJLIST): Remove.
17797 (free_realized_fontset) #if-0 the body, which does nothing.
17798 (face_suitable_for_char_p): #if-0, as it's never called.
17799 * fontset.h (face_suitable_for_char_p): Remove decl.
17800 * xfaces.c (face_at_string_position):
17801 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17802 since 0 is always ASCII.
17803
17804 * fns.c (weak_hash_tables): Now static.
17805
17806 * fileio.c: Make symbols static if they're not exported.
17807 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17808 (Vwrite_region_annotation_buffers): Now static.
17809
17810 * eval.c: Make symbols static if they're not exported.
17811 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17812 * lisp.h (backtrace_list): Remove decl.
17813
17814 * emacs.c: Make symbols static if they're not exported.
17815 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17816 (fatal_error_code, fatal_error_signal_hook, standard_args):
17817 Now static.
17818 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17819 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17820 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17821 * lisp.h (fatal_error_signal_hook): Remove decl.
17822 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17823
17824 * editfns.c: Move a (normally-unused) function to its only use.
17825 * editfns.c, lisp.h (get_operating_system_release): Remove.
17826 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17827 worth the hassle of breaking this out.
17828
17829 * xterm.c: Make symbols static if they're not exported.
17830 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17831 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17832 (x_destroy_window, x_delete_display):
17833 Now static.
17834 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17835 (x_mouse_leave): Remove; unused.
17836 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17837 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17838 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17839 Remove decls.
17840 (x_mouse_leave): Declare only if WINDOWSNT.
17841 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17842 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17843 USE_X_TOOLKIT.
17844
17845 * ftxfont.c: Make symbols static if they're not exported.
17846 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17847 HAVE_FREETYPE.
17848 * font.h (ftxfont_driver): Likewise.
17849
17850 * xfns.c: Make symbols static if they're not exported.
17851 (x_last_font_name, x_display_info_for_name):
17852 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17853 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17854 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17855 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17856 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17857 (last_show_tip_args): Now static.
17858 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17859 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17860 (x_screen_planes): Remove; unused.
17861 * dispextern.h (x_screen_planes): Remove decl.
17862
17863 * dispnew.c: Make symbols static if they're not exported.
17864 * dispextern.h (redraw_garbaged_frames, scrolling):
17865 (increment_row_positions): Remove.
17866 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17867 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17868 Now static.
17869 (redraw_garbaged_frames): Remove; unused.
17870
17871 * xfaces.c: Make symbols static if they're not exported.
17872 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17873 Remove decls.
17874 * xterm.h (defined_color): Remove decls.
17875 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17876 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17877 (menu_face_changed_default, defined_color, free_realized_face):
17878 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17879 (ascii_face_of_lisp_face): Remove; unused.
17880
17881 * xdisp.c: Make symbols static if they're not exported.
17882 * dispextern.h (scratch_glyph_row, window_box_edges):
17883 (glyph_to_pixel_coords, set_cursor_from_row):
17884 (get_next_display_element, set_iterator_to_next):
17885 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17886 (show_mouse_face): Remove decls
17887 * frame.h (message_buf_print): Likewise.
17888 * lisp.h (pop_message, set_message, check_point_in_composition):
17889 Likewise.
17890 * xterm.h (set_vertical_scroll_bar): Likewise.
17891 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17892 (message_buf_print, scratch_glyph_row, displayed_buffer):
17893 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17894 (get_next_display_element, show_mouse_face, window_box_edges):
17895 (frame_to_window_pixel_xy, check_point_in_composition):
17896 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17897 (glyph_to_pixel_coords): Remove; unused.
17898
17899 * dired.c (file_name_completion): Now static.
17900
17901 * dbusbind.c (xd_in_read_queued_messages): Now static.
17902
17903 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17904 * data.c (circular_list_error): Remove.
17905
17906 * commands.h (last_point_position, last_point_position_buffer):
17907 (last_point_position_window): Remove decls.
17908 * keyboard.c: Make these variables static.
17909
17910 * coding.h (coding, code_convert_region, encode_coding_gap):
17911 Remove decls.
17912 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17913 (iso_code_class, detect_coding, code_convert_region): Now static.
17914 (encode_coding_gap): Remove; unused.
17915
17916 * chartab.c (chartab_chars, chartab_bits): Now static.
17917
17918 * charset.h (charset_iso_8859_1): Remove decl.
17919 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17920 Now static.
17921
17922 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17923 * ccl.c (Vccl_program_table): Now static.
17924 (check_ccl_update): Remove; unused.
17925
17926 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17927 * category.h: ... from here.
17928 * category.c (check_category_table, set_category_set): Now static.
17929
17930 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17931 * lisp.h: Remove these decls.
17932
17933 * buffer.c (buffer_count): Remove unused var.
17934
17935 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17936 so that it's not optimized away.
17937 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17938 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17939 exported only to the debugger.
17940
17941 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17942 * atimer.h (run_all_atimers): Remove; not exported.
17943
17944 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17945 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17946 was inaccessible from Lisp.
17947 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17948 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17949
17950 alloc.c: Import and export fewer symbols, and remove unused items.
17951 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17952 is defined.
17953 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17954 it's not optimized away by whole-program optimization.
17955 (message_enable_multibyte, free_misc): Remove.
17956 (catchlist, handlerlist, mark_backtrace):
17957 Declare only if BYTE_MARK_STACK.
17958 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17959 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17960 (message_enable_multibyte): Remove decl.
17961 (free_misc, interval_free_list, float_block, float_block_index):
17962 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17963 (cons_free_list, last_marked_index):
17964 Now static.
17965 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17966 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17967 (mark_backtrace): Define only if BYTE_MARK_STACK.
17968 * xdisp.c (message_enable_multibyte): Now static.
17969
17970 Declare Lisp_Object Q* variables to be 'static' if not exported.
17971 This makes it easier for human readers (and static analyzers)
17972 to see whether these variables are used from other modules.
17973 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17974 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17975 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17976 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17977 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17978 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17979 * xmenu.c, xselect.c:
17980 Declare Q* vars static if they are not used in other modules.
17981 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17982 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17983 Remove decls of unexported vars.
17984 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17985
17986 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17987
17988 Make Emacs functions such as Fatom 'static' by default.
17989 This makes it easier for human readers (and static analyzers)
17990 to see whether these functions can be called from other modules.
17991 DEFUN now defines a static function. To make the function external
17992 so that it can be used in other C modules, use the new macro DEFUE.
17993 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17994 (Finit_image_library):
17995 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17996 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17997 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17998 Remove decls, since these functions are now static.
17999 (Funintern, Fget_internal_run_time): New decls, since these functions
18000 were already external.
18001
18002 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
18003 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
18004 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
18005 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
18006 * keyboard.c, keymap.c, lread.c:
18007 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
18008 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
18009 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
18010 Mark functions with DEFUE instead of DEFUN,
18011 if they are used in other modules.
18012 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
18013 decls for now-static functions.
18014 * buffer.h (Fdelete_overlay): Remove decl.
18015 * callproc.c (Fgetenv_internal): Mark as internal.
18016 * composite.c (Fremove_list_of_text_properties): Remove decl.
18017 (Fcomposition_get_gstring): New forward static decl.
18018 * composite.h (Fcomposite_get_gstring): Remove decl.
18019 * dired.c (Ffile_attributes): New forward static decl.
18020 * doc.c (Fdocumntation_property): New forward static decl.
18021 * eval.c (Ffetch_bytecode): New forward static decl.
18022 (Funintern): Remove extern decl; now in .h file where it belongs.
18023 * fileio.c (Fmake_symbolic_link): New forward static decl.
18024 * image.c (Finit_image_library): New forward static decl.
18025 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
18026 * intervals.h (Fprevious_property_change):
18027 (Fremove_list_of_text_properties): Remove decls.
18028 * keyboard.c (Fthis_command_keys): Remove decl.
18029 (Fcommand_execute): New forward static decl.
18030 * keymap.c (Flookup_key): New forward static decl.
18031 (Fcopy_keymap): Now static.
18032 * keymap.h (Flookup_key): Remove decl.
18033 * process.c (Fget_process): New forward static decl.
18034 (Fprocess_datagram_address): Mark as internal.
18035 * syntax.c (Fsyntax_table_p): New forward static decl.
18036 (skip_chars): Remove duplicate decl.
18037 * textprop.c (Fprevious_property_change): New forward static decl.
18038 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
18039 Now internal.
18040 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
18041 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
18042
18043 * editfns.c (Fformat): Remove unreachable code.
18044
18045 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
18046
18047 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
18048 change. (Bug#8496)
18049
18050 2011-04-13 Eli Zaretskii <eliz@gnu.org>
18051
18052 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
18053 when at ZV. (Bug#8487)
18054
18055 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
18056
18057 * charset.c (Fclear_charset_maps): Use xfree instead of free.
18058 (Bug#8437)
18059 * keyboard.c (parse_tool_bar_item): Likewise.
18060 * sound.c (sound_cleanup, alsa_close): Likewise.
18061 * termcap.c (tgetent): Likewise.
18062 * xfns.c (x_default_font_parameter): Likewise.
18063 * xsettings.c (read_and_apply_settings): Likewise.
18064
18065 * alloc.c (overrun_check_malloc, overrun_check_realloc)
18066 (overrun_check_free): Protoize.
18067
18068 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
18069
18070 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18071 since callers should never pass a negative size.
18072 Change the signature to match that of plain 'read' and 'write'; see
18073 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18074 * lisp.h: Update prototypes of emacs_write and emacs_read.
18075
18076 2011-04-11 Eli Zaretskii <eliz@gnu.org>
18077
18078 * xdisp.c (redisplay_window): Don't try to determine the character
18079 position of the scroll margin if the window start point w->startp
18080 is outside the buffer's accessible region. (Bug#8468)
18081
18082 2011-04-10 Eli Zaretskii <eliz@gnu.org>
18083
18084 Fix write-region and its subroutines for buffers > 2GB.
18085 * fileio.c (a_write, e_write): Modify declaration of arguments and
18086 local variables to support buffers larger than 2GB.
18087 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18088
18089 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18090 argument, local variables, and return value.
18091
18092 * lisp.h: Update prototypes of emacs_write and emacs_read.
18093
18094 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18095
18096 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
18097
18098 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18099
18100 Fix more problems found by GCC 4.6.0's static checks.
18101
18102 * xdisp.c (vmessage): Use a better test for character truncation.
18103
18104 * charset.c (load_charset_map): <, not <=, for optimization,
18105 and to avoid potential problems with integer overflow.
18106 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18107 * casetab.c (set_identity, shuffle): Likewise.
18108 * editfns.c (Fformat): Likewise.
18109 * syntax.c (skip_chars): Likewise.
18110
18111 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18112 This also lets GCC 4.6.0 generate slightly better loop code.
18113
18114 * callint.c (Fcall_interactively): <, not <=, for optimization.
18115 (Fcall_interactively): Count the number of arguments produced,
18116 not the number of arguments given. This is simpler and lets GCC
18117 4.6.0 generate slightly better code.
18118
18119 * ftfont.c: Distingish more carefully between FcChar8 and char.
18120 The previous code passed unsigned char * to a functions like
18121 strlen and xstrcasecmp that expect char *, which does not
18122 conform to the C standard.
18123 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18124 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18125 char * when the C standard requires it.
18126
18127 * keyboard.c (read_char): Remove unused var.
18128
18129 * eval.c: Port to Windows vsnprintf (Bug#8435).
18130 Include <limits.h>.
18131 (SIZE_MAX): Define if the headers do not.
18132 (verror): Do not give up if vsnprintf returns a negative count.
18133 Instead, grow the buffer. This ports to Windows vsnprintf, which
18134 does not conform to C99. Problem reported by Eli Zaretskii.
18135 Also, simplify the allocation scheme, by avoiding the need for
18136 calling realloc, and removing the ALLOCATED variable.
18137
18138 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18139
18140 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18141 But keep the doprint source code for now, as we might revamp it
18142 and use it again (Bug#8435).
18143 * lisp.h (doprnt): Remove.
18144 * Makefile.in (base_obj): Remove doprnt.o.
18145 * deps.mk (doprnt.o): Remove.
18146
18147 error: Print 32- and 64-bit integers portably (Bug#8435).
18148 Without this change, on typical 64-bit hosts error ("...%d...", N)
18149 was used to print both 32- and 64-bit integers N, which relied on
18150 undefined behavior.
18151 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18152 * lisp.h (error, verror): Mark as printf-like functions.
18153 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18154 Report overflow in size calculations when allocating printf buffer.
18155 Do not truncate output string at its first null byte.
18156 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18157 Truncate the output at a character boundary, since vsnprintf does not
18158 do that.
18159 * charset.c (check_iso_charset_parameter): Convert internal
18160 character to string before calling 'error', since %c now has the
18161 printf meaning.
18162 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18163 overflow when computing char to be passed to 'error'. Do not
18164 pass Lisp_Object to 'error'; pass the integer instead.
18165 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18166 formatted with plain %d.
18167
18168 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18169
18170 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18171
18172 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18173
18174 * xterm.c (x_catch_errors): Remove duplicate declaration.
18175
18176 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18177
18178 * xdisp.c, lisp.h (message_nolog): Remove; unused.
18179
18180 2011-04-10 Jim Meyering <meyering@redhat.com>
18181
18182 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18183 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18184 return ssize_t not "int", and use size_t as the buffer length.
18185 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18186 * gnutls.h: Update declarations.
18187 * process.c (read_process_output): Use ssize_t, to match.
18188 (send_process): Likewise.
18189
18190 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18191
18192 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18193
18194 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18195
18196 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18197 Use unsigned char, to match FcChar8 type definition.
18198
18199 * xterm.c (handle_one_xevent):
18200 * xmenu.c (create_and_show_popup_menu):
18201 * xselect.c (x_decline_selection_request)
18202 (x_reply_selection_request): Avoid type-punned deref of X events.
18203
18204 2011-04-09 Eli Zaretskii <eliz@gnu.org>
18205
18206 Fix some uses of `int' instead of EMACS_INT.
18207 * search.c (string_match_1, fast_string_match)
18208 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18209 (scan_buffer, find_next_newline_no_quit)
18210 (find_before_next_newline, search_command, Freplace_match)
18211 (Fmatch_data): Make some `int' variables be EMACS_INT.
18212
18213 * xdisp.c (display_count_lines): 3rd argument and return value now
18214 EMACS_INT. All callers changed.
18215 (pint2hrstr): Last argument is now EMACS_INT.
18216
18217 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18218 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18219 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18220 (decode_coding_utf_16, decode_coding_emacs_mule)
18221 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18222 (decode_coding_ccl, decode_coding_charset)
18223 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18224 (decode_coding_iso_2022, decode_coding_emacs_mule)
18225 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18226 <char_offset, last_offset>: Declare EMACS_INT.
18227 (encode_coding_utf_8, encode_coding_utf_16)
18228 (encode_coding_emacs_mule, encode_invocation_designation)
18229 (encode_designation_at_bol, encode_coding_iso_2022)
18230 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18231 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18232 Declare EMACS_INT.
18233 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18234 (encode_invocation_designation): Last argument P_NCHARS is now
18235 EMACS_INT.
18236 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18237 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18238
18239 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18240 All users changed.
18241
18242 * ccl.c (Fccl_execute_on_string): Declare some variables
18243 EMACS_INT.
18244
18245 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
18246
18247 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18248
18249 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18250
18251 * process.c (Fformat_network_address): Doc fix.
18252
18253 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18254
18255 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18256
18257 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18258
18259 * keyboard.c (read_char): Call Lisp function help-form-show,
18260 instead of using internal_with_output_to_temp_buffer.
18261 (Qhelp_form_show): New var.
18262 (syms_of_keyboard): Use DEFSYM macro.
18263
18264 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18265
18266 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18267
18268 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18269
18270 * process.c (Flist_processes): Remove to Lisp.
18271 (list_processes_1): Delete.
18272
18273 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18274
18275 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18276
18277 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18278
18279 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
18280
18281 Fix more problems found by GCC 4.6.0's static checks.
18282
18283 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18284
18285 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18286
18287 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18288
18289 * xdisp.c (vmessage): Mark as a printf-like function.
18290
18291 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18292
18293 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18294
18295 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18296 printf-like functions.
18297 (tiff_load): Add casts to remove these marks before passing them
18298 to system-supplied API.
18299
18300 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18301
18302 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18303 This avoids several warnings with gcc -Wstrict-overflow.
18304 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18305 directly, rather than having caller test rule sign. This avoids
18306 some unnecessary tests.
18307 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18308 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18309 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18310
18311 * xfont.c (xfont_text_extents): Remove var that was set but not used.
18312 (xfont_open): Avoid unnecessary tests.
18313
18314 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18315
18316 * composite.h, composite.c (composition_gstring_put_cache):
18317 Use EMACS_INT, not int, for length.
18318
18319 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18320 breaking out part of COMPOSITION_DECODE_RULE.
18321 (COMPOSITION_DECODE_RULE): Use it.
18322 * composite.c (get_composition_id): Remove unused local vars,
18323 by using the new macro.
18324
18325 * textprop.c (set_text_properties_1): Change while to do-while,
18326 since the condition is always true at first.
18327
18328 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18329 (interval_deletion_adjustment): Return unsigned value.
18330 All uses changed.
18331
18332 * process.c (list_processes_1, create_pty, read_process_output):
18333 (exec_sentinel): Remove vars that were set but not used.
18334 (create_pty): Remove unnecessary "volatile"s.
18335 (Fnetwork_interface_info): Avoid possibility of int overflow.
18336 (read_process_output): Do adaptive read buffering even if carryover.
18337 (read_process_output): Simplify nbytes computation if buffered.
18338
18339 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18340
18341 * syntax.c (scan_words): Remove var that was set but not used.
18342 (update_syntax_table): Use unsigned instead of int.
18343
18344 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18345 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18346 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18347
18348 * print.c (print_error_message): Avoid int overflow.
18349
18350 * font.c (font_list_entities): Redo for clarity,
18351 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18352
18353 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18354 (font_score): Avoid potential overflow in diff calculation.
18355
18356 * fns.c (substring_both): Remove var that is set but not used.
18357 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18358
18359 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18360
18361 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18362 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18363 can always succeed if overflow has undefined behavior.
18364
18365 * search.c (boyer_moore, wordify): Remove vars set but not used.
18366 (wordify): Omit three unnecessary tests.
18367
18368 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18369 All callers changed. This avoids the need for an unused var.
18370
18371 * casefiddle.c (casify_region): Remove var that is set but not used.
18372
18373 * dired.c (file_name_completion): Remove var that is set but not used.
18374
18375 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18376
18377 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18378 (Finsert_file_contents): Remove unnecessary code checking fd.
18379
18380 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18381 Check for integer overflow on size calculations.
18382
18383 * buffer.c (Fprevious_overlay_change): Remove var that is set
18384 but not used.
18385
18386 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18387 Remove vars that are set but not used.
18388 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18389 (timer_check_2): Mark vars as initialized.
18390
18391 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18392
18393 * image.c (lookup_image): Remove var that is set but not used.
18394 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18395
18396 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18397 that are set but not used.
18398
18399 * xfns.c (make_invisible_cursor): Don't return garbage
18400 if XCreateBitmapFromData fails (Bug#8410).
18401
18402 * xselect.c (x_get_local_selection, x_handle_property_notify):
18403 Remove vars that are set but not used.
18404
18405 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18406 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18407
18408 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18409 Remove var that is set but not used.
18410 (scroll_bar_windows_size): Now size_t, not int.
18411 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18412 Check for overflow.
18413
18414 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18415 (map_tty_color) [!defined MSDOS]: Likewise.
18416
18417 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18418
18419 * coding.c: Remove vars that are set but not used.
18420 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18421 All callers changed.
18422 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18423 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18424 (decode_coding_charset): Remove vars that are set but not used.
18425
18426 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18427 that is set but not used.
18428
18429 * print.c (print_object): Remove var that is set but not used.
18430
18431 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18432 The gnulib version avoids calling malloc in the usual case,
18433 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18434 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18435 * filelock.c (current_lock_owner): Likewise.
18436 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18437 * sysdep.c: Include allocator.h, careadlinkat.h.
18438 (emacs_no_realloc_allocator): New static constant.
18439 (emacs_readlink): New function.
18440 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18441 ../lib/careadlinkat.h.
18442
18443 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18444
18445 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18446 first non-nil return value).
18447
18448 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18449
18450 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18451 if not defined (Bug#8403).
18452
18453 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18454
18455 * xdisp.c (display_count_lines): Remove parameter `start',
18456 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18457 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18458 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18459 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18460 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18461 and thereabouts. All callers changed.
18462 (get_per_char_metric): Remove parameter `f', unused since
18463 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18464
18465 2011-04-02 Jim Meyering <meyering@redhat.com>
18466
18467 do not dereference NULL upon failed strdup
18468 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18469 (ns_get_family): Likewise.
18470
18471 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18472
18473 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18474
18475 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18476
18477 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18478 later (Bug#8403).
18479
18480 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18481
18482 Add lexical binding.
18483
18484 * window.c (Ftemp_output_buffer_show): New fun.
18485 (Fsave_window_excursion):
18486 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18487
18488 * lread.c (lisp_file_lexically_bound_p): New function.
18489 (Fload): Bind Qlexical_binding.
18490 (readevalloop): Remove `evalfun' arg.
18491 Bind Qinternal_interpreter_environment.
18492 (Feval_buffer): Bind Qlexical_binding.
18493 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18494 Mark as dynamic.
18495 (syms_of_lread): Declare `lexical-binding'.
18496
18497 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18498
18499 * keyboard.c (eval_dyn): New fun.
18500 (menu_item_eval_property): Use it.
18501
18502 * image.c (parse_image_spec): Use Ffunctionp.
18503
18504 * fns.c (concat, mapcar1): Accept byte-code-functions.
18505
18506 * eval.c (Fsetq): Handle lexical vars.
18507 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18508 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18509 (FletX, Flet): Obey lexical binding.
18510 (Fcommandp): Handle closures.
18511 (Feval): New `lexical' arg.
18512 (eval_sub): New function extracted from Feval. Use it almost
18513 everywhere where Feval was used. Look up vars in lexical env.
18514 Handle closures.
18515 (Ffunctionp): Move from subr.el.
18516 (Ffuncall): Handle closures.
18517 (apply_lambda): Remove `eval_flags'.
18518 (funcall_lambda): Handle closures and new byte-code-functions.
18519 (Fspecial_variable_p): New function.
18520 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18521 but without exporting it to Lisp.
18522
18523 * doc.c (Fdocumentation, store_function_docstring):
18524 * data.c (Finteractive_form): Handle closures.
18525
18526 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18527 interactive spec.
18528
18529 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18530 New byte-codes.
18531 (exec_byte_code): New function extracted from Fbyte_code to handle new
18532 calling convention for byte-code-functions. Add new byte-codes.
18533
18534 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18535
18536 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18537
18538 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18539
18540 * xdisp.c (redisplay_internal): Fix prototype.
18541
18542 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18543
18544 * xdisp.c (SCROLL_LIMIT): New macro.
18545 (try_scrolling): Use it when setting scroll_limit.
18546 Limit scrolling to 100 screen lines.
18547 (redisplay_window): Even when falling back on "recentering",
18548 position point in the window according to scroll-conservatively,
18549 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18550
18551 (try_scrolling): When point is above the window, allow searching
18552 as far as scroll_max, or one screenful, to compute vertical
18553 distance from PT to the scroll margin position. This prevents
18554 try_scrolling from unnecessarily failing when
18555 scroll-conservatively is set to a value slightly larger than the
18556 window height. Clean up the case of PT below the margin at bottom
18557 of window: scroll_max can no longer be INT_MAX. When aggressive
18558 scrolling is in use, don't let point enter the opposite scroll
18559 margin as result of the scroll.
18560 (syms_of_xdisp) <scroll-conservatively>: Document the
18561 threshold of 100 lines for never-recentering scrolling.
18562
18563 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18564
18565 * dispextern.h (move_it_by_lines):
18566 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18567 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18568 (message_log_check_duplicate): Remove parameters `prev_bol' and
18569 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18570 (redisplay_internal): Remove parameter `preserve_echo_area',
18571 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18572
18573 * indent.c (Fvertical_motion):
18574 * window.c (window_scroll_pixel_based, Frecenter):
18575 Don't pass `need_y_p' to `move_it_by_lines'.
18576
18577 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18578
18579 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18580 steal a few bits to be more compact.
18581 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18582 Remove unneeded casts.
18583
18584 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18585
18586 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18587
18588 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18589 binding" message (bug#7967).
18590
18591 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18592
18593 Fix more problems found by GCC 4.6.0's static checks.
18594
18595 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18596 Remove unused local var.
18597
18598 * editfns.c (Fmessage_box): Remove unused local var.
18599
18600 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18601 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18602 Omit unused local vars.
18603 * window.c (shrink_windows): Omit unused local var.
18604 * menu.c (digest_single_submenu): Omit unused local var.
18605 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18606 Omit unused local var.
18607
18608 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18609 Don't assume string length fits in int.
18610 (keyremap_step, read_key_sequence): Use size_t for sizes.
18611 (read_key_sequence): Don't check last_real_key_start redundantly.
18612
18613 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18614 instead of alloca (Bug#8344).
18615
18616 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18617 (Fbacktrace_frame): Don't assume nframes fits in int.
18618
18619 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18620
18621 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18622 concerns.
18623
18624 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18625
18626 * cm.c (calccost): Turn while-do into do-while, for clarity.
18627
18628 * keyboard.c (syms_of_keyboard): Use the same style as later
18629 in this function when indexing through an array. This also
18630 works around GCC bug 48267.
18631
18632 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18633
18634 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18635
18636 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18637 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18638
18639 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18640 This avoids undefined behavior on integer overflow, and is a bit
18641 more convenient anyway since it is compared to a size_t variable.
18642
18643 Variadic C functions now count arguments with size_t, not int.
18644 This avoids an unnecessary limitation on 64-bit machines, which
18645 caused (substring ...) to crash on large vectors (Bug#8344).
18646 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18647 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18648 All variadic functions and their callers changed accordingly.
18649 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18650 * data.c (arith_driver, float_arith_driver): Likewise.
18651 * editfns.c (general_insert_function): Likewise.
18652 * eval.c (struct backtrace.nargs, interactive_p)
18653 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18654 (funcall_lambda, mark_backtrace): Likewise.
18655 * fns.c (concat): Likewise.
18656 * frame.c (x_set_frame_parameters): Likewise.
18657 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18658 0 if not found, not -1. All callers changed.
18659
18660 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18661 (stack_copy_size): Now size_t, not int.
18662 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18663
18664 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18665
18666 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18667 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18668 All callers changed.
18669
18670 * lisp.h (multibyte_char_to_unibyte):
18671 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18672 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18673 * character.h (CHAR_TO_BYTE8):
18674 * cmds.c (internal_self_insert):
18675 * editfns.c (general_insert_function):
18676 * keymap.c (push_key_description):
18677 * search.c (Freplace_match):
18678 * xdisp.c (message_dolog, set_message_1): All callers changed.
18679
18680 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18681
18682 * keyboard.c (safe_run_hook_funcall): New function.
18683 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18684 don't set the hook to nil, but remove the offending function instead.
18685 (Qcommand_hook_internal): Remove, unused.
18686 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18687 Vcommand_hook_internal.
18688
18689 * eval.c (enum run_hooks_condition): Remove.
18690 (funcall_nil, funcall_not): New functions.
18691 (run_hook_with_args): Call each function through a `funcall' argument.
18692 Remove `cond' argument, now redundant.
18693 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18694 (Frun_hook_with_args_until_failure): Adjust accordingly.
18695 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18696
18697 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18698
18699 * dispextern.h (string_buffer_position): Remove declaration.
18700
18701 * print.c (strout): Remove parameter `multibyte', unused since
18702 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18703
18704 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18705 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18706 All callers changed.
18707
18708 * w32.c (_wsa_errlist): Use braces for struct initializers.
18709
18710 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18711 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18712 All callers changed.
18713 (string_buffer_position): Likewise. Also, make static (it's never
18714 used outside xdisp.c).
18715 (cursor_row_p): Remove parameter `w', unused since
18716 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18717 (decode_mode_spec): Remove parameter `precision', introduced during
18718 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18719 All callers changed.
18720
18721 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18722
18723 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18724
18725 2011-03-27 Anders Lindgren <andlind@gmail.com>
18726
18727 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18728 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18729 (ns_update_auto_hide_menu_bar): New functions.
18730 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18731 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18732 ns_constrain_all_frames.
18733 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18734 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18735
18736 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18737
18738 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18739
18740 2011-03-27 Glenn Morris <rgm@gnu.org>
18741
18742 * syssignal.h: Replace RETSIGTYPE with void.
18743 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18744 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18745 Replace SIGTYPE with void everywhere.
18746 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18747 * s/template.h (SIGTYPE): Remove commented out definition.
18748
18749 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18750
18751 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18752 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18753
18754 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18755
18756 * w32.c (read_unc_volume): Use parameter `henum', instead of
18757 global variable `wget_enum_handle'.
18758
18759 * keymap.c (describe_vector): Remove parameters `indices' and
18760 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18761 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18762
18763 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18764
18765 * keyboard.c (timer_check): Remove parameter `do_it_now',
18766 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18767 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18768 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18769
18770 * keyboard.c (read_char):
18771 * w32menu.c (w32_menu_display_help):
18772 * xmenu.c (show_help_event, menu_help_callback):
18773 Adjust calls to `show_help_echo'.
18774
18775 * gtkutil.c (xg_maybe_add_timer):
18776 * keyboard.c (readable_events):
18777 * process.c (wait_reading_process_output):
18778 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18779
18780 * insdel.c (adjust_markers_gap_motion):
18781 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18782 (gap_left, gap_right): Don't call it.
18783
18784 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18785
18786 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18787 incurred during fontification.
18788
18789 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18790
18791 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18792 (DEFVAR_PER_BUFFER): Don't pass it.
18793
18794 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18795 (scrolling_window): Don't pass it.
18796
18797 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18798
18799 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18800
18801 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18802 and `suffix'.
18803 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18804 of variables specific to SELinux and computation of `encoded_absname'.
18805
18806 * image.c (XPutPixel): Remove unused variable `height'.
18807
18808 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18809
18810 * unexw32.c (get_section_info): Remove unused variable `section'.
18811
18812 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18813 (system_process_attributes): Remove unused variable `sess'.
18814 (sys_read): Remove unused variable `err'.
18815
18816 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18817 (w32_wnd_proc): Remove unused variable `isdead'.
18818 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18819 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18820 (x_create_tip_frame): Remove unused variable `tem'.
18821
18822 * w32inevt.c (w32_console_read_socket):
18823 Remove unused variable `no_events'.
18824
18825 * w32term.c (x_draw_composite_glyph_string_foreground):
18826 Remove unused variable `width'.
18827
18828 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18829
18830 * w32term.c (x_set_glyph_string_clipping):
18831 Don't pass uninitialized region to CombineRgn.
18832
18833 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18834
18835 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18836 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18837 (Fx_close_connection): Remove unused variable `i'.
18838
18839 * w32font.c (w32font_draw): Return number of glyphs.
18840 (w32font_open_internal): Remove unused variable `i'.
18841 (w32font_driver): Add missing initializer.
18842
18843 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18844 (fill_in_menu): Remove unused variable `items_added'.
18845
18846 * w32term.c (last_mouse_press_frame): Remove static global variable.
18847 (w32_clip_to_row): Remove unused variable `f'.
18848 (x_delete_terminal): Remove unused variable `i'.
18849
18850 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18851 (NOTHING): Remove unused static global variable.
18852 (uniscribe_check_otf): Remove unused variable `table'.
18853 (uniscribe_font_driver): Add missing initializers.
18854
18855 2011-03-23 Julien Danjou <julien@danjou.info>
18856
18857 * term.c (Fsuspend_tty, Fresume_tty):
18858 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18859 * window.c (temp_output_buffer_show):
18860 * insdel.c (signal_before_change):
18861 * frame.c (Fhandle_switch_frame):
18862 * fileio.c (Fdo_auto_save):
18863 * emacs.c (Fkill_emacs):
18864 * editfns.c (save_excursion_restore):
18865 * cmds.c (internal_self_insert):
18866 * callint.c (Fcall_interactively):
18867 * buffer.c (Fkill_all_local_variables):
18868 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18869 Use Frun_hooks.
18870 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18871 unconditionally since it does the check itself.
18872
18873 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18874
18875 Fix more problems found by GCC 4.5.2's static checks.
18876
18877 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18878 the first time through the loop, since we know p0 < p1 then.
18879 This also avoids a gcc -Wstrict-overflow warning.
18880
18881 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18882 leading to a memory leak, possible in functions like
18883 load_charset_map_from_file that can allocate an unbounded number
18884 of objects (Bug#8318).
18885
18886 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18887 that could (at least in theory) be that large.
18888
18889 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18890 This is less likely to overflow, and avoids undefined behavior if
18891 overflow does occur. All callers changed. Use strtoul to scan
18892 for the unsigned long integer.
18893 (pint2hrstr): Simplify and tune code slightly.
18894 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18895
18896 * scroll.c (do_scrolling): Work around GCC bug 48228.
18897 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18898
18899 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18900 This also avoids a warning with gcc -Wstrict-overflow.
18901 (validate_x_resource_name): Simplify count usage.
18902 This also avoids a warning with gcc -Wstrict-overflow.
18903
18904 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18905 fail (Bug#8306).
18906
18907 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18908
18909 * process.c (Fmake_network_process): Use socklen_t, not int,
18910 where POSIX says socklen_t is required in portable programs.
18911 This fixes a porting bug on hosts like 64-bit HP-UX, where
18912 socklen_t is wider than int (Bug#8277).
18913 (Fmake_network_process, server_accept_connection):
18914 (wait_reading_process_output, read_process_output):
18915 Likewise.
18916
18917 * process.c: Rename or move locals to avoid shadowing.
18918 (list_processes_1, Fmake_network_process):
18919 (read_process_output_error_handler, exec_sentinel_error_handler):
18920 Rename or move locals.
18921 (Fmake_network_process): Define label "retry_connect" only if needed.
18922 (Fnetwork_interface_info): Fix pointer signedness.
18923 (process_send_signal): Add cast to avoid pointer signedness problem.
18924 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18925 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18926
18927 Make tparam.h and terminfo.c consistent.
18928 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18929 Include tparam.h instead, since it declares them.
18930 * cm.h (PC): Remove extern decl; tparam.h now does this.
18931 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18932 * terminfo.c: Include tparam.h, to check interfaces.
18933 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18934 (tparam): Adjust signature to match interface in tparam.h;
18935 this removes some undefined behavior. Check that outstring and len
18936 are zero, which they always are with Emacs.
18937 * tparam.h (PC, BC, UP): New extern decls.
18938
18939 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18940 (xftfont_open): Rename locals to avoid shadowing.
18941
18942 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18943 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18944 (OTF_TAG_SYM): Omit macro if not needed.
18945 (ftfont_list): Remove unused local.
18946 (get_adstyle_property, ftfont_pattern_entity):
18947 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18948 Rename locals to avoid shadowing.
18949
18950 * xfont.c (xfont_list_family): Mark var as initialized.
18951
18952 * xml.c (make_dom): Now static.
18953
18954 * composite.c (composition_compute_stop_pos): Rename local to
18955 avoid shadowing.
18956 (composition_reseat_it): Remove unused locals.
18957 (find_automatic_composition, composition_adjust_point): Likewise.
18958 (composition_update_it): Mark var as initialized.
18959 (find_automatic_composition): Mark vars as initialized,
18960 with a FIXME (Bug#8290).
18961
18962 character.h: Rename locals to avoid shadowing.
18963 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18964 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18965 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18966 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18967 to avoid shadowing.
18968
18969 * textprop.c (property_change_between_p): Remove; unused.
18970
18971 * intervals.c (interval_start_pos): Now static.
18972
18973 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18974
18975 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18976 Rename locals to avoid shadowing.
18977
18978 * sound.c (wav_play, au_play, Fplay_sound_internal):
18979 Fix pointer signedness.
18980 (alsa_choose_format): Remove unused local var.
18981 (wav_play): Initialize a variable to 0, to prevent undefined
18982 behavior (Bug#8278).
18983
18984 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18985
18986 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18987
18988 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18989 clobbering (Bug#8298).
18990 * sysdep.c (sys_subshell): Likewise.
18991 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18992
18993 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18994 This should get cleaned up, so that child_setup has the
18995 same signature on all platforms.
18996
18997 * callproc.c (call_process_cleanup): Now static.
18998 (relocate_fd): Rename locals to avoid shadowing.
18999
19000 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
19001
19002 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
19003 not to be necessary, and produces flickering.
19004
19005 2011-03-20 Glenn Morris <rgm@gnu.org>
19006
19007 * config.in: Remove file.
19008
19009 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
19010
19011 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
19012 are now in src/globals.h.
19013 (syms_of_minibuf): Remove spurious & from previous change.
19014
19015 2011-03-20 Leo Liu <sdl.web@gmail.com>
19016
19017 * minibuf.c (completing-read-function): New variable.
19018 (completing-read-default): Rename from completing-read.
19019 (completing-read): Call completing-read-function.
19020
19021 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19022
19023 * xfaces.c (Fx_load_color_file):
19024 Read color file from absolute filename (bug#8250).
19025
19026 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19027
19028 * makefile.w32-in: Update dependencies.
19029
19030 2011-03-17 Eli Zaretskii <eliz@gnu.org>
19031
19032 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
19033
19034 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
19035
19036 Fix more problems found by GCC 4.5.2's static checks.
19037
19038 * process.c (make_serial_process_unwind, send_process_trap):
19039 (sigchld_handler): Now static.
19040
19041 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
19042 That way, the code declares only the vars that it needs.
19043 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
19044 * s/cygwin.h (PTY_ITERATION): Likewise.
19045 * s/darwin.h (PTY_ITERATION): Likewise.
19046 * s/gnu-linux.h (PTY_ITERATION): Likewise.
19047
19048 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
19049 * process.c (allocate_pty): Don't declare stb unless it's needed.
19050
19051 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19052 (CONSTANTLIM): Remove; unused.
19053 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
19054 Define only if needed.
19055
19056 * unexelf.c (unexec): Name an expression,
19057 to avoid gcc -Wbad-function-cast warning.
19058 Use a different way to cause a compilation error if anyone uses
19059 n rather than nn, a way that does not involve shadowing.
19060 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
19061
19062 * deps.mk (unexalpha.o): Remove; unused.
19063
19064 New file unexec.h, the (simple) interface for unexec (Bug#8267).
19065 * unexec.h: New file.
19066 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19067 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19068 Depend on unexec.h.
19069 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19070 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19071 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19072 Change as necessary to match prototype in unexec.h.
19073
19074 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19075 shadowing.
19076 (back_comment, skip_chars): Mark vars as initialized.
19077
19078 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19079 Rename locals to avoid shadowing.
19080
19081 * lread.c (read1): Rewrite so as not to use empty "else".
19082 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19083
19084 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19085
19086 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19087 warning when compiling print.c.
19088
19089 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19090 instead of using an uninitialized var.
19091 (font_sort_entities): Mark var as initialized.
19092
19093 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19094
19095 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19096 pointers to constants.
19097 (font_parse_fcname): Remove unused vars.
19098 (font_delete_unmatched): Now static.
19099 (font_get_spec): Remove; unused.
19100 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19101 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19102 Rename or move locals to avoid shadowing.
19103
19104 * fns.c (require_nesting_list, require_unwind): Now static.
19105 (Ffillarray): Rename locals to avoid shadowing.
19106
19107 * floatfns.c (domain_error2): Define only if needed.
19108 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19109
19110 * alloc.c (mark_backtrace): Move decl from here ...
19111 * lisp.h: ... to here, so that it can be checked.
19112
19113 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19114 (Fdefvar): Rewrite so as not to use empty "else".
19115 (lisp_indirect_variable): Name an expression,
19116 to avoid gcc -Wbad-function-cast warning.
19117 (Fdefvar): Rename locals to avoid shadowing.
19118
19119 * callint.c (quotify_arg, quotify_args): Now static.
19120 (Fcall_interactively): Rename locals to avoid shadowing.
19121 Use const pointer when appropriate.
19122
19123 * lisp.h (get_system_name, get_operating_system_release):
19124 Move decls here, to check interfaces.
19125 * process.c (get_operating_system_release): Move decl to lisp.h.
19126 * xrdb.c (get_system_name): Likewise.
19127 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19128 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19129 some of which prompt warnings from gcc -Wbad-function-cast.
19130 (Fformat_time_string, Fencode_time, Finsert_char):
19131 (Ftranslate_region_internal, Fformat):
19132 Rename or remove local vars to avoid shadowing.
19133 (Ftranslate_region_internal): Mark var as initialized.
19134
19135 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19136 avoid shadowing.
19137
19138 * lisp.h (eassert): Check that the argument compiles, even if
19139 ENABLE_CHECKING is not defined.
19140
19141 * data.c (Findirect_variable): Name an expression, to avoid
19142 gcc -Wbad-function-cast warning.
19143 (default_value, arithcompare, arith_driver, arith_error): Now static.
19144 (store_symval_forwarding): Rename local to avoid shadowing.
19145 (Fmake_variable_buffer_local, Fmake_local_variable):
19146 Mark variables as initialized.
19147 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
19148
19149 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
19150 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19151 Rename locals to avoid shadowing.
19152 (mark_stack): Move local variables into the #ifdef region where
19153 they're used.
19154 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19155 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19156 needed otherwise.
19157 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19158 (GC_STRING_CHARS): Remove; not used.
19159 (Fmemory_limit): Cast sbrk's returned value to char *.
19160
19161 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19162 avoids undefined behavior in theory.
19163
19164 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19165
19166 Use functions, not macros, for up- and down-casing (Bug#8254).
19167 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19168 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
19169 to use the following functions instead of these macros.
19170 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
19171 EMACS_INT, since callers assume the returned value fits in int.
19172 (upcase1): Likewise, for UPCASE_TABLE.
19173 (uppercasep, lowercasep, upcase): New static inline functions.
19174 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19175 the race-condition problem in the old DOWNCASE.
19176
19177 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19178 Rename locals to avoid shadowing.
19179 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19180 (regex_compile, re_search_2, re_match_2_internal):
19181 Remove unused local vars.
19182 (FREE_VAR): Rewrite so as not to use empty "else",
19183 which gcc can warn about.
19184 (regex_compile, re_match_2_internal): Mark locals as initialized.
19185 (RETALLOC_IF): Define only if needed.
19186 (WORDCHAR_P): Likewise. This one is never needed, but is used
19187 only in a comment talking about a compiler bug, so put inside
19188 the #if 0 of that comment.
19189 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19190 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19191 Remove; unused.
19192
19193 * search.c (boyer_moore): Rename locals to avoid shadowing.
19194 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19195 (PREV_CHAR_BOUNDARY): Likewise.
19196
19197 * search.c (simple_search): Remove unused var.
19198
19199 * dired.c (compile_pattern): Move decl from here ...
19200 * lisp.h: ... to here, so that it can be checked.
19201 (struct re_registers): New forward decl.
19202
19203 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19204
19205 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19206 All uses changed.
19207 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19208 Rename locals to avoid shadowing.
19209 (Fvertical_motion): Mark locals as initialized.
19210
19211 * casefiddle.c (casify_object, casify_region): Now static.
19212 (casify_region): Mark local as initialized.
19213
19214 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19215
19216 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19217 New macros, so that the caller can use some names other than
19218 gcpro1, gcpro2, etc.
19219 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19220 of the new macros.
19221 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19222 argument, for consistency with GCPRO2_VAR, etc: it is now the
19223 prefix of the variable, not the variable itself. All uses
19224 changed.
19225 * dired.c (directory_files_internal, file_name_completion):
19226 Rename locals to avoid shadowing.
19227
19228 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19229 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19230 dired.c's scmp function, had undefined behavior.
19231 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19232 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19233 * buffer.h: ... to here, because these macros use current_buffer,
19234 and the new implementation with inline functions needs to have
19235 current_buffer in scope now, rather than later when the macros
19236 are used.
19237 (downcase, upcase1): New static inline functions.
19238 (DOWNCASE, UPCASE1): Reimplement using these functions.
19239 This avoids undefined behavior in expressions like
19240 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19241 from race conditions in accessing the global variables
19242 case_temp1 and case_temp2.
19243 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19244 * lisp.h (case_temp1, case_temp2): Remove their decls.
19245 * character.h (ASCII_CHAR_P): Move from here ...
19246 * lisp.h: ... to here, so that the inline functions mentioned
19247 above can use them.
19248
19249 * dired.c (directory_files_internal_unwind): Now static.
19250
19251 * fileio.c (file_name_as_directory, directory_file_name):
19252 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19253 Now static.
19254 (file_name_as_directory): Use const pointers when appropriate.
19255 (Fexpand_file_name): Likewise. In particular, newdir might
19256 point at constant storage, so make it a const pointer.
19257 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19258 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19259 signedness issues.
19260 (Fset_file_times, Finsert_file_contents, auto_save_error):
19261 Rename locals to avoid shadowing.
19262
19263 * minibuf.c (choose_minibuf_frame_1): Now static.
19264 (Ftry_completion, Fall_completions): Rename or remove locals
19265 to avoid shadowing.
19266
19267 * marker.c (bytepos_to_charpos): Remove; unused.
19268
19269 * lisp.h (verify_bytepos, count_markers): New decls,
19270 so that gcc does not warn that these functions aren't declared.
19271
19272 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19273 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19274 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19275 (copy_text): Remove unused local var.
19276
19277 * filelock.c (within_one_second): Now static.
19278 (lock_file_1): Rename local to avoid shadowing.
19279
19280 * buffer.c (fix_overlays_before): Mark locals as initialized.
19281 (fix_start_end_in_overlays): Likewise. This function should be
19282 simplified by using pointers-to-pointers, but that's a different
19283 matter.
19284 (switch_to_buffer_1): Now static.
19285 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19286 (report_overlay_modification): Rename locals to avoid shadowing.
19287
19288 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19289 Fix pointer signedness issue.
19290 (sys_subshell): Mark local as volatile if checking for lint,
19291 to suppress a gcc -Wclobbered warning that does not seem to be right.
19292 (MAXPATHLEN): Define only if needed.
19293
19294 * process.c (serial_open, serial_configure): Move decls from here ...
19295 * systty.h: ... to here, so that they can be checked.
19296
19297 * fns.c (get_random, seed_random): Move extern decls from here ...
19298 * lisp.h: ... to here, so that they can be checked.
19299
19300 * sysdep.c (reset_io): Now static.
19301 (wait_for_termination_signal): Remove; unused.
19302
19303 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19304 (copy_keymap_item, append_key, push_text_char_description):
19305 Now static.
19306 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19307 (DENSE_TABLE_SIZE): Remove; unused.
19308 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19309 (describe_map_tree):
19310 Rename locals to avoid shadowing.
19311
19312 * keyboard.c: Declare functions static if they are not used elsewhere.
19313 (echo_char, echo_dash, cmd_error, top_level_2):
19314 (poll_for_input, handle_async_input): Now static.
19315 (read_char, kbd_buffer_get_event, make_lispy_position):
19316 (make_lispy_event, make_lispy_movement, apply_modifiers):
19317 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19318 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19319 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19320 (read_key_sequence, read_char): Mark locals as initialized.
19321 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19322
19323 * keyboard.h (make_ctrl_char): New decl.
19324 (mark_kboards): Move decl here ...
19325 * alloc.c (mark_kboards): ... from here.
19326
19327 * lisp.h (force_auto_save_soon): New decl.
19328
19329 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19330 (DEFINE_DUMMY_FUNCTION): New macro.
19331 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19332 Use it.
19333 (main): Add casts to avoid warnings
19334 if GCC considers string literals to be constants.
19335
19336 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19337
19338 * dbusbind.c: Pointer signedness fixes.
19339 (xd_signature, xd_append_arg, xd_initialize):
19340 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19341 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19342 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19343 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19344
19345 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19346 if GCC considers string literals to be constants.
19347 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19348
19349 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19350
19351 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19352 (print_preprocess, print_object): New macro to fix last change.
19353
19354 * print.c (print_preprocess): Don't forget font objects.
19355
19356 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19357
19358 * emacs.c (USAGE3): Doc fixes.
19359
19360 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19361
19362 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19363 structure.
19364
19365 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19366
19367 * lisp.h (VWindow_system, Qfile_name_history):
19368 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19369 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19370 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19371
19372 * w32select.c: Don't #include "keyboard.h".
19373 (run_protected): Add extern declaration for waiting_for_input.
19374
19375 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19376 * w32console.c (detect_input_pending, read_input_pending)
19377 (encode_terminal_code):
19378 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19379 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19380 (w32_system_caret_y, Qfile_name_history):
19381 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19382 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19383 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19384 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19385 * w32proc.c (Qlocal, report_file_error):
19386 * w32term.c (Vwindow_system, updating_frame):
19387 * w32uniscribe.c (initialized, uniscribe_font_driver):
19388 Remove unneeded extern declarations.
19389
19390 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19391
19392 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19393
19394 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19395
19396 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19397 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19398 These macros can no longer be used for assignment.
19399
19400 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19401 Assign struct members directly, instead of using BUF_BEGV etc.
19402 (record_buffer_markers, fetch_buffer_markers): New functions for
19403 recording and fetching special buffer markers.
19404 (set_buffer_internal_1, set_buffer_temp): Use them.
19405
19406 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19407
19408 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19409
19410 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19411 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19412
19413 * xdisp.c (hscroll_window_tree):
19414 (reconsider_clip_changes): Use PT instead of BUF_PT.
19415
19416 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19417
19418 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19419 $(EMACS_ROOT)/lib/intprops.h.
19420
19421 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19422
19423 Fix more problems found by GCC 4.5.2's static checks.
19424
19425 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19426 to unsigned char * to avoid compiler diagnostic.
19427 (xg_free_frame_widgets): Make it clear that a local variable is
19428 needed only if USE_GTK_TOOLTIP.
19429 (gdk_window_get_screen): Make it clear that this macro is needed
19430 only if USE_GTK_TOOLTIP.
19431 (int_gtk_range_get_value): New function, which avoids a diagnostic
19432 from gcc -Wbad-function-cast.
19433 (xg_set_toolkit_scroll_bar_thumb): Use it.
19434 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19435 diagnostic from gcc -Wbad-function-cast.
19436 (get_utf8_string, xg_get_file_with_chooser):
19437 Rename locals to avoid shadowing.
19438 (create_dialog): Move locals to avoid shadowing.
19439
19440 * xgselect.c (xg_select): Remove unused var.
19441
19442 * image.c (four_corners_best): Mark locals as initialized.
19443 (gif_load): Initialize transparent_p to zero (Bug#8238).
19444 Mark another local as initialized.
19445 (my_png_error, my_error_exit): Mark with NO_RETURN.
19446
19447 * image.c (clear_image_cache): Now static.
19448 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19449 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19450 (x_edge_detection): Remove unnecessary cast that
19451 gcc -Wbad-function-cast diagnoses.
19452 (gif_load): Fix pointer signedness.
19453 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19454 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19455
19456 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19457
19458 Improve quality of tests for time stamp overflow.
19459 For example, without this patch (encode-time 0 0 0 1 1
19460 1152921504606846976) returns the obviously-bogus value (-948597
19461 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19462 reports time overflow. See
19463 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19464 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19465 * editfns.c: Include limits.h and intprops.h.
19466 (TIME_T_MIN, TIME_T_MAX): New macros.
19467 (time_overflow): Move earlier, to before first use.
19468 (hi_time, lo_time): New functions, for an accurate test for
19469 out-of-range times.
19470 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19471 (Fget_internal_run_time): Don't assume time_t fits in int.
19472 (make_time): Use list2 instead of Fcons twice.
19473 (Fdecode_time): More accurate test for out-of-range times.
19474 (check_tm_member): New function.
19475 (Fencode_time): Use it, to test for out-of-range times.
19476 (lisp_time_argument): Don't rely on undefined left-shift and
19477 right-shift behavior when checking for time stamp overflow.
19478
19479 * editfns.c (time_overflow): New function, refactoring common code.
19480 (Fformat_time_string, Fdecode_time, Fencode_time):
19481 (Fcurrent_time_string): Use it.
19482
19483 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19484 * dired.c (make_time): Move to ...
19485 * editfns.c (make_time): ... here.
19486 * systime.h: Note the move.
19487
19488 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19489
19490 * fringe.c (update_window_fringes): Remove unused variables.
19491
19492 * unexmacosx.c (copy_data_segment): Also copy __got section.
19493 (Bug#8223)
19494
19495 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19496
19497 * termcap.c [MSDOS]: Include "msdos.h".
19498 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19499 Constify `char *' arguments and their references according to
19500 prototypes in tparam.h.
19501
19502 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19503
19504 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19505 Adapt all references accordingly.
19506
19507 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19508
19509 2011-03-11 Tom Tromey <tromey@redhat.com>
19510
19511 * buffer.c (syms_of_buffer): Remove obsolete comment.
19512
19513 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19514
19515 * termhooks.h (encode_terminal_code): Declare prototype.
19516
19517 * msdos.c (encode_terminal_code): Don't declare prototype.
19518
19519 * term.c (encode_terminal_code): Now external again, used by
19520 w32console.c and msdos.c.
19521
19522 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19523 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19524
19525 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19526
19527 Fix some minor problems found by GCC 4.5.2's static checks.
19528
19529 * fringe.c (update_window_fringes): Mark locals as initialized
19530 (Bug#8227).
19531 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19532
19533 * alloc.c (mark_fringe_data): Move decl from here ...
19534 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19535 to check its interface.
19536 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19537
19538 * fontset.c (free_realized_fontset): Now static.
19539 (Fset_fontset_font): Rename local to avoid shadowing.
19540 (fontset_font): Mark local as initialized.
19541 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19542
19543 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19544
19545 * xselect.c (x_disown_buffer_selections): Remove; not used.
19546 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19547 (x_own_selection, Fx_disown_selection_internal): Rename locals
19548 to avoid shadowing.
19549 (x_handle_dnd_message): Remove local to avoid shadowing.
19550
19551 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19552 so that the caller can use some name other than gcpro1.
19553 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19554 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19555 (Fx_backspace_delete_keys_p):
19556 Use them to avoid shadowing, and rename vars to avoid shadowing.
19557 (x_decode_color, x_set_name, x_window): Now static.
19558 (Fx_create_frame): Add braces to silence GCC warning.
19559 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19560 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19561 Remove unused locals.
19562 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19563 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19564 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19565 macros.
19566
19567 * xterm.h (x_mouse_leave): New decl.
19568
19569 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19570 Remove unused functions.
19571 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19572 (x_calc_absolute_position): Now static.
19573 (XTread_socket): Don't define label "out" unless it's used.
19574 Don't declare local "event" unless it's used.
19575 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19576 unless they are used.
19577 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19578 (x_fatal_error_signal): Remove; not used.
19579 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19580 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19581 (x_error_catcher, x_connection_closed, x_error_handler):
19582 (x_error_quitter, xembed_send_message, x_iconify_frame):
19583 (my_log_handler): Rename locals to avoid shadowing.
19584 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19585 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19586
19587 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19588 Rename or move locals to avoid shadowing.
19589 (tty_defined_color, merge_face_heights): Now static.
19590 (free_realized_faces_for_fontset): Remove; not used.
19591 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19592 does not deduce is never used uninitialized.
19593 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19594 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19595
19596 * terminal.c (store_terminal_param): Now static.
19597
19598 * xmenu.c (menu_highlight_callback): Now static.
19599 (set_frame_menubar): Remove unused local.
19600 (xmenu_show): Rename parameter to avoid shadowing.
19601 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19602 since they might point to immutable storage.
19603 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19604 since it's unused otherwise.
19605
19606 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19607 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19608 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19609 avoids a gcc -Wuninitialized diagnostic.
19610 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19611 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19612 does not deduce are never used uninitialized.
19613
19614 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19615
19616 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19617 * window.c (window_loop, size_window):
19618 (run_window_configuration_change_hook, enlarge_window): Likewise.
19619
19620 * window.c (display_buffer): Now static.
19621 (size_window): Mark variables that gcc -Wuninitialized
19622 does not deduce are never used uninitialized.
19623 * window.h (check_all_windows): New decl, to forestall
19624 gcc -Wmissing-prototypes diagnostic.
19625 * dispextern.h (bidi_dump_cached_states): Likewise.
19626
19627 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19628 shadowing.
19629 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19630 Include <limits.h>.
19631 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19632 and to avoid gcc -Wuninitialized warning.
19633 (load_charset_map): Mark variables that gcc -Wuninitialized
19634 does not deduce are never used uninitialized.
19635 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19636
19637 * coding.c (coding_set_source, coding_set_destination):
19638 Use "else { /* comment */ }" rather than "else /* comment */;"
19639 for clarity, and to avoid gcc -Wempty-body warning.
19640 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19641 a block, when the outer 'i' will do.
19642 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19643 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19644 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19645 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19646 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19647 Rename locals to avoid shadowing.
19648 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19649 * coding.c (emacs_mule_char, encode_invocation_designation):
19650 Now static, since they're not used elsewhere.
19651 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19652 (decode_coding_object, encode_coding_object, detect_coding_system):
19653 (decode_coding_emacs_mule): Mark variables that gcc
19654 -Wuninitialized does not deduce are never used uninitialized.
19655 (detect_coding_iso_2022): Initialize a local variable that might
19656 be used uninitialized. Leave a FIXME because it's not clear that
19657 this initialization is needed. (Bug#8211)
19658 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19659 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19660 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19661 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19662 Remove unused macros.
19663
19664 * category.c (hash_get_category_set): Remove unused local var.
19665 (copy_category_table): Now static, since it's not used elsewhere.
19666 * character.c (string_count_byte8): Likewise.
19667
19668 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19669 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19670
19671 * chartab.c (copy_sub_char_table): Now static, since it's not used
19672 elsewhere.
19673 (sub_char_table_ref_and_range, char_table_ref_and_range):
19674 Rename locals to avoid shadowing.
19675 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19676
19677 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19678 (BIDI_BOB): Remove unused macro.
19679
19680 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19681 deduce are never used uninitialized.
19682 * term.c (encode_terminal_code): Likewise.
19683
19684 * term.c (encode_terminal_code): Now static. Remove unused local.
19685
19686 * tparam.h: New file.
19687 * term.c, tparam.h: Include it.
19688 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19689 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19690 Move these decls to tparam.h, and make them agree with what
19691 is actually in tparam.c. The previous trick of using incompatible
19692 decls in different modules does not conform to the C standard.
19693 All callers of tparam changed to use tparam's actual API.
19694 * tparam.c (tparam1, tparam, tgoto):
19695 Use const pointers where appropriate.
19696
19697 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19698 * cm.h (struct cm): Likewise.
19699 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19700 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19701 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19702 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19703 (turn_on_face, init_tty): Likewise.
19704 * termchar.h (struct tty_display_info): Likewise.
19705
19706 * term.c (term_mouse_position): Rename local to avoid shadowing.
19707
19708 * alloc.c (mark_ttys): Move decl from here ...
19709 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19710
19711 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19712
19713 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19714
19715 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19716
19717 * search.c (compile_pattern_1): Remove argument regp, unused since
19718 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19719 (compile_pattern): Don't pass it.
19720
19721 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19722
19723 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19724 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19725 for ! HAVE_GTK3.
19726 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19727
19728 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19729
19730 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19731 gdk_window_get_screen, gdk_window_get_geometry,
19732 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19733 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19734 (xg_get_pixbuf_from_pixmap): New function.
19735 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19736 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19737 Call xg_get_pixbuf_from_pixmap instead of
19738 gdk_pixbuf_get_from_drawable.
19739 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19740 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19741 (xg_check_special_colors): Use GtkStyleContext and its functions
19742 for HAVE_GTK3.
19743 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19744 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19745 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19746 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19747 Call gtk_widget_get_preferred_size.
19748 (xg_frame_resized): gdk_window_get_geometry only takes 5
19749 parameters.
19750 (xg_win_to_widget, xg_event_is_for_menubar):
19751 Call gdk_x11_window_lookup_for_display.
19752 (xg_set_widget_bg): New function.
19753 (delete_cb): New function.
19754 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19755 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19756 (xg_set_background_color): Call xg_set_widget_bg.
19757 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19758 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19759 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19760 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19761 if ! HAVE_GTK3.
19762 (update_frame_tool_bar): Call gtk_widget_hide.
19763 (xg_initialize): Use GDK_KEY_g.
19764
19765 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19766 if ! HAVE_GTK3
19767 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19768
19769 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19770 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19771 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19772
19773 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19774
19775 * w32xfns.c (select_palette): Check success of RealizePalette against
19776 GDI_ERROR, not zero.
19777
19778 See ChangeLog.11 for earlier changes.
19779
19780 ;; Local Variables:
19781 ;; coding: utf-8
19782 ;; End:
19783
19784 Copyright (C) 2011-2013 Free Software Foundation, Inc.
19785
19786 This file is part of GNU Emacs.
19787
19788 GNU Emacs is free software: you can redistribute it and/or modify
19789 it under the terms of the GNU General Public License as published by
19790 the Free Software Foundation, either version 3 of the License, or
19791 (at your option) any later version.
19792
19793 GNU Emacs is distributed in the hope that it will be useful,
19794 but WITHOUT ANY WARRANTY; without even the implied warranty of
19795 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19796 GNU General Public License for more details.
19797
19798 You should have received a copy of the GNU General Public License
19799 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.