Remove HAVE_MOUSE; see https://lists.gnu.org/archive/html/emacs-devel/2012-10/msg0040...
[bpt/emacs.git] / src / ChangeLog
1 2012-11-24 Ken Brown <kbrown@cornell.edu>
2
3 * keyboard.c (HAVE_MOUSE):
4 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
5 were always defined.
6
7 2012-11-24 Eli Zaretskii <eliz@gnu.org>
8
9 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
10 between bpos_covered and bpos_max. This fixes cursor display when
11 several display strings follow each other.
12
13 * .gdbinit (pgx): If the glyph's object is a string, display the
14 pointer to string data, rather than the value of the string object
15 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
16
17 * indent.c (Fvertical_motion): If the starting position is covered
18 by a display string, return to one position before that, to avoid
19 overshooting it inside move_it_to. (Bug#12930)
20
21 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
22
23 * frame.h (struct frame): Remove display_preempted member
24 since all users are dead long ago.
25 * nsterm.h (struct x_output): Use the only dummy member.
26 * w32menu.c (pending_menu_activation): Remove since not
27 really used.
28 (set_frame_menubar): Adjust user.
29 * w32term.h (struct x_output): Drop outdated #if 0 code.
30 (struct w32_output): Use bitfields for explicit_parent,
31 asked_for_visible and menubar_active members. Drop
32 unused pending_menu_activation member.
33 * xterm.h (struct x_output): Drop outdated #if 0 code.
34 Use bitfields for explicit_parent, asked_for_visible,
35 has_been_visible and net_wm_state_hidden_seen members.
36
37 2012-11-23 Eli Zaretskii <eliz@gnu.org>
38
39 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
40 of a literal "/". (Bug#12955)
41 (gl-stamp): Invoke fc.exe directly, not through cmd.
42
43 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
44
45 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
46 * dired.c: Assume HAVE_DIRENT_H.
47 (NAMLEN): Remove, replacing with ...
48 (dirent_namelen): New function. All uses changed. Use the GNU macro
49 _D_EXACT_NAMELEN if available, as it's faster than strlen.
50 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
51 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
52 * makefile.w32-in (DIR_H): Remove. All uses replaced with
53 $(NT_INC)/dirent.h.
54 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
55 * ndir.h: Rename to ../nt/inc/dirent.h.
56 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
57 Do not include <dirent.h>; no longer needed.
58 * w32.c: Include <dirent.h> rather than "ndir.h".
59
60 2012-11-23 Chong Yidong <cyd@gnu.org>
61
62 * xftfont.c (xftfont_open): Remove duplicate assignment.
63
64 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
65
66 * alloc.c (Fgarbage_collect): Unblock input after clearing
67 gc_in_progress to avoid note_mouse_highlight glitch with GC.
68 * frame.h (FRAME_MOUSE_UPDATE): New macro.
69 * msdos.c (IT_frame_up_to_date): Use it here...
70 * w32term.c (w32_frame_up_to_date): ...here...
71 * xterm.c (XTframe_up_to_date): ...and here...
72 * nsterm.m (ns_frame_up_to_date): ...but not here.
73 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
74 Adjust users.
75 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
76 Do not check whether GC is in progress.
77
78 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
79
80 * xdisp.c (window_buffer_changed): New function.
81 (update_menu_bar, update_tool_bar): Use it to
82 simplify large 'if' statements.
83 (redisplay_internal): Generalize commonly used
84 'tail' and 'frame' local variables.
85
86 2012-11-22 Eli Zaretskii <eliz@gnu.org>
87
88 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
89 with Windows system header.
90
91 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
92
93 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
94 * alloc.c: Assume unistd.h exists.
95 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
96 * sysdep.c (get_current_dir_name): Assume getcwd exists.
97 (getwd) [USG]: Remove; no longer needed.
98 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
99 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
100 * w32.h (getcwd): Remove decl.
101
102 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
103
104 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
105 Make it set selected_window as well.
106 (update_tool_bar): Use it.
107
108 2012-11-21 Ken Brown <kbrown@cornell.edu>
109
110 * emacs.c (main): Set the G_SLICE environment variable for all
111 Cygwin builds, not just GTK builds. See
112 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
113
114 2012-11-21 Eli Zaretskii <eliz@gnu.org>
115
116 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
117 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
118 Define for the MSVC compiler.
119
120 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
121
122 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
123 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
124 dostounix_filename. Prevents crashes down the road, because
125 dostounix_filename assumes it gets a unibyte string. Reported by
126 Michel de Ruiter <michel@sentient.nl>, see
127 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
128
129 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
130
131 Conflate Qnil and Qunbound for `symbol-function'.
132 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
133 * lread.c (init_obarray): Set `function' fields to Qnil.
134 * eval.c (Fcommandp): Ignore Qunbound.
135 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
136 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
137 Test NILP rather than Qunbound.
138 (Ffmakunbound): Set to Qnil.
139 (Fsymbol_function): Never signal an error.
140 (Finteractive_form): Ignore Qunbound.
141
142 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
143
144 * eval.c (interactive_p): Remove no-longer-used decl.
145
146 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
147
148 * xdisp.c (buffer_shared): Adjust comment.
149 (buffer_shared_and_changed): New function.
150 (prepare_menu_bars, redisplay_internal): Use it to
151 decide whether all windows or frames should be updated.
152 (window_outdated): New function.
153 (text_outside_line_unchanged_p, redisplay_window): Use it.
154 (redisplay_internal): Likewise. Fix indentation.
155
156 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
157
158 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
159 (syms_of_eval): Remove corresponding defsubr.
160 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
161
162 2012-11-19 Daniel Colascione <dancol@dancol.org>
163
164 * w32fns.c (Fx_file_dialog):
165 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
166 cygwin_convert_file_name*.
167
168 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
169 Rename cygwin_convert_path* to cygwin_convert_file_name*.
170
171 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
172
173 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
174
175 2012-11-18 Eli Zaretskii <eliz@gnu.org>
176
177 * w32select.c: Include w32common.h before w32term.h, so that
178 windows.h gets included before w32term.h uses some of its
179 features, see below.
180
181 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
182 New typedefs.
183 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
184 New prototypes.
185 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
186
187 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
188
189 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
190 (ns_select): Return at once if events are held (Bug#12834).
191
192 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
193
194 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
195 Needed following 2012-10-20 change. (Bug#12902)
196
197 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
198
199 * w32proc.c (waitpid): Remove unused label get_result.
200
201 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
202
203 * makefile.w32-in (SYSWAIT_H): New macro.
204 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
205 ($(BLD)/sysdep.$(O)): Update dependencies.
206
207 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
208
209 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
210 * callproc.c (relocate_fd): Assume F_DUPFD.
211 * emacs.c, term.c (O_RDWR): Remove.
212 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
213 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
214 * nsterm.m: Assume <fcntl.h> exists.
215 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
216 (create_pty, Fmake_network_process, server_accept_connection)
217 (wait_reading_process_output, init_process_emacs):
218 Assume O_NONBLOCK.
219 (wait_reading_process_output): Put in a special case for WINDOWSNT
220 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
221 It's not clear this is needed, but it's a more-conservative change.
222 (create_process): Assume FD_CLOEXEC.
223 (create_process, create_pty): Assume O_NOCTTY.
224 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
225 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
226 Omit if not DOS_NT, since F_GETFL is not defined there.
227 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
228 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
229 (O_NOCTTY): Remove.
230 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
231 lack it, since gnulib guarantees this.
232 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
233
234 2012-11-17 Eli Zaretskii <eliz@gnu.org>
235
236 * w32.c (faccessat): Pretend that directories have the execute bit
237 set. Emacs expects that, e.g., in files.el:cd-absolute.
238
239 * w32proc.c (create_child): Don't clip the PID of the child
240 process to fit into an Emacs integer, as this is no longer a
241 restriction.
242 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
243 reaping only the process specified by PID argument, if that is
244 positive. Use PID instead of dead_child to know which process to
245 reap. Wait for the child to die only if WNOHANG is not in
246 OPTIONS.
247 (sys_select): Don't set dead_child.
248
249 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
250 as it is no longer needed.
251
252 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
253 no longer needed.
254 (record_child_status_change): Remove the setting of
255 record_at_most_one_child for the !WNOHANG case.
256
257 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
258
259 Fix problems in ns port found by static checking.
260 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
261 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
262 not to process group.
263 (ns_select): Use emacs_write, not write, as that's more robust
264 in the presence of signals.
265 (fd_handler:): Check for read errors.
266
267 2012-11-16 Glenn Morris <rgm@gnu.org>
268
269 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
270
271 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
272
273 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
274
275 2012-11-16 Eli Zaretskii <eliz@gnu.org>
276
277 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
278 use the same value of thread handle.
279 (start_timer_thread): If the timer thread exited (due to error),
280 clean up by closing the two handles it used. Duplicate the caller
281 thread's handle here, so it gets duplicated only once, when
282 launching the timer thread. Set priority of the timer thread, not
283 the caller thread.
284 (getitimer): Don't duplicate the caller thread's handle here.
285 (Bug#12832)
286
287 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
288
289 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
290 called (Bug#12834).
291
292 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
293
294 Remove no-longer-used pty_max_bytes variable.
295 * process.c (pty_max_bytes): Remove; unused.
296 (send_process): Do not set it.
297
298 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
299
300 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
301 Update dependencies.
302
303 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
304
305 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
306 This follows up on the 2012-09-29 patch that removed indirection
307 for the 'function' field. Reported by Sergey Vinokurov in
308 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
309
310 2012-11-14 Eli Zaretskii <eliz@gnu.org>
311
312 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
313 different name, as the MS runtime does not have such a function,
314 and probably never will.) All callers changed. Ignore DIRFD
315 value if PATH is an absolute file name, to match Posix spec
316 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
317 symlinks.
318
319 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
320
321 * xdisp.c (echo_area_display, redisplay_internal):
322 Omit redundant check whether frame_garbaged is set.
323
324 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
325
326 Use faccessat, not access, when checking file permissions (Bug#12632).
327 This fixes a bug that has been present in Emacs since its creation.
328 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
329 which must set some sort of record. (Torek's bug report was against
330 a predecessor of GNU Emacs, but GNU Emacs happened to have the
331 same common flaw.) See Torek's Usenet posting
332 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
333 Posted: Fri Apr 8 14:18:56 1983.
334 * Makefile.in (LIB_EACCESS): New macro.
335 (LIBES): Use it.
336 * callproc.c (init_callproc):
337 * charset.c (init_charset):
338 * fileio.c (check_existing, check_executable, check_writable)
339 (Ffile_readable_p):
340 * lread.c (openp, load_path_check):
341 * process.c (allocate_pty):
342 * xrdb.c (file_p):
343 Use effective UID when checking permissions, not real UID.
344 * callproc.c (init_callproc):
345 * charset.c (init_charset):
346 * lread.c (load_path_check, init_lread):
347 Test whether directories are accessible, not merely whether they exist.
348 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
349 * fileio.c (check_existing, check_executable, check_writable)
350 (Ffile_readable_p):
351 Use symbolic names instead of integers for the flags, as they're
352 portable now.
353 (check_writable): New arg AMODE. All uses changed.
354 Set errno on failure.
355 (Ffile_readable_p): Use faccessat, not stat + open + close.
356 (Ffile_writable_p): No need to call check_existing + check_writable.
357 Just call check_writable and then look at errno. This saves a syscall.
358 dir should never be nil; replace an unnecessary runtime check
359 with an eassert. When checking the parent directory of a nonexistent
360 file, check that the directory is searchable as well as writable, as
361 we can't create files in unsearchable directories.
362 (file_directory_p): New function, which uses 'stat' on most platforms
363 but faccessat with D_OK (for efficiency) if WINDOWSNT.
364 (Ffile_directory_p, Fset_file_times): Use it.
365 (file_accessible_directory_p): New function, which uses a single
366 syscall for efficiency.
367 (Ffile_accessible_directory_p): Use it.
368 * xrdb.c (file_p): Use file_directory_p.
369 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
370 * lread.c (openp): When opening a file, use fstat rather than
371 stat, as that avoids a permissions race. When not opening a file,
372 use file_directory_p rather than stat.
373 (dir_warning): First arg is now a usage string, not a format.
374 Use errno. All uses changed.
375 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
376 that merely introduced a race.
377 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
378 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
379 and similarly for the other O_* flags.
380 * w32.c (sys_faccessat): Rename from sys_access and switch to
381 faccessat's API. All uses changed.
382 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
383 (magic_db): Rename from magic_file_p.
384 (magic_db, search_magic_path): Return an XrmDatabase rather than a
385 char *, so that we don't have to test for file existence
386 separately from opening the file for reading. This removes a race
387 fixes a permission-checking problem, and simplifies the code.
388 All uses changed.
389 (file_p): Remove; no longer needed.
390
391 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
392
393 Omit glyphs initialization at startup.
394 * dispnew.c (glyphs_initialized_initially_p): Remove.
395 (adjust_frame_glyphs_initially): Likewise. Adjust users.
396 (Fredraw_frame): Move actual code from here...
397 (redraw_frame): ...to here. Add eassert. Adjust comment.
398 (Fredraw_display): Use redraw_frame.
399 * xdisp.c (clear_garbaged_frames): Likewise.
400
401 2012-11-13 Eli Zaretskii <eliz@gnu.org>
402
403 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
404 passed to pint2str and pint2hrstr to be at most the size of the
405 frame's decode_mode_spec_buffer. This avoids crashes with very
406 large values of FIELD_WIDTH argument to decode_mode_spec.
407 (Bug#12867)
408
409 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
410
411 Fix a race with verify-visited-file-modtime (Bug#12863).
412 Since at least 1991 Emacs has ignored an mtime difference of no
413 more than one second, but my guess is that this was to work around
414 file system bugs that were fixed long ago. Since the race is
415 causing problems now, let's remove that code.
416 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
417 whose time stamp is off by no more than a second. Insist that the
418 file time stamps match exactly.
419
420 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
421
422 * frame.h (struct frame): Convert external_tool_bar member to
423 1-bit unsigned bitfield.
424 * termhooks.h (struct terminal): Remove mouse_moved member since
425 all users are long dead. Adjust comment on mouse_position_hook.
426
427 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
428
429 Simplify by using FOR_EACH_FRAME here and there.
430 * frame.c (next_frame, prev_frame, other_visible_frames)
431 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
432 * w32term.c (x_window_to_scroll_bar): Likewise.
433 * window.c (window_list): Likewise.
434 * xdisp.c (x_consider_frame_title): Likewise.
435 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
436 * xfns.c (x_window_to_frame, x_any_window_to_frame)
437 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
438 * xmenu.c (menubar_id_to_frame): Likewise.
439 * xselect.c (frame_for_x_selection): Likewise.
440 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
441 (x_window_to_menu_bar): Likewise.
442 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
443
444 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
445
446 * data.c (Qdefalias_fset_function): Now static.
447
448 Another tweak to vectorlike_header change.
449 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
450 Remove, and replace all uses with ...
451 (next_in_free_list, set_next_in_free_list):
452 New functions, which respect C's aliasing rules better.
453
454 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
455
456 * window.c (list4i): Rename from 'quad'. All uses changed.
457 Needed because <sys/types.h> defines 'quad' on Solaris 10.
458
459 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
460
461 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
462 warning about mixing declarations and code in ISO C90.
463
464 2012-11-10 Martin Rudalics <rudalics@gmx.at>
465
466 * window.c (Fsplit_window_internal): Set combination limit of
467 new parent window to t iff Vwindow_combination_limit is t;
468 fixing a regression introduced with the change from 2012-09-22.
469 (Fset_window_combination_limit): Fix doc-string.
470
471 2012-11-10 Eli Zaretskii <eliz@gnu.org>
472
473 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
474 amount when the scroll margins are too large. When scrolling
475 backwards in the buffer, give up if cannot reach point or the
476 scroll margin within a reasonable number of screen lines.
477 Fixes point position in window under scroll-up/down-aggressively when
478 point is positioned many lines beyond the window top/bottom.
479 (Bug#12811)
480
481 * ralloc.c (relinquish): If real_morecore fails to return memory
482 to the system, don't crash; instead, leave the last heap
483 unchanged and return. (Bug#12774)
484
485 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
486
487 * lisp.h (AUTOLOADP): New macro.
488 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
489 * data.c (Ffset): Remove special ad-advice-info handling.
490 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
491 (Fsubr_arity): CSE.
492 (Finteractive_form): Simplify.
493 (Fquo): Don't insist on having at least 2 arguments.
494 (Qdefalias_fset_function): New var.
495
496 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
497
498 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
499
500 * nsfont.m (Qcondensed, Qexpanded): New variables.
501 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
502 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
503
504 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
505
506 Fix recently introduced crash on MS-Windows (Bug#12839).
507 * w32term.h (struct scroll_bar): Use convenient header.
508 (SCROLL_BAR_VEC_SIZE): Remove.
509 * w32term.c (x_scroll_bar_create): Use VECSIZE.
510
511 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
512
513 Tweak last vectorlike_header change.
514 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
515 vectorlike object on the free list. This is introduced to avoid
516 some (but not all) pointer casting and aliasing problems, see
517 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
518 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
519 objects.
520 (xvectype, xvecsize): Use them to examine Lisp_Object values.
521
522 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
523
524 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
525 been removed, so remove them here also.
526
527 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
528
529 * doc.c (Fdocumentation): Handle new property
530 dynamic-docstring-function to replace the old ad-advice-info.
531
532 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
533
534 * fns.c (Qeql, hashtest_eq): Now static.
535
536 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
537
538 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
539 * fns.c (hashfn_eq, hashfn_eql, sxhash):
540 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
541 * buffer.c (compare_overlays): Use XLI rather than XHASH.
542
543 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
544
545 Use same hash function for hashfn_profiler as for hash_string etc.
546 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
547 * lisp.h (sxhash_combine): New inline function, with the contents
548 of the old SXHASH_COMBINE.
549 * profiler.c (hashfn_profiler): Use it, instead of having a
550 special hash function containing a comparison that always yields 1.
551
552 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
553
554 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
555 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
556 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
557 Remove unused vars.
558
559 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
560
561 * image.c (xpm_make_color_table_h): Fix compiler error because
562 make_hash_table changed.
563
564 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
565
566 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
567
568 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
569
570 Use ad-hoc comparison function for the profiler's hash-tables.
571 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
572 (make_log): Use them.
573 (handle_profiler_signal): Don't inhibit quit any longer since we don't
574 call Fequal any more.
575 (Ffunction_equal): New function.
576 (cmpfn_profiler, hashfn_profiler): New functions.
577 (syms_of_profiler): Initialize them.
578 * lisp.h (struct hash_table_test): New struct.
579 (struct Lisp_Hash_Table): Use it.
580 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
581 * fns.c (make_hash_table): Take a struct to describe the test.
582 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
583 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
584 (hash_lookup, hash_remove_from_table): Move assertion checking of
585 hashfn result here. Check hash-equality before calling cmpfn.
586 (Fmake_hash_table): Adjust call to make_hash_table.
587 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
588 (syms_of_fns): Initialize them.
589 * emacs.c (main): Move syms_of_fns earlier.
590 * xterm.c (syms_of_xterm):
591 * category.c (hash_get_category_set): Adjust call to make_hash_table.
592 * print.c (print_object): Adjust to new hash-table struct.
593 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
594
595 2012-11-08 Eli Zaretskii <eliz@gnu.org>
596
597 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
598 value of w32-scroll-lock-modifier is neither nil nor one of the
599 known key modifiers. (Bug#12806)
600
601 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
602
603 Shrink struct vectorlike_header to the only size field.
604 * lisp.h (enum pvec_type): Avoid explicit enum member values.
605 Adjust comment.
606 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
607 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
608 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
609 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
610 information from the vector header. Adjust comment.
611 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
612 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
613 layout.
614 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
615 (struct vectorlike_header): Remove next member. Adjust comment.
616 (struct Lisp_Subr): Add convenient header. Adjust comment.
617 (allocate_pseudovector): Adjust prototype.
618 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
619 (sweep_string, lisp_malloc): Remove useless prototypes.
620 (enum mem_type): Adjust comment.
621 (NEXT_IN_FREE_LIST): New macro.
622 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
623 (Fmake_bool_vector): Likewise.
624 (struct large_vector): New type to represent allocation unit for
625 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
626 (large_vectors): Change type to struct large_vector.
627 (allocate_vector_from_block): Simplify.
628 (PSEUDOVECTOR_NBYTES): Replace with...
629 (vector_nbytes): ...new function. Adjust users.
630 (sweep_vectors): Adjust processing of large vectors.
631 (allocate_vectorlike): Likewise.
632 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
633 Add easserts. Adjust XSETPVECTYPESIZE usage.
634 (allocate_buffer): Use BUFFER_PVEC_INIT.
635 (live_vector_p): Adjust to match large vector.
636 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
637 * buffer.h (struct buffer): Add next member.
638 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
639 New macros.
640 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
641 * fns.c (internal_equal): Adjust to match enum pvec_type change.
642 (copy_hash_table): Adjust to match vector header change.
643 * lread.c (defsubr): Use XSETPVECTYPE.
644 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
645 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
646 (xvecsize): New command.
647
648 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
649
650 * keyboard.c (event_to_kboard): Do not dereference
651 frame_or_window field of SELECTION_REQUEST_EVENT
652 and SELECTION_CLEAR_EVENT events (Bug#12814).
653 * xterm.h (struct selection_input_event): Adjust comment.
654
655 2012-11-07 Eli Zaretskii <eliz@gnu.org>
656
657 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
658 such as Scroll Lock, if the respective keys are treated as
659 function keys, not as modifiers. This avoids destroying non-ASCII
660 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
661
662 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
663
664 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
665
666 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
667
668 Restore some duplicate definitions (Bug#12814).
669 This undoes part of the 2012-11-03 changes. Some people build
670 with plain -g rather than with -g3, and they need the duplicate
671 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
672 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
673 Define as macros, as well as as enums or as constants.
674
675 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
676
677 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
678 to keypad keys (Bug#12816).
679
680 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
681
682 Minor adjustments of recently-changed frame functions.
683 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
684 known to be a frame (we're in the FRAMEP branch).
685 * lisp.h (Qframep): Remove decl. frame.h declares this.
686 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
687 since they're meant for Lisp fixnum values.
688
689 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
690
691 * window.c (Fwindow_combination_limit): Revert to the only
692 required argument and adjust docstring as suggested in
693 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
694 by Martin Rudalics <rudalics@gmx.at>.
695
696 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
697
698 Widely used frame validity and checking functions.
699 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
700 * frame.c (decode_live_frame, decode_any_frame): New functions.
701 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
702 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
703 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
704 (Fframe_pointer_visible_p): Use decode_any_frame.
705 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
706 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
707 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
708 (Fframe_focus): Likewise. Allow zero number of arguments.
709 Adjust docstring.
710 (frame_buffer_list, frame_buffer_predicate): Remove.
711 * lisp.h (frame_buffer_predicate): Remove prototype.
712 * buffer.c (Fother_buffer): Use decode_any_frame.
713 * xdisp.c (Ftool_bar_lines_needed): Likewise.
714 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
715 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
716 (Fclose_font, Ffont_info): Use decode_live_frame.
717 * fontset.c (check_fontset_name): Likewise.
718 * terminal.c (Fframe_terminal): Likewise.
719 * w32fns.c (check_x_frame): Likewise.
720 * window.c (Fminibuffer_window, Fwindow_at)
721 (Fcurrent_window_configuration): Likewise.
722 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
723 Likewise. Allow zero number of arguments. Adjust docstring.
724 * dispnew.c (Fredraw_frame): Likewise.
725 * xfaces.c (frame_or_selected_frame): Remove.
726 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
727 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
728 (Fframe_face_alist): Use decode_live_frame.
729 * xfns.c (check_x_frame): Likewise.
730
731 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
732
733 * window.c (quad): New function.
734 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
735 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
736 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
737 (Fwindow_line_height): Use it.
738 (Fwindow_fringes): Use list3.
739 (Fwindow_scroll_bars): Use list4.
740 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
741 (Fwindow_combination_limit): Allow zero number of arguments.
742
743 2012-11-05 Eli Zaretskii <eliz@gnu.org>
744
745 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
746
747 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
748 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
749 file descriptor 2 for standard error. (Bug#12805)
750
751 2012-11-05 Chong Yidong <cyd@gnu.org>
752
753 * process.c (wait_reading_process_output): Revert previous change.
754
755 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
756
757 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
758 This removes code that has been obsolete since around 1990.
759 * callproc.c (Fcall_process):
760 * emacs.c (main):
761 * process.c (create_process):
762 * term.c (dissociate_if_controlling_tty):
763 Assume setsid exists.
764 * callproc.c (child_setup): Assume setpgid exists and behaves as
765 per POSIX.1-1988 or later.
766 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
767 * emacs.c (shut_down_emacs):
768 * sysdep.c (sys_suspend, init_foreground_group):
769 Assume getpgrp behaves as per POSIX.1-1998 or later.
770 * msdos.c (setpgrp): Remove.
771 (tcgetpgrp, setpgid, setsid): New functions.
772 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
773 * term.c (no_controlling_tty): Remove; unused.
774 * w32proc.c (setpgrp): Remove.
775 (setsid, tcgetpgrp): New functions.
776
777 Simplify by assuming __fpending.
778 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
779 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
780 Do not assume that __fpending's result fits in int.
781
782 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
783
784 Remove EMACS_OUTQSIZE+sleep hack.
785 * dispnew.c (update_frame_1): Remove hack for terminals slower
786 than 2400 bps, which throttled Emacs by having it sleep.
787 This code hasn't worked since at least 2007, when the multi-tty stuff
788 was added, and anyway those old terminals are long dead.
789 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
790 without the dispnew.c change, as dispnew.c doesn't include systty.h.
791
792 Fix data-loss with --version (Bug#9574).
793 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
794 as we can't assume that emacs_strerror is initialized, and strerror
795 is good enough here.
796 (main): Invoke atexit earlier, to catch earlier instances of
797 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
798
799 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
800
801 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
802 (keyDown): Remap keypad keys to X11 virtual key codes.
803
804 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
805
806 Fix data-loss with --batch (Bug#9574).
807 * emacs.c: Include <close-stream.h>.
808 (close_output_streams): New function.
809 (main): Pass it to atexit, so that Emacs closes stdout and stderr
810 and handles errors appropriately.
811 (Fkill_emacs): Don't worry about flushing, as close_output_stream
812 does that now.
813
814 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
815 The symptom is a diagnostic "GLib-WARNING **: In call to
816 g_spawn_sync(), exit status of a child process was requested but
817 SIGCHLD action was set to SIG_IGN and ECHILD was received by
818 waitpid(), so exit status can't be returned." The diagnostic
819 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
820 The real bug is a race condition between Emacs and glib: Emacs
821 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
822 so that glib can't find it. Work around the bug by invoking
823 waitpid only on subprocesses that Emacs itself creates.
824 * process.c (create_process, record_child_status_change):
825 Don't use special value -1 in pid field, as the caller now must
826 know the pid rather than having the callee infer it.
827 The inference was sometimes incorrect anyway, due to another race.
828 (create_process): Set new 'alive' member if child is created.
829 (process_status_retrieved): New function.
830 (record_child_status_change): Use it.
831 Accept negative 1st argument, which means to wait for the
832 processes that Emacs already knows about. Move special-case code
833 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
834 processes that have already been waited for, by testing and
835 clearing new 'alive' member.
836 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
837 now does this internally.
838 (handle_child_signal): Let record_child_status_change do all
839 the work, since we do not want to reap all exited child processes,
840 only the child processes that Emacs itself created.
841 * process.h (Lisp_Process): New boolean member 'alive'.
842
843 Omit duplicate definitions no longer needed with gcc -g3.
844 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
845 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
846 Define only as macros. There's no longer any need to also define
847 these symbols as enums or as constants, since we now assume
848 gcc -g3 when debugging.
849
850 2012-11-03 Eli Zaretskii <eliz@gnu.org>
851
852 * lisp.mk: Adjust comments to the fact that term/internal is now
853 loaded from loadup.el.
854
855 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
856 (msdos_fatal_signal): New function.
857 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
858 its argument list.
859
860 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
861 for GCC versions before 4.
862 (emacs_raise): Define to call msdos_fatal_signal.
863
864 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
865 iterator when starting in the middle of a display or overlay
866 string. (Bug#12745)
867
868 2012-11-03 Chong Yidong <cyd@gnu.org>
869
870 * process.c (wait_reading_process_output): Clean up the last
871 change.
872
873 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
874
875 * process.c (wait_reading_process_output): Avoid a race condition
876 with SIGIO delivery (Bug#11536).
877
878 2012-11-03 Chong Yidong <cyd@gnu.org>
879
880 * buffer.c (cursor_type): Untabify docstring.
881
882 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
883
884 * frame.h (struct frame): Drop can_have_scroll_bars member
885 which is meaningless for a long time. Adjust comments.
886 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
887 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
888
889 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
890
891 * window.c (decode_next_window_args): Update window arg after
892 calling decode_live_window and so fix crash reported at
893 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
894 by Juanma Barranquero <lekktu@gmail.com>.
895 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
896 * font.c (Ffont_at): Likewise.
897
898 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
899
900 * widget.c (resize_cb): New function.
901 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
902 (EmacsFrameResize): Check if all is up to date before changing frame
903 size.
904
905 2012-11-02 Eli Zaretskii <eliz@gnu.org>
906
907 Implement backtrace output for fatal errors on MS-Windows.
908 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
909 (BACKTRACE_LIMIT_MAX): New macro.
910 (w32_backtrace): New function.
911 (emacs_abort): Use w32_backtrace when the user chooses not to
912 attach a debugger. Update the text of the abort dialog.
913
914 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
915
916 Window-related stuff cleanup here and there.
917 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
918 Use decode_any_window.
919 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
920 * xdisp.c (Fformat_mode_line): Likewise.
921 * font.c (Ffont_at): Use decode_live_window.
922 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
923 * window.c (decode_next_window_args): Likewise.
924 (decode_any_window): Remove static.
925 * window.h (decode_any_window): Add prototype.
926 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
927 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
928 respectively.
929
930 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
931
932 Remove pad from struct input_event.
933 * termhooks.h (struct input_event): Remove padding field.
934 Adjust comment.
935 * keyboard.c (event_to_kboard): Simplify because frame_or_window
936 member is never cons for a long time. Adjust comment.
937 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
938 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
939 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
940 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
941
942 2012-11-01 Eli Zaretskii <eliz@gnu.org>
943
944 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
945
946 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
947
948 Fix crash when using Emacs as commit editor for git (Bug#12697).
949 * callproc.c (setpgrp): Remove macro, as we now use setpgid
950 and it is configured in conf_post.h.
951 (Fcall_process): Don't invoke both setsid and setpgid; the former
952 is enough, if it exists.
953 * callproc.c (Fcall_process, child_setup):
954 * process.c (create_process): Use setpgid.
955 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
956 for the real thing.
957 * dispnew.c (init_display): Initialize the foreground group
958 if we are running a tty display.
959 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
960 * lisp.h (init_foreground_group): New decl.
961 * sysdep.c (inherited_pgroup): New static var.
962 (init_foreground_group, tcsetpgrp_without_stopping)
963 (narrow_foreground_group, widen_foreground_group): New functions.
964 (init_sys_modes): Narrow foreground group.
965 (reset_sys_modes): Widen foreground group.
966
967 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
968
969 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
970
971 2012-10-31 Martin Rudalics <rudalics@gmx.at>
972
973 * minibuf.c (read_minibuf): Restore current buffer since
974 choose_minibuf_frame calling Fset_frame_selected_window may
975 change it (Bug#12766).
976
977 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
978
979 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
980
981 2012-10-30 Kenichi Handa <handa@gnu.org>
982
983 * font.c (Ffont_at): If WINDOW is specified and it is not
984 displaying the current buffer, signal an error.
985
986 2012-10-29 Daniel Colascione <dancol@dancol.org>
987
988 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
989 In preparation for fixing bug#12739, move these functions from
990 here...
991
992 * coding.h, coding.c: ... to here, and compile them only when
993 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
994 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
995
996 2012-10-28 Eli Zaretskii <eliz@gnu.org>
997
998 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
999 (timer_loop, getitimer, setitimer): Use it instead of
1000 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1001 'clock'.
1002 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1003 literal 10000.
1004
1005 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1006
1007 * nsterm.m (NO_APPDEFINED_DATA): New define.
1008 (last_appdefined_event_data): New variable
1009 (last_appdefined_event): Remove.
1010 (ns_select): Initialize t from last_appdefined_event_data instead
1011 of [last_appdefined_event data1].
1012 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1013 remove last_appdefined_event (Bug#12698).
1014
1015 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1016
1017 * frame.c (x_set_font): Catch internal error.
1018
1019 2012-10-27 Eli Zaretskii <eliz@gnu.org>
1020
1021 Avoid overflow in w32 implementation of interval timers.
1022 When possible, for ITIMER_PROF count only times the main thread
1023 actually executes.
1024 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1025 'volatile ULONGLONG' types. All the other data which was
1026 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
1027 (GetThreadTimes_Proc): New typedef.
1028 (w32_get_timer_time): New function, returns a suitable time value
1029 for the timer.
1030 (timer_loop): Enter critical section when accessing ULONGLONG
1031 values of the itimer_data struct, as these accesses are no longer
1032 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1033 Remove unused variable.
1034 (init_timers): Initialize s_pfn_Get_Thread_Times.
1035 (start_timer_thread): Don't assign itimer->caller_thread here.
1036 (getitimer): Assign itimer->caller_thread here.
1037 (setitimer): Always call getitimer to get the value of ticks_now.
1038 (sys_spawnve): Avoid compiler warning about format mismatch.
1039
1040 2012-10-26 Eli Zaretskii <eliz@gnu.org>
1041
1042 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1043 mouse movement events if the menu bar is active. This avoids
1044 producing a busy "hour-glass" cursor by Windows if the mouse
1045 pointer is positioned over a tooltip shown for some menu item.
1046
1047 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1048
1049 Don't assume process IDs fit in int.
1050 * emacs.c (shut_down_emacs) [!DOS_NT]:
1051 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1052 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1053 Use pid_t, not int, to store process IDs, as 'int'
1054 is not wide enough on a few platforms (e.g., AIX and IRIX).
1055
1056 2012-10-23 Kenichi Handa <handa@gnu.org>
1057
1058 The following change is to make face-font-rescale-alist work
1059 correctly for non-ASCII fonts.
1060
1061 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1062 (font_open_for_lface): Handle Vface_font_rescale_alist.
1063
1064 2012-10-23 Chong Yidong <cyd@gnu.org>
1065
1066 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1067
1068 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1069
1070 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1071 for screen font.
1072 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1073
1074 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1075 event (Bug#12681).
1076
1077 2012-10-21 Glenn Morris <rgm@gnu.org>
1078
1079 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1080
1081 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1082
1083 Port to OpenBSD 5.1.
1084 * frame.c (Fmouse_position, Fmouse_pixel_position):
1085 * xdisp.c (produce_stretch_glyph):
1086 Declare local vars only when they're needed.
1087 This is clearer and avoids a warning on OpenBSD about unused vars.
1088 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1089 This is safer, and avoids OpenBSD warnings about unused vars.
1090 * keyboard.c (record_menu_key): Remove unnecessary decl.
1091 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1092 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1093 as our definition clashes with OpenBSD's.
1094 * xfaces.c (load_face_colors, check_lface_attrs)
1095 (get_lface_attributes_no_remap, get_lface_attributes)
1096 (lface_fully_specified_p, x_supports_face_attributes_p)
1097 (tty_supports_face_attributes_p, face_fontset, realize_face)
1098 (realize_x_face, realize_tty_face):
1099 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1100 merely Lisp_Object *. This is more informative and avoids
1101 a warning on OpenBSD about accessing beyond an object's size.
1102
1103 2012-10-20 Chong Yidong <cyd@gnu.org>
1104
1105 * lread.c (Fload): Doc fix (Bug#12592).
1106
1107 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1108
1109 * font.c (Ffont_at): Fix previous change.
1110
1111 2012-10-19 Eli Zaretskii <eliz@gnu.org>
1112
1113 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1114 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1115 for the reasons.
1116
1117 * alloc.c (NSTATICS): Decrease to 0x800.
1118
1119 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
1120
1121 * fns.c (Fnreverse): Include the problem element when signalling an
1122 error (bug#12677).
1123
1124 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
1125
1126 * nsterm.m (ns_select): Check writefds before call to
1127 FD_ISSET (Bug#12668).
1128
1129 2012-10-18 Daniel Colascione <dancol@dancol.org>
1130
1131 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1132 (staticpro): If we run out of staticpro slots, die with an
1133 informative error instead of just calling emacs_abort.
1134
1135 2012-10-18 Martin Rudalics <rudalics@gmx.at>
1136
1137 Fix two flaws reported by Dmitry Antipov.
1138 * window.c (Ftemp_output_buffer_show): Remove.
1139 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1140 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1141
1142 2012-10-17 Eli Zaretskii <eliz@gnu.org>
1143
1144 * makefile.w32-in ($(BLD)/w32.$(O)):
1145 ($(BLD)/vm-limit.$(O)):
1146 ($(BLD)/term.$(O)):
1147 ($(BLD)/unexw32.$(O)):
1148 ($(BLD)/fileio.$(O)):
1149 ($(BLD)/dispnew.$(O)): Update dependencies.
1150
1151 * w32term.h (w32_initialize_display_info, initialize_w32_display):
1152 Add prototypes.
1153
1154 * w32proc.c: Include ctype.h.
1155
1156 * w32.h (init_environment, check_windows_init_file)
1157 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1158 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1159 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1160 (sys_link): Add prototypes.
1161
1162 * w32.c: Include w32select.h.
1163 (sys_access, e_malloc, sys_select): Add prototypes.
1164 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1165
1166 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1167
1168 * unexw32.c: Include lisp.h and w32.h.
1169
1170 * term.c [WINDOWSNT]: Include w32term.h.
1171
1172 * process.c [WINDOWSNT]: Add prototype of sys_select.
1173
1174 * fileio.c [WINDOWSNT]: Include w32.h.
1175
1176 * dispnew.c [WINDOWSNT]: Include w32.h.
1177
1178 * cygw32.c (Fcygwin_convert_path_to_windows)
1179 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1180 Lisp_Object values. (Bug#12661)
1181
1182 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1183 to Lisp_Object. (Bug#12661)
1184
1185 2012-10-17 Kenichi Handa <handa@gnu.org>
1186
1187 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1188 invalidate.
1189
1190 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1191
1192 * buffer.c (Fkill_buffer): When unchaining the marker,
1193 reset its buffer pointer to NULL (Bug#12652).
1194
1195 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1196
1197 Do not verify indirection counters of killed buffers (Bug#12579).
1198 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1199 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1200
1201 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1202
1203 * alloc.c (Fmake_byte_code): Fix typo in comment.
1204 * print.c (print_interval): Define as static to match prototype.
1205 * indent.c (disptab_matches_widthtab, recompute_width_table):
1206 Convert to eassert.
1207
1208 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1209
1210 * editfns.c (get_system_name): Remove.
1211 * lisp.h (get_system_name): Remove prototype.
1212 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1213 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1214
1215 2012-10-15 Daniel Colascione <dancol@dancol.org>
1216
1217 * dbusbind.c: Add comment explaining reason for previous change.
1218
1219 2012-10-15 Martin Rudalics <rudalics@gmx.at>
1220
1221 * window.c (Fwindow_end): Rewrite check whether cached position
1222 can be used (Bug#12600).
1223 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1224 Set windows_or_buffers_changed.
1225
1226 2012-10-15 Daniel Colascione <dancol@dancol.org>
1227
1228 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1229 enabled by undefining the symbol "interface", which the platform
1230 headers define to something incompatible.
1231
1232 2012-10-14 Daniel Colascione <dancol@dancol.org>
1233
1234 * image.c (init_tiff_functions, init_imagemagick_functions)
1235 (init_svg_functions): Fix cygw32 build break by using these
1236 functions only when WINDOWSNT _and_ HAVE_NTGUI.
1237
1238 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
1239
1240 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1241
1242 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
1243
1244 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1245
1246 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
1247
1248 * coding.c (detect_coding): Set coding->id before calling
1249 this->detector.
1250
1251 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
1252
1253 * fileio.c: Formatting fixes.
1254
1255 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
1256
1257 Fix some stat-related races.
1258 * fileio.c (Fwrite_region): Avoid race condition if a file is
1259 removed or renamed by some other process immediately after Emacs
1260 writes it but before Emacs stats it. Do not assume that stat (or
1261 fstat) succeeds.
1262 * image.c (slurp_file): Resolve the file name with fopen + fstat
1263 rather than stat + fopen.
1264 (pbm_read_file) [0]: Remove unused code with stat race.
1265 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1266 Remove ineffective code with stat race.
1267
1268 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
1269
1270 * doc.c (get_doc_string): Don't signal an error if the file is missing.
1271
1272 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1273
1274 * nsterm.m (hold_event_q): New static variable.
1275 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1276 ! q_event_ptr.
1277 (hold_event): New function.
1278 (ns_read_socket): If hold_event_q have events, store them and
1279 return (Bug#12384).
1280 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1281 is zero (Bug#12384).
1282
1283 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
1284
1285 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1286
1287 2012-10-12 Eli Zaretskii <eliz@gnu.org>
1288
1289 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1290
1291 * fileio.c (check_existing): New function.
1292 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1293 instead of calling 'stat', when what's needed is to check whether
1294 a file exists. This avoids expensive system calls on MS-Windows.
1295 (Bug#12587)
1296
1297 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
1298
1299 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1300 determine whether a file exists and is not a directory.
1301
1302 * lisp.h (check_existing): Add prototype.
1303
1304 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1305
1306 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1307
1308 2012-10-12 Glenn Morris <rgm@gnu.org>
1309
1310 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
1311
1312 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
1313
1314 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1315
1316 * eval.c (Fautoload): Remember previous autoload status in load-history.
1317
1318 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1319
1320 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1321 * lread.c (load_each_byte, new_backquote_flag, readchar)
1322 (read_filtered_event, lisp_file_lexically_bound_p)
1323 (safe_to_load_version, Fload, complete_filename_p, openp)
1324 (build_load_history, readevalloop, read_escape, read1)
1325 (string_to_number, read_vector, read_list):
1326 * macros.c (Fstart_kbd_macro):
1327 * marker.c (CONSIDER):
1328 * menu.c (parse_single_submenu, digest_single_submenu)
1329 (find_and_return_menu_selection, Fx_popup_menu):
1330 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1331 (Ftry_completion):
1332 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1333 (ns_menu_show):
1334 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1335 (xmenu_show, xdialog_show):
1336 Use bool for booleans.
1337 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1338 as it's not a predicate. All uses changed. Omit unnecessary
1339 buffer termination.
1340
1341 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
1342
1343 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1344 (save_excursion_restore): Do not restore mark if it was not saved.
1345
1346 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1347
1348 * marker.c (cached_modiff): EMACS_INT, not int.
1349
1350 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1351 instead of having a wrong decl.
1352 * nsmenu.m (waiting_for_input): Remove wrong decl.
1353
1354 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1355
1356 keyboard.c, keymap.c: Use bool for booleans.
1357 * dispnew.c (sit_for): Distinguish between 3-way display_option
1358 and boolean do_display.
1359 * keyboard.c (single_kboard, this_command_key_count_reset)
1360 (waiting_for_input, echoing, immediate_quit, input_pending)
1361 (interrupt_input, interrupts_deferred, pop_kboard)
1362 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1363 (command_loop_1, adjust_point_for_property)
1364 (safe_run_hooks_error, input_polling_used, read_char):
1365 (help_char_p, readable_events, kbd_buffer_events_waiting)
1366 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1367 (lucid_event_type_list_p, get_input_pending):
1368 (gobble_input, menu_separator_name_p, menu_bar_item)
1369 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1370 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1371 (keyremap_step, test_undefined, read_key_sequence)
1372 (detect_input_pending, detect_input_pending_ignore_squeezables)
1373 (detect_input_pending_run_timers, requeued_events_pending_p)
1374 (quit_throw_to_read_char, Fset_input_interrupt_mode):
1375 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
1376 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
1377 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
1378 (accessible_keymaps_1, Fkey_description, push_key_description):
1379 (shadow_lookup, struct where_is_internal_data)
1380 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
1381 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
1382 (describe_map, describe_vector):
1383 * menu.c (single_menu_item):
1384 * nsmenu.m (ns_update_menubar):
1385 * process.c (wait_reading_process_output):
1386 * search.c (scan_buffer, scan_newline):
1387 Use bool for boolean.
1388 * keyboard.c (timers_run, swallow_events)
1389 (detect_input_pending_run_timers):
1390 * process.c (wait_reading_process_output):
1391 Use unsigned for counter where wraparound-on-overflow is desired,
1392 since unsigned is guaranteed to have that behavior and signed is not.
1393 (read_char): Use ptrdiff_t for string length.
1394 (get_input_pending): Remove first argument, since it was always
1395 the same pointer-to-int (now pointer-to-boolean) &input_pending,
1396 and behave as if it had that value. Return new value of
1397 input_pending. All callers changed.
1398 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
1399 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
1400 a string length.
1401 * keymap.c (push_key_description): Omit last arg, which was always 1.
1402 All callers changed.
1403
1404 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
1405
1406 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
1407
1408 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
1409 ($(BLD)/term.$(O)): Update dependencies.
1410
1411 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1412
1413 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
1414 * lisp.h (enum pvec_type): Adjust comments and omit explicit
1415 initializer for PVEC_NORMAL_VECTOR.
1416
1417 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1418
1419 Clean out old termopts cruft.
1420 * termopts.h (flow_control, meta_key): Remove unused decls.
1421 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
1422 Don't include termopts.h.
1423
1424 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1425
1426 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
1427
1428 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1429
1430 * commands.h (immediate_quit): Remove duplicate decl.
1431
1432 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
1433
1434 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
1435 caching.
1436 (nsfont_open): Remove setting of Vfonts_in_cache.
1437 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
1438
1439 2012-10-09 Eli Zaretskii <eliz@gnu.org>
1440
1441 * w32fns.c (w32_last_error): Change the return value to DWORD, to
1442 match what GetLastError returns. Explain why the function is
1443 needed.
1444
1445 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
1446 'is_tooltip_frame', to avoid confusion with its global namesake.
1447
1448 2012-10-08 Daniel Colascione <dancol@dancol.org>
1449
1450 * xdisp.c (start_hourglass): Call w32_note_current_window when
1451 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
1452 build that caused Emacs to display the hourglass cursor forever.
1453
1454 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
1455 which is broken under remote desktop, calculate the number of
1456 colors available for a display based on the display's number of
1457 planes and number of bits per pixel per plane. (bug#10397).
1458
1459 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
1460
1461 * nsfont.m (Vfonts_in_cache): New variable.
1462 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
1463 are used. Add cached fonts to Vfonts_in_cache.
1464 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
1465
1466 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
1467
1468 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
1469 in nt/config.nt.
1470 (FONT_H): Define after FRAME_H.
1471 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
1472 Update dependencies.
1473
1474 * w32term.c: Remove leftover declaration of keyboard_codepage.
1475
1476 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1477
1478 * makefile.w32-in (FONT_H): Add $(FRAME_H).
1479 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
1480 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
1481 (GLOBAL_SOURCES): Add cygw32.c.
1482 ($(BLD)/unexw32.$(O)):
1483 ($(BLD)/w32.$(O)):
1484 ($(BLD)/w32console.$(O)):
1485 ($(BLD)/w32fns.$(O)):
1486 ($(BLD)/w32heap.$(O)):
1487 ($(BLD)/w32menu.$(O)):
1488 ($(BLD)/w32proc.$(O)): Add w32common.h.
1489
1490 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
1491 'const char *'.
1492 (x_to_w32_color): Don't modify the argument, modify a copy instead.
1493
1494 2012-10-08 Daniel Colascione <dancol@dancol.org>
1495
1496 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
1497 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
1498 accidental message numbering hole. Change other messages to
1499 match.
1500
1501 * w32select.h (HAVE_W32SELECT): Remove.
1502
1503 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1504 w32common.h instead of w32heap.h.
1505
1506 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
1507 (get_allocation_unit, get_processor_type, get_w32_major_version)
1508 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1509 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1510 (OS_NT, os_subtype, cache_system_info): Move declarations to
1511 w32common.
1512
1513 * w32heap.c: Include w32common.h.
1514 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
1515 (w32_minor_version, w32_build_number, w32_subtype):
1516 Remove duplicate definitions.
1517
1518 * w32fns.c: Include w32common.h; include w32heap.h only in
1519 WINDOWSNT.
1520
1521 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
1522 Use `report_file_error' instead of `error' in order to better
1523 inform users of what went wrong. Increase NTGUI_UNICODE file
1524 dialog box file name length to 32k, the maximum allowed by the NT
1525 kernel.
1526
1527 * w32common.h: New file.
1528 (ROUND_UP, ROUND_DOWN, get_page_size)
1529 (get_allocation_unit, get_processor_type, get_w32_major_version)
1530 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1531 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1532 (OS_NT, os_subtype, cache_system_info): Move here.
1533
1534 * unexw32.c, unexcw.c: Include w32common.h.
1535
1536 * emacs.c (main): Use (defined (WINDOWSNT) || defined
1537 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1538 to call syms_of_w32select.
1539
1540 * cygw32.h: Remove obsolete EXFUN declarations.
1541
1542 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1543
1544 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1545 of w32inevt.o from SOME_MACHINE_OBJECTS.
1546
1547 2012-10-08 Daniel Colascione <dancol@dancol.org>
1548
1549 * image.c: Permanent fix for JPEG compilation issue --- limit
1550 jpeglib `boolean' redefinition to Cygwin builds.
1551
1552 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1553
1554 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1555
1556 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1557 Cygwin.
1558
1559 2012-10-08 Daniel Colascione <dancol@dancol.org>
1560
1561 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1562 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1563 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1564 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1565 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1566 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1567 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1568 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1569 now a supported configuration.
1570
1571 * Makefile.in: consolidate image variables into LIBIMAGE; add
1572 W32_OBJ and W32_LIBS. Compile new files.
1573
1574 * conf_post.h:
1575 (_DebPrint) declare tracing facility for W32 debugging. We need
1576 to unify tracing later.
1577
1578 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1579 unconditional use of W32 Unicode functions. Cygwin runs only on
1580 100% Unicode operating systems.
1581
1582 * cygw32.c: New file. Define Cygwin-specific facilities.
1583 (Fcygwin_convert_path_to_windows)
1584 (Fcygwin_convert_path_from_windows): New user functions for
1585 accessing Cygwin path-munging routines.
1586
1587 * cygw32.h: New file.
1588 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1589 UTF-16LE strings temporarily inside non-Lisp-visible string
1590 objects.
1591
1592 (w32_strerror): Just what it says on the tin.
1593
1594 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1595 also run for Cygwin; both systems have the same problem with using
1596 GUI facilities in a forked child. Also call syms_of_cygw32,
1597 syms_of_w32select in correct places.
1598
1599 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1600 needs fork-then-exec for daemon launching.
1601
1602 * font.h: Include frame.h.
1603
1604 * image.c: Use the image library cache machinery only when we're
1605 compiling for native WINDOWSNT; Cygwin can use shared libraries
1606 like any other Unixlike system.
1607
1608 * keyboard.c: Clarify a comment regarding the input loop.
1609
1610 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1611 functions directly instead of trying to detect at runtime that our
1612 host operating system supports them. We make this change for two
1613 reasons: Cygwin lacks support for the multibyte character
1614 conversion functions used by the legacy menu code, and Cygwin
1615 never needs to rely on non-Unicode APIs.
1616
1617 * unexw32.c (hinst): Declare extern.
1618
1619 * w32.c: Change header order;
1620 (w32_strerror): Move to w32fns.c because we need it for
1621 non-WINDOWSNT builds.
1622
1623 * w32.h: Add #error macro to make sure we don't include w32.h for
1624 Cygwin builds. Remove w32select declarations.
1625
1626 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1627 w32fns.c. w32console.c is WINDOWSNT-only.
1628
1629 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1630 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
1631 POSIXy alternative.
1632 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1633 (w32_major_version, w32_minor_version, w32_build_number)
1634 (os_subtype, sound_type): Define here
1635 (w32_defined_color): Make color parameter const for consistency
1636 with other _defined_color functions.
1637 (w32_createwindow): Unconditionally call w32_init_class instead of
1638 doing so only when hprevinst is non-NULL. Plumbing hprevinst
1639 through the code is complex and unnecessary because class
1640 registration is practically free.
1641 (w32_name_of_message): New EMACSDEBUG-only function.
1642 (Fset_message_beep): Move here
1643 (Fx_open_connection): Require that the display name for Windows be
1644 "w32" for consistency, emacsclient disambiguation, and maybe, one
1645 day, multi-window-system support.
1646 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1647 Cygwin files for W32 GUI facilities, since these clearly don't
1648 expect Cygwin names.
1649 (_DebPrint): Define.
1650 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1651 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1652 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1653 (w32_last_error): Remove.
1654
1655 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1656
1657 * w32heap.c (syspage_mask): Declare here.
1658 (cache_system_info): Remove.
1659
1660 * w32inevt.c (faked_key): Define globally, not statically.
1661 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1662 (w32_console_toggle_lock_key): Move to w32fns.c.
1663
1664 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
1665
1666 * w32proc.c (_DebPrint): Move to w32fns.c.
1667 * w32select.c: Include string.h, stdio.h for Cygwin.
1668 * w32select.h: New File.
1669
1670 * w32term.c: Include io.h for non-CYGWIN builds; needed for
1671 get_osfhandle.
1672 (w32_message_fd): New variable. Under Cygwin, holds the file
1673 descriptor the system used to tell us about pending thread
1674 messages.
1675
1676 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1677 that prevented compilation under non-WINDOWSNT systems.
1678
1679 (w32_initialize): Open /dev/windows and assign it to
1680 w32_message_fd. Provide w32 feature.
1681
1682 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1683 (WM_EMACS_INPUT_READY): add.
1684 (prepend_msg, w32_message_fd): Declare globally.
1685
1686 * w32xfns.c:
1687 (keyboard_handle): Use only when WINDOWSNT.
1688 (notify_msg_ready): New function. Posts a message to the main
1689 thread's message queue under CYGWIN, which wakes up the main
1690 thread from select(2) by making the /dev/windows file descriptor
1691 ready. Under WINDOWSNT, it sets an event the same way the old
1692 code did.
1693
1694 (post, prepend_msg): Actually call notify_msg_ready instead of
1695 setting the input event directly.
1696
1697 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1698
1699 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1700 but it still has blocs in it, don't return it to the system,
1701 instead of aborting. (Bug#12402)
1702
1703 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1704
1705 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1706
1707 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1708 MAC_OS_X_VERSION_10_6.
1709 (syms_of_nsterm): Remove comment about Panther and above for
1710 ns-antialias-text.
1711 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1712 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1713 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1714
1715 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1716 MAC_OS_X_VERSION_10_4.
1717
1718 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1719 MAC_OS_X_VERSION_10_2.
1720
1721 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1722
1723 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1724 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1725
1726 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1727 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1728 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1729 Remove ns_in_resize check.
1730 (ns_clear_frame_area): Remove resize handle code.
1731
1732 * nsfns.m (ns_in_resize): Remove.
1733 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1734 Remove ns_in_resize check.
1735
1736 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1737
1738 Improve sys_siglist detection.
1739 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1740 defined as a macro, as is done in Solaris.
1741 (sys_siglist_entries): New macro.
1742 (save_strsignal): Use it.
1743 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1744 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1745
1746 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1747
1748 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1749 fullscreen/Fullscreen.
1750
1751 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1752 tobar_height is new.
1753
1754 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1755 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1756 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1757 (windowDidResize:): Check for correct window if old style fullscreen.
1758 Capitalize word in comment. Remove incorrect comment.
1759 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1760 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1761 error in drawing background.
1762 (toggleFullScreen:): Remove comment. Rearrange calls.
1763 Set toolbar values to zero, save old height in tobar_height.
1764 Restore tool bar height when leaving fullscreen.
1765 (canBecomeMainWindow): New function.
1766
1767 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1768
1769 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1770
1771 2012-10-05 Eli Zaretskii <eliz@gnu.org>
1772
1773 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1774
1775 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1776 that time stamps of directories could also be changed.
1777 Don't request the too broad GENERIC_WRITE, only the more restrictive
1778 FILE_WRITE_ATTRIBUTES access rights.
1779
1780 * fileio.c (Fset_file_times): Special-case ignoring errors for
1781 directories only on MSDOS, not on MS-Windows.
1782
1783 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
1784
1785 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1786
1787 2012-10-04 Eli Zaretskii <eliz@gnu.org>
1788
1789 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1790 see whether CreateFile failed.
1791
1792 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1793
1794 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1795 to avoid similar races.
1796 * keyboard.c (pending_signals): Now bool, not int.
1797
1798 Port timers to OpenBSD, plus check for timer failures.
1799 OpenBSD problem reported by Han Boetes.
1800 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1801 and/or setitimer.
1802 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1803 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1804 like OpenBSD, which has timer_settime but does not declare it.
1805 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1806 whether to use itimerspec-related primitives. All uses of
1807 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1808
1809 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1810
1811 * profiler.c (handle_profiler_signal): Fix a malloc race
1812 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1813
1814 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1815
1816 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1817
1818 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1819
1820 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1821 consistent with the change in return value of 'safe_strsignal'.
1822
1823 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1824
1825 Prefer plain 'static' to 'static inline' (Bug#12541).
1826 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1827 (bidi_set_sor_type, bidi_push_embedding_level)
1828 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1829 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1830 (bidi_cache_search, bidi_cache_ensure_space)
1831 (bidi_cache_iterator_state, bidi_cache_find)
1832 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1833 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1834 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1835 Now 'static', not 'static inline'.
1836
1837 Count overruns when profiling; change units to ns.
1838 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1839 Give extra weight to samples after overruns, to attempt to count
1840 the time more accurately.
1841 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1842 the underlying primitives nominally do ns.
1843 (Fprofiler_cpu_start): Document the change. Mention that
1844 the sampling intervals are only approximate.
1845
1846 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1847
1848 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1849
1850 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1851 case for the special 0 coding-system.
1852
1853 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1854 (Fmake_overlay): Remove redundant tests.
1855 (fix_start_end_in_overlays): Remove redundant recentering.
1856
1857 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1858
1859 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1860 Update dependencies.
1861
1862 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1863
1864 Fix a malloc race condition involving strsignal.
1865 A signal can arrive in the middle of a malloc, and Emacs's signal
1866 handler can invoke strsignal, which can invoke malloc, which is
1867 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1868 Fix it by altering the signal handler so that it does not invoke
1869 strsignal.
1870 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1871 * process.c (status_message): Use const pointer, in case strsignal
1872 is #defined to safe_strsignal.
1873 * sysdep.c (sys_siglist, init_signals): Always define and
1874 initialize a substitute sys_siglist if the system does not define
1875 one, even if HAVE_STRSIGNAL.
1876 (safe_strsignal): Rename from strsignal. Always define,
1877 using sys_siglist. Return a const pointer.
1878 * syssignal.h (safe_strsignal): New decl.
1879 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1880
1881 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1882
1883 * w32proc.c (timer_loop): Fix code that waits for timer
1884 expiration, to avoid high CPU usage.
1885
1886 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1887
1888 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1889 (sweep_weak_table): Remove redundant prototypes.
1890
1891 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1892
1893 * emacs.c: Move the inclusion of TERM_HEADER after including
1894 windows.h on WINDOWSNT. This avoids compilation problems with
1895 MSVC.
1896
1897 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1898
1899 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1900 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1901 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1902 as the previous version used 'void *'.
1903
1904 * ralloc.c (ROUNDUP): Fix last change.
1905 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1906 'size_t'.
1907
1908 * w32proc.c <disable_itimers>: New static flag.
1909 (init_timers): Initialize it to zero, after creating the critical
1910 sections used by the timer threads.
1911 (term_timers): Set to 1 before deleting the critical sections.
1912 (getitimer, setitimer): If disable_itimers is non-zero, return an
1913 error indication without doing anything. Reported by Fabrice
1914 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1915 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1916 return results.
1917 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1918 support timers.
1919
1920 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1921 term_ntproc after all the other bookkeeping, to get timers working
1922 as long as possible.
1923
1924 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1925
1926 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1927 Suggested by Juri Linkov in
1928 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1929
1930 Prefer plain 'static' to 'static inline' (Bug#12541).
1931 With static functions, modern compilers inline pretty well by
1932 themselves; advice from programmers often hurts as much as it helps.
1933 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1934 this change shrinks the text size of the Emacs executable by 1.1%
1935 without affecting CPU significantly in my benchmark.
1936 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1937 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1938 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1939 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1940 (bset_auto_fill_function, bset_auto_save_file_format)
1941 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1942 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1943 (bset_cache_long_line_scans, bset_case_fold_search)
1944 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1945 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1946 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1947 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1948 (bset_header_line_format, bset_indicate_buffer_boundaries)
1949 (bset_indicate_empty_lines, bset_invisibility_spec)
1950 (bset_left_fringe_width, bset_major_mode, bset_mark)
1951 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1952 (bset_name, bset_overwrite_mode, bset_pt_marker)
1953 (bset_right_fringe_width, bset_save_length)
1954 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1955 (bset_scroll_up_aggressively, bset_selective_display)
1956 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1957 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1958 (set_buffer_overlays_after):
1959 * category.c (bset_category_table):
1960 * charset.c (read_hex):
1961 * coding.c (produce_composition, produce_charset)
1962 (handle_composition_annotation, handle_charset_annotation)
1963 (char_encodable_p):
1964 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1965 (assign_row, set_frame_matrix_frame, make_current)
1966 (add_row_entry):
1967 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1968 * fns.c (maybe_resize_hash_table):
1969 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1970 * gmalloc.c (register_heapinfo):
1971 * image.c (lookup_image_type):
1972 * intervals.c (set_interval_object, set_interval_left)
1973 (set_interval_right, copy_interval_parent, rotate_right)
1974 (rotate_left, balance_possible_root_interval):
1975 * keyboard.c (kset_echo_string, kset_kbd_queue)
1976 (kset_keyboard_translate_table, kset_last_prefix_arg)
1977 (kset_last_repeatable_command, kset_local_function_key_map)
1978 (kset_overriding_terminal_local_map, kset_real_last_command)
1979 (kset_system_key_syms, clear_event, set_prop):
1980 * lread.c (digit_to_number):
1981 * marker.c (attach_marker, live_buffer, set_marker_internal):
1982 * nsterm.m (ns_compute_glyph_string_overhangs):
1983 * process.c (pset_buffer, pset_command)
1984 (pset_decode_coding_system, pset_decoding_buf)
1985 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1986 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1987 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1988 * syntax.c (bset_syntax_table, dec_bytepos):
1989 * terminal.c (tset_param_alist):
1990 * textprop.c (interval_has_some_properties)
1991 (interval_has_some_properties_list):
1992 * window.c (wset_combination_limit, wset_dedicated)
1993 (wset_display_table, wset_hchild, wset_left_fringe_width)
1994 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1995 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1996 (wset_right_fringe_width, wset_right_margin_cols)
1997 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1998 (wset_vertical_scroll_bar_type, wset_window_parameters):
1999 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2000 (wset_column_number_displayed, wset_region_showing)
2001 (window_box_edges, run_window_scroll_functions)
2002 (append_glyph_string_lists, prepend_glyph_string_lists)
2003 (append_glyph_string, set_glyph_string_background_width)
2004 (append_glyph, append_composite_glyph)
2005 (take_vertical_position_into_account):
2006 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2007 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2008 (lface_hash, lface_same_font_attributes_p, lookup_face):
2009 * xml.c (libxml2_loaded_p):
2010 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2011 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2012 Now 'static', not 'static inline'.
2013
2014 * bidi.c: Tune.
2015 (bidi_copy_it): Do the whole copy with a single memcpy.
2016 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2017
2018 Revert the FOLLOW-SYMLINKS change for file-attributes.
2019 Doing it right would require several changes to Tramp, and there's
2020 not enough time to get that tested before the freeze today.
2021 * dired.c (directory_files_internal, Ffile_attributes):
2022 Undo last change.
2023
2024 * frame.c (x_report_frame_params): Port better to wider ints.
2025 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2026 or that pointers can be printed in 15 decimal digits.
2027 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2028
2029 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2030
2031 Support x64 build on MS-Windows.
2032 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2033 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2034 compatibility with x64.
2035 (x_get_focus_frame): Add prototype.
2036
2037 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2038 defining an XRectangle structure.
2039
2040 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2041 arithmetics for compatibility with x64.
2042
2043 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2044 compatibility with x64.
2045
2046 * w32heap.h: Adjust prototypes and declarations.
2047
2048 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2049 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2050 DWORD, long, and unsigned long, for compatibility with x64.
2051 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2052 (sbrk): Argument is now of type ptrdiff_t.
2053
2054 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2055 less than 0x0500.
2056 (w32_msg_pump): Use WPARAM type for 'result'.
2057
2058 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2059 architecture.
2060 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2061 compatibility with x64.
2062
2063 * vm-limit.c (lim_data): Now size_t.
2064 (check_memory_limits): Adjust prototypes of real_morecore and
2065 __morecore to receive argument of type ptrdiff_t. Use size_t for
2066 five_percent and data_size.
2067
2068 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2069 variables, for compatibility with x64.
2070 (rva_to_section, offset_to_section, relocate_offset)
2071 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2072 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2073 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2074 for compatibility with x64.
2075
2076 * sysdep.c (STDERR_FILENO): Define if not already defined.
2077
2078 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2079 (__morecore): Argument type is now ptrdiff_t.
2080 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2081 (relinquish): Use ptrdiff_t type for 'excess'.
2082 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2083
2084 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2085 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2086 instead of a literal number.
2087
2088 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2089 (min): Define only if not already defined.
2090
2091 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2092 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2093 hosts.
2094
2095 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2096 'bitmaps' is a pointer.
2097
2098 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2099
2100 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2101
2102 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2103
2104 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2105 * dired.c (directory_files_internal, Ffile_attributes):
2106 New arg follow_symlinks. All uses changed.
2107
2108 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2109
2110 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2111
2112 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2113
2114 Support atimers and CPU profiler via profile.c on MS-Windows.
2115 * w32proc.c (sig_mask, crit_sig): New static variables.
2116 (sys_signal): Support SIGALRM and SIGPROF.
2117 (sigemptyset, sigaddset, sigfillset, sigprocmask)
2118 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
2119 sigfillset, and sigprocmask are no longer no-ops.
2120 (sigismember): New function.
2121 (struct itimer_data): New definition.
2122 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2123 (crit_prof): New static variables.
2124 (MAX_SINGLE_SLEEP): New definition.
2125 (timer_loop, stop_timer_thread, term_timers, init_timers)
2126 (start_timer_thread, getitimer, setitimer): New functions.
2127 (alarm): No longer a no-op, calls setitimer.
2128
2129 * w32.c (term_ntproc): Call term_timers.
2130 (init_ntproc): Make sure all signals are unblocked at startup, to
2131 erase any traces of dumping. Call init_timers.
2132
2133 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2134 Windows-specific code to display the hourglass mouse pointer is no
2135 longer used.
2136 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2137 to hourglass timer expiration.
2138 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2139 Remove, no longer used.
2140 (w32_note_current_window, show_hourglass, hide_hourglass):
2141 New functions, in support of hourglass cursor display similar to other
2142 window systems.
2143 (syms_of_w32fns): Don't initialize hourglass_timer.
2144
2145 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2146 WINDOWSNT as well.
2147 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2148
2149 * w32.h (init_timers, term_timers): Add prototypes.
2150
2151 2012-09-30 Kenichi Handa <handa@gnu.org>
2152
2153 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2154 to the buffer relocation which may be caused by ccl_driver.
2155
2156 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2157
2158 * xfns.c (Fx_file_dialog): Update comment.
2159
2160 * w32fns.c (Fx_file_dialog): Update comment.
2161
2162 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2163 Initialize panel name field if OSX >= 10.6.
2164
2165 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2166
2167 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2168
2169 * nsterm.m (NEW_STYLE_FS): New define.
2170 (ns_fullscreen_hook, windowWillEnterFullScreen)
2171 (windowDidEnterFullScreen, windowWillExitFullScreen)
2172 (windowDidExitFullScreen, toggleFullScreen, handleFS)
2173 (setFSValue): New functions.
2174 (EmacsFSWindow): New implementation.
2175 (canBecomeKeyWindow): New function for EmacsFSWindow.
2176 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2177 (dealloc): Release nonfs_window if in fullscreen.
2178 (updateFrameSize:): Call windowDidMove to update top/left.
2179 (windowWillResize:toSize:): Check if frame is still maximized.
2180 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2181 next_maximized, maximized_width, maximized_height and nonfs_window.
2182 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
2183 tbar_height.
2184 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2185 fullscreen. Set maximized_width/height. Act on next_maximized.
2186
2187 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2188 (EmacsView): Add variables for fullscreen.
2189 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2190 (EmacsFSWindow): New interface for fullscreen.
2191
2192 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
2193
2194 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2195
2196 2012-09-30 Chong Yidong <cyd@gnu.org>
2197
2198 * fns.c (Frandom): Doc fix.
2199
2200 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2201
2202 * window.c (Vwindow_combination_limit): New default value.
2203 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2204
2205 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2206
2207 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2208 Suggested by Eli Zaretskii in
2209 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2210
2211 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2212
2213 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2214 HAVE_TIMER_SETTIME is defined.
2215
2216 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2217
2218 Profiler improvements: more-accurate timers, overflow checks.
2219 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2220 signal.h, setjmp.h. Include systime.h instead.
2221 (saturated_add): New function.
2222 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2223 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2224 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2225 New static vars.
2226 (enum profiler_cpu_running): New enum.
2227 (profiler_cpu_running): Now of that enum type, not bool.
2228 All uses changed to store the new value.
2229 (handle_profiler_signal): Rename from sigprof_handler_1,
2230 for consistency with other handlers. Do not check whether
2231 cpu_log is a hash-table if garbage collecting, since it
2232 doesn't matter in that case.
2233 (deliver_profiler_signal): Rename from sigprof_handler,
2234 for consistency with other handlers.
2235 (setup_cpu_timer): New function, with much of what used to be in
2236 Fprofiler_cpu_start. Check for out-of-range argument.
2237 Prefer timer_settime if available, and prefer
2238 thread cputime clocks, then process cputime clocks, then
2239 monotonic clocks, to the old realtime clock. Use make_timeval
2240 to round more-correctly when falling back to setitimer.
2241 (Fprofiler_cpu_start): Use it.
2242 (Fprofiler_cpu_stop): Prefer timer_settime if available.
2243 Don't assume that passing NULL as the 2nd argument of setitimer
2244 is the same as passing a pointer to all-zero storage.
2245 Ignore SIGPROF afterwards.
2246 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2247 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2248 non-fatal signal handlers. Ignore SIGPROF on startup.
2249 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2250 in profiler.c, since sysdep.c now uses it.
2251
2252 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2253 Suggested by Eli Zaretskii in
2254 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2255
2256 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
2257
2258 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2259
2260 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2261
2262 * lisp.h (struct backtrace): Remove indirection for `function' field.
2263 * xdisp.c (redisplay_internal):
2264 * profiler.c (record_backtrace, sigprof_handler_1):
2265 * alloc.c (Fgarbage_collect):
2266 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2267 (Fbacktrace_frame): Adjust accordingly.
2268
2269 2012-09-28 Glenn Morris <rgm@gnu.org>
2270
2271 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2272 (Frun_hook_with_args_until_failure): Doc fixes.
2273
2274 2012-09-28 Eli Zaretskii <eliz@gnu.org>
2275
2276 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2277 Qautomatic_redisplay and change the symbol name. All users changed.
2278
2279 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
2280
2281 * profiler.c (sigprof_handler): Fix race condition.
2282
2283 2012-09-28 Glenn Morris <rgm@gnu.org>
2284
2285 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
2286
2287 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
2288
2289 Check more robustly for timer_settime.
2290 * Makefile.in (LIB_TIMER_TIME): New macro.
2291 (LIBES): Add it.
2292 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2293 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2294 call timer_settime.
2295
2296 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2297
2298 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2299
2300 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
2301
2302 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2303
2304 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
2305
2306 * character.h (MAYBE_UNIFY_CHAR): Remove.
2307 * charset.c, charset.h (maybe_unify_char): Now static.
2308 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2309 Since this stuff is now private to charset.c, there's no need for
2310 a public macro and no need to inline by hand.
2311
2312 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2313 Stefan Monnier <monnier@iro.umontreal.ca>
2314 Juanma Barranquero <lekktu@gmail.com>
2315
2316 * profiler.c: New file.
2317 * Makefile.in (base_obj): Add profiler.o.
2318 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2319 ($(BLD)/profiler.$(O)): New target.
2320 * emacs.c (main): Call syms_of_profiler.
2321 * alloc.c (Qautomatic_gc): New constant.
2322 (MALLOC_PROBE): New macro.
2323 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2324 (total_bytes_of_live_objects): New function.
2325 (Fgarbage_collect): Use it. Record itself in backtrace_list.
2326 Call malloc_probe for the memory profiler.
2327 (syms_of_alloc): Define Qautomatic_gc.
2328 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2329 race condition.
2330 (struct backtrace): Move definition...
2331 * lisp.h (struct backtrace): ..here.
2332 (Qautomatic_gc, profiler_memory_running): Declare vars.
2333 (malloc_probe, syms_of_profiler): Declare functions.
2334 * xdisp.c (Qautomatic_redisplay): New constant.
2335 (redisplay_internal): Record itself in backtrace_list.
2336 (syms_of_xdisp): Define Qautomatic_redisplay.
2337
2338 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2339 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2340
2341 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2342
2343 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
2344
2345 Prefer POSIX timers if available.
2346 They avoid a race if the timer is too close to the current time.
2347 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2348 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
2349 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
2350
2351 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2352
2353 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2354 CHAR_STRING_ADVANCE.
2355 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2356 STRING_CHAR_ADVANCE.
2357
2358 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2359
2360 Move Vlibrary_cache to emacs.c and reset before dumping.
2361
2362 * lisp.h (reset_image_types): Declare.
2363 [WINDOWSNT] (Vlibrary_cache): Declare.
2364
2365 * image.c (reset_image_types): New function.
2366
2367 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2368 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2369 (Fdump_emacs): Reset Vlibrary_cache and image_types.
2370
2371 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2372 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
2373
2374 * w32.h (Vlibrary_cache): Do not declare.
2375
2376 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2377
2378 * w32proc.c (sys_signal): Handle all signals defined by the
2379 MS-Windows runtime, not just SIGCHLD. Actually install the signal
2380 handlers for signals supported by Windows. Don't override
2381 term_ntproc as the handler for SIGABRT.
2382 (sigaction): Rewrite to call sys_signal instead of duplicating its
2383 code.
2384 (sys_kill): Improve commentary.
2385
2386 * w32.c (term_ntproc): Accept (and ignore) one argument, for
2387 consistency with a signature of a signal handler. All callers
2388 changed.
2389 (init_ntproc): Accept an argument DUMPING. If dumping, don't
2390 install term_ntproc as a signal handler for SIGABRT, as that
2391 should be done by the dumped Emacs.
2392
2393 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
2394
2395 * w32select.c (term_w32select): Protect against repeated
2396 invocation by setting clipboard_owner to NULL after calling
2397 DestroyWindow.
2398
2399 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
2400 and term_ntproc to their modified signatures.
2401
2402 * character.c (char_string, string_char): Remove calls to
2403 MAYBE_UNIFY_CHAR. See the discussion starting at
2404 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
2405 for the details.
2406
2407 2012-09-25 Chong Yidong <cyd@gnu.org>
2408
2409 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
2410
2411 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
2412
2413 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
2414 when encountering an unknown bytecode.
2415
2416 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
2417
2418 image.c, indent.c: Use bool for booleans.
2419 * dispextern.h (struct image_type): Members valid_p, load, init
2420 now return bool, not int. All uses changed.
2421 * image.c: Omit unnecessary static decls.
2422 (x_create_bitmap_mask, x_build_heuristic_mask):
2423 Return void, not int, since callers don't care about the return value.
2424 (x_create_bitmap_mask, define_image_type, valid_image_p)
2425 (struct image_keyword, parse_image_spec, image_spec_value)
2426 (check_image_size, image_background)
2427 (image_background_transparent, x_clear_image_1)
2428 (postprocess_image, lookup_image, x_check_image_size)
2429 (x_create_x_image_and_pixmap, xbm_image_p)
2430 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
2431 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
2432 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
2433 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
2434 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
2435 (png_image_p, init_png_functions, png_load_body, png_load)
2436 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
2437 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
2438 (init_gif_functions, gif_load, imagemagick_image_p)
2439 (imagemagick_load_image, imagemagick_load, svg_image_p)
2440 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
2441 (gs_load):
2442 * nsimage.m (ns_load_image):
2443 * nsterm.m (ns_defined_color):
2444 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
2445 * xfns.c (x_defined_color):
2446 * xterm.c (x_alloc_lighter_color_for_widget)
2447 (x_alloc_nearest_color_1, x_alloc_nearest_color)
2448 (x_alloc_lighter_color):
2449 * indent.c (disptab_matches_widthtab, current_column)
2450 (scan_for_column, string_display_width, indented_beyond_p)
2451 (compute_motion, vmotion, Fvertical_motion):
2452 Use bool for booleans.
2453
2454 2012-09-24 Chong Yidong <cyd@gnu.org>
2455
2456 * chartab.c (Fset_char_table_default): Obsolete function removed.
2457
2458 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2459
2460 Move pid_t related decls out of lisp.h.
2461 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
2462 (interruptible_wait_for_termination):
2463 Move these decls from lisp.h to syswait.h, since they use pid_t.
2464 Needed on FreeBSD; see Herbert J. Skuhra in
2465 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
2466 * callproc.c: Include syswait.h.
2467
2468 gnutls.c, gtkutil.c: Use bool for boolean.
2469 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
2470 (emacs_gnutls_handle_error):
2471 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
2472 (xg_hide_tooltip, xg_create_frame_widgets)
2473 (create_dialog, xg_uses_old_file_dialog)
2474 (xg_get_file_with_chooser, xg_get_file_with_selection)
2475 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
2476 (xg_item_label_same_p, xg_update_menubar)
2477 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
2478 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
2479 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
2480 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
2481 (update_frame_tool_bar, free_frame_tool_bar):
2482 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
2483 * nsmenu.m (ns_update_menubar):
2484 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
2485 * xfns.c (Fx_show_tip) [USE_GTK]:
2486 Use bool for boolean.
2487 * gtkutil.c (xg_update_frame_menubar):
2488 * xmenu.c (update_frame_menubar):
2489 Return void, not int, since caller ignores return value.
2490 * gtkutil.c (xg_change_toolbar_position):
2491 Return void, not 1.
2492
2493 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2494
2495 * makefile.w32-in (BLOCKINPUT_H): Remove.
2496 (SYSSIGNAL_H): New macro.
2497 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
2498 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
2499 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
2500 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
2501 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
2502 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
2503 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
2504 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
2505 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
2506 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
2507 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
2508 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
2509 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
2510 ($(BLD)/w32xfns.$(O)): Update dependencies.
2511
2512 2012-09-23 Eli Zaretskii <eliz@gnu.org>
2513
2514 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
2515 fatal_error_backtrace.
2516
2517 * w32proc.c (sys_kill): Undo last change: don't do anything when
2518 invoked to deliver SIGABRT to our own process. This is now
2519 handled by emacs_raise.
2520
2521 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2522
2523 * w32term.c (w32_read_socket): Remove leftover reference to
2524 interrupt_input_pending.
2525
2526 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2527
2528 Do not use SA_NODEFER.
2529 Problem reported by Dani Moncayo in
2530 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2531 * alloc.c (die):
2532 * sysdep.c (emacs_abort): Do not reset signal handler.
2533 * emacs.c (terminate_due_to_signal): Reset signal handler here.
2534 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
2535 wanted even on POSIXish hosts, and it doesn't work on Windows.
2536
2537 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2538
2539 * xterm.c (x_term_init): Call fixup_locale before and after calling
2540 gtk_init (Bug#12392).
2541
2542 2012-09-23 Chong Yidong <cyd@gnu.org>
2543
2544 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2545 Vdynamic_library_alist.
2546
2547 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2548 (Fgnutls_available_p): Caller changed.
2549
2550 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2551 (Flibxml_parse_xml_region): Likewise.
2552
2553 * dispextern.h (struct image_type): Remove arg from init function.
2554
2555 * image.c (Finit_image_library, lookup_image_type)
2556 (define_image_type): Remove now-unneeded second arg.
2557 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2558 (init_tiff_functions, init_gif_functions, init_svg_functions):
2559 Arglist and w32_delayed_load calling convention changed.
2560 (gs_type): Remove init_gs_functions; there is no such function.
2561 (valid_image_p, make_image): Fix caller to lookup_image_type.
2562
2563 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2564
2565 Simplify and avoid signal-handling races (Bug#12471).
2566 * alloc.c (die):
2567 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2568 Avoid recursive loop if there's a fatal error in the function itself.
2569 * atimer.c (pending_atimers):
2570 * blockinput.h: Don't include "atimer.h"; no longer needed.
2571 (interrupt_input_pending): Remove. All uses removed.
2572 pending_signals now counts both atimers and ordinary interrupts.
2573 This is less racy than having three separate pending-signal flags.
2574 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2575 (input_blocked_p):
2576 Rename from their upper-case counterparts BLOCK_INPUT,
2577 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2578 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2579 This makes it easier to access volatile variables more accurately.
2580 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2581 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2582 that's more reliable if the code is buggy and sets
2583 interrupt_input_blocked to a negative value. All uses changed.
2584 * atimer.c (deliver_alarm_signal):
2585 Remove. No need to deliver this to the parent; any thread can
2586 handle this signal now. All uses replaced by underlying handler.
2587 * atimer.c (turn_on_atimers):
2588 * dispnew.c (handle_window_change_signal):
2589 * emacs.c (handle_danger_signal):
2590 * keyboard.c (kbd_buffer_get_event):
2591 Don't reestablish signal handler; not needed with sigaction.
2592 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2593 (UNBLOCK_INPUT_TO):
2594 Rework to avoid unnecessary accesses to volatile variables.
2595 (UNBLOCK_INPUT_TO): Now a function.
2596 (totally_unblock_input, unblock_input): New decls.
2597 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2598 (init_data): Remove. Necessary stuff now done in init_signal.
2599 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2600 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2601 (fatal_error_code): Remove; no longer needed.
2602 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2603 it doesn't always backtrace. All uses changed. No need to reset
2604 signal to default, since sigaction and/or die does that for us now.
2605 Use emacs_raise (FOO), not kill (getpid (), FOO).
2606 (main): Check more-accurately whether we're dumping.
2607 Move fatal-error setup to sysdep.c
2608 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2609 * gtkutil.c (xg_get_file_name, xg_get_font):
2610 Remove no-longer-needed signal-mask manipulation.
2611 * keyboard.c, process.c (POLL_FOR_INPUT):
2612 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2613 * keyboard.c (read_avail_input): Remove.
2614 All uses replaced by gobble_input.
2615 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2616 (kbd_buffer_store_event_hold, gobble_input):
2617 (record_asynch_buffer_change) [USABLE_SIGIO]:
2618 (store_user_signal_events):
2619 No need to mess with signal mask.
2620 (gobble_input): If blocking input and there are terminals, simply
2621 set pending_signals to 1 and return. All hooks changed to not
2622 worry about whether input is blocked.
2623 (process_pending_signals): Clear pending_signals before processing
2624 them, in case a signal comes in while we're processing.
2625 By convention callers now test pending_signals before calling us.
2626 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2627 New functions, to support changes to blockinput.h.
2628 (handle_input_available_signal): Now extern.
2629 (reinvoke_input_signal): Remove. All uses replaced by
2630 handle_async_input.
2631 (quit_count): Now volatile, since a signal handler uses it.
2632 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2633 All callers changed. Block SIGINT only if not already blocked.
2634 Clear sigmask reliably, even if Fsignal returns, which it can.
2635 Omit unnecessary accesses to volatile var.
2636 (quit_throw_to_read_char): No need to restore sigmask.
2637 * keyboard.c (gobble_input, handle_user_signal):
2638 * process.c (wait_reading_process_output):
2639 Call signal-handling code rather than killing ourselves.
2640 * lisp.h: Include <float.h>, for...
2641 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2642 (pending_signals): Now volatile.
2643 (syms_of_data): Now const if IEEE floating point.
2644 (handle_input_available_signal) [USABLE_SIGIO]:
2645 (terminate_due_to_signal, record_child_status_change): New decls.
2646 * process.c (create_process): Avoid disaster if memory is exhausted
2647 while we're processing a vfork, by tightening the critical section
2648 around the vfork.
2649 (send_process_frame, process_sent_to, handle_pipe_signal)
2650 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
2651 ignores SIGPIPE.
2652 (send_process): No need for setjmp/longjmp any more, since the
2653 SIGPIPE stuff is now gone. Instead, report an error if errno
2654 is EPIPE.
2655 (record_child_status_change): Now extern. PID and W are now args.
2656 Return void, not bool. All callers changed.
2657 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2658 Remove. All uses removed. This bug should be fixed now in a
2659 different way.
2660 (wait_for_termination_1): Use waitpid rather than sigsuspend,
2661 and record the child status change directly. This avoids the
2662 need to futz with the signal mask.
2663 (process_fatal_action): Move here from emacs.c.
2664 (emacs_sigaction_flags): New function, containing
2665 much of what used to be in emacs_sigaction_init.
2666 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
2667 caught by emacs, to make races less likely.
2668 (deliver_process_signal): Rename from handle_on_main_thread.
2669 All uses changed.
2670 (BACKTRACE_LIMIT_MAX): Now at top level.
2671 (thread_backtrace_buffer, threadback_backtrace_pointers):
2672 New static vars.
2673 (deliver_thread_signal, deliver_fatal_thread_signal):
2674 New functions, for more-accurate delivery of thread-specific signals.
2675 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2676 (deliver_arith_signal): Handle in this thread, not
2677 in the main thread, since it's triggered by this thread.
2678 (maybe_fatal_sig): New function.
2679 (init_signals): New arg DUMPING so that we can be more accurate
2680 about whether we're dumping. Caller changed.
2681 Treat thread-specific signals differently from process-general signals.
2682 Block all signals while handling fatal error; that's safer.
2683 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2684 on IEEE hosts.
2685 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2686 Ignore SIGPIPE unless batch.
2687 (emacs_backtrace): Output backtrace for the appropriate thread,
2688 which is not necessarily the main thread.
2689 * syssignal.h: Include <stdbool.h>.
2690 (emacs_raise): New macro.
2691 * xterm.c (x_connection_signal): Remove; no longer needed
2692 now that we use sigaction.
2693 (x_connection_closed): No need to mess with sigmask now.
2694 (x_initialize): No need to reset SIGPIPE handler here, since
2695 init_signals does this for us now.
2696
2697 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2698
2699 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2700 background rect may be larger (Bug#12245).
2701
2702 2012-09-23 Chong Yidong <cyd@gnu.org>
2703
2704 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2705
2706 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2707
2708 * .gdbinit: Just stop at fatal_error_backtrace.
2709 See Stefan Monnier's request in
2710 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2711 Remove no-longer-used query of system type.
2712
2713 2012-09-22 Chong Yidong <cyd@gnu.org>
2714
2715 * search.c (Freplace_match): Doc fix (Bug#12325).
2716
2717 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2718
2719 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2720 (Fline_end_position): Doc fix.
2721
2722 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2723
2724 2012-09-22 Chong Yidong <cyd@gnu.org>
2725
2726 * dispextern.h (struct image_type): Add new slot, storing a type
2727 initialization function.
2728
2729 * image.c (define_image_type): Call the image initializer function
2730 if it is defined. Arguments and return value changed.
2731 (valid_image_p, make_image): Callers changed.
2732 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2733 (gif_type, imagemagick_type, svg_type, gs_type):
2734 Add initialization functions.
2735 (Finit_image_library): Call lookup_image_type.
2736 (CHECK_LIB_AVAILABLE): Macro deleted.
2737 (lookup_image_type): Call define_image_type here, rather than via
2738 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2739 (syms_of_image): Move define_image_type calls for xbm_type and
2740 pbm_type to lookup_image_type.
2741
2742 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2743
2744 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2745 'idle_timers' from here ...
2746 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2747 lists, to avoid infloops when the timer does something stupid,
2748 like reinvoke itself with the same or smaller time-out.
2749 (Bug#12447)
2750
2751 2012-09-22 Martin Rudalics <rudalics@gmx.at>
2752
2753 * window.c (Fsplit_window_internal): Handle only Qt value of
2754 Vwindow_combination_limit separately.
2755 (Qtemp_buffer_resize): New symbol.
2756 (Vwindow_combination_limit): New default value.
2757 Rewrite doc-string.
2758
2759 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2760
2761 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2762 the new overlay string. (Bug#10159)
2763
2764 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2765
2766 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2767 or that fprintf is async-signal-safe. POSIX doesn't require
2768 either assumption.
2769
2770 2012-09-22 Chong Yidong <cyd@gnu.org>
2771
2772 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2773 (Bug#8207).
2774
2775 2012-09-22 Kenichi Handa <handa@gnu.org>
2776
2777 * composite.c (composition_reseat_it): Handle the case that a
2778 grapheme cluster is not covered by a single font (Bug#12352).
2779
2780 2012-09-21 Chong Yidong <cyd@gnu.org>
2781
2782 * image.c (define_image_type): Avoid adding duplicate types to
2783 image_types (Bug#12463). Suggested by Jörg Walter.
2784
2785 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2786
2787 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2788 (print_load_command_name): Add case LC_DATA_IN_CODE.
2789 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2790
2791 2012-09-21 Glenn Morris <rgm@gnu.org>
2792
2793 * eval.c (Frun_hook_with_args_until_success)
2794 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2795
2796 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
2797
2798 * fileio.c (Ffile_selinux_context): Only call freecon when
2799 lgetfilecon succeeded.
2800 (Fset_file_selinux_context): Likewise. (Bug#12444)
2801
2802 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2803
2804 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2805 reordering, locate the cursor by calling set_cursor_from_row; if
2806 that fails, clear the desired glyph matrix before returning a
2807 failure indication to the caller. Fixes leaving garbled display
2808 when fast scrolling with a down-key. (Bug#12403)
2809 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2810 scrolling through multibyte text.
2811
2812 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2813
2814 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2815 calling mark_vectorlike since that's the one that marks the window.
2816 (mark_discard_killed_buffers): Mark the final cdr.
2817 * window.h (struct window): Move prev/next_buffers to the
2818 non-standard fields.
2819 * window.c (make_window): Initialize prev/next_buffers manually.
2820
2821 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2822
2823 Omit unused arg EXPECTED from socket hooks.
2824 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2825 * nsterm.m (ns_term_init):
2826 * termhooks.h (struct terminal.read_socket_hook):
2827 * w32inevt.c (w32_console_read_socket):
2828 * w32term.c (w32_read_socket):
2829 * xterm.c (XTread_socket):
2830 Omit unused arg EXPECTED. All callers changed.
2831 (store_user_signal_events): Return void, not int, since callers no
2832 longer care about the return value. All uses changed.
2833
2834 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2835
2836 * w32gui.h (XParseGeometry): Do not declare.
2837
2838 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2839
2840 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2841 Ignore 'expected'. See Eli Zaretskii in
2842 <http://bugs.gnu.org/12471#8> (last line).
2843
2844 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2845 (XParseGeometry): Now static. Substitute extremal values for
2846 values that are out of range.
2847
2848 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2849
2850 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2851
2852 * nsfns.m (XParseGeometry): Remove.
2853 (Fx_create_frame): Call x_set_offset to correctly interpret
2854 top_pos in geometry.
2855
2856 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2857 (Fx_parse_geometry): If there is a space in string, call
2858 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2859
2860 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2861
2862 * search.c (scan_buffer): Use character positions in calls to
2863 region_cache_forward and region_cache_backward, not byte
2864 positions. (Bug#12196)
2865
2866 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2867 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2868
2869 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2870 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2871 emacs_blocked_malloc, now deleted.
2872
2873 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2874
2875 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2876 The workaround was for improving performance on Solaris 2.4, but
2877 is getting in the way now. Emacs will still work if someone is
2878 still running Solaris 2.4 in a museum somewhere; Sun dropped
2879 support for Solaris 2.4 in 2003.
2880 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2881 * process.c (create_process) [HAVE_WORKING_VFORK]:
2882 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2883 since Emacs no longer uses vfork on that platform.
2884
2885 2012-09-17 Glenn Morris <rgm@gnu.org>
2886
2887 * emacs.c: Use COPYRIGHT.
2888
2889 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2890
2891 Remove configure's --without-sync-input option (Bug#12450).
2892 When auditing signal-handling in preparation for cleaning it up,
2893 I found that SYNC_INPUT has race conditions and would be a real
2894 pain to fix. Since it's an undocumented and deprecated
2895 configure-time option, now seems like a good time to remove it.
2896 Also see <http://bugs.gnu.org/11080#16>.
2897 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2898 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2899 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2900 (malloc_hysteresis):
2901 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2902 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2903 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2904 (dont_register_blocks, bytes_used_when_reconsidered)
2905 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2906 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2907 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2908 Remove. All uses removed.
2909 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2910 implementation, one that depends on whether the new macro
2911 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2912 is defined.
2913 * atimer.c (run_timers, handle_alarm_signal):
2914 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2915 (handle_async_input, process_pending_signals)
2916 (handle_input_available_signal, init_keyboard):
2917 * nsterm.m (ns_read_socket):
2918 * process.c (wait_reading_process_output):
2919 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2920 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2921 (emacs_write):
2922 * xterm.c (XTread_socket):
2923 Assume SYNC_INPUT.
2924 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2925 * eval.c (handling_signal): Remove. All uses removed.
2926 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2927 All uses replaced with the SYNC_INPUT version.
2928 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2929 Remove decls.
2930 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2931 Now static.
2932
2933 * font.c (Ffont_shape_gstring): Remove unused local.
2934
2935 2012-09-16 Glenn Morris <rgm@gnu.org>
2936
2937 * Makefile.in (clean): No longer run nextstep's clean.
2938
2939 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2940 (ns_frag): Remove.
2941 (ns-app): Move here from ns.mk, and simplify.
2942 (clean): Simplify nextstep entry.
2943 * ns.mk: Remove file.
2944
2945 2012-09-17 Kenichi Handa <handa@gnu.org>
2946
2947 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2948 not covert the last few charactes.
2949
2950 2012-09-16 Kenichi Handa <handa@gnu.org>
2951
2952 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2953 here, but just check the validity of glyphs in the glyph-string.
2954
2955 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2956
2957 * window.c (Fwindow_parameter, Fset_window_parameter):
2958 Accept any window as argument (Bug#12452).
2959
2960 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2961
2962 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2963 to ns_term_init to avoid memory leak.
2964
2965 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2966 explicit retain/release.
2967 (ns_term_init): Only allow one display. Initialize outerpool and
2968 ns_*_types.
2969
2970 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2971
2972 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2973 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2974 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2975 the Microsoft problem in a different way, by altering ../nt/config.nt.
2976
2977 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2978
2979 * w32xfns.c:
2980 * w32uniscribe.c:
2981 * w32term.c:
2982 * w32select.c:
2983 * w32reg.c:
2984 * w32proc.c:
2985 * w32menu.c:
2986 * w32inevt.c:
2987 * w32heap.c:
2988 * w32font.c:
2989 * w32fns.c:
2990 * w32console.c:
2991 * w32.c:
2992 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2993 by lisp.h. This completes removal of setjmp.h inclusion
2994 erroneously announced in the previous commit. (Bug#12446)
2995
2996 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2997 more accurate.
2998
2999 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3000 not defined as a macro. The latter happens on MS-Windows.
3001 (Bug#12446)
3002
3003 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3004
3005 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3006 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3007 Some instances of '#include <setjmp.h>' removed, if the
3008 only reason for the instance was because "lisp.h" was included.
3009 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3010 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3011 and _longjmp with the new symbols. Emacs already uses _setjmp if
3012 available, so this change affects only POSIXish hosts that have
3013 sigsetjmp but not _setjmp, such as some versions of Solaris and
3014 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3015 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3016 (png_load_body) [HAVE_PNG]:
3017 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3018 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3019 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3020 since PNG requires jmp_buf. This is the only exception to the
3021 general rule that we now use sys_setjmp and sys_longjmp.
3022 This exception is OK since this code does not change the signal
3023 mask or longjmp out of a signal handler.
3024
3025 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3026
3027 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3028 Include "syssignal.h", for 'main_thread'.
3029
3030 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3031
3032 Avoid out-of-range marker position (Bug#12426).
3033 * insdel.c (replace_range, replace_range_2):
3034 Adjust markers before overlays, as suggested by comments.
3035 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3036 Remove redundant check before calling offset_intervals.
3037
3038 2012-09-14 Martin Rudalics <rudalics@gmx.at>
3039
3040 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3041 current buffer (Bug#12387).
3042
3043 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
3044
3045 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3046
3047 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3048
3049 Use a more backwards-compatible timer format (Bug#12430).
3050 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3051 vector element, not from the 4th, since PSECS is now at the end.
3052 (Fcurrent_idle_time): Doc fix.
3053
3054 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3055
3056 Function to mark objects and remove killed buffers at once.
3057 * alloc.c (discard_killed_buffers): Rename to ...
3058 (mark_discard_killed buffers) ... new name. Add marking
3059 of remaining objects. Fix comment. Adjust users.
3060 (mark_object): Do not touch frame buffer lists here.
3061 * frame.c (delete_frame): Reset frame buffer lists here.
3062
3063 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3064
3065 Better workaround for GNOME bug when --enable-gcc-warnings.
3066 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3067 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3068 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3069
3070 Simplify SIGIO usage (Bug#12408).
3071 The code that dealt with SIGIO was crufty and confusing, e.g., it
3072 played tricks like "#undef SIGIO" but these tricks were not used
3073 consistently. Simplify mostly by not #undeffing standard symbols,
3074 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3075 or not as we please) rather than "defined SIGIO" (standard symbol
3076 that we probably shouldn't #undef).
3077 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3078 Modules that need it can include it.
3079 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3080 * dispextern.h (ignore_sigio): New decl.
3081 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3082 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3083 * emacs.c (shut_down_emacs):
3084 * keyboard.c (kbd_buffer_store_event_hold):
3085 Use ignore_sigio rather than invoking 'signal' directly.
3086 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3087 for FIONREAD.
3088 (FIONREAD, SIGIO): Do not #undef.
3089 (tty_read_avail_input): Use #error rather than a syntax error.
3090 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3091 for I_PIPE, used by SETUP_SLAVE_PTY.
3092 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3093 * sysdep.c (croak): Remove; no longer needed. This bit of
3094 temporary code, with Fred N. Fish's comment that it's temporary,
3095 has been in Emacs since at least 1992!
3096 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3097 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3098 * syssignal.h (croak): Remove decl.
3099 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3100 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3101 now that we're termios-only.
3102 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3103 * term.c (dissociate_if_controlling_tty): Use #error rather than
3104 a run-time error.
3105
3106 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3107 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3108 to work around GNOME bug 683906.
3109 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3110 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3111 This works around GCC bug 54561.
3112
3113 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3114
3115 More fixes for 'volatile' and setjmp/longjmp.
3116 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3117 * image.c (struct png_load_context) [HAVE_PNG]: New type.
3118 (png_load_body) [HAVE_PNG]:
3119 (jpeg_load_body) [HAVE_JPEG]:
3120 New function, with most of the old parent function's body.
3121 (png_load) [HAVE_PNG]:
3122 (jpeg_load) [HAVE_JPEG]:
3123 Invoke the new function, to avoid longjmp munging our locals.
3124 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3125 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3126 longjmp is passed 2, as the C standard doesn't guarantee this.
3127 Instead, store the failure code into mgr->failure_code.
3128
3129 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3130
3131 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3132 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3133 (syms_of_keyboard): Remove support for unread-command-char.
3134
3135 2012-09-12 Eli Zaretskii <eliz@gnu.org>
3136
3137 * w32proc.c (sys_kill): If PID is our process ID and the signal is
3138 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
3139 violation. (Bug#12426)
3140
3141 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3142
3143 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3144
3145 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3146
3147 * eval.c: Add `inhibit-debugger'.
3148 (Qinhibit_debugger): New symbol.
3149 (call_debugger): Bind it instead of Qdebug_on_error.
3150 (maybe_call_debugger): Test Vinhibit_debugger.
3151 (syms_of_eval): Define inhibit-debugger.
3152 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3153 (syms_of_xdisp): Remove inhibit-debug-on-message.
3154
3155 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3156
3157 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3158 If a nonvolatile local variable is written before a _longjmp to
3159 the frame containing the variable, and is read after the _longjmp,
3160 the value read is indeterminate. Some local variables of type
3161 'struct handler' and 'struct catchtag' are used in this way, so
3162 mark each of their slots as volatile if the slot can be set before
3163 _longjmp and read afterwards.
3164 * lisp.h (struct handler): var and chosen_clause are now volatile.
3165 (struct catchtag): val, next, and pdlcount are now volatile.
3166
3167 * bidi.c (bidi_push_it, bidi_pop_it):
3168 * fns.c (copy_hash_table):
3169 * image.c (define_image_type):
3170 * keyboard.c (kbd_buffer_store_event_hold):
3171 * process.c (Fprocess_send_eof):
3172 * xfaces.c (x_create_gc) [HAVE_NS]:
3173 * xgselect.c (xg_select):
3174 Prefer assignment to memcpy when either will do.
3175
3176 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3177 Use pointer-to-a-pointer to simplify and avoid a NILP check each
3178 time an item is removed. No need to mark this function 'inline';
3179 the compiler knows better than we do.
3180
3181 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
3182
3183 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3184 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3185 to change_frame_size (Bug#12388).
3186 (windowDidResize:): Pass YES to updateFrameSize.
3187
3188 * nsterm.h: Add delay parameter to updateFrameSize.
3189
3190 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3191
3192 Discard killed buffers from deleted window and frame objects.
3193 This reduces an amount of references to killed buffers and
3194 helps GC to reclaim them faster.
3195 * alloc.c (discard_killed_buffers): New function.
3196 (mark_object): Use it for deleted windows and frames.
3197 (mark_object): If symbol's value is set up for a killed buffer
3198 or deleted frame, restore its global binding.
3199 * data.c (swap_in_global_binding): Add GC notice.
3200 (swap_in_symval_forwarding): Use convenient set_blv_where.
3201 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3202 * window.h: ... to here.
3203
3204 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3205
3206 Convenient macro to check whether the buffer is live.
3207 * buffer.h (BUFFER_LIVE_P): New macro.
3208 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3209 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3210
3211 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3212
3213 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3214 composition cases (Bug#12364).
3215
3216 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3217 overhang of succeeding glyphs overlapping box cursor.
3218
3219 * w32term.c (x_draw_glyph_string): Likewise.
3220
3221 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3222
3223 Simplify, document, and port floating-point (Bug#12381).
3224 The porting part of this patch fixes bugs on non-IEEE platforms
3225 with frexp, ldexp, logb.
3226 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3227 Now static.
3228 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3229 support, by removing commented-out code and briefly listing the
3230 C89 functions excluded. The commented-out stuff was confusing
3231 maintenance, e.g., we thought we needed cbrt but it was commented out.
3232 (logb): Remove decl; no longer needed.
3233 (isfinite): New macro, if not already supplied.
3234 (isnan): Don't replace any existing macro.
3235 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3236 are present on all C89 platforms.
3237 (Ffrexp): Do not special-case zero, as frexp does the right thing
3238 for that case.
3239 (Flogb): Do not use logb, as it doesn't have the desired meaning
3240 on hosts that use non-base-2 floating point. Instead, stick with
3241 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
3242 frexp, to avoid getting an unspecified result.
3243
3244 * xdisp.c (Qinhibit_debug_on_message): Now static.
3245
3246 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
3247
3248 * nsterm.m (ns_update_begin): Set clip path to whole view by using
3249 NSBezierPath (Bug#12131).
3250
3251 2012-09-10 Chong Yidong <cyd@gnu.org>
3252
3253 * fns.c (Fdelq, Fdelete): Doc fix.
3254
3255 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
3256
3257 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3258 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3259
3260 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
3261
3262 * lisp.h (make_lisp_ptr): New macro to replace XSET.
3263 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3264 Use it.
3265
3266 2012-09-09 Eli Zaretskii <eliz@gnu.org>
3267
3268 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3269 left fringe if the window has a left margin. This avoids leaving
3270 traces of the cursor because its leftmost pixel is not drawn over.
3271
3272 * dispnew.c (update_window_line): When the left margin area of a
3273 screen line is updated, set the redraw_fringe_bitmaps_p flag of
3274 that screen line. (Bug#12277)
3275
3276 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
3277
3278 Assume C89 or later for math functions (Bug#12381).
3279 This simplifies the code, and makes it a bit smaller and faster,
3280 and (most important) makes it easier to clean up signal handling
3281 since we can stop worring about floating-point exceptions in
3282 library code. That was a problem before C89, but the problem
3283 went away many years ago on all practical Emacs targets.
3284 * data.c, image.c, lread.c, print.c:
3285 Don't include <math.h>; no longer needed.
3286 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3287 might be autoconfigured, as that never happens.
3288 * data.c (fmod):
3289 * doprnt.c (DBL_MAX_10_EXP):
3290 * print.c (DBL_DIG):
3291 Remove. C89 or later always defines these.
3292 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3293 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3294 (arith_error, domain_error, domain_error2):
3295 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
3296 no longer needed -- we simply return what C returns. All uses removed.
3297 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
3298 the wrapped code.
3299 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3300 Remove. All uses expanded, as these macros are no longer used
3301 more than once and are now more trouble than they're worth.
3302 (Ftan): Use tan, not sin / cos.
3303 (Flogb): Assume C89 frexp.
3304 (fmod_float): Assume C89 fmod.
3305 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3306 (init_floatfns): Remove. All uses removed.
3307
3308 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3309
3310 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3311 compositeToPoint for OSX < 10.6 (Bug#12390).
3312
3313 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
3314
3315 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3316 This produces more-accurate results.
3317
3318 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3319
3320 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3321 changes (Bug#12088).
3322
3323 2012-09-08 Chong Yidong <cyd@gnu.org>
3324
3325 * syntax.c (Fstring_to_syntax): Doc fix.
3326
3327 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3328
3329 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3330 in the internal border.
3331 (x_set_window_size): Remove static variables and their usage.
3332 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3333 (ns_after_update_window_line, ns_draw_fringe_bitmap):
3334 Remove fringe/internal border adjustment (Bug#11052).
3335 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3336 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3337 (ns_fix_rect_ibw): Remove.
3338 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3339 (ns_dumpglyphs_box_or_relief): Ditto.
3340 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3341 adjustment.
3342 (ns_dumpglyphs_image): Ditto.
3343 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
3344 border adjustment.
3345 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3346 their usage. Add fringe_extended_p and its use as in other terms.
3347 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
3348 scroll bar was removed.
3349 (updateFrameSize): New function.
3350 (windowDidResize): Move code to updateFrameSize and call it.
3351
3352 * nsterm.h (EmacsView): Add updateFrameSize.
3353
3354 2012-09-07 Chong Yidong <cyd@gnu.org>
3355
3356 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3357
3358 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3359
3360 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3361
3362 More signal-handler cleanup (Bug#12327).
3363 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3364 Problem introduced when merging patches. Noted by Eli Zaretskii in
3365 <http://bugs.gnu.org/12327#67>.
3366 * floatfns.c: Comment fix.
3367 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3368 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3369 and anyway the declaration is harmless even if SIGDANGER is not defined.
3370 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3371 defined BROKEN_FIONREAD). systty.h formerly did this, but other
3372 source files not surprisingly expected syssignal.h to define, or
3373 not define, SIGIO, and it's cleaner to do it that way, for consistency.
3374 Include <sys/ioctl.h>, for FIONREAD.
3375 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
3376 This eliminates a problem whereby other files mysteriously had
3377 to include "syssignal.h" before including "systty.h" if they
3378 wanted to use "#ifdef SIGIO".
3379
3380 2012-09-07 Eli Zaretskii <eliz@gnu.org>
3381
3382 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
3383
3384 * w32.c (sigemptyset): Empty the set.
3385 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
3386
3387 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
3388
3389 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
3390
3391 * alloc.c (mark_buffer): Revert unsafe marking optimization.
3392 (mark_object): Likewise for frame objects.
3393
3394 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3395
3396 * syssignal.h (handle_on_main_thread): Always declare,
3397 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
3398 This ports to platforms without HAVE_PTHREAD.
3399
3400 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3401
3402 Signal-handler cleanup (Bug#12327).
3403 Emacs's signal handlers were written in the old 4.2BSD style with
3404 sigblock and sigmask and so forth, and this led to some
3405 inefficiencies and confusion. Rewrite these to use
3406 pthread_sigmask etc. without copying signal sets around. Also,
3407 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
3408 'signal', and instead use functions that do not attempt to take
3409 over the system name space. This patch causes Emacs's text
3410 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
3411 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
3412 Do not include <signal.h> or "syssignal.h", as these
3413 modules do not use signals.
3414 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
3415 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
3416 Do not include <signal.h>, as "syssignal.h" does that for us now.
3417 * atimer.c (sigmask_atimers): New function.
3418 (block_atimers, unblock_atimers): New functions,
3419 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
3420 All uses replaced.
3421 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
3422 no longer needed here.
3423 * emacs.c (main): Inspect existing signal handler with sigaction,
3424 so that there's no need to block and unblock SIGHUP.
3425 * sysdep.c (struct save_signal): New member 'action', replacing
3426 old member 'handler'.
3427 (save_signal_handlers, restore_signal_handlers):
3428 Use sigaction instead of 'signal' to save and restore.
3429 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
3430 New function. All users of 'signal' modified to use set_sighandler
3431 if they're writeonly, and to use sys_signal if they're read+write.
3432 (emacs_sigaction_init, forwarded_signal): New functions.
3433 (sys_signal): Remove. All uses replaced by calls to sigaction
3434 and emacs_sigaction_init, or by direct calls to 'signal'.
3435 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
3436 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
3437 all uses replaced by pthread_sigmask etc. calls.
3438 * syssignal.h: Include <signal.h>.
3439 (emacs_sigaction_init, forwarded_signal): New decls.
3440 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
3441 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
3442 (sigmask, sys_sigmask): Remove; no longer needed.
3443 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
3444 (sigblock, sigunblock, sigfree):
3445 (sigsetmask) [!defined sigsetmask]:
3446 Remove. All uses replaced by pthread_sigmask.
3447 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
3448 no longer need to be replaced, and its typical old uses
3449 are now done via emacs_sigaction_init and sigaction.
3450 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
3451 (sys_sigdel): Remove; unused.
3452 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
3453
3454 2012-09-06 Eli Zaretskii <eliz@gnu.org>
3455
3456 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
3457 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
3458
3459 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3460
3461 Explicitly mark buffer_defaults and buffer_local_symbols.
3462 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
3463 mark_local_symbols here.
3464 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
3465 since special buffers aren't marked here any more.
3466 (allocate_buffer): Chain new buffer with all_buffers here...
3467 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
3468 not here.
3469 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
3470 (syms_of_buffer): Remove staticpro of the above.
3471 (init_buffer_once): Set names for buffer_defaults and
3472 buffer_local_symbols.
3473
3474 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3475
3476 Use bool for booleans in font-related modules.
3477 * font.c (font_intern_prop, font_style_to_value)
3478 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
3479 (generate_otf_features, font_check_otf_features, font_check_otf)
3480 (font_match_p, font_list_entities, font_at):
3481 * fontset.c (fontset_id_valid_p, reorder_font_vector
3482 (fontset_find_font, Fset_fontset_font)
3483 (face_suitable_for_char_p) [0]:
3484 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
3485 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
3486 (m17n_flt_initialized, ftfont_shape_by_flt):
3487 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
3488 * nsfont.m (nsfont_draw):
3489 * w32font.c (w32font_draw):
3490 * w32term.c (x_draw_glyphless_glyph_string_foreground):
3491 Use bool for booleans.
3492 * font.h: Adjust to above API changes.
3493 (struct font, struct font_driver, struct font_driver_list):
3494 Use bool for booleans.
3495 (struct font): Remove useless member encoding_type.
3496 All users removed.
3497 * fontset.c, xftfont.c: Omit unnecessary static decls.
3498
3499 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3500
3501 * alloc.c (mark_object): Revert window marking code
3502 since it's unsafe for the Fset_window_configuration.
3503
3504 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3505
3506 Fix race conditions with signal handlers and errno (Bug#12327).
3507 Be more systematic about preserving errno whenever a signal
3508 handler returns, even if it's not in the main thread. Do this by
3509 renaming signal handlers to distinguish between signal delivery
3510 and signal handling. All uses changed.
3511 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
3512 * data.c (deliver_arith_signal): Rename from arith_error.
3513 * dispnew.c (deliver_window_change_signal): Rename from
3514 window_change_signal.
3515 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
3516 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
3517 * keyboard.c (deliver_input_available_signal): Rename from
3518 input_available_signal.
3519 (deliver_user_signal): Rename from handle_user_signal.
3520 (deliver_interrupt_signal): Rename from interrupt_signal.
3521 * process.c (deliver_pipe_signal): Rename from send_process_trap.
3522 (deliver_child_signal): Rename from sigchld_handler.
3523 * atimer.c (handle_alarm_signal):
3524 * data.c (handle_arith_signal):
3525 * dispnew.c (handle_window_change_signal):
3526 * emacs.c (handle_fatal_signal, handle_danger_signal):
3527 * keyboard.c (handle_input_available_signal):
3528 * keyboard.c (handle_user_signal, handle_interrupt_signal):
3529 * process.c (handle_pipe_signal, handle_child_signal):
3530 New functions, with the actual signal-handling code taken from the
3531 original respective signal handlers, sans the sporadic attempts to
3532 preserve errno, since that's now done by handle_on_main_thread.
3533 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3534 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3535 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3536 Move to sysdep.c.
3537 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3538 Move initialization of main_thread to sysdep.c's init_signals.
3539 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3540 our usage, and simplifies the mainline code.
3541 (record_child_status_change): New static function, as a helper
3542 for handle_child_signal, and with most of the old child handler's
3543 contents.
3544 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3545 (handle_child_signal): Use the above.
3546 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3547 Moved here from emacs.c.
3548 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3549 code moved here from emacs.c's main function.
3550 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3551 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
3552 This lets callers save and restore errno properly.
3553
3554 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3555
3556 Remove redundant or unused things here and there.
3557 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3558 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3559 * editfns.c (Fcompare_buffer_substrings): Likewise.
3560 * frame.h (struct terminal, struct font_driver_list):
3561 Remove redundant declarations.
3562 * window.h (Qleft, Qright): Likewise.
3563
3564 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3565
3566 Do not mark objects from deleted buffers, windows and frames.
3567 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3568 (mark_object): Likewise for windows and frames.
3569
3570 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3571
3572 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3573 buffer_defaults and buffer_local_symbols as valid objects.
3574 Return special value to denote them.
3575
3576 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3577
3578 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3579 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3580 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3581 (file_name_absolute_p, Fsubstitute_in_file_name):
3582 (check_executable, check_writable, Ffile_accessible_directory_p)
3583 (Fset_file_selinux_context, Fdefault_file_modes)
3584 (Finsert_file_contents, choose_write_coding_system)
3585 (Fwrite_region, build_annotations, a_write, e_write)
3586 (Fdo_auto_save):
3587 * filelock.c (boot_time_initialized, get_boot_time)
3588 (get_boot_time_1, lock_file_1, within_one_second):
3589 * floatfns.c (in_float):
3590 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3591 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3592 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3593 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3594 * window.c (compare_window_configurations):
3595 Use bool for booleans.
3596 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3597 (Fdefault_file_modes): Now mode_t, not int, for modes.
3598 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3599 (internal_delete_file): Now returns void, not a (boolean) int,
3600 since nobody was looking at the return value.
3601 * lisp.h, window.h: Adjust to above API changes.
3602
3603 * xdisp.c (set_message): Simplify and reindent last change.
3604
3605 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
3606
3607 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3608
3609 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3610
3611 * eval.c (call_debugger): Make the function non-static so that we
3612 can call it from set_message.
3613
3614 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3615 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3616
3617 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3618
3619 Give more-useful info on a fatal error (Bug#12328).
3620 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3621 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3622 of doing the work ourselves.
3623 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3624 do most of the work.
3625 (fatal_error_backtrace): New function, taken from the guts
3626 of the old fatal_error_signal, but with a new option to output
3627 a backtrace.
3628 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3629 info about the signal than just its number.
3630 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3631 * sysdep.c: Include <execinfo.h>
3632 (emacs_backtrace): New function, taken partly from the previous
3633 code of the 'die' function.
3634 (emacs_abort): Call fatal_error_backtrace rather than abort.
3635
3636 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
3637
3638 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3639 eager (load-time) macro-expansion.
3640 * lisp.mk (lisp): Add macroexp.
3641
3642 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3643
3644 Simplify redefinition of 'abort' (Bug#12316).
3645 Do not try to redefine the 'abort' function. Instead, redo
3646 the code so that it calls 'emacs_abort' rather than 'abort'.
3647 This removes the need for the NO_ABORT configure-time macro
3648 and makes it easier to change the abort code to do a backtrace.
3649 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3650 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3651 Remove; sysdep.c's emacs_abort now takes its place.
3652 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
3653 'abort' changed to use 'emacs_abort'.
3654 * msdos.c (dos_abort) [defined abort]: Remove; not used.
3655 (abort) [!defined abort]: Rename to ...
3656 (emacs_abort): ... new name.
3657 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3658 the place of the old 'abort' in emacs.c.
3659 * w32.c, w32fns.c (abort): Do not #undef.
3660 * w32.c (emacs_abort): Rename from w32_abort.
3661
3662 2012-09-04 Eli Zaretskii <eliz@gnu.org>
3663
3664 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3665 offsets[j].dv, since the y axis of the screen coordinates points
3666 down, while the y axis of the font definition coordinates points
3667 up. This fixes display of Arabic diacritics such as KASRA and
3668 KASRATAN. (Bug#11860)
3669
3670 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3671
3672 Be more systematic about _setjmp vs setjmp.
3673 * alloc.c (test_setjmp, mark_stack):
3674 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3675 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3676 (png_load, my_error_exit, jpeg_load):
3677 * process.c (send_process_trap, send_process):
3678 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3679 The underscored versions are up to 30x faster on some hosts.
3680 Formerly, the code used setjmp+longjmp sometimes and
3681 _setjmp+_longjmp at other times, with no particular reason to
3682 prefer setjmp+longjmp.
3683
3684 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3685
3686 Fix minor problem found by static checking.
3687 * buffer.c (Fdelete_all_overlays): Return nil.
3688
3689 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3690
3691 * buffer.c (Fdelete_all_overlays): New function.
3692
3693 2012-09-03 Chong Yidong <cyd@gnu.org>
3694
3695 * gtkutil.c: Add extern decl for Qxft.
3696
3697 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3698
3699 * emacs.c, eval.c: Use bool for boolean.
3700 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3701 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3702 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3703 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3704 (main, decode_env_path, Fdaemon_initialized):
3705 * eval.c (call_debugger, Finteractive_p, interactive_p):
3706 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3707 (maybe_call_debugger, Fbacktrace):
3708 * process.c (read_process_output, exec_sentinel):
3709 Use bool for booleans.
3710 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3711 All callers changed.
3712 * eval.c (interactive_p): Omit always-true boolean argument
3713 EXCLUDE_SUBRS_P. All callers changed.
3714 * dispextern.h, lisp.h: Reflect above API changes.
3715 * firstfile.c (dummy): Use the address of 'main', whose signature
3716 won't change, instead of the address of 'initialize', whose
3717 signature just changed from int to bool.
3718 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3719 * msdos.c (fatal_error_in_progress): ... from here.
3720 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3721 of incrementing it.
3722 (redisplay_internal, unwind_redisplay): Simply clear
3723 REDISPLAYING_P when unwinding, instead of saving its previous,
3724 always-false value and then restoring it.
3725
3726 Clean up some extern decls.
3727 Mostly, this hoists extern decls out of .c files and into .h files.
3728 That way, we're more likely to catch errors if the interfaces change.
3729 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3730 declare xg_mark_data.
3731 * dispextern.h (x_frame_parm_handlers):
3732 * font.h (Qxft):
3733 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3734 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3735 (Qultra_bold, Qoblique, Qitalic):
3736 Move extern decl here from .c file.
3737 * alloc.c (xg_mark_data) [USE_GTK]:
3738 * doc.c (Qclosure):
3739 * eval.c (Qlexical_binding):
3740 * fns.c (time) [!HAVE_UNISTD_H]:
3741 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3742 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3743 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3744 * lread.c (Qinternal_interpreter_environment):
3745 * minibuf.c (Qbuffer):
3746 * process.c (QCfamily, QCfilter):
3747 * widget.c (free_frame_faces):
3748 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3749 * xfont.c (x_clear_errors):
3750 * xterm.c (x_frame_parm_handlers):
3751 Remove now-redundant extern decls.
3752 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3753 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3754 Now static.
3755 * xfaces.c: Remove unnecessary static decls.
3756 * xterm.c (updating_frame): Remove decl of nonexistent object.
3757
3758 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3759 when building globals.h, as the objects that are not built on
3760 this host are not needed to compile C files on this host.
3761
3762 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3763
3764 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3765
3766 * frame.h: Add missing prototype for x_wm_set_size_hint.
3767
3768 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3769
3770 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3771 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3772 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3773 (Fsubstitute_command_keys):
3774 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3775 (save_excursion_save, save_excursion_restore)
3776 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3777 (format_time_string, general_insert_function)
3778 (make_buffer_string, make_buffer_string_both)
3779 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3780 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3781 (copy_text, insert_1, insert_1_both, insert_from_string)
3782 (insert_from_string_before_markers, insert_from_string_1)
3783 (insert_from_buffer, insert_from_buffer_1, replace_range)
3784 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3785 (del_range_2, modify_region):
3786 * intervals.c (intervals_equal, balance_possible_root_interval)
3787 (adjust_intervals_for_insertion, merge_properties_sticky)
3788 (graft_intervals_into_buffer, lookup_char_property)
3789 (adjust_for_invis_intang, set_point_both)
3790 (get_property_and_range, compare_string_intervals)
3791 (set_intervals_multibyte_1, set_intervals_multibyte):
3792 * keyboard.c (decode_timer):
3793 Use bool for boolean.
3794 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3795 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3796
3797 2012-09-02 Chong Yidong <cyd@gnu.org>
3798
3799 * keymap.c (push_key_description): Print M-TAB as C-M-i
3800 (Bug#11758).
3801
3802 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3803
3804 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3805 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3806 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3807 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3808 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3809 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3810 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3811
3812 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3813
3814 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3815 more than one grapheme cluster passed to the shaper: compute the
3816 offset adjustment values separately for each cluster. (Bug#11860)
3817
3818 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3819 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3820 about implicit conversions from integer to pointer.
3821
3822 2012-09-01 Daniel Colascione <dancol@dancol.org>
3823
3824 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3825 system used too early.
3826
3827 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3828
3829 Better seed support for (random).
3830 * emacs.c (main): Call init_random.
3831 * fns.c (Frandom): Set the seed from a string argument, if given.
3832 Remove long-obsolete Gentzel cruft.
3833 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3834 (init_random): New function.
3835
3836 2012-09-01 Daniel Colascione <dancol@dancol.org>
3837
3838 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3839 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3840 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3841 x_wm_set_size_hint, x_query_colors, x_real_positions,
3842 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3843 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3844 all of which have been moved to common code.
3845
3846 * xfaces.c: Include TERM_HEADER instead of listing all possible
3847 window-system headers.
3848
3849 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3850 to match header.
3851
3852 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3853 directly accessing frame internals.
3854
3855 * w32font.h: Include font.h. Define syms_of_w32font and
3856 globals_of_w32font.
3857
3858 * process.c: Include TERM_HEADER instead of listing all possible
3859 window-system headers.
3860
3861 * nsterm.h: Remove declarations now in frame.h.
3862 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3863
3864 * menu.c: Include TERM_HEADER instead of listing all possible
3865 window-system headers.
3866
3867 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3868 window system.
3869
3870 * keyboard.c: Include TERM_HEADER instead of listing all possible
3871 window-system headers.
3872
3873 * image.c: Include TERM_HEADER instead of listing all possible
3874 window-system headers. Declare Vlibrary_cache when compiling for
3875 Windows.
3876
3877 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3878 window system declarations.
3879
3880 * frame.h: Move common functions here: set_frame_menubar,
3881 x_set_window_size, x_sync, x_get_focus_frame,
3882 x_set_mouse_position, x_set_mouse_pixel_position,
3883 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3884 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3885 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3886 x_activate_menubar, x_real_positions, x_bitmap_icon,
3887 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3888 and x_query_colors.
3889
3890 * frame.c: Include TERM_HEADER instead of listing all possible
3891 window-system headers.
3892
3893 * font.c: Include TERM_HEADER instead of listing all possible
3894 window-system headers.
3895
3896 * emacs.c: Include TERM_HEADER.
3897
3898 * dispnew.c: Include TERM_HEADER instead of listing all possible
3899 window-system headers.
3900
3901 * ccl.h: Include character.h.
3902
3903 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3904 the current window system; include in list of objects to link into
3905 Emacs.
3906
3907 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3908
3909 Remove mark_ttys function and fix tty_display_info initialization.
3910 * lisp.h (mark_ttys): Remove prototype.
3911 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3912 to mark_ttys because all possible values of 'top_frame' slot are
3913 the frames which are reachable from Vframe_list.
3914 * term.c (mark_ttys): Remove.
3915 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3916
3917 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3918
3919 Change struct frame bitfields from unsigned char to unsigned.
3920 * frame.h (struct frame): Change type of 'display_preempted',
3921 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3922 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3923 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3924 bitfields from unsigned char to unsigned.
3925
3926 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3927
3928 Remove unused member of struct x_output and struct w32_output.
3929 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3930 * w32term.h (struct w32_output): Likewise.
3931
3932 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3933
3934 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3935 does not become zero (Bug#12234).
3936
3937 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3938
3939 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3940 for GCC 4.7.1 x86-64.
3941
3942 2012-08-30 Glenn Morris <rgm@gnu.org>
3943
3944 * lread.c (init_lread): For out-of-tree builds, only add the
3945 source directory's site-lisp dir to the load-path if it exists,
3946 consistent with in-tree builds. (Bug#12302)
3947
3948 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3949
3950 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3951 button_values to NULL. Call setStykeMask so dialogs get a close button.
3952 (windowShouldClose:): Set window_closed.
3953 (dealloc): New member, free button_values.
3954 (process_dialog:): Make member function. Remove window argument,
3955 replace window with self. Count buttons and allocate and store values
3956 in button_values.
3957 (addButton:value:row:): value is int with the name tag. Call setTag
3958 with tag. Remove return self, declare return value as void.
3959 (addString:row:): Remove return self, declare return value as void.
3960 (addSplit): Remove return self, declare return value as void.
3961 (clicked:): Remove return self, declare return value as void.
3962 Set dialog_return to button_values[seltag]. Code formatting change.
3963 (initFromContents:isQuestion:): Adjust call to process_dialog.
3964 Code formatting change.
3965 (timeout_handler:): Set timer_fired to YES.
3966 (runDialogAt:): Set timer_fired to NO.
3967 Handle click on close button as quit.
3968
3969 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3970 Add window_closed and button_values. Add void as return value for
3971 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3972 Add process_dialog as new member.
3973
3974 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3975
3976 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3977 is not one of the heaps we manage. (Bug#12242)
3978
3979 2012-08-28 Glenn Morris <rgm@gnu.org>
3980
3981 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3982
3983 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3984
3985 * window.c (Fset_window_configuration): Remove handling of
3986 auto-buffer-name window parameter. Install revision of reverted
3987 fix.
3988
3989 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3990
3991 Do not allow to set major mode for a dead buffer.
3992 * buffer.c (Fset_buffer_major_mode): Signal an error
3993 if the buffer is dead.
3994 (Fother_buffer, other_buffer_safely): Remove redundant
3995 nested declaration.
3996
3997 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3998
3999 Always use set_buffer_if_live to restore original buffer at unwind.
4000 * buffer.h (record_unwind_current_buffer): New function.
4001 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4002 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4003 * undo.c, window.c: Adjust users.
4004 * buffer.c (set_buffer_if_live): Fix comment.
4005
4006 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4007
4008 Fix usage of set_buffer_internal.
4009 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4010 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4011 * coding.c (decode_coding): Omit redundant test.
4012 * fileio.c (decide_coding_unwind): Likewise.
4013 * fns.c (secure_hash): Likewise.
4014 * insdel.c (modify_region): Likewise.
4015 * keyboard.c (command_loop_1): Likewise.
4016 * print.c (PRINTFINISH): Likewise.
4017 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4018
4019 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4020
4021 * dispnew.c: Use bool for boolean.
4022 (frame_garbaged, display_completed, delayed_size_change)
4023 (fonts_changed_p, add_window_display_history)
4024 (add_frame_display_history, verify_row_hash)
4025 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4026 (row_equal_p, realloc_glyph_pool)
4027 (allocate_matrices_for_frame_redisplay)
4028 (showing_window_margins_p)
4029 (adjust_frame_glyphs_for_frame_redisplay)
4030 (build_frame_matrix_from_leaf_window, make_current)
4031 (mirrored_line_dance, mirror_line_dance, update_frame)
4032 (update_window_tree, update_single_window)
4033 (check_current_matrix_flags, update_window, update_text_area)
4034 (update_window_line, set_window_update_flags, scrolling_window)
4035 (update_frame_1, scrolling, buffer_posn_from_coords)
4036 (do_pending_window_change, change_frame_size)
4037 (change_frame_size_1, sit_for):
4038 Use bool for boolean.
4039 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4040 and remove last int (actually boolean) argument, which was always 0.
4041 All callers changed.
4042 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4043 * dispextern.h (struct composition_it): Use bool for boolean.
4044 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4045 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4046 * dired.c (file_name_completion):
4047 Use bool for boolean. (This was missed in an earlier change.)
4048
4049 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4050
4051 * window.c (Fset_window_configuration): Revert first part of
4052 last change.
4053
4054 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4055
4056 * nsterm.h (NSPanel): New class variable dialog_return.
4057
4058 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4059 Initialize dialog_return.
4060 (windowShouldClose:): Use stop instead of stopModalWithCode.
4061 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4062 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4063 event.
4064 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4065 modal loop returns.
4066
4067 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4068
4069 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4070 * composite.c (find_composition, composition_gstring_p)
4071 (composition_reseat_it, find_automatic_composition):
4072 * data.c (let_shadows_buffer_binding_p)
4073 (let_shadows_global_binding_p, set_internal, make_blv)
4074 (Fmake_variable_buffer_local, Fmake_local_variable)
4075 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4076 (cons_to_signed, arith_driver):
4077 * dbusbind.c (xd_in_read_queued_messages):
4078 * dired.c (directory_files_internal, file_name_completion):
4079 Use bool for booleans.
4080 * dired.c (file_name_completion):
4081 * process.h (fd_callback):
4082 Omit int (actually boolean) argument. It wasn't being used.
4083 All uses changed.
4084 * composite.h, lisp.h: Reflect above API changes.
4085
4086 * cmds.c, coding.c: Use bool for booleans.
4087 * cmds.c (move_point, Fself_insert_command):
4088 * coding.h (struct composition status, struct coding_system):
4089 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4090 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4091 (emacs_mule_char, decode_coding_emacs_mule)
4092 (encode_coding_emacs_mule, detect_coding_iso_2022)
4093 (decode_coding_iso_2022, encode_invocation_designation)
4094 (encode_designation_at_bol, encode_coding_iso_2022)
4095 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4096 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4097 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4098 (encode_coding_raw_text, detect_coding_charset)
4099 (decode_coding_charset, encode_coding_charset, detect_eol)
4100 (detect_coding, get_translation_table, produce_chars)
4101 (consume_chars, reused_workbuf_in_use)
4102 (make_conversion_work_buffer, code_conversion_save)
4103 (decode_coding_object, encode_coding_object)
4104 (detect_coding_system, char_encodable_p)
4105 (Funencodable_char_position, code_convert_region)
4106 (code_convert_string, code_convert_string_norecord)
4107 (Fset_coding_system_priority):
4108 * fileio.c (Finsert_file_contents):
4109 Use bool for booleans.
4110 * coding.h, lisp.h: Reflect above API changes.
4111 * coding.c: Remove unnecessary static function decls.
4112 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4113 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4114 not a boolean 'int', since callers never look at the return value.
4115 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4116 * coding.h (decoding_buffer_size, encoding_buffer_size)
4117 (emacs_mule_string_char): Remove unused extern decls.
4118 (struct iso_2022_spec, struct coding_system):
4119 Use 'unsigned int : 1' for boolean fields, since there's more than one.
4120 (struct emacs_mule_spec): Remove unused field 'full_support'.
4121 All initializations removed.
4122 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4123
4124 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4125
4126 Fix spare memory change (Bug#12286).
4127 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4128 (valid_lisp_object_p): Likewise.
4129
4130 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4131
4132 * window.c (Fset_window_configuration): Record any window's old
4133 buffer if it's replaced (see Bug#8789). If the new current
4134 buffer doesn't appear in the selected window, go to its old
4135 point (Bug#12208).
4136
4137 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4138
4139 Special MEM_TYPE_SPARE to denote reserved memory.
4140 * alloc.c (enum mem_type): New memory type.
4141 (refill_memory_reserve): Use new type for spare memory.
4142 This prevents live_cons_p and live_string_p from incorrect
4143 detection of uninitialized objects from spare memory as live.
4144
4145 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
4146
4147 Spelling fixes.
4148 * Makefile.in (.PHONY): versioclean -> versionclean.
4149
4150 Remove unused external symbols.
4151 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4152 * window.c (Qwindow_valid_p, decode_valid_window):
4153 Now static, not extern.
4154 * data.c (Qinterval): Remove; unused.
4155 (syms_of_data): Do not define 'interval'.
4156 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4157 * window.h (decode_valid_window):
4158 Remove decls.
4159
4160 * character.c, charset.c, chartab.c: Use bool for booleans.
4161 * character.c (lisp_string_width, string_count_byte8)
4162 (string_escape_byte8):
4163 * charset.c (charset_map_loaded, load_charset_map, read_hex):
4164 (load_charset_map_from_file, map_charset_chars)
4165 (Fdefine_charset_internal, define_charset_internal)
4166 (Fdeclare_equiv_charset, find_charsets_in_text)
4167 (Ffind_charset_region, char_charset, Fiso_charset):
4168 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4169 (sub_char_table_set, sub_char_table_set_range)
4170 (char_table_set_range, optimize_sub_char_table)
4171 (map_sub_char_table):
4172 Use bool for boolean.
4173 * character.c (str_to_unibyte): Omit last boolean argument; it was
4174 always 0. All callers changed.
4175 * character.h, charset.h: Adjust to match previous changes.
4176 * character.h (char_printable_p): Remove decl of nonexistent function.
4177 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4178 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4179 are all boolean, so make them single-bit bitfields.
4180
4181 * lisp.h (ASET): Remove attempt to detect side effects.
4182 It was meant to be temporary and it often doesn't work,
4183 because when IDX has side effects the behavior of IDX==IDX
4184 is undefined. See Stefan Monnier in
4185 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4186
4187 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4188
4189 * lisp.h (functionp): New function (extracted from Ffunctionp).
4190 (FUNCTIONP): Use it.
4191 * eval.c (Ffunctionp): Use it.
4192
4193 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4194
4195 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4196 as that's faster and simpler than static storage. Don't bother
4197 with the g_main_context_query overhead if g_main_context_pending
4198 says no events are pending.
4199 (gfds, gfds_size): Remove these static vars.
4200 (xgselect_initialize): Remove; no longer needed.
4201 All uses and decls removed.
4202
4203 * emacs.c (fatal_error_signal_hook): Remove.
4204 All uses removed. This leftover from old code was always 0.
4205
4206 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4207 * casefiddle.c (casify_object, casify_region):
4208 * casetab.c (set_case_table):
4209 * category.c, category.h (word_boundary_p):
4210 * category.h (CHAR_HAS_CATEGORY):
4211 Use bool for booleans, instead of int.
4212
4213 2012-08-25 Eli Zaretskii <eliz@gnu.org>
4214
4215 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4216
4217 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4218
4219 On assertion failure, print backtrace if available.
4220 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4221 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4222 * Makefile.in (LIB_EXECINFO): New macro.
4223 (LIBES): Use it.
4224
4225 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4226 * bytecode.c (exec_byte_code):
4227 * callint.c (check_mark, Fcall_interactively):
4228 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4229 (getenv_internal, sync_process_alive, call_process_exited):
4230 * lisp.h (USE_SAFE_ALLOCA):
4231 Use bool for booleans, instead of int.
4232 * lisp.h, process.h: Adjust prototypes to match above changes.
4233 * callint.c (Fcall_interactively): Don't assume the mark's
4234 offset fits in 'int'.
4235
4236 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
4237
4238 * buffer.c, buffer.h: Use bool for boolean.
4239 * buffer.c (reset_buffer_local_variables)
4240 (buffer_lisp_local_variables, Fset_buffer_modified_p)
4241 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4242 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4243 (overlay_touches_p, overlay_strings, Foverlay_put)
4244 (report_overlay_modification, call_overlay_mod_hooks):
4245 (mmap_enlarge, mmap_set_vars):
4246 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4247 Use bool for booleans, instead of int.
4248 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4249 since the 1-or-0 return value is always ignored anyway.
4250 (mmap_initialized_p):
4251 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4252 * buffer.h, lisp.h: Adjust prototypes to match above changes.
4253
4254 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4255
4256 * bidi.c: Use bool for boolean.
4257 This is a bit more readable, and makes the text segment of bidi.o
4258 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4259 Presumably it's faster too.
4260 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4261 Now bool.
4262 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4263 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4264 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4265 (bidi_explicit_dir_char, bidi_level_of_next_char)
4266 (bidi_find_other_level_edge, bidi_move_to_visually_next):
4267 Use bool for booleans, instead of int.
4268 * dispextern.h (bidi_init_it, bidi_paragraph_init)
4269 (bidi_unshelve_cache): Adjust decls to match code.
4270
4271 2012-08-23 Martin Rudalics <rudalics@gmx.at>
4272
4273 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4274 argument.
4275
4276 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4277
4278 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4279 * atimer.h: Include <stdbool.h>.
4280
4281 2012-08-22 Dan Nicolaescu <dann@gnu.org>
4282
4283 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4284 compile time tests instead of run time tests on systems that do
4285 not use them.
4286 (FRAME_MAC_P): Remove leftover from deleted code.
4287 * frame.c (syms_of_frame): Remove leftover from deleted code.
4288
4289 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
4290
4291 * nsterm.m (insertText:): Don't clear modifiers if code is space.
4292
4293 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
4294
4295 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4296 Otherwise, the compiler complains about (A?B:C) where B is void
4297 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
4298 (fontset_add): Return void, for FONTSET_ADD.
4299
4300 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4301
4302 * alloc.c: Use bool for booleans.
4303 (gc_in_progress, abort_on_gc)
4304 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4305 (dont_register_blocks) [GC_MALLOC_CHECK]:
4306 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4307 (check_string_bytes, make_specified_string, memory_full)
4308 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4309 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4310 (mark_stack, valid_pointer_p, make_pure_string)
4311 (Fgarbage_collect, survives_gc_p, gc_sweep):
4312 Use bool for booleans, instead of int.
4313 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4314 Remove unused local.
4315 * alloc.c (PURE_POINTER_P):
4316 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4317 * editfns.c (Fformat):
4318 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4319 (Fdo_auto_save):
4320 * fns.c (sweep_weak_table):
4321 * lisp.h (suppress_checking, push_message, survives_gc_p)
4322 (make_pure_string, gc_in_progress, abort_on_gc):
4323 * lread.c (readchar, read1):
4324 * print.c (Fprin1_to_string):
4325 * xdisp.c (push_message):
4326 Use bool for booleans affected directly or indirectly by
4327 alloc.c's changes.
4328
4329 Make recently-introduced setters macros.
4330 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4331 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4332 (set_fontset_default, set_fontset_fallback): Rename from their
4333 upper-case counterparts, and make them functions rather than macros.
4334 This is more consistent with the other recently-introduced setters.
4335 These don't need to be inline, since they're local.
4336
4337 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
4338
4339 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4340 the loop (Bug#12247).
4341
4342 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4343
4344 * lisp.h (vcopy): Use memcpy rather than our own loop.
4345 This fixes a performance regression introduced by the recent
4346 addition of vcopy. This means 'vcopy' will need to be modified
4347 for a copying collector, but that's OK. Also, tighten the
4348 checking in the assertion.
4349
4350 2012-08-21 Eli Zaretskii <eliz@gnu.org>
4351
4352 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4353 components for RTL text (Bug#11860). Adjust X-OFFSET of each
4354 non-base glyph for the width of the base character, according to
4355 what x_draw_composite_glyph_string_foreground expects.
4356 Generate WADJUST value according to composition_gstring_width's
4357 expectations, to produce correct width of the composed character.
4358 Reverse the sign of the DU offset produced by ScriptPlace.
4359
4360 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4361
4362 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4363
4364 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4365
4366 Avoid direct writes to contents member of struct Lisp_Vector.
4367 * lisp.h (vcopy): New function to copy data into vector.
4368 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4369 * fns.c (Ffillarray): Use ASET.
4370 * keyboard.c (timer_check_2): Use AREF and ASET.
4371 (append_tool_bar_item, Frecent_keys): Use vcopy.
4372 * lread.c (read_vector): Use ASET.
4373 * msdos.c (Frecent_doskeys): Use vcopy.
4374 * xface.c (Finternal_copy_lisp_face): Use vcopy.
4375 (Finternal_merge_in_global_face): Use ASET and vcopy.
4376 * xfont.c (xfont_list_pattern): Likewise.
4377
4378 2012-08-21 Martin Rudalics <rudalics@gmx.at>
4379
4380 * window.c (Fwindow_point): For the selected window always return
4381 the position of its buffer's point.
4382 (Fset_window_point): For the selected window always go in its
4383 buffer to the specified position.
4384
4385 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4386
4387 Setter macros for fontsets.
4388 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
4389 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
4390 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
4391 Adjust users.
4392
4393 2012-08-20 Glenn Morris <rgm@gnu.org>
4394
4395 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4396 Don't assume that `ln -f' works.
4397
4398 2012-08-20 Eli Zaretskii <eliz@gnu.org>
4399
4400 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
4401 and later about non-assignments with no effect. See discussion at
4402 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
4403 details.
4404
4405 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4406
4407 Inline setter functions for Lisp_Objects slots of struct specbinding.
4408 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
4409 Adjust users.
4410
4411 2012-08-20 Martin Rudalics <rudalics@gmx.at>
4412
4413 * window.c (select_window): Always make selected window's buffer
4414 current.
4415
4416 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4417
4418 Use AREF and ASET for docstrings of category tables.
4419 * category.h (CATEGORY_DOCSTRING): Use AREF.
4420 (SET_CATEGORY_DOCSTRING): Use ASET.
4421 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
4422
4423 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4424
4425 Inline setter functions for hash table members.
4426 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
4427 (set_hash_hash, set_hash_index): Rename with _slot suffix.
4428 (set_hash_key_and_value, set_hash_index, set_hash_next)
4429 (set_hash_hash): New functions.
4430 * charset.c, fns.c: Adjust users.
4431
4432 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4433
4434 Inline getter and setter functions for per-buffer values.
4435 * buffer.h (per_buffer_default, set_per_buffer_default)
4436 (per_buffer_value, set_per_buffer_value): New functions.
4437 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
4438 * buffer.c, data.c: Adjust users.
4439
4440 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
4441
4442 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
4443
4444 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
4445
4446 Rely on <config.h> + <unistd.h> to declare 'environ',
4447 as gnulib does this if the system doesn't.
4448 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
4449 Remove declaration. MS-Windows declares it on stdlib.h which is
4450 included by conf_post.h.
4451 * emacs.c (environ) [DOUG_LEA_MALLOC]:
4452 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
4453 * vm-limit.c: Include <unistd.h>, for 'environ'.
4454
4455 * unexaix.c, unexcoff.c: Include "mem-limits.h".
4456 (start_of_data): Remove decl; mem-limits.h provides it.
4457
4458 * xdisp.c (handle_invisible_prop): Make it a bit faster
4459 and avoid a gcc -Wmaybe-uninitialized diagnostic.
4460
4461 2012-08-19 Chong Yidong <cyd@gnu.org>
4462
4463 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
4464 ends (Bug#3874).
4465
4466 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
4467
4468 * .gdbinit: Use call instead of set when calling a function in the
4469 inferior.
4470
4471 * data.c (set_internal): Don't use set_blv_found.
4472 (Fkill_local_variable): Likewise.
4473
4474 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
4475
4476 * nsfont.m (ns_ascii_average_width): Ensure the string
4477 ascii_printable is initialized with a null-terminated character
4478 array. Otherwise, it can contain undesired extra characters.
4479
4480 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4481
4482 port new setting code to Sun C 5.8 2005/10/13
4483 * chartab.c, lisp.h (char_table_set, char_table_set_range):
4484 Return void, not Lisp_Object. Otherwise, the compiler
4485 complains about (A?B:C) where B is void and C is Lisp_Object
4486 when compiling CHAR_TABLE_SET, due to the recent change to
4487 the API of sub_char_table_set_contents.
4488
4489 2012-08-18 Chong Yidong <cyd@gnu.org>
4490
4491 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
4492 for the string case (Bug#3874).
4493
4494 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4495
4496 * buffer.h (BSET): Remove (Bug#12215).
4497 Replace all uses with calls to new setter functions.
4498 (bset_bidi_paragraph_direction, bset_case_canon_table)
4499 (bset_case_eqv_table, bset_directory, bset_display_count)
4500 (bset_display_time, bset_downcase_table)
4501 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
4502 (bset_last_selected_window, bset_local_var_alist)
4503 (bset_mark_active, bset_point_before_scroll, bset_read_only)
4504 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
4505 (bset_width_table):
4506 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4507 (bset_auto_fill_function, bset_auto_save_file_format)
4508 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4509 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4510 (bset_cache_long_line_scans, bset_case_fold_search)
4511 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4512 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4513 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4514 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4515 (bset_header_line_format, bset_indicate_buffer_boundaries)
4516 (bset_indicate_empty_lines, bset_invisibility_spec)
4517 (bset_left_fringe_width, bset_major_mode, bset_mark)
4518 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4519 (bset_name, bset_overwrite_mode, bset_pt_marker)
4520 (bset_right_fringe_width, bset_save_length)
4521 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4522 (bset_scroll_up_aggressively, bset_selective_display)
4523 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4524 (bset_word_wrap, bset_zv_marker):
4525 * category.c (bset_category_table):
4526 * syntax.c (bset_syntax_table):
4527 New setter functions.
4528
4529 * process.h (PSET): Remove (Bug#12215).
4530 Replace all uses with calls to new setter functions.
4531 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4532 (PROCESS_INLINE): New macro.
4533 (pset_childp): New setter function.
4534 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4535 * process.c (PROCESS_INLINE):
4536 Define to EXTERN_INLINE, so that the corresponding functions
4537 are compiled into code.
4538 (pset_buffer, pset_command, pset_decode_coding_system)
4539 (pset_decoding_buf, pset_encode_coding_system)
4540 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4541 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4542 (pset_type, pset_write_queue): New setter functions.
4543
4544 * window.h (WSET): Remove (Bug#12215).
4545 Replace all uses with calls to new setter functions.
4546 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4547 (WINDOW_INLINE): New macro.
4548 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4549 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4550 (wset_total_lines, wset_vertical_scroll_bar)
4551 (wset_window_end_pos, wset_window_end_valid)
4552 (wset_window_end_vpos): New setter functions.
4553 * window.c (WINDOW_INLINE):
4554 Define to EXTERN_INLINE, so that the corresponding functions
4555 are compiled into code.
4556 (wset_combination_limit, wset_dedicated, wset_display_table)
4557 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4558 (wset_new_normal, wset_new_total, wset_next_buffers)
4559 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4560 (wset_prev_buffers, wset_right_fringe_width)
4561 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4562 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4563 (wset_window_parameters):
4564 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4565 (wset_column_number_displayed, wset_region_showing):
4566 New setter functions.
4567
4568 * termhooks.h (TSET): Remove (Bug#12215).
4569 Replace all uses with calls to new setter functions.
4570 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4571 (TERMHOOKS_INLINE): New macro.
4572 (tset_charset_list, tset_selection_alist): New setter functions.
4573 * terminal.c (TERMHOOKS_INLINE):
4574 Define to EXTERN_INLINE, so that the corresponding functions
4575 are compiled into code.
4576 (tset_param_alist): New setter function.
4577
4578 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4579
4580 * keyboard.h (KSET): Remove (Bug#12215).
4581 Replace all uses with calls to new setter functions.
4582 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4583 (KEYBOARD_INLINE): New macro.
4584 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4585 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4586 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4587 New setter functions.
4588 * keyboard.c (KEYBOARD_INLINE):
4589 Define to EXTERN_INLINE, so that the corresponding functions
4590 are compiled into code.
4591 (kset_echo_string, kset_kbd_queue)
4592 (kset_keyboard_translate_table, kset_last_prefix_arg)
4593 (kset_last_repeatable_command, kset_local_function_key_map)
4594 (kset_overriding_terminal_local_map, kset_real_last_command)
4595 (kset_system_key_syms): New setter functions.
4596
4597 * frame.h (FSET): Remove (Bug#12215).
4598 Replace all uses with calls to new setter functions.
4599 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4600 (FRAME_INLINE): New macro.
4601 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4602 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4603 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4604 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4605 (fset_param_alist, fset_root_window, fset_scroll_bars)
4606 (fset_selected_window, fset_title, fset_tool_bar_items)
4607 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4608 * frame.c (FRAME_INLINE):
4609 Define to EXTERN_INLINE, so that the corresponding functions
4610 are compiled into code.
4611 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4612
4613 A few more naming-convention fixes for getters and setters.
4614 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4615 and rename from buffer_overlays_set_before.
4616 (set_buffer_overlays_after): Move here from buffer.h, and rename
4617 from buffer_overlays_set_after.
4618 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4619 All uses changed.
4620 (set_buffer_intervals): Rename from buffer_set_intervals.
4621 * intervals.c (set_interval_object): Move here from intervals.h,
4622 and rename from interval_set_object.
4623 (set_interval_left): Move here from intervals.h, and rename from
4624 interval_set_left.
4625 (set_interval_right): Move here from intervals.h, and rename from
4626 interval_set_right.
4627 (copy_interval_parent): Move here from intervals.h, and rename from
4628 interval_copy_parent.
4629 * intervals.h (set_interval_parent): Rename from interval_set_parent.
4630 (set_interval_plist): Rename from interval_set_plist.
4631 Return void, not Lisp_Object, since no caller uses the result.
4632 * lisp.h (string_intervals): Rename from string_get_intervals.
4633 (set_string_intervals): Rename from string_set_intervals.
4634
4635 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4636 (set_char_table_contents): Rename from char_table_set_contents.
4637 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4638 All uses changed. See the end of
4639 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4640
4641 * lisp.h (CSET): Remove (Bug#12215).
4642 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4643 (set_char_table_purpose): New functions,
4644 replacing CSET. All uses changed. For example, replace
4645 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4646 "set_char_table_parent (char_table, parent);".
4647 The old version was confusing because it used the same name
4648 'parent' for two different things.
4649
4650 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4651
4652 Functions to get and set Lisp_Object fields of buffer-local variables.
4653 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4654 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4655 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4656 * data.c, eval.c, frame.c: Adjust users.
4657
4658 2012-08-17 Chong Yidong <cyd@gnu.org>
4659
4660 * xfaces.c (merge_face_vectors): If the target font specfies a
4661 font spec, make the font's attributes take precedence over
4662 directly-specified attributes.
4663 (merge_face_ref): Recognize :font.
4664
4665 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4666
4667 Do not use memcpy for copying intervals.
4668 * intervals.c (reproduce_interval): New function.
4669 (reproduce_tree, reproduce_tree_obj): Use it.
4670 (reproduce_tree_obj): Remove prototype.
4671
4672 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4673
4674 * lisp.h (duration_to_sec_usec): Remove unused decl.
4675
4676 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
4677
4678 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4679 to an allocated instance of NSString, not to the class itself.
4680
4681 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
4682
4683 * makefile.w32-in (C_CTYPE_H): New macro.
4684 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4685 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4686 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4687
4688 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4689
4690 Use ASCII tests for character types.
4691 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4692 * xfns.c, xterm.c:
4693 Don't include <ctype.h>; was not needed.
4694 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4695 * sysdep.c, xfaces.c:
4696 Include <c-ctype.h> instead of <ctype.h>.
4697 * nsterm.m: Include <c-ctype.h>.
4698 * charset.c (read_hex):
4699 * doc.c (Fsnarf_documentation):
4700 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4701 (DRIVE_LETTER) [DOS_NT]:
4702 (Ffile_name_directory, Fexpand_file_name)
4703 (Fsubstitute_in_file_name):
4704 * font.c (font_parse_xlfd, font_parse_fcname):
4705 * frame.c (x_set_font_backend):
4706 * gtkutil.c (xg_get_font):
4707 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4708 * nsimage.m (hexchar):
4709 * nsterm.m (ns_xlfd_to_fontname):
4710 * sysdep.c (system_process_attributes):
4711 * xfaces.c (hash_string_case_insensitive):
4712 Use C-locale tests instead of locale-specific tests for character
4713 types, since we want the ASCII interpretation here, not the
4714 interpretation suitable for whatever happens to be the current locale.
4715
4716 2012-08-16 Martin Rudalics <rudalics@gmx.at>
4717
4718 Consistently check windows for validity/liveness
4719 (Bug#11984, Bug#12025, Bug#12026).
4720 * lisp.h (CHECK_VALID_WINDOW): New macro.
4721 * window.c (decode_window): Rename to decode_live_window.
4722 (decode_valid_window, Fwindow_valid_p): New functions.
4723 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4724 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4725 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4726 (Fwindow_prev_sibling, Fwindow_combination_limit)
4727 (Fset_window_combination_limit, Fwindow_use_time)
4728 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4729 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4730 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4731 (Fwindow_hscroll, Fset_window_hscroll)
4732 (Fwindow_redisplay_end_trigger)
4733 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4734 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4735 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4736 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4737 (Fwindow_end, Fset_window_point, Fset_window_start)
4738 (Fpos_visible_in_window_p, Fwindow_line_height)
4739 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4740 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4741 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4742 (Fset_window_parameter, Fwindow_display_table)
4743 (Fset_window_display_table, Fdelete_other_windows_internal)
4744 (Fset_window_buffer, Fset_window_new_total)
4745 (Fset_window_new_normal, Fdelete_window_internal)
4746 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4747 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4748 (Fwindow_scroll_bars): Check whether argument window is a valid or
4749 live window. Update doc-strings.
4750 (syms_of_window): New symbol Qwindow_valid_p.
4751 * keyboard.c (Fposn_at_x_y): Check whether argument
4752 frame_or_window denotes a valid window.
4753
4754 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4755
4756 Fix previous char table change.
4757 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4758 * chartab.c (optimize_sub_char_table): Likewise.
4759
4760 2012-08-16 Chong Yidong <cyd@gnu.org>
4761
4762 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4763
4764 * xfont.c (xfont_open):
4765 * xftfont.c (xftfont_open): Set the font's max_width field.
4766
4767 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4768 min_width to space_width and average_width to the average over
4769 printable ASCII characters.
4770 (ns_char_width): Code cleanup.
4771 (ns_ascii_average_width): New utility function.
4772
4773 * font.h (struct font): Update comments.
4774
4775 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4776
4777 Simple interface to set Lisp_Object fields of character tables.
4778 * lisp.h (CSET): New macro.
4779 (char_table_set_extras, char_table_set_contents)
4780 (sub_char_table_set_contents): New function.
4781 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4782 * syntax.c: Adjust users.
4783
4784 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4785
4786 * eval.c (eval_sub): Bind lexical-binding.
4787 * lread.c (Qlexical_binding): Make non-static.
4788
4789 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4790
4791 * nsmenu.m (popupSession): Remove.
4792 (pop_down_menu): Remove endModalSession.
4793 (timeout_handler:): New method.
4794 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4795 Call runModalForWindow. Check timer_fired when it returns.
4796 If not set, cancel timer and break out of loop.
4797 Otherwise loop again, with a new timeout.
4798
4799 * nsterm.m: Include fcntl.h if present.
4800 (fd_entry, t_readfds, inNsSelect): Remove.
4801 (select_writefds, select_valid, select_timeout, selfds)
4802 (select_mutex, apploopnr): Add.
4803 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4804 Otherwise call kbd_buffer_store_event.
4805 (ns_send_appdefined): Remove release of fd_entry.
4806 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4807 Increment and decrement apploopnr.
4808 (ns_select): If no file descriptors, just do a NSTimer.
4809 Otherwise copy read/write masks and start select thread (fd_handler).
4810 Start main loop and wait for application defined event.
4811 Inform select thread to stop selecting after main loop is exited.
4812 (ns_term_init): Create selfds pipe and set non-blocking.
4813 Initialize select_mutex. Start the select thread (fd_handler).
4814 (fd_handler:): Loop forever, wait for info from the main thread
4815 to either start or stop selecting. When select returns, send
4816 and appdefined event.
4817 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4818 If not call kbd_buffer_store_event.
4819
4820 * nsterm.h (EmacsApp): fd_handler takes id argument.
4821 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4822
4823 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4824
4825 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4826
4827 * region-cache.c (move_cache_gap): Update gap_len using the actual
4828 growth of the boundaries array. Do not change cache_len.
4829 (Bug#12196)
4830
4831 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4832
4833 Generalize and cleanup font subsystem checks.
4834 * font.h (FONT_DEBUG, font_assert): Remove.
4835 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4836 Change font_assert to eassert. Use eassert where appropriate.
4837
4838 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4839
4840 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4841
4842 2012-08-15 Chong Yidong <cyd@gnu.org>
4843
4844 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4845 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4846 extract the font descriptor instead of just the font name.
4847 In that case, return a font spec instead of a string.
4848 (x_last_font_name): Move to this file from xfns.c.
4849
4850 * xfns.c (Fx_select_font): The return value can also be a font
4851 spec. Move x_last_font_name management to gtkutil.c.
4852
4853 * xfaces.c: Make font weight and style symbols non-static.
4854
4855 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4856
4857 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4858 (bug#12117).
4859
4860 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4861
4862 * alloc.c (Fgarbage_collect): Use plural form consistently.
4863
4864 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4865
4866 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4867 iteration through the command loop. Fixes a problem whereby mouse
4868 movements are ignored until the first mouse click.
4869
4870 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4871
4872 Use bool, not int, for Lisp booleans.
4873 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4874 makes Emacs a bit smaller and presumably a bit faster.
4875 * lisp.h: Include <stdbool.h>.
4876 (struct Lisp_Boolfwd, defvar_bool):
4877 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4878 * regex.c [!emacs]: Include <stdbool.h>.
4879 (false, true): Remove; <stdbool.h> does this for us now.
4880
4881 2012-08-14 Chong Yidong <cyd@gnu.org>
4882
4883 * character.c (Fcharacterp): Doc fix (Bug#12076).
4884
4885 * data.c (Findirect_variable): Doc fix (Bug#11040).
4886
4887 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4888
4889 * editfns.c (Fformat): Doc fix (Bug#12059).
4890 (Fsave_current_buffer): Doc fix (Bug#11542).
4891
4892 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4893
4894 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4895 (bug#12022).
4896
4897 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4898
4899 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4900 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4901 * minibuf.c (choose_minibuf_frame, read_minibuf):
4902 * w32fns.c (x_create_tip_frame):
4903 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4904 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4905
4906 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4907
4908 * intervals.c (offset_intervals): Remove obsolete comment.
4909
4910 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4911
4912 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4913
4914 2012-08-14 Gergely Risko <gergely@risko.hu>
4915
4916 * coding.c (decode_coding): Record buffer modification before
4917 disabling undo_list (Bug#11773).
4918
4919 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4920
4921 Revert and cleanup some recent overlay changes.
4922 * buffer.h (enum overlay_type): Remove.
4923 (buffer_get_overlays, buffer_set_overlays): Likewise.
4924 (buffer_set_overlays_before, buffer_set_overlays_after):
4925 New function. Adjust users.
4926 (unchain_both): Add eassert.
4927
4928 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4929
4930 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4931
4932 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4933
4934 * gtkutil.c (xg_mark_data): Don't assume C99.
4935
4936 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4937
4938 * gtkutil.c (xg_frame_tb_info): New struct.
4939 (TB_INFO_KEY): New define.
4940 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4941 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4942 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4943 if not present.
4944 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4945 is up to date. Otherwise store new data.
4946 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4947
4948 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4949
4950 Use KSET for write access to Lisp_Object members of struct kboard.
4951 * keyboard.h (KSET): New macro.
4952 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4953 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4954 * xterm.c: Adjust users.
4955
4956 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4957
4958 Use BSET for write access to Lisp_Object members of struct buffer.
4959 * buffer.h (BSET): New macro.
4960 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4961 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4962 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4963 * window.c, xdisp.c, xfns.c: Adjust users.
4964
4965 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4966
4967 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4968
4969 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4970
4971 * nsterm.m (not_in_argv): New function.
4972 (application:openFile, application:openTempFile:):
4973 (application:openFileWithoutUI:, application:openFiles:): Open file
4974 if not_in_argv returns non-zero (bug#12171).
4975
4976 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4977 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4978 Define for Gtk+ versions less than 3.2.
4979 (xg_get_font_name): Use those functions/macros here.
4980 Reported by Frans Oilinki <moilinki@gmail.com>.
4981
4982 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4983
4984 * unexmacosx.c (copy_data_segment): Copy initialized data in
4985 statically linked libraries from input file rather than memory.
4986
4987 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4988 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4989 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4990
4991 2012-08-10 Glenn Morris <rgm@gnu.org>
4992
4993 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4994 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4995
4996 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4997
4998 Fix last change to allow compilation with low optimization levels.
4999 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5000 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5001
5002 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5003
5004 Use common inline syntax in intervals.h.
5005 * intervals.h (INTERVALS_INLINE): New macro.
5006 Change all users from LISP_INLINE.
5007
5008 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5009
5010 Define Qnone once for all platforms.
5011 * frame.c (Qnone): Define here.
5012 (syms_of_frame): DEFSYM it.
5013 * lisp.h (Qnone): New declaration.
5014 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5015 * xfns.c: Remove duplication. Adjust users.
5016
5017 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5018
5019 Remove unused macros from intervals.h.
5020 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5021 * intervals.c: Adjust comment.
5022
5023 2012-08-10 Eli Zaretskii <eliz@gnu.org>
5024
5025 * w32fns.c <w32_unicode_gui>: New static variable.
5026 (globals_of_w32fns): Initialize it according to os_subtype.
5027 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5028 testing os_subtype.
5029
5030 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
5031 Eli Zaretskii <eliz@gnu.org>
5032
5033 Fix bug #10299 with Unicode characters sent by customized
5034 keyboards created by MSKLC.
5035 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5036 (w32_init_class): Use it to initialize the Emacs class with either
5037 ANSI or Unicode API calls.
5038 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5039 later.
5040 (w32_wnd_proc): If the character code sent by WM_CHAR or
5041 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5042 original message. Call DefWindowProcW on NT and later.
5043
5044 2012-08-10 Glenn Morris <rgm@gnu.org>
5045
5046 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5047
5048 * lisp.h (DIRECTORY_SEP): Let configure set it.
5049
5050 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5051
5052 Use TSET for write access to Lisp_Object slots of struct terminal.
5053 * termhooks.h (TSET): New macro.
5054 * coding.c, terminal.c, xselect.c: Adjust users.
5055
5056 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5057
5058 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5059 the failing expression, include them in the error message.
5060 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5061 * lisp.h (internal_condition_case_n): Update declaration.
5062
5063 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5064
5065 Inline functions to examine and change buffer overlays.
5066 * buffer.c (unchain_both): New function.
5067 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5068 (buffer_has_overlays): New function.
5069 (enum overlay_type): New enum.
5070 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5071 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5072
5073 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5074
5075 Inline functions to examine and change buffer intervals.
5076 * alloc.c (mark_interval_tree): Remove.
5077 (MARK_INTERVAL_TREE): Simplify.
5078 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5079 * intervals.c (buffer_balance_intervals): New function.
5080 (graft_intervals_into_buffer): Adjust indentation.
5081 (set_intervals_multibyte): Simplify.
5082 * buffer.h (BUF_INTERVALS): Remove.
5083 (buffer_get_intervals, buffer_set_intervals): New function.
5084 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5085 * intervals.c, textprop.c: Adjust users.
5086
5087 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5088
5089 Inline functions to examine and change string intervals.
5090 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5091 (string_get_intervals, string_set_intervals): New function.
5092 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5093 * lread.c, print.c, textprop.c: Adjust users.
5094
5095 2012-08-08 Glenn Morris <rgm@gnu.org>
5096
5097 * lisp.mk (lisp): Remove language/persian.elc.
5098
5099 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5100
5101 Cleanup intervals.
5102 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5103 (NULL_INTERVAL_P): Likewise. Adjust users.
5104 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5105 Adjust comment. Move under #if 0.
5106 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5107 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5108
5109 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5110
5111 Check total length of intervals with eassert.
5112 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5113 * intervals.c: Change all users to eassert.
5114
5115 2012-08-07 Eli Zaretskii <eliz@gnu.org>
5116
5117 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5118 Rename fields to match removal of FGET and WGET and disuse of
5119 INTERNAL_FIELD in Lisp_Cons.
5120
5121 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5122
5123 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5124 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5125 name since all xname users are fixed long time ago. Do not
5126 use INTERNAL_FIELD.
5127 (set_symbol_name, set_symbol_function, set_symbol_plist):
5128 (set_symbol_next, set_overlay_plist): New function.
5129 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5130 (struct Lisp_Overlay): Likewise.
5131 (CVAR, MVAR, SVAR): Remove.
5132 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5133 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5134 * xterm.c: Adjust users.
5135 * .gdbinit: Change to use name field of struct Lisp_Symbol
5136 where appropriate.
5137
5138 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5139
5140 Basic functions to set Lisp_Object and pointer slots of intervals.
5141 * intervals.h (interval_set_parent, interval_set_object):
5142 (interval_set_left, interval_set_right, interval_set_plist):
5143 (interval_copy_parent): New function.
5144 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5145 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5146 Adjust indentation.
5147 (INTERVAL_SIZE): Remove. Adjust users.
5148 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5149
5150 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5151
5152 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5153 * process.h (PGET): Remove.
5154 (struct Lisp_Process): Do not use INTERNAL_FIELD.
5155 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5156
5157 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5158
5159 Drop WGET and revert read access to Lisp_Objects slots of struct window.
5160 * window.h (WGET): Remove.
5161 (struct window): Do not use INTERNAL_FIELD.
5162 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5163 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5164 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5165 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5166 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5167 Adjust users.
5168
5169 2012-08-07 Chong Yidong <cyd@gnu.org>
5170
5171 * window.c (Fwindow_edges, Fwindow_pixel_edges)
5172 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5173 (Fdelete_window_internal): Signal an error if the window is not on
5174 a live frame (Bug#12025).
5175
5176 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5177
5178 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5179 * frame.h (FGET): Remove.
5180 (struct frame): Do not use INTERNAL_FIELD.
5181 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5182 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5183 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5184 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5185
5186 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
5187
5188 * w32.c: Silence compiler warnings.
5189 (map_w32_filename): Remove unused variable `is_fat'.
5190 (chase_symlinks): Add parentheses around expression.
5191
5192 2012-08-06 Glenn Morris <rgm@gnu.org>
5193
5194 * sysdep.c: Respect BROKEN_GETWD.
5195
5196 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5197 Let configure handle it.
5198 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5199
5200 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5201
5202 Use GCALIGNMENT where appropriate.
5203 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5204 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5205 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5206
5207 2012-08-06 Eli Zaretskii <eliz@gnu.org>
5208
5209 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5210 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5211
5212 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5213
5214 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5215 that should be sufficient for everyone.
5216
5217 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5218
5219 * keyboard.c (timer_check_2): Add break so timer_check returns next
5220 timeout.
5221
5222 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5223
5224 Fix Windows build errors introduced after converting to WGET and WSET.
5225 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5226 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5227
5228 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5229
5230 * nsterm.m (ns_frame_rehighlight): Use FSET.
5231
5232 * nsmenu.m (ns_update_menubar): Use FSET.
5233
5234 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5235
5236 Separate read and write access to Lisp_Object slots of Lisp_Process.
5237 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5238 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5239
5240 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5241
5242 Separate read and write access to Lisp_Object slots of struct window.
5243 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5244 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5245 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5246 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5247 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5248 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5249 Adjust users.
5250
5251 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5252
5253 Fix Windows build errors introduced after converting to FGET and FSET.
5254 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5255 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5256 (w32_judge_scroll_bars): Change to use FSET.
5257 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5258
5259 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5260
5261 Fix replacement typo.
5262 * window.c (replace_window): Set root_window instead of
5263 selected_window. This fixes a total window subsystem
5264 malfunction reported by Bastien Guerry <bzg@gnu.org>.
5265
5266 2012-08-06 Glenn Morris <rgm@gnu.org>
5267
5268 * lisp.mk (lisp): Add language/persian.elc.
5269
5270 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5271
5272 Separate read and write access to Lisp_Object slots of struct frame.
5273 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5274 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5275 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5276 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5277 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5278
5279 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
5280
5281 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5282
5283 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
5284
5285 Generalize common compile-time constants.
5286 * lisp.h (header_size, bool_header_size, word_size): Now here.
5287 (struct Lisp_Vector): Add comment.
5288 (struct Lisp_Bool_Vector): Move up to define handy constants.
5289 (VECSIZE, PSEUDOVECSIZE): Simplify.
5290 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
5291 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5292 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5293 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5294 * xfont.c, xmenu.c: Use word_size where appropriate.
5295
5296 2012-08-05 Lawrence Mitchell <wence@gmx.li>
5297
5298 * search.c (Freplace_match): Treat \? in the replacement text
5299 literally (Bug#8161).
5300
5301 2012-08-05 Chong Yidong <cyd@gnu.org>
5302
5303 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5304 * frame.c (Vdelete_frame_functions):
5305 * emacs.c (Vkill_emacs_hook): Doc fix.
5306
5307 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5308
5309 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5310 --with-x-toolkit=no builds.
5311 Reported by Carsten Mattner <carstenmattner@gmail.com>.
5312
5313 2012-08-04 Chong Yidong <cyd@gnu.org>
5314
5315 * syntax.c (Fmodify_syntax_entry): Doc fix.
5316
5317 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5318
5319 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
5320 * w32.c (init_environment): Change the default values of many
5321 environment variables in dflt_envvars[] to NULL, to avoid pushing
5322 them into environment when they were not already defined.
5323 Remove the code that deletes site-lisp subdirectories from the default
5324 value of EMACSLOADPATH, as it is no longer needed.
5325 (check_windows_init_file): Now external, not static.
5326 Use Vload_path as is, without adding anything, as this function is now
5327 called when Vload_path is already set up.
5328
5329 * w32.h (check_windows_init_file): Add prototype.
5330
5331 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5332 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5333 compatibility with Posix platforms.
5334 (main): Move the call to check_windows_init_file to here from
5335 w32.c.
5336 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5337 any, in the DEFALT argument into the root of the Emacs build or
5338 installation tree, as appropriate.
5339
5340 * callproc.c (init_callproc_1): Call decode_env_path instead of
5341 doing its equivalent by hand.
5342 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5343 the code that sets Vexec_path run on MS-Windows.
5344
5345 * lread.c (init_lread): Add comments to #ifdef's.
5346
5347 * msdos.c (dos_set_window_size, IT_update_begin)
5348 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5349 instead of direct references.
5350
5351 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
5352
5353 Export DEFAULT_REHASH_* to GDB.
5354 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5355 Now constants, not macros.
5356
5357 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
5358
5359 Remove unnecessary casts involving pointers.
5360 These casts are no longer needed now that we assume C89 or later,
5361 since they involve casting to or from void *.
5362 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5363 (make_pure_float, make_pure_vector):
5364 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5365 * macros.c (Fstart_kbd_macro):
5366 * menu.c (find_and_return_menu_selection):
5367 * minibuf.c (read_minibuf_noninteractive):
5368 * sysdep.c (closedir):
5369 * xdisp.c (x_produce_glyphs):
5370 * xfaces.c (compare_fonts_by_sort_order):
5371 * xfns.c (x_real_positions, select_visual):
5372 * xselect.c (x_stop_queuing_selection_requests)
5373 (x_get_window_property, x_get_window_property_as_lisp_data):
5374 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
5375 Remove unnecessary pointer casts.
5376 * alloc.c (record_xmalloc): New function.
5377 * lisp.h (record_xmalloc): New decl.
5378 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
5379 more like a function. This is because the pointer cast is not
5380 needed. All uses changed.
5381 * print.c (print_string, print_error_message): Avoid length recalc.
5382
5383 Improve fix for macroexp crash with debugging (Bug#12118).
5384 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
5385 ARRAY_MARK_FLAG when checking subscripts, because ASET is
5386 not supposed to be invoked from the garbage collector.
5387 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
5388 (gc_aset): New function, which is like ASET but can be
5389 used in the garbage collector.
5390 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5391 (set_hash_index): Use it instead of ASET.
5392
5393 2012-08-03 Eli Zaretskii <eliz@gnu.org>
5394
5395 Support symlinks on latest versions of MS-Windows.
5396 * w32.c: Include winioctl.h and aclapi.h.
5397 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
5398 (revert_to_self): Forward declarations of static functions.
5399 <static BOOL g_b_init_get_security_info>:
5400 <g_b_init_create_symbolic_link>: New static flags.
5401 (globals_of_w32): Initialize them to zero.
5402 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
5403 (map_w32_filename): Improve commentary. Simplify switch.
5404 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
5405 headers (most versions of MinGW w32api don't).
5406 (get_security_info, create_symbolic_link)
5407 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
5408 New functions.
5409 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
5410 in the argument file name.
5411 (sys_access): Call unc_volume_file_attributes only if
5412 GetFileAttributes fails with network-related error codes.
5413 (sys_rename): Diagnose renaming of a symlink when the user doesn't
5414 have the required privileges.
5415 (get_file_security_desc_by_name): Rename from
5416 get_file_security_desc.
5417 (stat_worker): New function, with most of the guts of 'stat', and
5418 with addition of handling of symlinks and support for 'lstat'.
5419 If possible, get file's attributes and security information by
5420 handle, not by name. Produce S_IFLNK bit for symlinks, when
5421 called from 'lstat'.
5422 (stat, lstat): New functions, call 'stat_worker'.
5423 (symlink, readlink, careadlinkat): Rewritten to create and resolve
5424 symlinks when the underlying filesystem supports them.
5425
5426 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5427
5428 Fix macroexp crash on Windows with debugging (Bug#12118).
5429 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
5430 checking subscripts; problem introduced with the recent
5431 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
5432 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
5433 since it's used in non-static inline functions now.
5434
5435 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
5436 Don't assume buffer size fits in 'int'. Remove unused local.
5437
5438 Use C99-style 'extern inline' if available.
5439 * buffer.h (BUFFER_INLINE):
5440 * category.h (CATEGORY_INLINE):
5441 * character.h (CHARACTER_INLINE):
5442 * charset.h (CHARSET_INLINE):
5443 * composite.h (COMPOSITE_INLINE):
5444 * dispextern.h (DISPEXTERN_INLINE):
5445 * lisp.h (LISP_INLINE):
5446 * systime.h (SYSTIME_INLINE):
5447 New macro, replacing 'static inline' in this header.
5448 * buffer.h, category.h, character.h, charset.h, composite.h:
5449 * dispextern.h, lisp.h, systime.h:
5450 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5451 * alloc.c (LISP_INLINE):
5452 * buffer.c (BUFFER_INLINE):
5453 * category.c (CATEGORY_INLINE):
5454 * character.c (CHARACTER_INLINE):
5455 * charset.c (CHARSET_INLINE):
5456 * composite.c (COMPOSITE_INLINE):
5457 * dispnew.c (DISPEXTERN_INLINE):
5458 * sysdep.c (SYSTIME_INLINE):
5459 Define to EXTERN_INLINE, so that the corresponding functions
5460 are compiled into code.
5461 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
5462 (INLINE_HEADER_END): New macros.
5463 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
5464 since it's used in non-static inline functions now.
5465 (VALMASK) [!USE_LSB_TAG]: Likewise.
5466
5467 2012-08-02 Glenn Morris <rgm@gnu.org>
5468
5469 * s/: Remove empty directory.
5470
5471 * s/ms-w32.h: Move to ../nt/inc.
5472 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
5473 Update for new ms-w32.h location.
5474
5475 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5476
5477 Port to Solaris 8.
5478 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
5479
5480 2012-08-02 Glenn Morris <rgm@gnu.org>
5481
5482 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
5483 hard-coding the path separator.
5484
5485 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5486
5487 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
5488 This how ASET and AREF are supposed to work, and makes
5489 it easier to think about future improvements. See
5490 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
5491 * charset.h (set_charset_attr): New function.
5492 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
5493 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
5494 (aref_addr): New function. All uses of &AREF(...) changed.
5495 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5496 (set_hash_index): New functions. All lvalue-style uses of
5497 HASH_KEY etc. changed.
5498 * keyboard.c (set_prop): New function. All lvalue-style uses
5499 of PROP changed.
5500
5501 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
5502
5503 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
5504 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
5505 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
5506 * nsfns.m (ns_set_name_as_filename): Likewise.
5507 * nsmenu.m (ns_update_menubar): Likewise.
5508 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
5509
5510 2012-08-01 Eli Zaretskii <eliz@gnu.org>
5511
5512 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
5513 Adapt to latest changes in field names of the corresponding Lisp
5514 objects.
5515
5516 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
5517
5518 2012-08-01 Glenn Morris <rgm@gnu.org>
5519
5520 * s/msdos.h: Remove file.
5521 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
5522 * Makefile.in (S_FILE): Remove.
5523 (config_h): Remove S_FILE.
5524
5525 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5526
5527 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5528 Remove; moved to nt/config.nt.
5529
5530 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5531
5532 Use INTERNAL_FIELD for conses and overlays.
5533 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5534 Remove obsolete comment.
5535 (MVAR): New macro.
5536 (struct Lisp_Overlay): Use INTERNAL_FIELD.
5537 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5538
5539 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5540
5541 Use INTERNAL_FIELD for symbols.
5542 * lisp.h (SVAR): New macro. Adjust users.
5543 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5544 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5545
5546 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5547
5548 Use INTERNAL_FIELD for processes.
5549 * process.h (PVAR): New macro. Adjust style.
5550 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5551 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5552
5553 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5554
5555 Use INTERNAL_FIELD for windows.
5556 * window.h (WVAR): New macro.
5557 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5558 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5559 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5560 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5561 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5562 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5563
5564 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5565
5566 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5567
5568 2012-08-01 Glenn Morris <rgm@gnu.org>
5569
5570 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5571 Move to configure.ac.
5572
5573 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5574
5575 * makefile.w32-in (CONFIG_H): Update dependencies.
5576 (CONF_POST_H): New macro.
5577
5578 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5579
5580 2012-07-31 Glenn Morris <rgm@gnu.org>
5581
5582 * Makefile.in (S_FILE): No longer set by configure.
5583
5584 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5585 is available.
5586 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5587
5588 * process.h (NULL_DEVICE):
5589 * emacs.c (SEPCHAR):
5590 * editfns.c (USER_FULL_NAME): Let configure set them.
5591
5592 * s/README, s/template.h: Remove files.
5593
5594 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5595
5596 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5597 Move to configure.ac.
5598
5599 2012-07-31 Eli Zaretskii <eliz@gnu.org>
5600
5601 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5602 resulting renaming of 'struct frame' members.
5603
5604 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5605
5606 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5607 after introduction of FVAR.
5608
5609 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5610
5611 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5612
5613 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5614 instead of compositeToPoint.
5615 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5616
5617 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5618
5619 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5620
5621 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5622 * lisp.h (INTERNAL_FIELD): New macro.
5623 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5624 (BVAR): Change to use INTERNAL_FIELD.
5625 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5626 (KVAR): Change to use INTERNAL_FIELD.
5627 * frame.h (FVAR): New macro.
5628 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5629 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5630 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5631 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5632 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5633
5634 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5635
5636 Miscellaneous fixes for non-default X toolkits.
5637 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5638 * xterm.c (x_frame_of_widget): Remove redundant prototype.
5639 Move under #ifdef USE_LUCID.
5640 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5641 definition and usage to avoid warnings.
5642
5643 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5644
5645 * nsterm.m (openFiles): Fix previous checkin.
5646
5647 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
5648
5649 * indent.c (compute_motion): Remove unused local.
5650
5651 2012-07-31 Glenn Morris <rgm@gnu.org>
5652
5653 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5654
5655 * conf_post.h [USG5_4]:
5656 Move remaining contents of s/usg5-4-common.h here.
5657 * s/usg5-4-common.h: Remove file.
5658
5659 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5660 * s/irix6-5.h: Remove file.
5661
5662 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5663 * s/darwin.h: Remove file.
5664
5665 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5666 * s/hpux10-20.h: Remove file, which is now empty.
5667
5668 2012-07-30 Glenn Morris <rgm@gnu.org>
5669
5670 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5671 * Makefile.in (config_h): Add conf_post.h.
5672 * makefile.w32-in (CONFIG_H): Add conf_post.h.
5673
5674 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
5675
5676 * nsterm.m (ns_do_open_file): New variable.
5677 (ns_term_init): Set ns_do_open_file to YES after run returns.
5678 (openFile, openTempFile, openFileWithoutUI, openFiles):
5679 Open files only if ns_do_open_file.
5680
5681 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5682
5683 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5684 This no-op macro hasn't been needed for many years.
5685 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5686
5687 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5688 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5689 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5690 gdb_make_enums_visible.
5691 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5692 (DIRECTORY_SEP): Now a constant, not a macro.
5693
5694 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5695
5696 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5697 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5698
5699 * w32term.c <w32_keyboard_codepage>: Renamed from
5700 keyboard_codepage and now external. All users changed.
5701
5702 * w32term.h: Add declaration of w32_keyboard_codepage.
5703
5704 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5705 the codepage to translate keys to Unicode. If this argument is
5706 -1, use the value returned by GetConsoleCP. All callers changed.
5707
5708 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5709
5710 Update .PHONY listings in makefiles.
5711 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5712 bootstrap-clean, distclean, maintainer-clean, versioclean,
5713 extraclean, frc.
5714
5715 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5716 This is a bit clearer. Fix some commentary typos.
5717
5718 2012-07-30 Glenn Morris <rgm@gnu.org>
5719
5720 * s/netbsd.h: Let configure include signal.h if needed.
5721 Remove file, which is now empty.
5722
5723 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5724 Let configure set them.
5725 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5726 No more need to undefine.
5727
5728 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5729
5730 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5731 non-single-byte char when adding meta modifier. (Bug#12090)
5732
5733 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5734
5735 Convert safe_call to use variable number of arguments.
5736 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5737 (safe_call2): Fix comment.
5738 * lisp.h (safe_call): Adjust prototype.
5739 * coding.c (encode_coding_object): Change to use safe_call2.
5740 * xfaces.c (merge_face_heights): Change to use safe_call1.
5741
5742 2012-07-30 Glenn Morris <rgm@gnu.org>
5743
5744 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5745 does that unconditionally. Remove file, which is now empty.
5746
5747 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5748 Remove empty files.
5749
5750 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5751
5752 Export to GDB most of lisp.h's remaining object-like macros.
5753 * lisp.h (min, max): Move earlier, because they're used earlier now.
5754 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5755 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5756 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5757 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5758 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5759 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5760 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5761 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5762 Now constants, for GDB. They need not be macros.
5763 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5764 Now constants, for GDB, as well as macros, for static initializers.
5765 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5766 Move to after the definition of struct Lisp_Char_Table,
5767 since the former now needs that type defined.
5768 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5769 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5770 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5771 New enums, for gdb_make_enums_visible.
5772 (GLYPH_MODE_LINE_FACE): Remove; unused.
5773 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5774 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5775 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5776 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5777 enum maxargs, enum MAX_ALLOCA.
5778 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5779 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5780 no longer needed, now that they are done in lisp.h.
5781
5782 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5783
5784 Cleanup string bytes checking.
5785 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5786 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5787 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5788 (check_sblock, compact_small_strings): Simplify.
5789
5790 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5791
5792 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5793 These macros are confusing and no longer need to be defined, as
5794 the enum values now suffice. All uses replaced with definiens.
5795 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5796
5797 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5798
5799 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5800 ($(BLD)/w32console.$(O)): Update dependencies.
5801
5802 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5803
5804 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5805 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5806 time. Adjust users.
5807 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5808
5809 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5810
5811 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5812 setting sitelisp (Bug#12010).
5813
5814 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5815
5816 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5817
5818 * w32heap.c (cache_system_info):
5819 * w32.c (sys_rename):
5820 * w32proc.c (find_child_console, sys_kill): All users changed.
5821
5822 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5823
5824 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5825
5826 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5827
5828 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5829
5830 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5831
5832 Cleanup statistics calculation in Fgarbage_collect.
5833 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5834 Fix zombies percentage calculation. Simplify elapsed time calculation.
5835
5836 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5837
5838 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5839 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5840 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5841 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5842 (replace_range, replace_range_2, del_range_2): Change to eassert.
5843 * marker.c (byte_char_debug_check): Adjust style.
5844
5845 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5846
5847 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5848 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5849 long-ago-commented-out code that talks about "WIN32".
5850 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5851 All uses changed.
5852
5853 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5854
5855 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5856 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5857 Simplify by using alignof.
5858 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5859 * lisp.h: Include <stdalign.h>.
5860 (GCALIGNMENT): New macro and constant.
5861 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5862 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5863 (stdalign): New macro, if not already defined.
5864
5865 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5866
5867 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5868 * w32inevt.c: Include w32inevt.h.
5869 (w32_read_console_input): New inline function, calls either
5870 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5871 w32_console_unicode_input.
5872 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5873 (w32_kbd_patch_key, key_event): Use the codepage returned by
5874 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5875 (key_event): use uChar.UnicodeChar only if
5876 w32_console_unicode_input is non-zero.
5877
5878 * w32console.c: Include w32heap.h.
5879 <w32_console_unicode_input>: New global variable.
5880 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5881 family of Windows, zero otherwise.
5882
5883 * w32inevt.h: Declare w32_console_unicode_input.
5884
5885 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5886 --without-x. (Bug#11742)
5887
5888 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5889
5890 Adjust GDB to reflect pvec_type changes (Bug#12036).
5891 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5892 2012-07-04 changes to pseudovector representation.
5893 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5894
5895 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5896
5897 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5898 bus address.
5899 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5900
5901 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5902
5903 * alloc.c (listn): Fix the order the arguments are consed onto the
5904 list.
5905
5906 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5907 enumeration constants, as PURE and HEAP are too general, and clash
5908 with other headers and sources, such as gmalloc.c and the
5909 MS-Windows system headers. All users changed.
5910
5911 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5912
5913 Revert last save_excursion_save and save_excursion_restore changes.
5914 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5915 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5916
5917 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5918
5919 Fix recently-introduced typos in Windows port.
5920 Reported by Martin Rudalics <rudalics@gmx.at>.
5921 * w32.c (init_environment): Replace comma with semicolon.
5922 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5923
5924 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5925
5926 Improve GDB symbol export (Bug#12036).
5927 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5928 arms of an 'if', not using conditional expressions; otherwise GDB
5929 complains about the types in the unevaluated arm when the argument
5930 is an integer literal.
5931 (xgetint): Simplify expression.
5932 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5933 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5934 Zaretskii in <http://bugs.gnu.org/12036#13>.
5935 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5936 needed now that we have gdb_make_enums_visible.
5937 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5938 (enum enum_USE_LSB_TAG):
5939 New enum types, packaging up enums that need to be exported to GDB.
5940
5941 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5942
5943 Utility function to make a list from specified amount of objects.
5944 * lisp.h (enum constype): New datatype.
5945 (listn): New prototype.
5946 * alloc.c (listn): New function.
5947 (Fmemory_use_count, syms_of_alloc): Use it.
5948 * buffer.c (syms_of_buffer): Likewise.
5949 * callint.c (syms_of_callint): Likewise.
5950 * charset.c (define_charset_internal): Likewise.
5951 * coding.c (syms_of_coding): Likewise.
5952 * keymap.c (syms_of_keymap): Likewise.
5953 * search.c (syms_of_search): Likewise.
5954 * syntax.c (syms_of_syntax): Likewise.
5955 * w32.c (init_environment): Likewise.
5956 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5957 * xdisp.c (syms_of_xdisp): Likewise.
5958 * xfns.c (syms_of_xfns): Likewise.
5959
5960 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5961
5962 Fast save_excursion_save and save_excursion_restore.
5963 * lisp.h (struct Lisp_Excursion): New data type.
5964 (PVEC_EXCURSION): New pseudovector type.
5965 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5966 to deal with it. Adjust comments.
5967 (init_marker, attach_marker): New prototype.
5968 (unchain_marker): Adjust prototype.
5969 * marker.c (attach_marker): Change to global.
5970 (init_marker): New function.
5971 * alloc.c (Fmake_marker, build_marker): Use it.
5972 (build_marker): More easserts.
5973 (mark_object): Handle struct Lisp_Excursion.
5974 * editfns.c (save_excursion_save, save_excursion_restore):
5975 Reimplement to use struct Lisp_Excursion. Add comments.
5976
5977 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5978
5979 Fix export of symbols to GDB (Bug#12036).
5980 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5981 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5982 emacs.c, as this is a more-suitable home. Had this been done earlier
5983 the fix for 12036 would have avoided some of the problems noted in
5984 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5985 would have been more obvious.
5986 * emacs.c: Do not include <verify.h>; no longer needed.
5987 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5988 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5989 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5990 Remove; now done in lisp.h.
5991 * lisp.h (PUBLISH_TO_GDB): New macro.
5992 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5993 (DATA_SEG_BITS): Use it.
5994 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5995 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5996 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5997 not be usable in #if. This simplifies things.
5998
5999 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
6000
6001 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6002
6003 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6004
6005 Simplify export of symbols to GDB (Bug#12036).
6006 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6007 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6008 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6009 Adjust to changes in lisp.h and emacs.c, by using
6010 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6011 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6012 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6013 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6014 instead of gdb_valbits.
6015 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6016 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6017 instead of gdb_array_mark_flag.
6018 (xboolvector): Get size from $->size, not $->header.size.
6019 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6020 (xreload, hook-run, hookpost-run): Remove.
6021 * emacs.c: Include <verify.h>.
6022 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6023 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6024 Remove.
6025 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6026 (gdb_USE_LSB_TAG): New enum constants.
6027 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6028 Also define these as enum constants, so they're visible to GDB.
6029 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6030 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6031 as constants, so they're visible to GDB.
6032 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6033 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6034 Now enum constants, not macros, so they're visible to GDB.
6035 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6036 more convenient now. All uses changed.
6037 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6038 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6039
6040 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6041
6042 Explicitly free restriction data that are not needed anymore.
6043 * editfns.c (save_restriction_restore): Free restriction data.
6044
6045 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6046
6047 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6048 add argument, tune behavior, and adjust all callers.
6049
6050 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6051
6052 Use typedef for EMACS_INT, EMACS_UINT.
6053 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6054 than macros. This simplifies debugging in the usual case, since
6055 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6056 and it allows expressions involving EMACS_INT casts.
6057 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6058
6059 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6060
6061 * nsterm.m (ns_read_socket): Return early if there is a modal
6062 window (Bug#12043).
6063
6064 2012-07-25 Martin Rudalics <rudalics@gmx.at>
6065
6066 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6067 that FOCUS-FRAME can be omitted.
6068
6069 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6070
6071 Adjust buffer text indirection counters at the end of Fkill_buffer.
6072 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6073 buffer is definitely dead. This should really fix an issue reported
6074 by Christoph Scholtes again. (Bug#12007).
6075 (init_buffer_once): Initialize indirection counters of
6076 buffer_defaults and buffer_local_symbols (for sanity and safety).
6077
6078 2012-07-24 Eli Zaretskii <eliz@gnu.org>
6079
6080 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6081 and continuation glyphs on tooltip frames, leave them at zero.
6082 Avoids continued lines in tooltips. (Bug#11832)
6083
6084 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6085
6086 Simplify copy_overlay.
6087 * buffer.c (copy_overlay): Simplify. Use build_marker.
6088 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6089
6090 2012-07-23 Eli Zaretskii <eliz@gnu.org>
6091
6092 * print.c (print_object): Don't crash when a frame's name is nil
6093 or invalid. (Bug#12025)
6094
6095 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6096 it signals an error when a tooltip frame is being created.
6097
6098 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6099
6100 Cleanup miscellaneous objects allocation and initialization.
6101 * alloc.c (allocate_misc): Change to static. Add argument to
6102 specify the subtype. Adjust comment and users.
6103 (build_overlay): New function.
6104 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6105 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6106 (allocate_misc): Remove prototype.
6107 (build_overlay): Add prototype.
6108
6109 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6110
6111 Swap buffer text indirection counters in Fbuffer_swap_text.
6112 * buffer.c (Fbuffer_swap_text): Swap indirections too.
6113 This avoids crash reported by Christoph Scholtes at
6114 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6115
6116 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
6117
6118 * nsmenu.m (Popdown_data): New struct.
6119 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
6120 free Popdown_data.
6121 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6122 (initWithContentRect): Make imgView and contentView non-static
6123 and autorelease them. Also autorelease img and matrix (Bug#12005).
6124 (dealloc): Remove (Bug#12005).
6125
6126 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6127
6128 Adjust consing_since_gc when objects are explicitly freed.
6129 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6130 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
6131 (free_cons, free_misc): Subtract object size from consing_since_gc.
6132
6133 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6134
6135 Simplify and cleanup markers positioning code.
6136 * marker.c (attach_marker): More useful eassert.
6137 (live_buffer, set_marker_internal): New function.
6138 (Fset_marker, set_marker_restricted): Use set_marker_internal.
6139 (set_marker_both, set_marker_restricted_both): Use live_buffer.
6140
6141 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
6142
6143 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6144 as it's limited by the amount of memory, not by INT_MAX.
6145
6146 2012-07-21 Eli Zaretskii <eliz@gnu.org>
6147
6148 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6149 in special-event-map. See the discussion at
6150 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6151 for the reasons.
6152
6153 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6154 info.dwItemData. Fixes crashes on 64-bit Windows.
6155 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6156
6157 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
6158
6159 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
6160 (conversationIdentifier): Return value is NSInteger.
6161 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6162
6163 2012-07-21 Chong Yidong <cyd@gnu.org>
6164
6165 * window.c (decode_any_window): Signal an error if the window is
6166 on a dead frame (Bug#11984).
6167
6168 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6169
6170 Add indirection counting to speed up Fkill_buffer.
6171 * buffer.h (struct buffer): New member.
6172 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6173 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6174 base buffer indirection counter.
6175 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6176 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6177 through buffer list if indirection counter is 0.
6178
6179 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6180
6181 Extend the value returned by Fgarbage_collect with heap statistics.
6182 * alloc.c (Qheap): New symbol.
6183 (syms_of_alloc): DEFSYM it.
6184 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6185 (Fmemory_free): Remove.
6186 (syms_of_alloc): Don't defsubr it.
6187 * buffer.c (Fcompact_buffer): Remove.
6188 (syms_of_buffer): Don't defsubr it.
6189
6190 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6191
6192 Make maybe_gc inline.
6193 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6194 * lisp.h (consing_since_gc, gc_relative_threshold)
6195 (memory_full_cons_threshold): Revert declaration.
6196 (maybe_gc): Remove prototype, define as inline.
6197 * alloc.c: Remove old commented-out code.
6198 (consing_since_gc, gc_relative_threshold)
6199 (memory_full_cons_threshold): Revert to global.
6200 (maybe_gc): Remove.
6201
6202 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6203
6204 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6205 * lisp.h (build_unibyte_string): New function.
6206 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6207 * sysdep.c, w32fns.c, xfns.c: Use it.
6208 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6209 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6210 Adjust users accordingly.
6211 * font.h (font_open_by_name): Adjust prototype.
6212
6213 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6214
6215 Cleanup calls to Fgarbage_collect.
6216 * lisp.h (maybe_gc): New prototype.
6217 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6218 Remove declarations.
6219 * alloc.c (maybe_gc): New function.
6220 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6221 Make them static.
6222 * bytecode.c (MAYBE_GC): Use maybe_gc.
6223 * eval.c (eval_sub, Ffuncall): Likewise.
6224 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6225 to avoid dependency from auto-save feature.
6226
6227 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6228
6229 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6230 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6231 'for_each_per_buffer_object_at'.
6232 All uses changed. It's better to use upper-case for macros that
6233 cannot be implemented as functions, to give the reader a clue
6234 that they're special.
6235
6236 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
6237
6238 * alloc.c (Fgarbage_collect): Tweak docstring.
6239
6240 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6241
6242 Tweak the value returned from Fgarbage_collect again.
6243 * alloc.c (Fgarbage_collect): New return value, as confirmed in
6244 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6245 Adjust documentation.
6246 (total_vector_bytes): Rename to total_vector_slots, adjust
6247 accounting.
6248 (total_free_vector_bytes): Rename to total_free_vector_slots,
6249 adjust accounting.
6250 (Qstring_bytes, Qvector_slots): New symbols.
6251 (syms_of_alloc): DEFSYM them.
6252
6253 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6254
6255 Buffer compaction primitive which may be used from Lisp.
6256 * buffer.c (compact_buffer, Fcompact_buffer): New function.
6257 (syms_of_buffer): Register Fcompact_buffer.
6258 * alloc.c (Fgarbage_collect): Use compact_buffer.
6259 * buffer.h (compact_buffer): New prototype.
6260 (struct buffer_text): New member.
6261
6262 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6263
6264 New macro to iterate over all buffers, miscellaneous cleanups.
6265 * lisp.h (all_buffers): Remove declaration.
6266 * buffer.h (all_buffers): Add declaration, with comment.
6267 (for_each_buffer): New macro.
6268 * alloc.c (Fgarbage_collect, mark_object): Use it.
6269 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6270 (init_buffer): Likewise.
6271 * data.c (Fset_default): Likewise.
6272 * coding.c (code_conversion_restore): Remove redundant check
6273 for dead buffer.
6274 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
6275
6276 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6277
6278 Fix bug that created negative-length intervals.
6279 * intervals.c (merge_interval_right, merge_interval_left):
6280 Do not zero out this interval if it is absorbed by its children,
6281 as this interval's total length doesn't change in that case. See
6282 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6283
6284 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
6285
6286 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6287 when invoking (make-bool-vector N t) and N is a positive
6288 multiple of 8 -- the last 8 bits were mistakenly cleared.
6289
6290 Remove some struct layout assumptions in bool vectors.
6291 * alloc.c (bool_header_size): New constant.
6292 (header_size, word_size): Move earlier, as they're now used earlier.
6293 Use 'word_size' in a few more places, where it's appropriate.
6294 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6295 padding before the data member of a bool vector.
6296 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6297 than doing the check by hand with an abort ().
6298
6299 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6300
6301 * eval.c (Fdefvar): Don't check constants since we only set the var if
6302 it's not yet defined anyway (bug#11904).
6303
6304 * lisp.h (last_undo_boundary): Declare new var.
6305 * keyboard.c (command_loop_1): Set it.
6306 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6307 were auto-added by the command loop (bug#11774).
6308
6309 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6310
6311 * w32font.c (Qsymbol): Remove local definition.
6312 (syms_of_w32font): Don't DEFSYM it.
6313
6314 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6315
6316 Fix sweep_vectors to handle large bool vectors correctly.
6317 * alloc.c (sweep_vectors): Account total_vector_bytes for
6318 bool vectors larger than VBLOCK_BYTES_MAX.
6319
6320 2012-07-18 Chong Yidong <cyd@gnu.org>
6321
6322 * frame.c (x_set_frame_parameters): Revert bogus change introduced
6323 in 2012-05-25 commit by Paul Eggert (Bug#11738).
6324
6325 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6326
6327 Return more descriptive data from Fgarbage_collect.
6328 Suggested by Stefan Monnier in
6329 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6330 * alloc.c (bounded_number): New function.
6331 (total_buffers, total_vectors): New variable.
6332 (total_string_size): Rename to total_string_bytes, adjust users.
6333 (total_vector_size): Rename to total_vector_bytes, adjust users.
6334 (sweep_vectors): Account total_vectors and total_vector_bytes.
6335 (Fgarbage_collect): New return value. Adjust documentation.
6336 (gc_sweep): Account total_buffers.
6337 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6338 (VECTOR_SIZE): Remove.
6339 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6340 (Qinterval, Qmisc): New symbols.
6341 (syms_of_data): Initialize them.
6342 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6343 (Qcons, Qbuffer): New declarations.
6344
6345 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6346
6347 * alloc.c (Fmemory_free): Account for memory-free's own storage.
6348 Round up, not down. Improve doc.
6349
6350 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6351
6352 Restore old code in allocate_string_data to avoid Faset breakage.
6353 Reported by Julien Danjou <julien@danjou.info> in
6354 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6355 * alloc.c (allocate_string_data): Restore old code with minor
6356 adjustments, fix comment to explain this subtle issue.
6357
6358 2012-07-17 Eli Zaretskii <eliz@gnu.org>
6359
6360 Remove FILE_SYSTEM_CASE.
6361 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6362
6363 * fileio.c (FILE_SYSTEM_CASE): Don't define.
6364 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6365 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6366 call-process-region passes it through expand-file-name.
6367
6368 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6369
6370 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6371
6372 Fix crash when creating indirect buffer (Bug#11917)
6373 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
6374 Don't handle unbound variables specially if non-zero.
6375 (Fbuffer_local_variables): Pass zero.
6376 (clone_per_buffer_values): Pass non-zero.
6377
6378 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6379
6380 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
6381 to make the loop interruptible.
6382
6383 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6384
6385 * gnutls.c (emacs_gnutls_handshake): Only retry if
6386 GNUTLS_E_INTERRUPTED.
6387
6388 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6389
6390 Cleanup and convert miscellaneous checks to eassert.
6391 * alloc.c (mark_interval): Fix comment, partially rephrase
6392 old comment from intervals.h (see below).
6393 * intervals.c (find_interval, adjust_intervals_for_insertion)
6394 (delete_interval, adjust_intervals_for_deletion)
6395 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
6396 Convert to eassert.
6397 (adjust_intervals_for_insertion, make_new_interval):
6398 Remove obsolete and unused code.
6399 * intervals.h (struct interval): Remove obsolete comment.
6400 * textprotp.c (erase_properties): Remove unused code.
6401 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
6402 (Fremove_list_of_text_properties): Convert to eassert.
6403
6404 2012-07-17 Chong Yidong <cyd@gnu.org>
6405
6406 * editfns.c (Finsert_char): Doc fix.
6407
6408 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6409
6410 Fix previous change to make Fmemory_free always accurate.
6411 * alloc.c (make_interval): Update total_free_intervals.
6412 (make_float): Likewise for total_free_floats.
6413 (free_cons, Fcons): Likewise for total_free_conses.
6414 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
6415 Likewise for total_free_vector_bytes.
6416 (Fmake_symbol): Likewise for total_free_symbols.
6417 (bytes_free): Remove.
6418
6419 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6420
6421 Simple free memory accounting feature.
6422 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
6423 (sweep_vectors): Accumulate size of free vectors.
6424 (Fgarbage_collect): Setup bytes_free.
6425 (Fmemory_free): New function.
6426 (syms_of_alloc): Register it.
6427
6428 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6429
6430 Cleanup overlays checking.
6431 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
6432 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
6433 eassert and OVERLAYP.
6434 (sort_overlays): Change to use OVERLAYP.
6435
6436 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
6437
6438 * editfns.c (Finsert_char): Make it interactive, and make the
6439 second arg optional. Copy interactive spec and docstring from
6440 ucs-insert.
6441
6442 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6443
6444 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
6445 Unlike the other wrapped functions, fabs has an unspecified
6446 effect on errno.
6447
6448 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
6449
6450 * nsterm.m (keyDown): Interpret flags without left/right bits
6451 as the left key (Bug#11670).
6452
6453 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6454
6455 Remove empty and useless init functions.
6456 * lisp.h (init_character_once, init_fns, init_image)
6457 (init_filelock, init_sound): Remove prototype.
6458 * character.c (init_character_once): Remove.
6459 * filelock.c (init_filelock): Likewise.
6460 * fns.c (init_fns): Likewise.
6461 * image.c (init_image): Likewise.
6462 * sound.c (init_sound): Likewise.
6463 * emacs.c (main): Adjust accordingly.
6464
6465 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6466
6467 * gtkutil.h: Tiny cleanups.
6468 (use_old_gtk_file_dialog): Remove useless declaration.
6469 (xg_uses_old_file_dialog): Add suggested const attribute.
6470
6471 2012-07-15 Eli Zaretskii <eliz@gnu.org>
6472
6473 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
6474 (bidi_paragraph_init): Use it to limit search forward for a strong
6475 directional character in abnormally large paragraphs full of
6476 neutral or weak characters. (Bug#11943)
6477
6478 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
6479
6480 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
6481 the toolbar (Bug#9451).
6482 (xg_make_tool_item): Give the widget event box a transparent
6483 background.
6484
6485 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6486
6487 Cleanup basic allocation variables and functions.
6488 * alloc.c (ignore_warnings, init_intervals, init_float)
6489 (init_cons, init_symbol, init_marker): Remove.
6490 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
6491 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
6492 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
6493 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
6494 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
6495 (staticidx, init_alloc_once, init_strings, free_ablock):
6496 Remove redundant initialization.
6497 * fns.c (init_weak_hash_tables): Remove.
6498 * lisp.h (init_weak_hash_tables): Remove prototype.
6499
6500 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6501
6502 Use zero_vector where appropriate.
6503 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
6504 accordingly.
6505 * lisp.h (zero_vector): New declaration.
6506 * font.c (null_vector): Remove.
6507 (syms_of_font): Remove initialization and staticpro.
6508 (font_list_entities, font_find_for_lface): Change to use zero_vector.
6509 * keymap.c (Faccessible_keymaps): Likewise.
6510
6511 2012-07-15 Leo Liu <sdl.web@gmail.com>
6512
6513 * fringe.c: Fix typo in comments.
6514
6515 2012-07-14 Leo Liu <sdl.web@gmail.com>
6516
6517 * fringe.c: Add a new bitmap exclamation-mark.
6518
6519 2012-07-14 Eli Zaretskii <eliz@gnu.org>
6520
6521 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
6522
6523 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
6524 (HAVE_MENUS): Don't define, defined by editing config.in with
6525 msdos/sed2v2.inp.
6526 (GMALLOC_INHIBIT_VALLOC): Don't define.
6527 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6528
6529 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
6530
6531 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6532
6533 2012-07-14 Glenn Morris <rgm@gnu.org>
6534
6535 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6536 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6537 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6538
6539 2012-07-13 Glenn Morris <rgm@gnu.org>
6540
6541 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6542
6543 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6544 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6545
6546 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
6547
6548 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6549 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6550 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6551 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6552 where appropriate.
6553 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6554 as boolean expression.
6555 (x_set_window_size): Remove unused variable toolbar.
6556 (ns_get_color_default, ns_mod_to_lisp): Remove.
6557 (ns_mouse_position): Remove unused variables xchar and ychar.
6558 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6559 (ns_set_vertical_scroll_bar): Remove unused variable count.
6560 (ns_delete_terminal): Remove unused variable i.
6561 (ns_term_init): Remove unused variables r, g and b.
6562 (mouseDown): Remove unused variable window.
6563 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6564 (initFrameFromEmacs): Remove unused variable vbextra.
6565 (mouseEntered): Remove unused variables p and dpyinfo.
6566 (mouseExited): Remove unused variables p and r.
6567 (ns_define_frame_cursor, ns_clear_frame_area)
6568 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6569 (menuDown): Assign [sender tag] to variable and cast the variable.
6570
6571 * nsterm.h (menuDown): Add id as type to argument sender.
6572 (ns_display_info_for_name): Add Lisp_Object argument.
6573 (ns_term_init): Add Lisp_Object argument.
6574 (ns_map_event_to_object): Add void argument.
6575 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6576 prototype with arguments and only declare if __OBJC__.
6577 (nxatoms_of_nsselect): Add void argument.
6578 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6579 (ns_alloc_autorelease_pool): Add void argument.
6580 (ns_release_autorelease_pool): Add void* argument.
6581 (ns_get_defaults_value): Add const char* argument.
6582
6583 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6584 (initFromContents): Use SSDATA where appropriate.
6585 (ns_update_menubar): Add braces to ambigous if-else.
6586 (initWithTitle): Put () around assignment in if statement.
6587 (ns_menu_show): Remove unused variables window and keymap.
6588 (update_frame_tool_bar): Remove unused variable selected_p.
6589 (initWithContentRect): Remove unused variable this_cmd_name.
6590
6591 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6592 appropriate.
6593 (setXBMColor): Remove unused variable len.
6594 (setPixmapData): Put () around assignment in loop statement.
6595
6596 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6597 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6598 where appropriate.
6599 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6600 around assignment in loop statement.
6601 (nsfont_open): Remove unused variable i.
6602 (nsfont_open): Remove unused variable len.
6603 (nsfont_draw): Remove unused variable cs.
6604
6605 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6606 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6607 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6608 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6609 (Fns_font_name, Fns_perform_service)
6610 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6611 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6612 (ns_set_name): Remove unused variable view.
6613 (x_set_menu_bar_lines): Remove unused variable olines.
6614 (x_set_tool_bar_lines): Remove unused variable root_window.
6615 (Fns_list_colors): Put () around assignment in while statement.
6616 (Fns_perform_service): Remove unused variable len.
6617 (Fns_display_usable_bounds): Remove unused variable top.
6618 (syms_of_nsfns): Remove unused variable i.
6619
6620 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6621 memcpy (Bug#11907).
6622
6623 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
6624
6625 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6626 and free it with DestroyExceptionInfo (Bug#11558).
6627
6628 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
6629
6630 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6631 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6632 Set here, not in nt/config.nt.
6633
6634 2012-07-13 Eli Zaretskii <eliz@gnu.org>
6635
6636 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6637 cursor overflow into the last glyph on display line when the right
6638 fringe is off. (Bug#11832)
6639
6640 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
6641
6642 * xdisp.c (produce_special_glyphs): Now static.
6643 * dispextern.h (produce_special_glyphs): Remove decl.
6644
6645 2012-07-13 Glenn Morris <rgm@gnu.org>
6646
6647 * s/bsd-common.h, s/cygwin.h: Remove empty files.
6648 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6649
6650 * s/usg5-4-common.h (USG, USG5):
6651 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6652 * s/sol2-6.h (SOLARIS2):
6653 * s/irix6-5.h (IRIX6_5):
6654 * s/hpux10-20.h (USG, USG5, HPUX):
6655 * s/gnu-linux.h (USG, GNU_LINUX):
6656 * s/freebsd.h (BSD_SYSTEM):
6657 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6658 * s/cygwin.h (CYGWIN):
6659 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6660 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6661
6662 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
6663
6664 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6665
6666 2012-07-13 Glenn Morris <rgm@gnu.org>
6667
6668 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6669
6670 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6671
6672 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6673 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6674
6675 2012-07-12 Glenn Morris <rgm@gnu.org>
6676
6677 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6678
6679 * process.c (init_process_emacs): Rename from init_process.
6680 The old name is also the name of a Mach system call.
6681 * lisp.h, emacs.c: Update for this name change.
6682 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6683 longer needed.
6684
6685 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6686
6687 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6688 memmove call that removes glyphs covered by the left truncation
6689 glyph. Improve commentary.
6690 (display_line): Fix display of continuation glyphs on GUI frames
6691 when the right fringe is turned off and variable-size fonts are
6692 used in the window. Move the code that appends a stretch glyph to
6693 produce_special_glyphs, so that it could be used for truncation
6694 and continuation glyphs alike.
6695 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6696 glyph of a suitably computed width, to align the special glyphs at
6697 the window margin. Code moved from display_line. (Bug#11832)
6698
6699 2012-07-12 Glenn Morris <rgm@gnu.org>
6700
6701 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6702
6703 * s/gnu-linux.h, s/hpux10-20.h:
6704 Do not unconditionally define HAVE_XRMSETDATABASE.
6705
6706 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6707
6708 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6709
6710 Fix typos that broke OS X build.
6711 Reported by Randal L. Schwartz in
6712 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6713 * nsterm.m (ns_timeout): Add missing local decl.
6714 (ns_get_color): snprintf -> sprintf, to fix typo.
6715
6716 2012-07-12 Glenn Morris <rgm@gnu.org>
6717
6718 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6719 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6720 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6721 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6722
6723 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6724 Move PTY_OPEN to configure.
6725
6726 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6727 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6728 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6729
6730 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6731
6732 Use empty_unibyte_string where applicable.
6733 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6734 * lread.c (read1): Likewise.
6735 * xsettings.c (syms_of_xsettings): Likewise.
6736
6737 2012-07-12 Glenn Morris <rgm@gnu.org>
6738
6739 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6740 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6741 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6742 * s/hpux10-20.h (RUN_TIME_REMAP):
6743 * s/bsd-common.h (TABDLY): Move to configure.
6744
6745 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6746
6747 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6748
6749 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6750 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6751
6752 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6753
6754 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6755 * s/template.h: Move NARROWPROTO to configure.
6756
6757 2012-07-11 Glenn Morris <rgm@gnu.org>
6758
6759 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6760 unused since 2011-01-17 change to systty.h.
6761
6762 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6763 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6764 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6765
6766 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6767
6768 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6769
6770 2012-07-11 Glenn Morris <rgm@gnu.org>
6771
6772 * s/darwin.h, s/gnu-linux.h, s/template.h:
6773 Move INTERRUPT_INPUT to configure.
6774
6775 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6776
6777 Minor adjustments to interning code.
6778 * lisp.h (intern, intern_c_string): Redefine as static inline
6779 wrappers for intern_1 and intern_c_string_1, respectively.
6780 (intern_1, intern_c_string_1): Rename prototypes.
6781 * lread.c (intern_1, intern_c_string_1, oblookup):
6782 Simplify Vobarray checking.
6783 * font.c (font_intern_prop): Likewise. Adjust comment.
6784 * w32font.c (intern_font_name): Likewise.
6785
6786 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6787
6788 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6789
6790 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6791 of Fcar/Fcdr if possible.
6792 * font.c (check_otf_features): Likewise.
6793 * fontset.c (Fnew_fontset): Likewise.
6794 * gnutls.c (Fgnutls_boot): Likewise.
6795 * minibuf.c (read_minibuf): Likewise.
6796 * msdos.c (IT_set_frame_parameters): Likewise.
6797 * xmenu.c (Fx_popup_dialog): Likewise.
6798 * w32menu.c (Fx_popup_dialog): Likewise.
6799
6800 2012-07-11 Glenn Morris <rgm@gnu.org>
6801
6802 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6803 since nothing has defined it on these platforms.
6804
6805 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6806 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6807
6808 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6809 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6810 Move CLASH_DETECTION to configure.
6811
6812 * s/gnu.h: Remove file, which is now empty.
6813
6814 * s/gnu.h, s/gnu-linux.h:
6815 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6816
6817 2012-07-11 John Wiegley <johnw@newartisans.com>
6818
6819 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6820 function attribute, so we only use it if it exists in the
6821 compiler.
6822
6823 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6824
6825 Avoid call to strlen in fast_c_string_match_ignore_case.
6826 * search.c (fast_c_string_match_ignore_case): Change to use
6827 length argument. Adjust users accordingly.
6828 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6829
6830 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6831
6832 Assume mkdir, rmdir.
6833 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6834 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6835
6836 Assume rename.
6837 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6838
6839 Assume perror.
6840 * s/hpux10-20.h (HAVE_PERROR): Remove.
6841 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6842 Remove dummy definition, as this problem was obsolete long ago.
6843
6844 Assume strerror.
6845 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6846
6847 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6848
6849 Avoid calls to strlen in font processing functions.
6850 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6851 (font_open_by_name): Change to use length argument.
6852 Adjust users accordingly.
6853 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6854 Adjust prototypes.
6855 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6856 Change to return ptrdiff_t.
6857 (xfont_list_pattern, xfont_match): Use length returned by
6858 xfont_decode_coding_xlfd.
6859 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6860
6861 2012-07-11 Glenn Morris <rgm@gnu.org>
6862
6863 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6864 Move DONT_REOPEN_PTY to configure.
6865
6866 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6867 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6868
6869 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6870
6871 Remove "#define unix" that is no longer needed (Bug#11905).
6872 * s/aix4-2.h (unix): Remove; no longer needed.
6873
6874 EMACS_TIME simplification (Bug#11875).
6875 This replaces macros (which typically do not work in GDB)
6876 with functions, typedefs and enums, making the code easier to debug.
6877 The functional style also makes code easier to read and maintain.
6878 * systime.h: Include <sys/time.h> on all hosts, not just if
6879 WINDOWSNT, since 'struct timeval' is needed in general.
6880 (EMACS_TIME): Now a typedef, not a macro.
6881 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6882 not macros.
6883 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6884 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6885 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6886 (EMACS_TIME_LE): Now functions, not macros.
6887 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6888 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6889 which are not functions. All uses rewritten to use:
6890 (make_emacs_time): New function.
6891 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6892 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6893 not functions. All uses rewritten to use the following, respectively:
6894 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6895 (add_emacs_time, sub_emacs_time): New functions.
6896 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6897 * fileio.c (Fcopy_file):
6898 * xterm.c (XTflash): Get the current time closer to when it's used.
6899 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6900
6901 * bytecode.c (targets): Suppress -Woverride-init warnings.
6902
6903 Simplify by avoiding confusing use of strncpy etc.
6904 * doc.c (Fsnarf_documentation):
6905 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6906 * frame.c (Fmake_terminal_frame):
6907 * gtkutil.c (get_utf8_string):
6908 * lread.c (openp):
6909 * nsmenu.m (ns_update_menubar):
6910 * regex.c (regerror):
6911 Prefer memcpy to strncpy and strncat when either will do.
6912 * fileio.c (Fsubstitute_in_file_name):
6913 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6914 (menu_separator_name_p):
6915 * nsmenu.m (ns_update_menubar):
6916 Prefer memcmp to strncmp when either will do.
6917 * nsterm.m: Include <ftoastr.h>.
6918 (ns_get_color):
6919 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6920 Prefer snprintf to strncpy.
6921 * nsterm.m (ns_term_init):
6922 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6923 * nsterm.m (ns_term_init):
6924 Avoid the need for strncpy, by using build_string or
6925 make_unibyte_string directly. Use dtoastr, not snprintf.
6926 * process.c (Fmake_network_process): Diagnose service names that
6927 are too long, rather than silently truncating them or creating
6928 non-null-terminated names.
6929 (Fnetwork_interface_info): Likewise, for interface names.
6930 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6931 Prefer sprintf to strncat.
6932 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6933 Prefer vsnprintf to vsprintf + strncpy.
6934
6935 2012-07-10 Glenn Morris <rgm@gnu.org>
6936
6937 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6938 Clarify fallback case.
6939
6940 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6941
6942 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6943 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6944 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6945 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6946 where argument type is known to be a Lisp_Cons.
6947
6948 2012-07-10 Tom Tromey <tromey@redhat.com>
6949
6950 * bytecode.c (BYTE_CODE_THREADED): New macro.
6951 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6952 (enum byte_code_op): New type.
6953 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6954 (exec_byte_code): Use them. Use token threading when applicable.
6955
6956 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6957
6958 Optimize pure C strings initialization.
6959 * lisp.h (make_pure_string): Fix prototype.
6960 (build_pure_c_string): New function, defined as static inline. This
6961 provides a better opportunity to optimize away calls to strlen when
6962 the function is called with compile-time constant argument.
6963 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6964 argument, adjust users accordingly. Use build_pure_c_string where
6965 appropriate.
6966 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6967 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6968 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6969
6970 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6971
6972 Avoid calls to strlen in miscellaneous functions.
6973 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6974 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6975 * lread.c (openp): Likewise.
6976
6977 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6978
6979 Avoid calls to strlen in path processing functions.
6980 * fileio.c (file_name_as_directory): Add comment. Change to add
6981 srclen argument and return the length of result. Adjust users
6982 accordingly.
6983 (directory_file_name): Fix comment. Change to add srclen argument,
6984 swap 1st and 2nd arguments to obey the common convention.
6985 Adjust users accordingly.
6986 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6987
6988 2012-07-10 Glenn Morris <rgm@gnu.org>
6989
6990 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6991 Move PENDING_OUTPUT_COUNT definition to configure.
6992
6993 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6994 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6995 * s/gnu.h (DATA_START): Move definitions to configure.
6996
6997 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6998 We include usg5-4-common.h, which defines them both.
6999
7000 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7001 O_RDONLY already includes it).
7002
7003 Stop ns builds setting the EMACSLOADPATH environment variable.
7004 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7005 Now it does not set EMACSLOADPATH, just returns the load-path string.
7006 * nsterm.h: Update accordingly.
7007 * lread.c [HAVE_NS]: Include nsterm.h.
7008 (init_lread) [HAVE_NS]: Use ns_load_path.
7009 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7010
7011 2012-07-09 Glenn Morris <rgm@gnu.org>
7012
7013 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7014 since the included bsd-common.h does so.
7015
7016 Stop ns builds setting the EMACSPATH environment variable.
7017 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7018 (ns_init_paths): Do not set EMACSPATH.
7019 * nsterm.h (ns_exec_path): Add it.
7020 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7021 Use ns_exec_path.
7022
7023 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7024
7025 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7026
7027 * process.c (wait_reading_process_output): 'waitchannels' was unset
7028 when read_kbd || !NILP (wait_for_cell); fix this.
7029
7030 Add GCC-style 'const' attribute to functions that can use it.
7031 * character.h (char_resolve_modifier_mask):
7032 * keyboard.h (make_ctrl_char):
7033 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7034 (init_character_once, next_almost_prime, init_fns, init_image)
7035 (flush_pending_output, init_sound):
7036 * mem-limits.h (start_of_data):
7037 * menu.h (finish_menu_items):
7038 Add ATTRIBUTE_CONST.
7039 * emacs.c (DEFINE_DUMMY_FUNCTION):
7040 Declare the dummy function with ATTRIBUTE_CONST.
7041 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7042 Add decls with ATTRIBUTE_CONST.
7043
7044 Minor improvements to make_formatted_string.
7045 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7046 where int is good enough, as vsprintf returns an int.
7047 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7048
7049 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7050
7051 Use make_formatted_string to avoid double length calculation.
7052 * lisp.h (make_formatted_string): New prototype.
7053 * alloc.c (make_formatted_string): New function.
7054 * buffer.c (Fgenerate_new_buffer_name): Use it.
7055 * dbusbind.c (syms_of_dbusbind): Likewise.
7056 * editfns.c (Fcurrent_time_zone): Likewise.
7057 * filelock.c (get_boot_time): Likewise.
7058 * frame.c (make_terminal_frame, set_term_frame_name)
7059 (x_report_frame_params): Likewise.
7060 * image.c (gs_load): Likewise.
7061 * minibuf.c (get_minibuffer): Likewise.
7062 * msdos.c (dos_set_window_size): Likewise.
7063 * process.c (make_process): Likewise.
7064 * xdisp.c (ensure_echo_area_buffers): Likewise.
7065 * xsettings.c (apply_xft_settings): Likewise.
7066
7067 2012-07-09 Glenn Morris <rgm@gnu.org>
7068
7069 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7070 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7071 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7072 * nsterm.h (ns_etc_directory): Add it.
7073 * callproc.c [HAVE_NS]: Include nsterm.h.
7074 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7075
7076 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7077
7078 Move marker debugging code under MARKER_DEBUG.
7079 * marker.c (MARKER_DEBUG): Move marker debugging code under
7080 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7081 for bootstrap with --enable-checking (~3x slowdown reported
7082 by Juanma Barranquero <lekktu@gmail.com>).
7083 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7084
7085 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7086
7087 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7088 See <http://bugs.gnu.org/11825#29>.
7089
7090 2012-07-08 Eli Zaretskii <eliz@gnu.org>
7091
7092 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7093 has no font, use the frame's font. (Bug#11813)
7094 (display_line): Add commentary about displaying truncation glyphs
7095 on GUI frames.
7096 (produce_special_glyphs): Move here from term.c.
7097
7098 * term.c (produce_special_glyphs): Move to xdisp.c.
7099
7100 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7101 section.
7102
7103 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7104
7105 * xdisp.c (display_line): Avoid warning about implicit declaration
7106 of FRAME_FONT.
7107
7108 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7109
7110 * lisp.h: Remove empty conditional.
7111
7112 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7113
7114 * lread.c (load_path_check): Now static.
7115
7116 Fix some minor --with-ns problems found by static checking.
7117 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7118 (x_set_font) [!HAVE_X_WINDOWS]:
7119 * image.c (xpm_load_image) [HAVE_NS]:
7120 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7121 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7122 Remove unused local.
7123 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7124 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7125 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7126 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7127 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7128 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7129 Fix pointer signedness problem.
7130 * xfaces.c (FRAME_X_FONT_TABLE):
7131 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7132
7133 2012-07-07 Glenn Morris <rgm@gnu.org>
7134
7135 * lread.c (load_path_check): New function, split from init_lread.
7136 (init_lread): Reorganize. Motivation:
7137 If EMACSLOADPATH is set, check/warn about that rather than the
7138 defaults, which we are not going to use. Hence we can remove
7139 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7140 Don't warn if site-lisp directories are missing.
7141 If not installed, start from a blank load-path, since
7142 PATH_LOADSEARCH refers to the eventual installation directories.
7143
7144 2012-07-07 Eli Zaretskii <eliz@gnu.org>
7145
7146 Support truncation and continuation glyphs on GUI frames, when
7147 fringes are disabled. (Bug#11832)
7148 * xdisp.c (init_iterator): Get dimensions of truncation and
7149 continuation glyphs even if on GUI frames.
7150 Adjust it->last_visible_x on GUI frames when the left or right fringes,
7151 or both, are absent.
7152 (start_display, move_it_in_display_line_to): Handle the case of a
7153 GUI frame without a fringe to display continuation or truncation
7154 glyphs.
7155 (insert_left_trunc_glyphs): Support GUI frames: make sure
7156 truncation glyphs overwrite enough glyphs from the current line to
7157 have sufficient space in pixels.
7158 (display_line): Support truncation and continuation glyphs on GUI
7159 frames. If some spare pixels are left on the line after inserting
7160 the truncation glyphs, fill that space with a stretch glyph of a
7161 suitably computed width.
7162
7163 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7164 produce_glyphs, to support GUI sessions.
7165
7166 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7167
7168 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7169
7170 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7171
7172 Do not require float-time's arg to fit in time_t (Bug#11825).
7173 This works better on hosts where time_t is unsigned, and where
7174 float-time is applied to the (negative) difference between two times.
7175 * editfns.c (decode_time_components): Last arg is now double *,
7176 not int *, and means to store all the result as a double, without
7177 worrying about whether the seconds part fits in time_t.
7178 All callers changed.
7179 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7180 All callers changed.
7181 (Ffloat_time): Do not fail merely because the specified time falls
7182 outside of time_t range.
7183
7184 2012-07-07 Glenn Morris <rgm@gnu.org>
7185
7186 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7187 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7188 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7189
7190 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
7191
7192 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7193 Update dependencies.
7194
7195 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7196
7197 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7198
7199 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7200 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7201 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7202 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7203 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7204 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7205
7206 * xfont.c (compare_font_names): Redo to omit the need for casts.
7207
7208 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7209
7210 * xfns.c (Fx_change_window_property): Doc fix.
7211 * w32fns.c (Fx_change_window_property): Doc fix.
7212
7213 * w32fns.c (Fx_window_property): Accept the same arguments as the
7214 X Windows version. Doc fix.
7215 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7216
7217 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
7218 Eli Zaretskii <eliz@gnu.org>
7219
7220 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7221 Windows-specific code from nt/config.nt moved here.
7222 Obsolete settings removed.
7223
7224 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7225
7226 * process.c: Avoid unnecessary calls to gettime.
7227 (wait_reading_process_output): Don't get the time of day
7228 when gobbling data immediately and not waiting, as there's no need
7229 for it in that case. This removes a FIXME.
7230
7231 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
7232
7233 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7234 is defined (Bug#11768).
7235
7236 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7237
7238 Fix marker debugging code.
7239 * marker.c (byte_char_debug_check): Do not perform the check
7240 if buffer is not multibyte.
7241 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7242 Call byte_char_debug_check with correct arguments.
7243
7244 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7245
7246 Compile marker debugging code only if ENABLE_CHECKING is defined.
7247 * marker.c (byte_char_debug_check, count_markers):
7248 Use only if ENABLE_CHECKING is defined.
7249 (byte_debug_flag): Remove.
7250 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7251 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7252
7253 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7254
7255 Avoid code repetition in marker-related functions.
7256 * marker.c (attach_marker): New function.
7257 (Fset_marker, set_marker_restricted, set_marker_both)
7258 (set_marker_restricted_both): Use it.
7259 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7260 Consistently rename charno to charpos.
7261 (marker_position): Add eassert.
7262 (marker_byte_position): Convert to eassert.
7263
7264 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7265
7266 Simplify list operations in unchain_overlay and unchain_marker.
7267 * buffer.c (unchain_overlay): Simplify. Add comment.
7268 * marker.c (unchain_marker): Simplify. Fix comments.
7269
7270 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7271
7272 Introduce fast path for the widely used marker operation.
7273 * alloc.c (build_marker): New function.
7274 * lisp.h (build_marker): New prototype.
7275 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7276 * composite.c (autocmp_chars): Likewise.
7277 * editfns.c (buildmark): Remove.
7278 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7279 (save_restriction_save): Use build_marker.
7280 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7281 * window.c (save_window_save): Likewise.
7282
7283 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7284
7285 Do not use Fdelete_overlay in delete_all_overlays
7286 to avoid redundant calls to unchain_overlay.
7287 * buffer.c (drop_overlay): New function.
7288 (delete_all_overlays, Fdelete_overlay): Use it.
7289 * minibuf.c (get_minibuffer): Fix comment.
7290
7291 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7292
7293 Port to OpenBSD 5.1 amd64.
7294 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7295 This is needed for OpenBSD, and should be harmless on all BSD systems.
7296 Also, include <sys/sysctl.h>, as it should be available on all
7297 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7298 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7299 use p_pid member, not kp_proc.pid.
7300
7301 2012-07-06 Glenn Morris <rgm@gnu.org>
7302
7303 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7304
7305 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7306
7307 More xmalloc and related cleanup.
7308 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7309 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7310 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7311 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7312 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7313 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7314 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7315 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7316 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7317 * xterm.c:
7318 Omit needless casts involving void * pointers and allocation.
7319 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7320 as the former is more robust if P's type is changed.
7321 Prefer xzalloc to xmalloc + memset 0.
7322 Simplify malloc-or-realloc to realloc.
7323 Don't worry about xmalloc returning a null pointer.
7324 Prefer xstrdup to xmalloc + strcpy.
7325 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7326 growing it.
7327 * keyboard.c (apply_modifiers_uncached): Prefer local array to
7328 alloca of a constant.
7329
7330 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7331
7332 * xdisp.c (display_line): Fix horizontal pixel coordinates when
7333 hscroll is larger than the line width. Fixes long and futile
7334 looping inside extend_face_to_end_of_line (on a TTY) producing
7335 glyphs that are not needed and thrown away.
7336
7337 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7338
7339 * marker.c (set_marker_restricted_both): Simplify by using
7340 clip_to_bounds.
7341
7342 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7343
7344 * editfns.c (region_limit): Simplify by using clip_to_bounds.
7345
7346 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
7347
7348 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7349 not defined (Bug#11768).
7350 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7351 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7352 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7353 followed by gtk_box_set_homogeneous (Bug#11768).
7354 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
7355 (update_theme_scrollbar_width, xg_create_scroll_bar):
7356 Use gtk_scrollbar_new (Bug#11768).
7357 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7358 (is_box_type): New function (Bug#11768).
7359 (xg_tool_item_stale_p): Call is_box_type.
7360 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
7361 with default display (Bug#11768).
7362
7363 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7364
7365 * xdisp.c (window_hscroll_limited): New function.
7366 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7367 coordinates when window's hscroll is set to insanely large
7368 values. (Bug#11857)
7369
7370 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
7371
7372 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
7373 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
7374
7375 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7376
7377 Cleanup xmalloc.
7378 * lisp.h (xzalloc): New prototype. Omit needless casts.
7379 * alloc.c (xzalloc): New function. Omit needless casts.
7380 * charset.c: Omit needless casts. Convert all calls to
7381 xmalloc with following memset to xzalloc.
7382 * dispnew.c: Likewise.
7383 * fringe.c: Likewise.
7384 * image.c: Likewise.
7385 * sound.c: Likewise.
7386 * term.c: Likewise.
7387 * w32fns.c: Likewise.
7388 * w32font.c: Likewise.
7389 * w32term.c: Likewise.
7390 * xfaces.c: Likewise.
7391 * xfns.c: Likewise.
7392 * xterm.c: Likewise.
7393 * atimer.c: Omit needless casts.
7394 * buffer.c: Likewise.
7395 * callproc.c: Likewise.
7396 * ccl.c: Likewise.
7397 * coding.c: Likewise.
7398 * composite.c: Likewise.
7399 * doc.c: Likewise.
7400 * doprnt.c: Likewise.
7401 * editfns.c: Likewise.
7402 * emacs.c: Likewise.
7403 * eval.c: Likewise.
7404 * filelock.c: Likewise.
7405 * fns.c: Likewise.
7406 * gtkutil.c: Likewise.
7407 * keyboard.c: Likewise.
7408 * lisp.h: Likewise.
7409 * lread.c: Likewise.
7410 * minibuf.c: Likewise.
7411 * msdos.c: Likewise.
7412 * print.c: Likewise.
7413 * process.c: Likewise.
7414 * region-cache.c: Likewise.
7415 * search.c: Likewise.
7416 * sysdep.c: Likewise.
7417 * termcap.c: Likewise.
7418 * terminal.c: Likewise.
7419 * tparam.c: Likewise.
7420 * w16select.c: Likewise.
7421 * w32.c: Likewise.
7422 * w32reg.c: Likewise.
7423 * w32select.c: Likewise.
7424 * w32uniscribe.c: Likewise.
7425 * widget.c: Likewise.
7426 * xdisp.c: Likewise.
7427 * xmenu.c: Likewise.
7428 * xrdb.c: Likewise.
7429 * xselect.c: Likewise.
7430
7431 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7432
7433 * fileio.c (time_error_value): Check the right error number.
7434 Problem reported by Troels Nielsen in
7435 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
7436
7437 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7438
7439 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
7440 This should be fixed in a better way; see Eli Zaretskii in
7441 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
7442 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
7443
7444 * fileio.c (time_error_value): Rename from special_mtime.
7445 The old name's problems were noted by Eli Zaretskii in
7446 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
7447
7448 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
7449 This variable's comment says Emacs needs at least one GDB-visible
7450 symbol of type enum pvec_type, to work around GDB problems.
7451 The symbol's value doesn't matter.
7452
7453 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
7454 that causes compilation to fail on pre-C99 compilers.
7455
7456 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
7457
7458 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
7459 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
7460
7461 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7462
7463 * buffer.c (init_buffer_once): Fix initialization of
7464 headers for buffer_defaults and buffer_local_symbols.
7465 Reported by Juanma Barranquero <lekktu@gmail.com>.
7466
7467 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7468
7469 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
7470 * lisp.h (enum pvec_type): Use fewer bits.
7471 (PSEUDOVECTOR_SIZE_BITS): New constant.
7472 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
7473 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
7474 change in pvec_type.
7475 (PSEUDOVECTOR_TYPEP): New macro.
7476 (TYPED_PSEUDOVECTORP): Use it.
7477 * fns.c (internal_equal): Adapt code to extract pvectype.
7478 * emacs.c (gdb_pvec_type): Update type.
7479 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
7480 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
7481 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
7482 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
7483 (sweep_vectors): Use it. Use local var `total_bytes' instead of
7484 abusing vector->header.next.nbytes.
7485 (live_vector_p): Use PVEC_TYPE.
7486 (mark_object): Adapt code to extract pvectype. Use switch.
7487
7488 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7489
7490 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
7491 Tighten new eassert a bit.
7492
7493 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7494
7495 Fix compilation with --enable-gcc-warnings and -O1
7496 optimization level.
7497 * doprnt.c (doprnt): Change type of tem to int, initialize
7498 to avoid compiler warning. Add eassert.
7499 * search.c (simple_search): Initialize match_byte to avoid
7500 compiler warning. Add eassert.
7501
7502 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7503
7504 Avoid weird behavior with large horizontal scrolls.
7505 Without this change, for example, large hscroll values would
7506 mess up Emacs's display on Fedora 15 x86, presumably due to
7507 overflows in int calculations in the display code.
7508 Also, if buffers had long lines, Emacs would freeze.
7509 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
7510 (set_window_hscroll): New function, containing the old guts of
7511 Fset_window_hscroll. Return the clipped value.
7512 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
7513 This avoids the need to check against PTRDIFF_MAX.
7514
7515 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
7516
7517 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7518
7519 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
7520
7521 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7522
7523 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
7524 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
7525 since GCC 4.4.6 issues a bogus warning for them.
7526
7527 Fix bugs in file timestamp newness comparisons.
7528 * fileio.c (Ffile_newer_than_file_p):
7529 * lread.c (Fload): Use full timestamp resolution of files,
7530 not just the 1-second resolution, so that files that are only
7531 slightly newer still count as newer.
7532 * fileio.c (Ffile_newer_than_file_p): Don't assume file
7533 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7534
7535 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
7536
7537 * fileio.c: Improve handling of file time marker. (Bug#11852)
7538 (special_mtime): New function.
7539 (Finsert_file_contents, Fverify_visited_file_modtime):
7540 Use it to set special mtime values consistently.
7541
7542 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
7543
7544 * fileio.c (Finsert_file_contents): Properly handle st_mtime
7545 marker for non-existing file. (Bug#11852)
7546
7547 2012-07-03 Glenn Morris <rgm@gnu.org>
7548
7549 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7550 and did not make it into globals.h).
7551
7552 2012-07-03 Tom Tromey <tromey@redhat.com>
7553
7554 * window.c (Fset_window_margins, Fset_window_fringes)
7555 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7556 * textprop.c (Fprevious_property_change): No longer static.
7557 * syntax.c (Fsyntax_table_p): No longer static.
7558 * process.c (Fget_process, Fprocess_datagram_address): No longer
7559 static.
7560 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7561 * keyboard.c (Fcommand_execute): No longer static.
7562 Remove EXFUN.
7563 * insdel.c (Fcombine_after_change_execute): No longer static.
7564 * image.c (Finit_image_library): No longer static.
7565 * fileio.c (Fmake_symbolic_link): No longer static.
7566 * eval.c (Ffetch_bytecode): No longer static.
7567 * editfns.c (Fuser_full_name): No longer static.
7568 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7569 No longer static.
7570 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7571 static.
7572 * dired.c (Ffile_attributes): No longer static.
7573 * composite.c (Fcomposition_get_gstring): No longer static.
7574 * callproc.c (Fgetenv_internal): No longer static.
7575
7576 * ccl.h: Remove EXFUNs.
7577 * buffer.h: Remove EXFUNs.
7578 * dispextern.h: Remove EXFUNs.
7579 * intervals.h: Remove EXFUNs.
7580 * fontset.h: Remove EXFUN.
7581 * font.h: Remove EXFUNs.
7582 * dosfns.c (system_process_attributes): Remove EXFUN.
7583 * keymap.h: Remove EXFUNs.
7584 * lisp.h: Remove EXFUNs.
7585 * w32term.h: Remove EXFUNs.
7586 * window.h: Remove EXFUNs.
7587 * xsettings.h: Remove EXFUN.
7588 * xterm.h: Remove EXFUN.
7589
7590 2012-07-03 Glenn Morris <rgm@gnu.org>
7591
7592 * lisp.h (Frandom): Make it visible to C.
7593 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7594 buffer for invisible buffers. (Bug#1229)
7595
7596 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7597
7598 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7599 values which aren't power of 2.
7600 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7601 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
7602 accordingly.
7603
7604 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7605
7606 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7607
7608 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7609
7610 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7611
7612 * alloc.c (allocate_vector_block): Remove redundant
7613 calls to mallopt if DOUG_LEA_MALLOC is defined.
7614 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7615 avoid calls to mallopt if zero_vector is returned.
7616
7617 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7618
7619 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7620 is enabled, avoid dereferencing NULL current_sblock if
7621 running undumped.
7622
7623 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7624
7625 Cleanup basic buffer management.
7626 * buffer.h (struct buffer): Change layout to use generic vector
7627 marking code. Fix some comments. Change type of 'clip_changed'
7628 to bitfield. Remove unused #ifndef old.
7629 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7630 (GET_OVERLAYS_AT): Fix indentation.
7631 (for_each_per_buffer_object_at): New macro.
7632 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7633 (Fbuffer_local_variables): Use it.
7634 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7635 * alloc.c (allocate_buffer): Adjust to match new layout of
7636 struct buffer. Fix comment.
7637 (mark_overlay): New function.
7638 (mark_buffer): Use it. Use mark_vectorlike to mark normal
7639 Lisp area of struct buffer.
7640 (mark_object): Use it. Adjust marking of misc objects
7641 and related comments.
7642
7643 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
7644
7645 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7646 wrapper that is not needed because the wrapped code is a no-op (zero
7647 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7648 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7649
7650 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
7651
7652 * alloc.c (mark_buffer): Simplify. Remove prototype.
7653 (mark_object): Add comment. Reorganize marking of vector-like
7654 objects. Use CHECK_LIVE for all vector-like objects except buffers
7655 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7656 Avoid redundant calls to mark_vectorlike for bool vectors.
7657
7658 2012-06-30 Glenn Morris <rgm@gnu.org>
7659
7660 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7661
7662 * epaths.in (PATH_SITELOADSEARCH): New.
7663 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7664 This is rather than relying on --enable-locallisppath elements
7665 having "site-lisp" in their names. (Bug#10208#25, 11658)
7666
7667 2012-06-30 Eli Zaretskii <eliz@gnu.org>
7668
7669 * w32proc.c (sys_select): Accept and ignore one more argument.
7670
7671 * w32.c (emacs_gnutls_pull): Call select with one more argument.
7672
7673 * sysselect.h [DOS_NT]: Don't include sys/select.h.
7674 (pselect) [!MS_DOS]: Redirect to sys_select.
7675
7676 * sysdep.c: Don't include dos.h and dosfns.h.
7677
7678 * process.c (sys_select):
7679 * msdos.c (sys_select): Accept one more argument and ignore it.
7680
7681 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7682 adapt data types and code to that.
7683
7684 * dosfns.c:
7685 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7686 which clashes with the gnulib function of the same name.
7687
7688 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7689
7690 * font.c (font_style_to_value, font_style_symbolic)
7691 (font_prop_validate_style): Add type checks for values in
7692 font_style_table.
7693
7694 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7695 argument.
7696 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7697 uses.
7698
7699 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7700
7701 * xdisp.c (try_window_id): Undo last change.
7702
7703 * w32.c (getwd): Adjust commentary about startup_dir.
7704 (init_environment): Always call sys_access, even in non-MSVC
7705 builds. Don't chdir to the directory of the Emacs executable.
7706 This undoes code from 1997 which was justified by the need to
7707 "avoid conflicts when removing and renaming directories". But its
7708 downside was that every relative file name was being interpreted
7709 relative to the directory of the Emacs executable, which can never
7710 be TRT. In particular, it broke sys_access when called with
7711 relative file names.
7712 (sys_access): Map GetLastError to errno.
7713
7714 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7715
7716 * window.h (struct window): Change type of 'fringes_outside_margins'
7717 to bitfield. Fix comment. Adjust users accordingly.
7718 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7719 Adjust comment.
7720 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7721 to ptrdiff_t.
7722
7723 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
7724
7725 * gnutls.c (emacs_gnutls_handshake):
7726 Add QUIT to make the loop interruptible.
7727
7728 2012-06-29 Glenn Morris <rgm@gnu.org>
7729
7730 * charset.c (init_charset): Make lack of etc/charsets fatal.
7731
7732 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7733
7734 * editfns.c (region_limit): Fix type mismatch.
7735
7736 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7737
7738 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7739 undefined. Convert from xassert to eassert.
7740 * nsmenu.m: Convert from xassert to eassert.
7741 * nsterm.m: Likewise.
7742
7743 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7744
7745 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7746
7747 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7748
7749 Avoid integer overflow on scroll-left and scroll-right.
7750 * window.c (HSCROLL_MAX): New macro.
7751 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7752 overflow when requested scroll falls outside ptrdiff_t range.
7753
7754 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7755
7756 * window.h (struct window): Change type of 'hscroll',
7757 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7758 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7759 Adjust users accordingly.
7760 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7761 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7762 from EMACS_INT to ptrdiff_t.
7763 (make_window): Omit redundant initialization.
7764
7765 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
7766
7767 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7768
7769 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7770
7771 * window.h (struct window): Change type of 'use_time' and
7772 'sequence_number' from Lisp_Object to int.
7773 * frame.c (make_frame): Adjust users accordingly.
7774 * print.c (print_object): Likewise.
7775 * window.c (select_window, Fwindow_use_time, make_parent_window)
7776 (make_window): Likewise.
7777
7778 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7779
7780 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7781 enabled with --enable-checking=[all,glyphs] configure option.
7782 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7783 adjust comments accordingly.
7784 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7785 undefined, adjust comments accordingly.
7786 * image.c: Likewise.
7787 * scroll.c: Likewise.
7788 * w32fns.c: Likewise.
7789 * w32term.c: Likewise.
7790 * xdisp.c: Likewise.
7791 * xfaces.c: Likewise.
7792 * xfns.c: Likewise.
7793 * xterm.c: Likewise.
7794
7795 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7796
7797 Generalize run-time debugging checks.
7798 * dispextern.h (XASSERTS): Remove.
7799 * fontset.c (xassert): Remove.
7800 Convert from xassert to eassert.
7801 * alloc.c: Convert from xassert to eassert.
7802 * bidi.c: Likewise.
7803 * dispnew.c: Likewise.
7804 * fns.c: Likewise.
7805 * fringe.c: Likewise.
7806 * ftfont.c: Likewise.
7807 * gtkutil.c: Likewise.
7808 * image.c: Likewise.
7809 * keyboard.c: Likewise.
7810 * menu.c: Likewise.
7811 * process.c: Likewise.
7812 * scroll.c: Likewise.
7813 * sound.c: Likewise.
7814 * term.c: Likewise.
7815 * w32console.c: Likewise.
7816 * w32fns.c: Likewise.
7817 * w32term.c: Likewise.
7818 * window.c: Likewise.
7819 * xdisp.c: Likewise.
7820 * xfaces.c: Likewise.
7821 * xfns.c: Likewise.
7822 * xselect.c: Likewise.
7823 * xterm.c: Likewise.
7824
7825 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7826
7827 * fns.c (maybe_resize_hash_table): Output message when growing the
7828 purify-hashtable.
7829
7830 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7831
7832 * alloc.c (allocate_string_data): Remove dead code.
7833 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7834 avoid GCC warning about unused macro.
7835
7836 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7837
7838 * alloc.c (allocate_string): Omit intervals initialization.
7839 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7840 as in make_pure_string and make_pure_c_string.
7841
7842 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7843
7844 * alloc.c (allocate_string): Fix last change.
7845
7846 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7847
7848 * alloc.c (allocate_string): Remove two redundant calls
7849 to memset, add explicit initialization where appropriate.
7850
7851 2012-06-27 Glenn Morris <rgm@gnu.org>
7852
7853 * lisp.mk (lisp): Remove paths.elc.
7854
7855 2012-06-27 Chong Yidong <cyd@gnu.org>
7856
7857 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7858
7859 2012-06-26 John Wiegley <johnw@newartisans.com>
7860
7861 * unexmacosx.c (copy_data_segment): Add two section names used
7862 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7863
7864 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7865 when building with Clang.
7866
7867 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7868
7869 * eval.c (Fapply): Allow calling it with a single argument.
7870
7871 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7872
7873 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7874 _stricmp and _strnicmp.
7875 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7876
7877 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7878
7879 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7880 allocated window.
7881 (allocate_process): Likewise for new process.
7882 (allocate_terminal): Change to use offsetof.
7883 (allocate_frame): Likewise.
7884 * frame.c (make_frame): Omit redundant initialization.
7885 * window.c (make_parent_window): Use memset.
7886 (make_window): Omit redundant initialization.
7887 * process.c (make_process): Omit redundant initialization.
7888 * terminal.c (create_terminal): Likewise.
7889
7890 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7891
7892 * term.c (delete_tty): Remove redundant call to memset.
7893
7894 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7895
7896 * alloc.c: Remove build_string.
7897 * lisp.h: Define build_string as static inline. This provides
7898 a better opportunity to optimize away calls to strlen when the
7899 function is called with compile-time constant argument.
7900 * image.c (imagemagick_error): Convert to build_string.
7901 * w32proc.c (sys_spawnve): Likewise.
7902 * xterm.c (x_term_init): Likewise.
7903
7904 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7905
7906 Use sprintf return value instead of invoking strlen on result.
7907 In the old days this wasn't portable, since some sprintf
7908 implementations returned char *. But they died out years ago and
7909 Emacs already assumes sprintf returns int.
7910 Similarly for float_to_string.
7911 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7912 * ccl.c (ccl_driver):
7913 * character.c (string_escape_byte8):
7914 * data.c (Fnumber_to_string):
7915 * doprnt.c (doprnt):
7916 * print.c (print_object):
7917 * xdisp.c (message_dolog):
7918 * xfns.c (syms_of_xfns):
7919 Use sprintf or float_to_string result to avoid need to call strlen.
7920 * data.c (Fnumber_to_string):
7921 Use make_unibyte_string, since the string must be ASCII.
7922 * lisp.h, print.c (float_to_string): Now returns int length.
7923 * term.c (produce_glyphless_glyph):
7924 Use sprintf result rather than recomputing it.
7925
7926 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7927 * Makefile.in (ALL_CFLAGS):
7928 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7929 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7930
7931 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7932
7933 * dispextern.h (xstrcasecmp): Define to library function
7934 strcasecmp if available.
7935 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7936
7937 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7938
7939 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7940 Avoid comma operator.
7941 * menu.c (push_submenu_start, push_submenu_end)
7942 (push_left_right_boundary, push_menu_pane): Likewise.
7943 * msdos.c (dos_rawgetc): Likewise.
7944
7945 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7946
7947 * xfns.c (xic_create_fontsetname): Remove redundant calls
7948 to memset.
7949
7950 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7951
7952 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7953 sprintf already null-terminates its output.
7954
7955 * xfns.c (x_window): Remove redundant cast.
7956
7957 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7958
7959 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7960 `const char *' to `char *' to avoid compiler warning.
7961
7962 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7963
7964 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7965 instead of truncating it to 63 (admittedly a generous limit).
7966
7967 * process.c: Fix spelling and caps in comments.
7968
7969 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7970
7971 * emacs.c (setpgrp): Remove definition, unused.
7972 * sysdep.c (setpgrp): Remove definition, not used in this file.
7973
7974 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7975
7976 * makefile.w32-in: Update dependencies.
7977
7978 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7979
7980 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7981 (SYSTIME_H): Add nt/inc/sys/time.h.
7982
7983 * systime.h [WINDOWSNT]: Include sys/time.h.
7984
7985 * s/ms-w32.h (struct timespec): Definition moved from
7986 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7987
7988 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7989
7990 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7991 * buffer.h (buffer_slot_type_mismatch):
7992 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7993 * eval.c (unwind_to_catch):
7994 * image.c (my_png_error, my_error_exit):
7995 * keyboard.c (quit_throw_to_read_char, user_error)
7996 (Fexit_recursive_edit, Fabort_recursive_edit):
7997 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7998 (wrong_type_argument, buffer_overflow, __executable_start)
7999 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8000 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8001 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8002 (fatal):
8003 (child_setup) [!DOS_NT]:
8004 * lread.c (end_of_file_error, invalid_syntax):
8005 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8006 * puresize.h (pure_write_error):
8007 * search.c (matcher_overflow):
8008 * sound.c (sound_perror, alsa_sound_perror):
8009 * sysdep.c, syssignal.h (croak):
8010 * term.c (maybe_fatal, vfatal):
8011 * textprop.c (text_read_only):
8012 * undo.c (user_error):
8013 * unexmacosx.c (unexec_error):
8014 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8015 Use _Noreturn rather than NO_RETURN.
8016 No need for separate decl merely because of _Noreturn.
8017 * sound.c (sound_warning, parse_sound):
8018 Remove unnecessary forward decls.
8019
8020 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8021
8022 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8023 * lisp.h (WAIT_READING_MAX): New macro.
8024 * dispnew.c (Fsleep_for, sit_for):
8025 * keyboard.c (kbd_buffer_get_event):
8026 * process.c (Faccept_process_output):
8027 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8028 This improves on the previous patch, which introduced a bug
8029 when time_t is unsigned and as wide as intmax_t.
8030 See <http://bugs.gnu.org/9000#51>.
8031
8032 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8033
8034 * dispnew.c (sit_for, Fsleep_for):
8035 * keyboard.c (kbd_buffer_get_event):
8036 * process.c (Faccept_process_output): Avoid compiler warnings when
8037 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8038
8039 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
8040
8041 * makefile.w32-in: Update dependencies.
8042
8043 * w32.c (ltime): Add return type and declare static.
8044 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8045
8046 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8047
8048 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8049 Privately reported by Herbert J. Skuhra.
8050 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8051 All uses changed.
8052 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8053 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8054
8055 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8056
8057 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8058 last argument of make_unibyte_string.
8059
8060 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8061 language ID in the event parameters.
8062
8063 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8064 event.code, not the obscure "character set ID".
8065
8066 2012-06-23 Chong Yidong <cyd@gnu.org>
8067
8068 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8069
8070 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8071
8072 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8073 * w32.c (fdutimens): New function.
8074
8075 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8076
8077 * s/ms-w32.h (pselect): Redirect to sys_select.
8078
8079 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8080
8081 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8082 in the logic of incrementing and decrementing the value of
8083 use_relocatable_buffers.
8084
8085 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8086
8087 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8088 Privately reported by Herbert J. Skuhra.
8089 [__FreeBSD__]: Remove "*/" typo after "#include".
8090 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8091 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8092 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8093 Don't assume EMACS_TIME and struct timeval are the same type.
8094
8095 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8096
8097 Support higher-resolution time stamps (Bug#9000).
8098 The time stamps are only nanosecond-resolution at the C level,
8099 since that's the best that any real-world system supports now.
8100 But they are picosecond-resolution at the Lisp level, as that's
8101 easy, and leaves room for future OS improvements.
8102
8103 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8104 (LIBES): Use it.
8105
8106 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8107 Don't get current time unless it's needed.
8108
8109 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8110 now provides it if it's absent.
8111 (start_atimer): Port to higher-res time stamps.
8112 Check for time stamp overflow. Don't get current time more
8113 often than is needed.
8114
8115 * buffer.h (struct buffer): Buffer modtime now has high resolution.
8116 Include systime.h, not time.h.
8117 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8118
8119 * dired.c: Include stat-time.h.
8120 (Ffile-attributes): File times now have higher resolution.
8121
8122 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8123 (struct image): Timestamp now has higher resolution.
8124
8125 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8126 has at least microseconds now. All uses removed.
8127 (update_frame, update_single_window, update_window, update_frame_1)
8128 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8129 (duration_to_sec_usec): Remove; no longer needed.
8130
8131 * editfns.c (time_overflow): Now extern.
8132 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8133 (float-time, Fformat_time_string, Fcurrent_time_string)
8134 (Fcurrent_time_zone): Accept and generate higher-resolution
8135 time stamps.
8136 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8137 (decode_time_components, lisp_seconds_argument): New functions.
8138 (make_time): Now static.
8139 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
8140 Report an error if the time is invalid, rather than having the caller
8141 do that.
8142
8143 * fileio.c: Include <stat-time.h>
8144 (Fcopy_file): Copy higher-resolution time stamps.
8145 Prefer to set the time stamp via a file descriptor if that works.
8146 (Fset_file_times, Finsert_file_contents, Fwrite_region)
8147 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8148 (Fvisited_file_modtime, Fset_visited_file_modtime):
8149 Support higher-resolution time stamps.
8150
8151 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8152
8153 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8154
8155 * image.c (prepare_image_for_display, clear_image_cache)
8156 (lookup_image): Port to higer-resolution time stamps.
8157
8158 * keyboard.c (start_polling, bind_polling_period):
8159 Check for time stamp overflow.
8160 (read_char, kbd_buffer_get_event, timer_start_idle)
8161 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8162 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8163 Port to higher-resolution time stamps. Do not assume time_t is signed.
8164 (decode_timer): New function. Timers are now vectors of length 9,
8165 not 8, to accommodate the picosecond component.
8166 (timer_check_2): Use it.
8167
8168 * nsterm.m (select_timeout, timeval_subtract): Remove.
8169 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8170 as they're a bit more accurate and handle overflow better.
8171 (ns_select): Change prototype to be compatible with pselect.
8172 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8173 * nsterm.h (ns_select): Adjust prototype.
8174
8175 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8176 us-resolution time stamps.
8177 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8178
8179 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8180
8181 * lisp.h (time_overflow): New decl.
8182 (wait_reading_process_output): First arg is now intmax_t, not int,
8183 to accommodate larger waits.
8184
8185 * process.h (struct Lisp_Process.read_output_delay):
8186 Now counts nanoseconds, not microseconds.
8187 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8188 EMACS_HAS_USECS.
8189 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8190 (wait_reading_process_output):
8191 Port to ns-resolution time stamps.
8192 (Faccept_process_output, wait_reading_process_output):
8193 Check for time stamp overflow. Do not assume time_t is signed.
8194 (select_wrapper): Remove; we now use pselect.
8195 (Fprocess_attributes): Now generates ns-resolution time stamps.
8196
8197 * sysdep.c: Include utimens.h. Don't include utime.h
8198 or worry about struct utimbuf; gnulib does that for us now.
8199 (gettimeofday): Remove; gnulib provides a substitute.
8200 (make_timeval): New function.
8201 (set_file_times): Now sets ns-resolution time stamps.
8202 New arg FD; all uses changed.
8203 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8204 (system_process_attributes):
8205 Now returns ns-resolution time stamp. All uses changed.
8206 Check for time stamp overflow.
8207
8208 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8209 provides a substitute now.
8210
8211 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8212 since it guarantees struct timespec.
8213 (EMACS_TIME): Now struct timespec, so that we can support
8214 ns-resolution time stamps.
8215 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8216 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8217 (EMACS_USECS): Remove.
8218 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8219 so multiply the arg by 1000 before storing it.
8220 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8221 New macros.
8222 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8223 Port to ns-resolution time stamps.
8224 (EMACS_TIME_NEG_P): Remove; replaced by....
8225 (EMACS_TIME_SIGN): New macro.
8226 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8227 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8228 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8229 (make_timeval, make_lisp_time, decode_time_components): New decls.
8230 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
8231 that it mishandled time_t overflow. You can't compare by subtracting!
8232 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8233 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8234
8235 * term.c: Include <sys/time.h>.
8236 (timeval_to_Time): New function, for proper overflow wraparound.
8237 (term_mouse_position, term_mouse_click): Use it.
8238
8239 * undo.c (record_first_change): Support higher-resolution time stamps
8240 in the undo buffer.
8241 (Fprimitive_undo): Use them when restoring time stamps.
8242
8243 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8244 (w32_get_internal_run_time):
8245 Port to higher-resolution Emacs time stamps.
8246 (ltime): Now accepts single 64-bit integer, as that's more convenient
8247 for callers.
8248
8249 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8250
8251 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8252 for compatibility with pselect. Support ns-resolution time stamps.
8253
8254 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8255
8256 * xselect.c (wait_for_property_change, x_get_foreign_selection):
8257 Check for time stamp overflow, and support ns-resolution time stamps.
8258
8259 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8260 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8261 (timeval_subtract): Remove; no longer needed.
8262 (XTflash, XTring_bell, x_wait_for_event):
8263 Port to ns-resolution time stamps. Don't assume time_t is signed.
8264
8265 2012-06-22 Chong Yidong <cyd@gnu.org>
8266
8267 * xdisp.c (x_consider_frame_title): Revert last change.
8268
8269 2012-06-22 Eli Zaretskii <eliz@gnu.org>
8270
8271 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
8272 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8273 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
8274 staticidx goes up to 1597 out of 1600 = 0x640.)
8275
8276 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
8277
8278 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8279 Otherwise, the umask might be mistakenly 0 while handling input signals.
8280
8281 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
8282
8283 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8284
8285 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
8286
8287 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8288 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8289 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8290 access to `contents' member of Lisp_Vector objects with AREF and ASET
8291 where appropriate.
8292
8293 2012-06-19 Chong Yidong <cyd@gnu.org>
8294
8295 * frame.c (delete_frame): When selecting a frame on a different
8296 text terminal, do not alter the terminal's top-frame.
8297
8298 * xdisp.c (format_mode_line_unwind_data): Record the target
8299 frame's selected window and its terminal's top-frame.
8300 (unwind_format_mode_line): Restore them.
8301 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8302 Callers changed.
8303 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8304 since tty frames can be explicitly named.
8305 (prepare_menu_bars): Likewise.
8306
8307 * term.c (Ftty_top_frame): New function.
8308
8309 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8310
8311 Port byte-code-meter to modern targets.
8312 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8313 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8314 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
8315 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8316 (METER_1, METER_2): Simplify.
8317
8318 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
8319
8320 * data.c (Fdefalias): Return `symbol' (bug#11686).
8321
8322 2012-06-18 Martin Rudalics <rudalics@gmx.at>
8323
8324 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
8325 gets killed during executing of this function (Bug#11665).
8326 Try to always return Qt when the buffer has been actually killed.
8327 (Vkill_buffer_query_functions): In doc-string say that functions
8328 run by this hook should not change the current buffer.
8329
8330 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8331
8332 Fix recently-introduced process.c problems found by static checking.
8333 * process.c (write_queue_push, write_queue_pop, send_process):
8334 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8335 (write_queue_pop): Fix pointer signedness problem.
8336 (send_process): Remove unused local.
8337
8338 2012-06-17 Chong Yidong <cyd@gnu.org>
8339
8340 * xdisp.c (redisplay_internal): No need to redisplay terminal
8341 frames that are not on top.
8342
8343 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
8344
8345 * process.c (make_process): Initialize write_queue.
8346 (write_queue_push, write_queue_pop): New functions.
8347 (send_process): Use them to maintain correct ordering of process
8348 writes (Bug#10815).
8349
8350 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
8351
8352 * lisp.h (eassert): Assume C89 or later.
8353 This removes the need for CHECK.
8354 (CHECK): Remove. Its comments about always evaluating its
8355 argument were confusing, as 'eassert' typically does not evaluate
8356 its argument.
8357
8358 * coding.c (produce_chars): Use ptrdiff_t, not int.
8359
8360 * xterm.c (x_draw_underwave): Check for integer overflow.
8361 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8362
8363 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
8364
8365 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8366 referenced (Bug#11583).
8367
8368 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
8369
8370 Implement wave-style variant of underlining.
8371 * dispextern.h (face_underline_type): New enum.
8372 (face): Add field for underline type.
8373 * nsterm.m (ns_draw_underwave): New function.
8374 (ns_draw_text_decoration): Use it.
8375 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
8376 New functions.
8377 (x_draw_glyph_string): Use them.
8378 * xfaces.c (Qline, Qwave): New Lisp objects.
8379 (check_lface_attrs, merge_face_ref)
8380 (Finternal_set_lisp_face_attribute, realize_x_face):
8381 Handle wave-style underline face attributes.
8382 * xterm.c (x_draw_underwave): New function.
8383 (x_draw_glyph_string): Use it.
8384
8385 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
8386
8387 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
8388 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
8389 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
8390 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
8391 ($(BLD)/w32select.$(O)): Update dependencies.
8392
8393 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8394
8395 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
8396 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
8397 * character.c (_fetch_multibyte_char_p): Remove.
8398 * alloc.c: Include "character.h" before "buffer.h".
8399 * bidi.c: Likewise.
8400 * buffer.c: Likewise.
8401 * bytecode.c: Likewise.
8402 * callint.c: Likewise.
8403 * callproc.c: Likewise.
8404 * casefiddle.c: Likewise.
8405 * casetab.c: Likewise.
8406 * category.c: Likewise.
8407 * cmds.c: Likewise.
8408 * coding.c: Likewise.
8409 * composite.c: Likewise.
8410 * dired.c: Likewise.
8411 * dispnew.c: Likewise.
8412 * doc.c: Likewise.
8413 * dosfns.c: Likewise.
8414 * editfns.c: Likewise.
8415 * emacs.c: Likewise.
8416 * fileio.c: Likewise.
8417 * filelock.c: Likewise.
8418 * font.c: Likewise.
8419 * fontset.c: Likewise.
8420 * fringe.c: Likewise.
8421 * indent.c: Likewise.
8422 * insdel.c: Likewise.
8423 * intervals.c: Likewise.
8424 * keyboard.c: Likewise.
8425 * keymap.c: Likewise.
8426 * lread.c: Likewise.
8427 * macros.c: Likewise.
8428 * marker.c: Likewise.
8429 * minibuf.c: Likewise.
8430 * nsfns.m: Likewise.
8431 * nsmenu.m: Likewise.
8432 * print.c: Likewise.
8433 * process.c: Likewise.
8434 * regex.c: Likewise.
8435 * region-cache.c: Likewise.
8436 * search.c: Likewise.
8437 * syntax.c: Likewise.
8438 * term.c: Likewise.
8439 * textprop.c: Likewise.
8440 * undo.c: Likewise.
8441 * unexsol.c: Likewise.
8442 * w16select.c: Likewise.
8443 * w32fns.c: Likewise.
8444 * w32menu.c: Likewise.
8445 * window.c: Likewise.
8446 * xdisp.c: Likewise.
8447 * xfns.c: Likewise.
8448 * xmenu.c: Likewise.
8449 * xml.c: Likewise.
8450 * xselect.c: Likewise.
8451
8452 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8453
8454 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
8455 If all the glyphs of the glyph row came from strings, and we have no
8456 cursor positioning clues, put the cursor on the first glyph of the
8457 row.
8458 (handle_face_prop): Use chunk-relative overlay string index when
8459 indexing into it->string_overlays array. (Bug#11653)
8460 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
8461 the rightmost. (Bug#11720)
8462
8463 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8464
8465 * category.h (CHAR_HAS_CATEGORY): Define as inline.
8466 (CATEGORY_MEMBER): Enforce 1/0 value.
8467 * category.c (_temp_category_set): Remove.
8468
8469 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8470
8471 * window.c (Fdelete_other_windows_internal)
8472 (Fdelete_window_internal): Don't access frame's mouse highlight
8473 info of the initial frame. (Bug#11677)
8474
8475 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
8476
8477 * .gdbinit (xgetint): Fix recently-introduced paren typo.
8478 Assume USE_2_TAGS_FOR_INTS.
8479 (xreload): Adjust $tagmask width to match recent lisp.h change.
8480
8481 Simplify lisp.h in minor ways that should not affect code.
8482 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
8483 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
8484 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
8485 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
8486 (INTTYPEBITS): New macro, for clarity.
8487 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
8488 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
8489 Simplify now that USE_LSB_TAG is always defined.
8490 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
8491 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
8492
8493 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
8494
8495 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
8496
8497 2012-06-13 Glenn Morris <rgm@gnu.org>
8498
8499 * s/bsd-common.h (BSD4_3):
8500 * s/usg5-4-common.h (USG5_4): No longer define; unused.
8501
8502 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
8503
8504 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
8505 instead of union.
8506 (XLI, XIL): Define.
8507 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
8508 Use them.
8509 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
8510 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
8511 * alloc.c (widen_to_Lisp_Object): Remove.
8512 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
8513 * frame.c (delete_frame): Remove outdated comment.
8514 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
8515 USE_LISP_UNION_TYPE.
8516 (Fw32_unregister_hot_key): Likewise.
8517 (Fw32_toggle_lock_key): Likewise.
8518 * w32menu.c (add_menu_item): Likewise.
8519 (w32_menu_display_help): Use XIL instead of checking
8520 USE_LISP_UNION_TYPE.
8521 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
8522 (init_heap): Likewise.
8523 * w32term.c (w32_read_socket): Update comment.
8524
8525 2012-06-13 Glenn Morris <rgm@gnu.org>
8526
8527 * s/usg5-4-common.h, src/s/unixware.h:
8528 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8529
8530 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8531
8532 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
8533
8534 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8535 * alloc.c (make_number) [!defined make_number]:
8536 Remove, as lisp.h always defines this now.
8537 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8538 (roundup_size): Verify that it is a power of 2.
8539 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8540 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8541 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8542 -DUSE_LSB_TAG=0, to override the automatically-selected default.
8543 USE_LSB_TAG now is always defined to be either 0 or 1.
8544 All uses changed.
8545 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8546 code works fine either way, and efficiency is not a concern here,
8547 as the union type is for debugging, not for production.
8548 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8549 Use an inline function on all platforms when using the union type,
8550 since this is simpler and 'static inline' can be used portably
8551 within Emacs now.
8552 (LISP_INITIALLY_ZERO): New macro.
8553 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8554 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8555
8556 2012-06-12 Glenn Morris <rgm@gnu.org>
8557
8558 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8559
8560 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8561
8562 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8563 Move BROKEN_SIGIO to configure.
8564
8565 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8566 Move NO_TERMIO to configure.
8567
8568 2012-06-12 Chong Yidong <cyd@gnu.org>
8569
8570 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8571 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8572 MagickExportImagePixels is undefined.
8573
8574 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8575
8576 * image.c (imagemagick_load_image): Remove unused label.
8577
8578 2012-06-11 Glenn Morris <rgm@gnu.org>
8579
8580 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8581 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8582 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8583 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8584
8585 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8586
8587 * alloc.c (make_byte_code): New function.
8588 (Fmake_byte_code): Use it. Don't purify here.
8589 * lread.c (read1): Use it as well to avoid extra allocation.
8590
8591 2012-06-11 Chong Yidong <cyd@gnu.org>
8592
8593 * image.c (imagemagick_load_image): Implement transparency.
8594
8595 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8596
8597 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8598 account for preceding backslashes. (Bug#11663)
8599
8600 2012-06-09 Chong Yidong <cyd@gnu.org>
8601
8602 * term.c: Support italics in capable terminals (Bug#9652).
8603 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8604 (turn_on_face): Output using TS_enter_italic_mode if available.
8605 Don't handle unused blinking and alt-charset cases.
8606 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8607 and tty_alt_charset_p cases.
8608 (tty_capable_p, init_tty): Support italics.
8609
8610 * termchar.h (struct tty_display_info): Add field for italics.
8611 Remove unused blink field.
8612
8613 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8614 Handle slant.
8615
8616 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8617 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8618 tty_alt_charset_p. Add tty_italic_p.
8619
8620 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
8621
8622 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8623 dbus_type_is_basic if available.
8624 (xd_extract_signed, xd_extract_unsigned): Rename from
8625 extract_signed and extract_unsigned, respectively. Adapt callers.
8626
8627 2012-06-09 Chong Yidong <cyd@gnu.org>
8628
8629 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8630
8631 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8632 case (Bug#9752).
8633
8634 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
8635
8636 * xdisp.c (vmessage): Treat frame message as multibyte.
8637 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8638 would generate the diagnostic "Making \302\247 buffer-local while
8639 let-bound!".
8640
8641 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8642
8643 * dispnew.c (showing_window_margins_p): Undo last change, which
8644 was done due to an inadvertent commit.
8645 (adjust_frame_glyphs_for_frame_redisplay): Do call
8646 showing_window_margins_p.
8647
8648 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8649
8650 * eval.c (Fmake_var_non_special): New primitive.
8651 (syms_of_eval): Defsubr it.
8652 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8653
8654 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
8655
8656 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8657 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8658
8659 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8660
8661 * alloc.c (allocate_vectorlike): Fix last change.
8662
8663 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
8664
8665 Block-based vector allocation of small vectors.
8666 * lisp.h (struct vectorlike_header): New field `nbytes',
8667 adjust comment accordingly.
8668 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8669 to denote vector blocks. Adjust users (live_vector_p,
8670 mark_maybe_pointer, valid_lisp_object_p) accordingly.
8671 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8672 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8673 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8674 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8675 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8676 (roundup_size): New constant.
8677 (struct vector_block): New data type.
8678 (vector_blocks, vector_free_lists, zero_vector): New variables.
8679 (all_vectors): Rename to `large_vectors'.
8680 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8681 (sweep_vectors): New functions.
8682 (allocate_vectorlike): Return `zero_vector' as the only vector of
8683 0 items. Allocate new vector from block if vector size is less than
8684 or equal to VBLOCK_BYTES_MAX.
8685 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8686 (init_alloc_once): Add call to init_vectors.
8687
8688 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8689
8690 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8691
8692 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8693
8694 * doprnt.c (doprnt): Truncate multibyte char correctly.
8695 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8696 would mishandle a string argument "Xc" if X was a multibyte
8697 character of length 2: it would truncate after X's first byte
8698 rather than including all of X.
8699
8700 2012-06-06 Chong Yidong <cyd@gnu.org>
8701
8702 * buffer.c (word_wrap): Doc fix.
8703
8704 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8705
8706 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8707
8708 2012-06-03 Glenn Morris <rgm@gnu.org>
8709
8710 * xdisp.c (tool-bar-style): Doc fix.
8711
8712 2012-06-03 Ulrich Müller <ulm@gentoo.org>
8713
8714 * Makefile.in (PAXCTL): Define.
8715 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8716 binary via PaX flags if the paxctl utility is available.
8717 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8718 Restore PaX flags to their default. (Bug#11398)
8719
8720 2012-06-03 Chong Yidong <cyd@gnu.org>
8721
8722 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8723 buffer (Bug#11226).
8724
8725 2012-06-03 Chong Yidong <cyd@gnu.org>
8726
8727 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8728 (note_mode_line_or_margin_highlight): If there is no help echo,
8729 use mode-line-default-help-echo. Handle the case where the mouse
8730 position is past the end of the mode line string.
8731
8732 * buffer.c (buffer_local_value_1): New function, split from
8733 Fbuffer_local_value; can return Qunbound.
8734 (Fbuffer_local_value): Use it.
8735 (Vmode_line_format): Docstring tweaks.
8736
8737 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8738
8739 * sysdep.c (system_process_attributes): Improve comment.
8740
8741 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8742
8743 * keyboard.c: Export real-this-command to Elisp.
8744 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8745 and DEFVAR it. Update all users.
8746
8747 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8748
8749 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8750
8751 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8752 Convert pctcpu and pctmem to Lisp float properly.
8753 Let the compiler fold better, as 100.0/0x8000 is exact.
8754
8755 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8756
8757 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8758 cons_block.
8759
8760 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8761
8762 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8763
8764 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8765
8766 For a 'struct window', replace some Lisp_Object fields to
8767 bitfields where appropriate, remove unused fields.
8768 * window.h (struct window): Remove unused 'last_mark_x' and
8769 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
8770 change its type from Lisp_Object to bitfield.
8771 Change type of 'force_start', 'optional_new_start',
8772 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8773 fields from Lisp_Object to bitfield. Adjust users accordingly.
8774
8775 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8776
8777 Pacify gcc -Wdouble-precision when using Xaw.
8778 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8779 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8780 Use 'float' consistently, rather than 'float' in most places
8781 and 'double' in a couple of places.
8782
8783 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8784
8785 * xdisp.c (handle_stop): Detect whether we have overlay strings
8786 loaded by testing it->current.overlay_string_index to be
8787 non-negative, instead of checking whether n_overlay_strings is
8788 positive. (Bug#11587)
8789
8790 2012-05-31 Chong Yidong <cyd@gnu.org>
8791
8792 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8793
8794 * doc.c (Fsubstitute_command_keys): Doc fix.
8795
8796 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8797
8798 * search.c (search_buffer): Remove calls to
8799 r_alloc_inhibit_buffer_relocation, as it is now called by
8800 maybe_unify_char, which was the cause of relocation of buffer text
8801 in bug#11519.
8802
8803 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8804
8805 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8806 for the duration of call to load_charset, to avoid problems with
8807 callers of maybe_unify_char that access buffer text through C
8808 pointers.
8809
8810 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8811 decrement the inhibition flag, instead of just setting or
8812 resetting it.
8813
8814 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8815
8816 Remove obsolete '#define static' cruft.
8817 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8818 This #undef was "temporary" in 2000; it is no longer needed
8819 now that '#define static' has gone away.
8820 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8821 (gray_bitmap_bits): Remove; no longer needed.
8822 All uses replaced with definiens.
8823 * xterm.c: Include "bitmaps/gray.xbm".
8824
8825 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8826
8827 Clean up __executable_start, monstartup when --enable-profiling.
8828 The following changes affect the code only when profiling.
8829 * dispnew.c (__executable_start): Rename from safe_bcopy.
8830 Define only on platforms that need it.
8831 * emacs.c: Include <sys/gmon.h> when profiling.
8832 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8833 (__executable_start): Remove decl, since lisp.h does it now.
8834 (safe_bcopy): Remove decl; no longer has that name.
8835 (main): Coalesce #if into single bit of code, for simplicity.
8836 Cast pointers to uintptr_t, since standard libraries want integers
8837 and not pointers.
8838 * lisp.h (__executable_start): New decl.
8839
8840 2012-05-31 Glenn Morris <rgm@gnu.org>
8841
8842 * image.c (Fimagemagick_types): Doc fix.
8843
8844 2012-05-30 Jim Meyering <meyering@redhat.com>
8845
8846 * callproc.c (Fcall_process_region): Include directory component
8847 in mkstemp error message (Bug#11586).
8848
8849 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8850
8851 * alloc.c, lisp.h (make_pure_vector): Now static.
8852
8853 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8854
8855 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8856 Move to byte-run.el.
8857 (Fautoload): Do the hash-doc more carefully.
8858 * data.c (Fdefalias): Purify definition, except for keymaps.
8859 (Qdefun): Move from eval.c.
8860 * lisp.h (Qdefun): Remove.
8861 * lread.c (read1): Tiny simplification.
8862
8863 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8864
8865 Do not create empty overlays with the evaporate property (Bug#9642).
8866 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8867 Bug#9642, but explicitly check that the buffer the overlay would
8868 be moved to is live and rearrange lines to make sure that errors
8869 will not put the overlay in an inconsistent state.
8870 (Fdelete_overlay): Cosmetics.
8871
8872 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8873
8874 * w32term.c (my_bring_window_to_top): New function.
8875 (x_raise_frame): Use handle returned by DeferWindowPos, which
8876 could be different from the original one.
8877 Call my_bring_window_to_top instead of my_set_foreground_window.
8878 (Bug#11513)
8879
8880 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8881 by calling BringWindowToTop.
8882
8883 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8884 (WM_EMACS_END): Increase by one.
8885
8886 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8887
8888 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8889 This avoids undefined behavior that might cause the eassert
8890 to not catch an out-of-range value.
8891
8892 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8893
8894 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8895 Update dependencies.
8896
8897 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8898
8899 * bidi.c (bidi_mirror_char): Fix last change.
8900
8901 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8902
8903 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8904 when referring to sectname field in printf format.
8905
8906 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8907
8908 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8909 Only r_alloc_inhibit_buffer_relocation needed to be added;
8910 the others were already declared.
8911
8912 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8913 before checking whether it's out of range. Put the check inside
8914 eassert. See
8915 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8916
8917 2012-05-27 Ken Brown <kbrown@cornell.edu>
8918
8919 * callproc.c (Fcall_process): Restore a line that was accidentally
8920 commented out in the 2011-02-13 change (bug#11547).
8921
8922 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8923
8924 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8925 defined on ralloc.c.
8926
8927 * buffer.c [REL_ALLOC]: Remove prototypes of
8928 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8929 they are now on lisp.h.
8930
8931 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8932
8933 * search.c (search_buffer): Use it to inhibit relocation of buffer
8934 text while re_search_2 is doing its job, because re_search_2 is
8935 passed C pointers to buffer text. (Bug#11519)
8936
8937 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8938 Update value to 24.
8939
8940 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8941 state after an additional call to move_it_in_display_line_to, keep
8942 the values of it->max_ascent and it->max_descent found for the
8943 entire line.
8944 (pos_visible_p): Revert the comparison against bottom_y to what it
8945 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8946 (Bug#11464)
8947
8948 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8949
8950 Fix coding-related core dumps with gcc -ftrapv.
8951 The code was computing A - B, where A and B are pointers, and B is
8952 random garbage. This can lead to core dumps on platforms that
8953 have special pointer registers, and it also leads to core dumps on
8954 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8955 A - B only when B is initialized properly.
8956 * coding.c (coding_set_source, coding_set_destination): Return void.
8957 (coding_change_source, coding_change_destinations): New functions,
8958 with the old behaviors of coding_set_source and coding_set_destination.
8959 All callers that need an offset changed to use these new functions.
8960
8961 2012-05-26 Glenn Morris <rgm@gnu.org>
8962
8963 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8964
8965 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8966
8967 Extend mouse support on W32 text-mode console.
8968 * xdisp.c (draw_row_with_mouse_face):
8969 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8970
8971 * w32console.c: Include window.h.
8972 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8973 New functions.
8974 (initialize_w32_display): Initialize mouse-highlight data.
8975
8976 * w32inevt.c: Include termchar.h and window.h.
8977 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8978 moves, call note_mouse_highlight. If help_echo changed, call
8979 gen_help_event to produce help-echo message in the echo area.
8980 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8981 highlight info.
8982
8983 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8984
8985 * lread.c (read1): Simplify slightly to avoid an overflow warning
8986 with GCC 4.7.0 on x86-64.
8987
8988 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8989
8990 * bidi.c (bidi_mirror_char): Revert last change: an int is
8991 definitely wide enough here.
8992
8993 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8994
8995 Fix integer width and related bugs (Bug#9874).
8996 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8997 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8998 (string_bytes, check_sblock, allocate_string_data):
8999 (compact_small_strings, Fmake_bool_vector, make_string)
9000 (make_unibyte_string, make_multibyte_string)
9001 (make_string_from_bytes, make_specified_string)
9002 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9003 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9004 (mark_vectorlike):
9005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9006 (allocate_pseudovector):
9007 Use int, not EMACS_INT, where int is wide enough.
9008 (inhibit_garbage_collection, Fgarbage_collect):
9009 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9010 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9011 int might not be wide enough.
9012 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9013 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9014 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9015 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9016 (bidi_level_of_next_char, bidi_move_to_visually_next):
9017 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9018 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9019 (Fkill_buffer, Fset_buffer_major_mode)
9020 (advance_to_char_boundary, Fbuffer_swap_text)
9021 (Fset_buffer_multibyte, overlays_at, overlays_in)
9022 (overlay_touches_p, struct sortvec, record_overlay_string)
9023 (overlay_strings, recenter_overlay_lists)
9024 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9025 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9026 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9027 (Foverlay_recenter, last_overlay_modification_hooks_used)
9028 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9029 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9030 (validate_region): Omit unnecessary test for b <= e,
9031 since that's guaranteed by the previous test.
9032 (adjust_overlays_for_delete): Avoid pos + length overflow.
9033 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9034 (report_overlay_modification):
9035 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9036 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9037 Omit pointer cast, which isn't needed anyway, and doesn't work
9038 after the EMACS_INT -> ptrdiff_t change.
9039 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9040 * buffer.h: Adjust decls to match defn changes elsewhere.
9041 (struct buffer_text, struct buffer):
9042 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9043 Use EMACS_INT, not int, where int might not be wide enough.
9044 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9045 not int, to avoid needless 32-bit limit on 64-bit hosts.
9046 (exec_byte_code): Use tighter memory-full test, one that checks
9047 for alloca overflow. Don't compute the address of the object just
9048 before an array, as that's not portable. Use EMACS_INT, not
9049 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9050 * callint.c (Fcall_interactively):
9051 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9052 * callproc.c (call_process_kill, Fcall_process):
9053 Don't assume pid_t fits into an Emacs fixnum.
9054 (call_process_cleanup, Fcall_process, child_setup):
9055 Don't assume pid_t fits into int.
9056 (call_process_cleanup, Fcall_process, delete_temp_file)
9057 (Fcall_process_region):
9058 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9059 (Fcall_process): Simplify handling of volatile integers.
9060 Use int, not EMACS_INT, where int will do.
9061 * casefiddle.c (casify_object, casify_region, operate_on_word)
9062 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9063 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9064 (casify_object): Avoid integer overflow when overallocating buffer.
9065 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9066 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
9067 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9068 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9069 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9070 integers are now checked earlier. All uses replaced with XINT.
9071 (ccl_driver):
9072 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9073 For CCL_MapSingle, check that content and value are in int range.
9074 (ccl_driver, Fregister_code_conversion_map):
9075 Check that Vcode_version_map_vector is a vector.
9076 (resolve_symbol_ccl_program): Check that vector header is in range.
9077 Always copy the vector, so that we can check its contents reliably
9078 now rather than having to recheck each instruction as it's being
9079 executed. Check that vector words fit in 'int'.
9080 (ccl_get_compiled_code, Fregister_ccl_program)
9081 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9082 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9083 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9084 contents are in range.
9085 (Fccl_execute_on_string): Check that status is in range.
9086 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9087 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9088 Accept and return EMACS_INT, not int, because callers can pass values
9089 out of 'int' range.
9090 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9091 (multibyte_chars_in_text, parse_str_as_multibyte)
9092 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9093 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9094 (string_escape_byte8, Fget_byte):
9095 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9096 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9097 avoid mishandling large integers.
9098 * character.h: Adjust decls to match defn changes elsewhere.
9099 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9100 (Ffind_charset_region):
9101 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9102 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9103 (load_charset_map_from_vector, Fdefine_charset_internal):
9104 Don't assume fixnum fits in int.
9105 (load_charset_map_from_vector, Fmap_charset_chars):
9106 Remove now-unnecessary CHECK_NATNUMs.
9107 (Fdefine_charset_internal): Check ranges here, more carefully.
9108 Don't rely on undefined behavior with signed left shift overflow.
9109 Don't assume unsigned int fits into fixnum, or that fixnum fits
9110 into unsigned int. Don't require max_code to be a valid fixnum;
9111 that's not true for gb10830 4-byte on a 32-bit host. Allow
9112 invalid_code to be a cons, for the same reason. Require code_offset
9113 to be a character. Avoid int overflow if max_char is close
9114 to INT_MAX.
9115 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9116 this is intended anyway and avoids some undefined behavior.
9117 (load_charset_map): Pass unsigned, not int, as 2nd arg of
9118 INDEX_TO_CODE_POINT, as that's what it expects.
9119 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9120 * charset.h (DECODE_CHAR): Return int, not unsigned;
9121 this is what was intended anyway, and it avoids undefined behavior.
9122 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9123 integer-overflow issues.
9124 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9125 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9126 where the argument is EMACS_INT, and this behavior is not intended.
9127 * chartab.c (Fmake_char_table, Fset_char_table_range)
9128 (uniprop_get_decoder, uniprop_get_encoder):
9129 Don't assume fixnum fits in int.
9130 * cmds.c (move_point): New function, that does the gist of
9131 Fforward_char and Fbackward_char, but does so while checking
9132 for integer overflow more accurately.
9133 (Fforward_char, Fbackward_char): Use it.
9134 (Fforward_line, Fend_of_line, internal_self_insert)
9135 (internal_self_insert):
9136 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9137 Fix a FIXME, by checking for integer overflow when calculating
9138 target_clm and actual_clm.
9139 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9140 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9141 (ASSURE_DESTINATION, coding_alloc_by_realloc)
9142 (coding_alloc_by_making_gap, alloc_destination)
9143 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9144 (encode_coding_utf_16, detect_coding_emacs_mule)
9145 (decode_coding_emacs_mule, encode_coding_emacs_mule)
9146 (detect_coding_iso_2022, decode_coding_iso_2022)
9147 (encode_invocation_designation, encode_designation_at_bol)
9148 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9149 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9150 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9151 (encode_coding_ccl, encode_coding_raw_text)
9152 (detect_coding_charset, decode_coding_charset)
9153 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9154 (produce_composition, produce_charset, produce_annotation)
9155 (decode_coding, handle_composition_annotation)
9156 (handle_charset_annotation, consume_chars, decode_coding_gap)
9157 (decode_coding_object, encode_coding_object, detect_coding_system)
9158 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9159 (code_convert_region, code_convert_string)
9160 (Fdefine_coding_system_internal)
9161 (coding_set_source, coding_set_destination):
9162 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9163 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9164 (Fdefine_coding_system_internal):
9165 Don't assume fixnums fit in int.
9166 (decode_coding_gap, decode_coding_object, encode_coding_object)
9167 (Fread_coding_system, Fdetect_coding_region)
9168 (Funencodable_char_position, Fcheck_coding_systems_region)
9169 (get_translation, handle_composition_annotation, consume_chars):
9170 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9171 (consume_chars): Rewrite to not calculate an address outside buffer.
9172 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9173 Don't access memory outside of the args array.
9174 (Fdefine_coding_system_internal): Check for charset-id overflow.
9175 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9176 result of ENCODE_CHAR.
9177 * coding.h: Adjust decls to match defn changes elsewhere.
9178 (struct coding_system):
9179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9180 * composite.c (get_composition_id, find_composition)
9181 (run_composition_function, update_compositions)
9182 (compose_text, composition_gstring_put_cache)
9183 (composition_gstring_p, composition_gstring_width)
9184 (fill_gstring_header, fill_gstring_body, autocmp_chars)
9185 (composition_compute_stop_pos, composition_reseat_it)
9186 (composition_update_it, struct position_record)
9187 (find_automatic_composition, composition_adjust_point)
9188 (Fcomposition_get_gstring, Ffind_composition_internal):
9189 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9190 (update_compositions):
9191 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9192 * composite.h: Adjust decls to match defn changes elsewhere.
9193 (struct composition):
9194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9195 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9196 Do not attempt to compute the address of the object just before a
9197 buffer; this is not portable.
9198 (Faref, Faset):
9199 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9200 (Faset): Use int, not EMACS_INT, where int is wide enough.
9201 (Fstring_to_number): Don't assume fixnums fit in int.
9202 (Frem): Don't assume arg is nonnegative.
9203 * dbusbind.c (xd_append_arg): Check for integers out of range.
9204 (Fdbus_call_method): Don't overflow the timeout int.
9205 (extract_signed, extract_unsigned): New functions.
9206 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9207 (xd_get_connection_references): Return ptrdiff_t, not int.
9208 All uses changed.
9209 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9210 (xd_read_message_1):
9211 Use int, not unsigned, where the dbus API uses int.
9212 (Fdbus_message_internal): Don't overflow mtype.
9213 (syms_of_dbusbind): Allocate right-sized buffer for integers.
9214 * dired.c (directory_files_internal, file_name_completion, scmp)
9215 (file_name_completion_stat):
9216 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9217 (file_name_completion): Don't overflow matchcount.
9218 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9219 * dispextern.h: Adjust decls to match defn changes elsewhere.
9220 (struct text_pos, struct glyph, struct bidi_saved_info)
9221 (struct bidi_string_data, struct bidi_it, struct composition_it)
9222 (struct it):
9223 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9224 (struct display_pos, struct composition_it, struct it):
9225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9226 * dispnew.c (increment_matrix_positions)
9227 (increment_row_positions, mode_line_string)
9228 (marginal_area_string):
9229 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9230 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9231 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9232 (duration_to_sec_usec): New function, to check for overflow better.
9233 (Fsleep_for, sit_for): Use it.
9234 * doc.c (get_doc_string, store_function_docstring):
9235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9236 (get_doc_string, Fsnarf_documentation):
9237 Use int, not EMACS_INT, where int is wide enough.
9238 (get_doc_string):
9239 Use SAFE_ALLOCA, not alloca.
9240 Check for overflow when converting EMACS_INT to off_t.
9241 * doprnt.c (doprnt):
9242 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9243 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9244 Don't assume uid_t fits into fixnum.
9245 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9246 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9247 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9248 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9249 (general_insert_function)
9250 (Finsert_char, make_buffer_string, make_buffer_string_both)
9251 (update_buffer_properties, Fbuffer_substring)
9252 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9253 (Fsubst_char_in_region, check_translation)
9254 (Ftranslate_region_internal, save_restriction_restore, Fformat)
9255 (transpose_markers, Ftranspose_regions):
9256 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9257 (clip_to_bounds): Move to lisp.h as an inline function).
9258 (Fconstrain_to_field): Don't assume integers are nonnegative.
9259 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9260 (Fsubst_char_in_region, Fsave_restriction):
9261 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9262 (Femacs_pid): Don't assume pid_t fits into fixnum.
9263 (lo_time): Use int, not EMACS_INT, when int suffices.
9264 (lisp_time_argument): Check for usec out of range.
9265 (Fencode_time): Don't assume fixnum fits in int.
9266 (Fuser_login_name, Fuser_full_name): Signal an error
9267 if a uid argument is out of range, rather than relying on
9268 undefined behavior.
9269 (Fformat_time_string): Remove now-unnecessary check.
9270 lisp_time_argument checks for out-of-range usec now.
9271 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9272 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9273 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9274 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9275 (init_cmdargs, Fdump_emacs):
9276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9277 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9278 the bottom (typically) 32 bits of the fixnum.
9279 * eval.c (specpdl_size, call_debugger):
9280 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9281 (when_entered_debugger, Fbacktrace_debug):
9282 Don't assume fixnum can fit in int.
9283 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9284 the object just before a buffer; this is not portable.
9285 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9286 (grow_specpdl, unbind_to):
9287 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9288 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9289 (grow_specpdl): Simplify allocation by using xpalloc.
9290 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
9291 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9292 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9293 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9294 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9295 (a_write, e_write):
9296 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9297 (Fcopy_file, non_regular_nbytes, read_non_regular)
9298 (Finsert_file_contents):
9299 Use int, not EMACS_INT, where int is wide enough.
9300 (READ_BUF_SIZE): Verify that it fits in int.
9301 (Finsert_file_contents): Check that counts are in proper range,
9302 rather than assuming fixnums fit into ptrdiff_t etc.
9303 Don't assume fixnums fit into int.
9304 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
9305 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9306 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
9307 (string_char_to_byte, string_byte_to_char)
9308 (string_make_multibyte, string_to_multibyte)
9309 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9310 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9311 (substring_both, Fdelete, internal_equal, Ffillarray)
9312 (Fclear_string, mapcar1)
9313 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9314 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9315 (larger_vector, make_hash_table, maybe_resize_hash_table)
9316 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9317 (Fmaphash, secure_hash):
9318 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9319 (concat): Check for string index and length overflow.
9320 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9321 (Frequire):
9322 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9323 (larger_vector): New API (vec, incr_min, size_max) replaces old
9324 one (vec, new_size, init). This catches size overflow.
9325 INIT was removed because it was always Qnil.
9326 All callers changed.
9327 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9328 the upper bound on a hash table index size.
9329 (make_hash_table, maybe_resize_hash_table): Use it.
9330 (secure_hash): Computer start_byte and end_byte only after
9331 they're known to be in ptrdiff_t range.
9332 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9333 (Ffont_get_glyphs, Ffont_at):
9334 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9335 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9336 (Flist_fonts, Fopen_font):
9337 Don't assume fixnum can fit in int.
9338 (check_gstring): Don't assume index can fit in int.
9339 (font_match_p): Check that fixnum is a character, not a nonnegative
9340 fixnum, since the later code needs to stuff it into an int.
9341 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9342 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9343 conversion overflow issues.
9344 (Fopen_font): Check for integer out of range.
9345 (Ffont_get_glyphs): Don't assume index can fit in int.
9346 * font.h: Adjust decls to match defn changes elsewhere.
9347 * fontset.c (reorder_font_vector): Redo score calculation to avoid
9348 integer overflow.
9349 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9350 printmax_t, where ptrdiff_t is wide enough.
9351 (Finternal_char_font):
9352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9353 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9354 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9355 (Fset_frame_position, x_set_frame_parameters)
9356 (x_set_line_spacing, x_set_border_width)
9357 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9358 Check that fixnums are in proper range for system types.
9359 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9360 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9361 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9362 Use SAFE_ALLOCA_LISP, not alloca.
9363 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9364 intptr_t is wide enough.
9365 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9366 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9367 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9368 Check for fixnum out of range.
9369 * ftfont.c (ftfont_list): Don't assume index fits in int.
9370 Check that fixnums are in proper range for system types.
9371 (ftfont_shape_by_flt):
9372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9373 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9374 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9375 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
9376 Check that fixnums are in proper range for system types.
9377 * gnutls.h: Adjust decls to match defn changes elsewhere.
9378 * gtkutil.c (xg_dialog_run):
9379 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9380 (update_frame_tool_bar):
9381 Check that fixnums are in proper range for system types.
9382 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
9383 (lookup_image): Check that fixnums are in range for system types.
9384 * indent.c (last_known_column, last_known_column_point):
9385 (current_column_bol_cache):
9386 (skip_invisible, current_column, check_display_width):
9387 (check_display_width, scan_for_column, current_column_1)
9388 (Findent_to, Fcurrent_indentation, position_indentation)
9389 (indented_beyond_p, Fmove_to_column, compute_motion):
9390 (Fcompute_motion, Fvertical_motion):
9391 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9392 (last_known_column_modified): Use EMACS_INT, not int.
9393 (check_display_width):
9394 (Fcompute_motion):
9395 Check that fixnums and floats are in proper range for system types.
9396 (compute_motion): Don't assume index or fixnum fits in int.
9397 (compute_motion, Fcompute_motion):
9398 Use int, not EMACS_INT, when it is wide enough.
9399 (vmotion): Omit local var start_hpos that is always 0; that way
9400 we don't need to worry about overflow in expressions involving it.
9401 * indent.h: Adjust decls to match defn changes elsewhere.
9402 (struct position):
9403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9404 Use int, not EMACS_INT, where int is wide enough.
9405 Remove unused members ovstring_chars_done and tab_offset;
9406 all uses removed.
9407 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
9408 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
9409 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
9410 (make_gap, copy_text, insert, insert_and_inherit)
9411 (insert_before_markers, insert_before_markers_and_inherit)
9412 (insert_1, count_combining_before, count_combining_after)
9413 (insert_1_both, insert_from_string)
9414 (insert_from_string_before_markers, insert_from_string_1)
9415 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
9416 (adjust_after_replace, adjust_after_insert, replace_range)
9417 (replace_range_2, del_range, del_range_1, del_range_byte)
9418 (del_range_both, del_range_2, modify_region)
9419 (prepare_to_modify_buffer, signal_before_change)
9420 (signal_after_change, Fcombine_after_change_execute):
9421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9422 * intervals.c (traverse_intervals, rotate_right, rotate_left)
9423 (balance_an_interval, split_interval_right, split_interval_left)
9424 (find_interval, next_interval, update_interval)
9425 (adjust_intervals_for_insertion, delete_node, delete_interval)
9426 (interval_deletion_adjustment, adjust_intervals_for_deletion)
9427 (static_offset_intervals, offset_intervals)
9428 (merge_interval_right, merge_interval_left, make_new_interval)
9429 (graft_intervals_into_buffer, temp_set_point_both)
9430 (temp_set_point, set_point, adjust_for_invis_intang)
9431 (set_point_both, move_if_not_intangible, get_property_and_range)
9432 (get_local_map, copy_intervals, copy_intervals_to_string)
9433 (compare_string_intervals, set_intervals_multibyte_1):
9434 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9435 * intervals.h: Adjust decls to match defn changes elsewhere.
9436 (struct interval):
9437 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9438 * keyboard.c (this_command_key_count, this_single_command_key_start)
9439 (before_command_key_count, before_command_echo_length, echo_now)
9440 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
9441 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
9442 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
9443 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
9444 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9445 (last_non_minibuf_size, last_point_position, echo_truncate)
9446 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
9447 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
9448 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
9449 (stuff_buffered_input):
9450 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9451 (last_auto_save, command_loop_1, read_char):
9452 Use EMACS_INT, not int, to avoid integer overflow.
9453 (record_char): Avoid overflow in total_keys computation.
9454 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
9455 * keyboard.h: Adjust decls to match defn changes elsewhere.
9456 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
9457 (Fkey_description, Fdescribe_vector, Flookup_key):
9458 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9459 (click_position): New function, to check that positions are in range.
9460 (Fcurrent_active_maps):
9461 (describe_command):
9462 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9463 (Faccessible_keymaps, Fkey_description):
9464 (preferred_sequence_p):
9465 Don't assume fixnum can fit into int.
9466 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
9467 Check for integer overflow in size calculations.
9468 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
9469 avoid mishandling large integers.
9470 * lisp.h: Adjust decls to match defn changes elsewhere.
9471 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
9472 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
9473 (struct Lisp_Marker):
9474 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9475 (clip_to_bounds): Now an inline function, moved here from editfns.c.
9476 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
9477 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
9478 All callers changed.
9479 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
9480 Assume the arg has valid form, since it always does.
9481 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
9482 unsigned integer system type.
9483 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
9484 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
9485 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9486 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
9487 (duration_to_sec_usec): New decl.
9488 * lread.c (read_from_string_index, read_from_string_index_byte)
9489 (read_from_string_limit, readchar, unreadchar, openp)
9490 (read_internal_start, read1, oblookup):
9491 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9492 (Fload, readevalloop, Feval_buffer, Feval_region):
9493 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9494 (openp): Check for out-of-range argument to 'access'.
9495 (read1): Use int, not EMACS_INT, where int is wide enough.
9496 Don't assume fixnum fits into int.
9497 Fix off-by-one error that can read outside a buffer.
9498 (read_filtered_event): Use duration_to_sec_usec
9499 to do proper overflow checking on durations.
9500 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
9501 in size calculation.
9502 (Fexecute_kbd_macro):
9503 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9504 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
9505 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
9506 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
9507 (set_marker_both, set_marker_restricted_both, marker_position)
9508 (marker_byte_position, Fbuffer_has_markers_at):
9509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9510 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
9511 * menu.c (ensure_menu_items): Rename from grow_menu_items.
9512 It now merely ensures that the menu is large enough, without
9513 necessarily growing it, as this avoids some integer overflow issues.
9514 All callers changed.
9515 (keymap_panes, parse_single_submenu, Fx_popup_menu):
9516 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9517 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
9518 Use SAFE_ALLOCA_LISP, not alloca.
9519 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
9520 to EMACS_INT. Check that fixnums are in proper range for system types.
9521 * minibuf.c (minibuf_prompt_width, string_to_object)
9522 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
9523 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
9524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9525 (get_minibuffer, read_minibuf_unwind):
9526 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9527 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9528 this simplifies overflow checking. All callers changed.
9529 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9530 (Ftest_completion):
9531 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9532 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9533 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9534 Check that fixnums are in proper range for system types.
9535 (Fx_create_frame, Fx_show_tip):
9536 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9537 * nsfont.m (ns_findfonts, nsfont_list_family):
9538 Don't assume fixnum fits in long.
9539 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9540 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9541 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9542 wide enough.
9543 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9544 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9545 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9546 (PRINTDECLARE, PRINTPREPARE):
9547 (strout, print_string):
9548 (print, print_preprocess, print_check_string_charset_prop)
9549 (print_object):
9550 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9551 (PRINTDECLARE):
9552 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9553 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9554 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9555 (printchar, strout): Use xpalloc to catch size calculation overflow.
9556 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9557 (print_error_message): Use SAFE_ALLOCA, not alloca.
9558 (print_object): Use int, not EMACS_INT, where int is wide enough.
9559 (print_depth, new_backquote_output, print_number_index):
9560 Use ptrdiff_t, not int, where int might not be wide enough.
9561 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9562 (Fset_process_window_size, Fformat_network_address)
9563 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9564 (sigchld_handler):
9565 Check that fixnums are in proper range for system types.
9566 (Fsignal_process): Simplify by avoiding a goto.
9567 Check for process-ids out of pid_t range rather than relying on
9568 undefined behavior.
9569 (process_tick, update_tick): Use EMACS_INT, not int.
9570 (Fformat_network_address, read_process_output, send_process)
9571 (Fprocess_send_region, status_notify):
9572 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9573 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9574 (wait_reading_process_output, read_process_output, exec_sentinel):
9575 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9576 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9577 (Faccept_process_output): Use duration_to_sec_usec to do proper
9578 overflow checking on durations.
9579 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9580 Don't assume pid_t fits in int.
9581 * process.h (struct Lisp_Process): Members tick and update_tick
9582 are now of type EMACS_INT, not int.
9583 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9584 configured --with-wide-int.
9585 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9586 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9587 * search.c (looking_at_1, string_match_1):
9588 (fast_string_match, fast_c_string_match_ignore_case)
9589 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9590 (scan_newline, find_before_next_newline, search_command)
9591 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9592 (set_search_regs, wordify):
9593 (Freplace_match):
9594 (Fmatch_data):
9595 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9596 (string_match_1, search_buffer, set_search_regs):
9597 (Fmatch_data):
9598 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9599 (wordify): Check for overflow in size calculation.
9600 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9601 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9602 Check that fixnums are in proper range for system types.
9603 * sound.c (struct sound_device)
9604 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9605 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9606 (Fplay_sound_internal):
9607 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9608 * syntax.c (struct lisp_parse_state, find_start_modiff)
9609 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9610 (Fparse_partial_sexp):
9611 Don't assume fixnums can fit in int.
9612 (struct lisp_parse_state, find_start_pos, find_start_value)
9613 (find_start_value_byte, find_start_begv)
9614 (update_syntax_table, char_quoted, dec_bytepos)
9615 (find_defun_start, prev_char_comend_first, back_comment):
9616 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9617 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9619 (Finternal_describe_syntax_value): Check that match_lisp is a
9620 character, not an integer, since the code stuffs it into int.
9621 (scan_words, scan_sexps_forward):
9622 Check that fixnums are in proper range for system types.
9623 (Fforward_word):
9624 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9625 (scan_sexps_forward):
9626 Use CHARACTERP, not INTEGERP, since the value must fit into int.
9627 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9628 * syntax.h: Adjust decls to match defn changes elsewhere.
9629 (struct gl_state_s):
9630 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9631 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9632 MOST_POSITIVE_FIXNUM.
9633 * sysdep.c (wait_for_termination_1, wait_for_termination)
9634 (interruptible_wait_for_termination, mkdir):
9635 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9636 (emacs_read, emacs_write):
9637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9638 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9639 and double all fit in int.
9640 * term.c (set_tty_color_mode):
9641 Check that fixnums are in proper range for system types.
9642 * termhooks.h (struct input_event):
9643 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9644 * textprop.c (validate_interval_range, interval_of)
9645 (Fadd_text_properties, set_text_properties_1)
9646 (Fremove_text_properties, Fremove_list_of_text_properties)
9647 (Ftext_property_any, Ftext_property_not_all)
9648 (copy_text_properties, text_property_list, extend_property_ranges)
9649 (verify_interval_modification):
9650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9651 (Fnext_single_char_property_change)
9652 (Fprevious_single_char_property_change):
9653 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9654 (copy_text_properties):
9655 Check for integer overflow in index calculation.
9656 * undo.c (last_boundary_position, record_point, record_insert)
9657 (record_delete, record_marker_adjustment, record_change)
9658 (record_property_change):
9659 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9660 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9661 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9662 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9663 (Fx_hide_tip, Fx_file_dialog):
9664 * w32menu.c (set_frame_menubar):
9665 Use ptrdiff_t, not int, for consistency with rest of code.
9666 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9667 (select_window, Fdelete_other_windows_internal)
9668 (window_scroll_pixel_based, window_scroll_line_based)
9669 (Frecenter, Fset_window_configuration):
9670 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9671 (Fset_window_hscroll, run_window_configuration_change_hook)
9672 (set_window_buffer, temp_output_buffer_show, scroll_command)
9673 (Fscroll_other_window, Frecenter):
9674 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9675 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9676 Don't assume fixnum fits in int.
9677 (Fset_window_scroll_bars):
9678 Check that fixnums are in proper range for system types.
9679 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9680 (string_pos, c_string_pos, number_of_chars, init_iterator)
9681 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9682 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9683 (compute_display_string_end, handle_face_prop)
9684 (face_before_or_after_it_pos, handle_invisible_prop)
9685 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9686 (display_prop_intangible_p, string_buffer_position_lim)
9687 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9688 (get_overlay_strings_1, get_overlay_strings)
9689 (iterate_out_of_display_property, forward_to_next_line_start)
9690 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9691 (get_next_display_element, set_iterator_to_next)
9692 (get_visually_first_element, compute_stop_pos_backwards)
9693 (handle_stop_backwards, next_element_from_buffer)
9694 (move_it_in_display_line_to, move_it_in_display_line)
9695 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9696 (add_to_log, message_dolog, message_log_check_duplicate)
9697 (message2, message2_nolog, message3, message3_nolog
9698 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9699 (current_message_1, truncate_echo_area, truncate_message_1)
9700 (set_message, set_message_1, store_mode_line_noprop)
9701 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9702 (text_outside_line_unchanged_p, check_point_in_composition)
9703 (reconsider_clip_changes)
9704 (redisplay_internal, set_cursor_from_row, try_scrolling)
9705 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9706 (redisplay_window, find_last_unchanged_at_beg_row)
9707 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9708 (trailing_whitespace_p, find_row_edges, display_line)
9709 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9710 (display_mode_element, store_mode_line_string)
9711 (pint2str, pint2hrstr, decode_mode_spec)
9712 (display_count_lines, display_string, draw_glyphs)
9713 (x_produce_glyphs, x_insert_glyphs)
9714 (rows_from_pos_range, mouse_face_from_buffer_pos)
9715 (fast_find_string_pos, mouse_face_from_string_pos)
9716 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9718 (safe_call, init_from_display_pos, handle_fontified_prop)
9719 (handle_single_display_spec, load_overlay_strings)
9720 (with_echo_area_buffer, setup_echo_area_for_printing)
9721 (display_echo_area, echo_area_display)
9722 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9723 (update_tool_bar, hscroll_window_tree, redisplay_internal)
9724 (redisplay_window, dump_glyph_row, display_mode_line)
9725 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9726 (handle_display_spec, display_prop_string_p):
9727 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9728 (handle_single_display_spec, build_desired_tool_bar_string)
9729 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9730 (get_specified_cursor_type):
9731 Check that fixnums are in proper range for system types.
9732 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9733 (Flookup_image_map):
9734 Don't assume fixnums fit in int.
9735 (compare_overlay_entries):
9736 Avoid mishandling comparisons due to subtraction overflow.
9737 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9738 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9739 (handle_tool_bar_click):
9740 Use int, not unsigned, since we prefer signed and the signedness
9741 doesn't matter here.
9742 (get_next_display_element, next_element_from_display_vector):
9743 Use int, not EMACS_INT, when int is wide enough.
9744 (start_hourglass): Use duration_to_sec_usec to do proper
9745 overflow checking on durations.
9746 * xfaces.c (Fbitmap_spec_p):
9747 Check that fixnums are in proper range for system types.
9748 (compare_fonts_by_sort_order):
9749 Avoid mishandling comparisons due to subtraction overflow.
9750 (Fx_family_fonts, realize_basic_faces):
9751 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9752 (Fx_family_fonts):
9753 Don't assume fixnum fits in int.
9754 Use SAFE_ALLOCA_LISP, not alloca.
9755 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9756 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9757 (face_at_buffer_position, face_for_overlay_string)
9758 (face_at_string_position):
9759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9760 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9761 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9762 (Fx_show_tip):
9763 Check that fixnums are in proper range for system types.
9764 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9765 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9766 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9767 (Fx_change_window_property): Don't assume fixnums fit in int.
9768 * xfont.c (xfont_chars_supported):
9769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9770 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9771 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9772 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9773 * xml.c (parse_region):
9774 * xrdb.c (magic_file_p):
9775 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9776 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9777 (x_get_local_selection, x_reply_selection_request)
9778 (x_handle_selection_request, wait_for_property_change):
9779 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9780 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9781 short is wide enough.
9782 (x_send_client_event): Don't assume fixnum fits in int.
9783 * xterm.c (x_x_to_emacs_modifiers):
9784 Don't assume EMACS_INT overflows nicely into int.
9785 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9786 may come from Lisp.
9787 (handle_one_xevent): NATNUMP can eval its arg twice.
9788 (x_connection_closed):
9789 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9790 * xterm.h: Adjust decls to match defn changes elsewhere.
9791 (struct scroll_bar): Use struct vectorlike_header
9792 rather than rolling our own approximation.
9793 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9794
9795 2012-05-25 Glenn Morris <rgm@gnu.org>
9796
9797 * lisp.mk (lisp): Update for more files being compiled now.
9798
9799 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9800
9801 * lread.c: Remove `read_pure' which makes no difference.
9802 (read_pure): Remove var.
9803 (unreadpure): Remove function.
9804 (readevalloop): Don't call read_list with -1 flag.
9805 (read1, read_vector): Don't test read_pure any more.
9806 (read_list): Simplify.
9807
9808 * fileio.c, character.h: Minor style tweaks.
9809
9810 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9811
9812 * window.h (clip_changed): Remove useless declaration.
9813
9814 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9815
9816 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9817 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9818
9819 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9820
9821 Remove src/m/*.
9822 This directory predates autoconf and is no longer needed nowadays.
9823 Move its few remaining bits of functionality to where they're needed.
9824 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9825 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9826 * m/template.h: Remove.
9827 * Makefile.in (M_FILE): Remove. All uses removed.
9828 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9829 * lisp.h (USE_LSB_TAG):
9830 * mem-limits.h (EXCEEDS_LISP_PTR):
9831 Use VAL_MAX, not VALBITS, in #if.
9832 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9833 (EMACS_UINT): Define unconditionally now.
9834 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9835 (BITS_PER_EMACS_INT): New constants, replacing
9836 what used to be in config.h, but not useful in #if.
9837 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9838 define them any more.
9839 (VAL_MAX): New macro.
9840 (VALMASK): Use it.
9841 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9842 BITS_PER_EMACS_INT, in #if.
9843 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9844 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9845 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9846 * s/ms-w32.h (DATA_START):
9847 Move here from removed file m/intel386.h.
9848 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9849 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9850
9851 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9852
9853 Assume C89 or later.
9854 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9855 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9856 (xrealloc):
9857 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9858 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9859 * textprop.c, tparam.c (NULL): Remove.
9860 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9861 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9862 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9863 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9864 * xterm.c (input_signal_count): Assume volatile works.
9865
9866 2012-05-21 Ken Brown <kbrown@cornell.edu>
9867
9868 * xgselect.c (xg_select): Fix first argument in call to 'select'
9869 (bug#11508).
9870
9871 2012-05-20 Ken Brown <kbrown@cornell.edu>
9872
9873 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9874 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9875
9876 2012-05-19 Ken Brown <kbrown@cornell.edu>
9877
9878 * xfns.c (x_in_use): Remove `static' qualifier.
9879 * xterm.h (x_in_use): Declare.
9880 * xgselect.c: Include xterm.h.
9881 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9882 and `display_arg' (bug#9754).
9883
9884 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9885
9886 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9887
9888 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9889 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9890
9891 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9892
9893 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9894
9895 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9896 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9897
9898 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9899 reference to image_cache->refcount.
9900 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9901
9902 2012-05-17 Juri Linkov <juri@jurta.org>
9903
9904 * search.c (Fword_search_regexp, Fword_search_backward)
9905 (Fword_search_forward, Fword_search_backward_lax)
9906 (Fword_search_forward_lax): Move functions to isearch.el
9907 (bug#10145, bug#11381).
9908
9909 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9910
9911 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9912
9913 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9914
9915 * lread.c (init_obarray): Declare Qt and Qnil as special.
9916
9917 2012-05-14 Glenn Morris <rgm@gnu.org>
9918
9919 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9920 Put "libexec" before "bin", for the sake of init_callproc_1.
9921
9922 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9923
9924 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9925
9926 * unexaix.c: Port to more-recent AIX compilers.
9927 (report_error, report_error_1, make_hdr, copy_sym)
9928 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9929 Make arguments const char *, not char *, to avoid violations of C
9930 standard and to fix some AIX warnings reported by Gilles Pion.
9931
9932 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9933
9934 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9935 already have overlays loaded.
9936 (handle_single_display_spec): Before returning without displaying
9937 fringe bitmap, synchronize the bidi iterator with the main display
9938 iterator, by calling iterate_out_of_display_property.
9939 (iterate_out_of_display_property): Detect buffer iteration by
9940 testing that it->string is a Lisp string.
9941 (get_next_display_element): When the current object is exhausted,
9942 and there's something on it->stack, call set_iterator_to_next to
9943 proceed with what's on the stack, instead of returning zero.
9944 (set_iterator_to_next): If called at the end of a Lisp string,
9945 proceed to consider_string_end without incrementing string
9946 position. Don't increment display vector index past the end of
9947 the display vector. (Bug#11417)
9948 (pos_visible_p): Don't report a position visible when move_it_to
9949 stopped at the last line of window, which happens to be scanned
9950 backwards by the bidi iteration. (Bug#11464)
9951
9952 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9953
9954 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9955 and right-margin display specs even if the spec is invalid or we
9956 are on a TTY, and thus unable to display on the fringes.
9957 That's because the text with the property will not be displayed anyway,
9958 so we need to signal to the caller that this is a "replacing"
9959 display spec. This fixes display when the spec is invalid or we
9960 are on a TTY.
9961
9962 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9963
9964 * unexaix.c (make_hdr): Fix typo in prototype.
9965 This bug broke the build on AIX. Problem reported by Gilles Pion.
9966
9967 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9968
9969 * keyboard.c (kbd_buffer_get_event): Read special events also in
9970 batch mode. (Bug#11415)
9971
9972 2012-05-12 Glenn Morris <rgm@gnu.org>
9973
9974 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9975
9976 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9977
9978 * lisp.mk (lisp): Add newcomment.elc.
9979
9980 2012-05-12 Glenn Morris <rgm@gnu.org>
9981
9982 * Makefile.in (MKDIR_P): New, set by configure.
9983 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9984
9985 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9986
9987 Remove unused function hourglass_started.
9988 * dispextern.h (hourglass_started):
9989 * w32fns.c (hourglass_started):
9990 * xdisp.c (hourglass_started): Remove.
9991
9992 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9993
9994 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9995 Update dependencies.
9996
9997 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9998
9999 * xgselect.c (xg_select): Put maxfds+1 into a var.
10000 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10001
10002 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10003
10004 2012-05-10 Dave Abrahams <dave@boostpro.com>
10005
10006 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10007 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10008
10009 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
10010
10011 * dbusbind.c (xd_registered_buses): New internal Lisp object.
10012 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
10013 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10014 Initialize xd_registered_buses.
10015
10016 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10017
10018 Untag more efficiently if USE_LSB_TAG.
10019 This is based on a proposal by YAMAMOTO Mitsuharu in
10020 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10021 For an admittedly artificial (nth 8000 longlist) benchmark on
10022 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10023 Emacs's overall text size by 1%.
10024 * lisp.h (XUNTAG): New macro.
10025 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10026 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10027 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10028 * eval.c (Fautoload):
10029 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10030 * frame.h (XFRAME): Use XUNTAG.
10031
10032 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10033 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10034 Remove unportable assumptions about print widths of types like
10035 dbus_uint32_t.
10036 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10037 intptr_t when converting between pointer and integer, to avoid GCC
10038 warnings about wrong width.
10039
10040 2012-05-09 Eli Zaretskii <eliz@gnu.org>
10041
10042 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10043 stack for each reader_thread, instead of defaulting to 8MB
10044 determined by the linker. This avoids failures in creating
10045 subprocesses on Windows 7, see the discussion in this thread:
10046 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10047
10048 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10049
10050 Fix up display of the *Minibuf-0* buffer in the mini window.
10051 * keyboard.c (read_char): Don't clear the echo area if there's no
10052 message to clear.
10053 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10054 contents of *Minibuf-0*) if there's no message displayed in its stead.
10055
10056 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
10057
10058 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10059 batch mode.
10060
10061 2012-05-06 Chong Yidong <cyd@gnu.org>
10062
10063 * lisp.mk (lisp): Update.
10064
10065 2012-05-05 Jim Meyering <meyering@redhat.com>
10066
10067 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10068
10069 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10070
10071 * data.c (PUT_ERROR): New macro.
10072 (syms_of_data): Use it. Add new error type `user-error'.
10073 * undo.c (user_error): New function.
10074 (Fprimitive_undo): Use it.
10075 * print.c (print_error_message): Adjust print style for `user-error'.
10076 * keyboard.c (user_error): New function.
10077 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10078
10079 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10080
10081 Do not limit current-time-string to years 1000..9999.
10082 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10083 (Fcurrent_time_string): Support any year that is supported by the
10084 underlying localtime representation. Don't use asctime, as it
10085 has undefined behavior for years outside the range -999..9999.
10086
10087 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10088
10089 Fix race conditions involving setenv, gmtime, localtime, asctime.
10090 Without this fix, interrupts could mess up code that uses these
10091 nonreentrant functions, since setting TZ invalidates existing
10092 tm_zone or tzname values, and since most of these functions return
10093 pointers to static storage.
10094 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10095 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10096 Grow the critical sections to include not just invoking
10097 localtime/gmtime, but also accessing these functions' results
10098 including their tm_zone values if any, and any related TZ setting.
10099 (format_time_string): Last arg is now struct tm *, not struct tm **,
10100 so that the struct tm is saved in the critical section.
10101 All callers changed. Simplify allocation of initial buffer, partly
10102 motivated by the fact that memory allocation needs to be outside
10103 the critical section.
10104
10105 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10106
10107 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10108 with RESET_INTERVAL.
10109
10110 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10111 Remove duplicated buffer name initialization.
10112
10113 2012-05-02 Jim Meyering <jim@meyering.net>
10114
10115 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10116
10117 * xfns.c (x_window): Use xstrdup (Bug#11375).
10118
10119 2012-05-02 Eli Zaretskii <eliz@gnu.org>
10120
10121 * xdisp.c (pos_visible_p): If already at a newline from the
10122 display string before the 'while' loop, don't walk back the glyphs
10123 from it3.glyph_row. Solves assertion violation when the display
10124 string begins with a newline (egg.el). (Bug#11367)
10125
10126 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
10127
10128 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10129 Move to simple.el.
10130
10131 2012-05-01 Glenn Morris <rgm@gnu.org>
10132
10133 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10134 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10135 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10136 All were removed before 23.1.
10137
10138 * dispnew.c: Remove HAVE_LIBNCURSES test;
10139 it is always true on relevant platforms.
10140
10141 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10142 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10143
10144 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10145
10146 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
10147
10148 * .gdbinit (xpr): Remove checks for no longer existing misc types.
10149 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10150 Remove.
10151
10152 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
10153
10154 Do not avoid creating empty evaporating overlays (Bug#9642).
10155 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10156 That is, do not delete an evaporating overlay if it becomes
10157 empty after its bounds are adjusted to fit within its buffer.
10158 This fix caused other problems, and I'm reverting it until we get
10159 to the bottom of them.
10160
10161 2012-04-27 Chong Yidong <cyd@gnu.org>
10162
10163 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10164
10165 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10166
10167 * xdisp.c (pos_visible_p): If the window start position is beyond
10168 ZV, start the display from buffer beginning. Prevents assertion
10169 violation in init_iterator when the minibuffer window is scrolled
10170 via the scroll bar.
10171
10172 * window.c (window_scroll_pixel_based): Likewise.
10173
10174 2012-04-27 Chong Yidong <cyd@gnu.org>
10175
10176 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10177
10178 2012-04-27 Glenn Morris <rgm@gnu.org>
10179
10180 * fileio.c (Fcopy_file, Fset_file_selinux_context):
10181 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
10182
10183 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10184
10185 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10186 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
10187
10188 2012-04-26 Eli Zaretskii <eliz@gnu.org>
10189
10190 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10191 display element, check also the underlying string or buffer
10192 character. (Bug#11341)
10193
10194 * w32menu.c: Include w32heap.h.
10195 (add_menu_item): If the call to AppendMenuW (via
10196 unicode_append_menu) fails, disable Unicode menus only if we are
10197 running on Windows 9X/Me.
10198
10199 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10200
10201 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10202 (xgetint): Add missing shift for LSB tags.
10203
10204 2012-04-24 Martin Rudalics <rudalics@gmx.at>
10205
10206 * keyboard.c (read_char): Don't wipe echo area for select window
10207 events: These might get delayed via `mouse-autoselect-window'
10208 (Bug#11304).
10209
10210 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
10211
10212 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10213 manipulation of :loaded-from data.
10214
10215 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
10216
10217 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10218 now a cons (bug#11311).
10219
10220 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10221
10222 Do not create empty overlays with the evaporate property (Bug#9642).
10223 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10224 if it becomes empty after its bounds are adjusted to fit within
10225 its buffer. Without this fix, in a nonempty buffer (let ((o
10226 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10227 yields an empty overlay that has the evaporate property, which is
10228 not supposed to happen.
10229
10230 Fix minor GTK3 problems found by static checking.
10231 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10232 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10233 (struct _EmacsFixedClass, emacs_fixed_get_type):
10234 Move decls here from emacsgtkfixed.h, since they needn't be public.
10235 (emacs_fixed_get_type): Now static.
10236 (emacs_fixed_class_init): Omit unused local.
10237 (emacs_fixed_child_type): Remove; unused.
10238 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10239 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10240 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10241 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10242 (EMACS_FIXED_GET_CLASS): Remove; unused.
10243 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10244
10245 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10246 Problem reported by Juanma Barranquero for Windows -Wunused-function.
10247
10248 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10249
10250 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10251 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10252 (__malloc_size_t, __malloc_ptrdiff_t):
10253 Remove. All uses removed, replaced by the definiens if needed,
10254 since we can assume C89 or better now.
10255 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10256 (protect_malloc_state, align, get_contiguous_space)
10257 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10258 (malloc_atfork_handler_child, malloc_enable_thread)
10259 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10260 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10261 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10262 (special_realloc, _realloc_internal_nolock, _realloc_internal)
10263 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10264 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10265 Define using prototypes, not old style.
10266 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10267 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10268 (align): Don't assume that signed integer overflow wraps around.
10269 Omit unused local var.
10270 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10271 (_free_internal_nolock, memalign, mallochook, reallochook):
10272 Omit no-longer-needed casts.
10273 (valloc): Use getpagesize, not __getpagesize.
10274 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10275 (struct hdr): The 'magic' member is now size_t, not unsigned long.
10276
10277 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10278
10279 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
10280
10281 Move functions from C to Lisp. Make non-blocking method calls
10282 the default. Implement further D-Bus standard interfaces.
10283
10284 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10285 (QCdbus_request_name_allow_replacement)
10286 (QCdbus_request_name_replace_existing)
10287 (QCdbus_request_name_do_not_queue)
10288 (QCdbus_request_name_reply_primary_owner)
10289 (QCdbus_request_name_reply_in_queue)
10290 (QCdbus_request_name_reply_exists)
10291 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10292 (QCdbus_registered_serial, QCdbus_registered_method)
10293 (QCdbus_registered_signal): New Lisp objects.
10294 (XD_DEBUG_MESSAGE): Use sizeof.
10295 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10296 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10297 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10298 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10299 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10300 (xd_signature, xd_append_arg): Allow float for integer types.
10301 (xd_get_connection_references): New function.
10302 (xd_get_connection_address): Rename from xd_initialize.
10303 Return cached address.
10304 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10305 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
10306 level.
10307 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
10308 Return number of refcounts.
10309 (Fdbus_get_unique_name): Make stronger parameter check.
10310 (Fdbus_message_internal): New defun.
10311 (Fdbus_call_method, Fdbus_call_method_asynchronously)
10312 (Fdbus_method_return_internal, Fdbus_method_error_internal)
10313 (Fdbus_send_signal, Fdbus_register_service)
10314 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10315 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10316 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10317 (Vdbus_compiled_version, Vdbus_runtime_version)
10318 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10319 (Vdbus_message_type_method_return, Vdbus_message_type_error)
10320 (Vdbus_message_type_signal): New defvars.
10321 (Vdbus_registered_buses, Vdbus_registered_objects_table):
10322 Adapt docstring.
10323
10324 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10325
10326 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10327 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10328 Do not assume ptrdiff_t is the same width as 'int'.
10329
10330 * alloc.c: Handle unusual debugging option combinations.
10331 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10332 since the two debugging options are incompatible.
10333 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10334 is defined.
10335 (mem_init, mem_insert, mem_insert_fixup):
10336 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10337 (NEED_MEM_INSERT): Remove; no longer needed.
10338
10339 2012-04-22 Leo Liu <sdl.web@gmail.com>
10340
10341 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10342
10343 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10344
10345 * sysdep.c [__FreeBSD__]: Minor cleanups.
10346 (list_system_processes, system_process_attributes) [__FreeBSD__]:
10347 Use Emacs indenting style more consistently. Avoid some casts.
10348 Use 'double' consistently rather than mixing 'float' and 'double'.
10349
10350 2012-04-21 Eduard Wiebe <usenet@pusto.de>
10351
10352 * sysdep.c (list_system_processes, system_process_attributes):
10353 Add implementation for FreeBSD (Bug#5243).
10354
10355 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
10356
10357 * lisp.mk (lisp): Update.
10358
10359 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
10360
10361 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10362 It is never used otherwise.
10363
10364 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
10365
10366 * print.c (print_preprocess): Only check print_depth if print-circle
10367 is nil.
10368 (print_object): Check for cycles even when print-circle is nil and
10369 print-gensym is t, but only check print_depth if print-circle is nil.
10370
10371 2012-04-20 Chong Yidong <cyd@gnu.org>
10372
10373 * process.c (wait_reading_process_output): If EIO occurs on a pty,
10374 set the status to "failed" and ensure that sentinel is run.
10375
10376 2012-04-20 Glenn Morris <rgm@gnu.org>
10377
10378 * process.c (Fset_process_inherit_coding_system_flag)
10379 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
10380 (Fmake_network_process, Fmake_serial_process): Doc fix.
10381
10382 2012-04-20 Eli Zaretskii <eliz@gnu.org>
10383
10384 * xdisp.c (string_buffer_position_lim): Limit starting position to
10385 BEGV.
10386 (set_cursor_from_row): If called for a mode-line or header-line
10387 row, return zero immediately.
10388 (try_cursor_movement): If inside continuation line, don't back up
10389 farther than the first row after the header line, if any.
10390 Don't consider the header-line row as "partially visible", even if
10391 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
10392
10393 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10394
10395 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
10396 (bug#11238).
10397
10398 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
10399 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
10400
10401 configure: new option --enable-gcc-warnings (Bug#11207)
10402 * Makefile.in (C_WARNINGS_SWITCH): Remove.
10403 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
10404 (ALL_CFLAGS): Use new macros rather than old.
10405 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
10406 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
10407 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
10408 -Wunused-result, -Wunused-variable. This should go away once
10409 the Emacs and Gnulib regex code is merged.
10410 (xmalloc, xrealloc): Now static.
10411
10412 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
10413
10414 * dired.c (Fsystem_groups): Remove unused local.
10415
10416 2012-04-17 Glenn Morris <rgm@gnu.org>
10417
10418 * dired.c (Fsystem_users): Doc fix.
10419
10420 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
10421
10422 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
10423 (syms_of_dired): Add them.
10424
10425 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
10426
10427 Fix minor alloc.c problems found by static checking.
10428 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
10429 New extern decls, to avoid calling undeclared functions.
10430 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
10431 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
10432 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
10433 (NEED_MEM_INSERT): New macro.
10434 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
10435 Remove one incorrect comment and fix another.
10436
10437 Fix minor ralloc.c problems found by static checking.
10438 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10439 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
10440 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
10441 (r_alloc_sbrk): Now static.
10442
10443 Improve ralloc.c interface checking.
10444 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10445 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
10446 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
10447 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
10448 [REL_ALLOC]: ... to here, to check interface.
10449 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
10450 Remove decls. This fixes an "It stinks!".
10451
10452 * alloc.c (which_symbols): Fix alignment issue / type clash.
10453
10454 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
10455
10456 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
10457 (struct Lisp_Misc_Any): Likewise.
10458 (struct Lisp_Free): Likewise.
10459 * alloc.c (union aligned_Lisp_Symbol): Define.
10460 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
10461 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
10462 (union aligned_Lisp_Misc): Define.
10463 (MARKER_BLOCK_SIZE, struct marker_block): Use union
10464 aligned_Lisp_Misc instead of union Lisp_Misc.
10465 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
10466
10467 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
10468
10469 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
10470 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
10471 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
10472 * s/netbsd.h, s/sol2-6.h:
10473 Remove definition of GC_MARK_STACK, since the default now works.
10474 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
10475 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
10476 no longer the default.
10477 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
10478
10479 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10480
10481 * lread.c (lisp_file_lexically_bound_p):
10482 Fix hang at ";-*-\n" (bug#11238).
10483
10484 2012-04-14 Eli Zaretskii <eliz@gnu.org>
10485
10486 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
10487 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
10488
10489 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
10490
10491 * nsterm.m (constrainFrameRect): Always constrain when there is only
10492 one screen (Bug#10962).
10493
10494 2012-04-13 Ken Brown <kbrown@cornell.edu>
10495
10496 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
10497
10498 2012-04-13 Reuben Thomas <rrt@sc3d.org>
10499
10500 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
10501
10502 2012-04-11 Daniel Colascione <dancol@dancol.org>
10503
10504 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
10505 against is gone. It's better to use vfork now so that when Cygwin
10506 gains a new, working vfork, we use it automatically (bug#10398).
10507
10508 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10509
10510 * window.c (save_window_save): Obey window-point-insertion-type.
10511
10512 2012-04-11 Glenn Morris <rgm@gnu.org>
10513
10514 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
10515
10516 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10517
10518 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
10519
10520 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
10521
10522 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
10523 (force_quit_count): New var.
10524 (handle_interrupt): Use it.
10525
10526 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
10527
10528 * w32.c (w32_delayed_load): Record the full path of the library
10529 being loaded (bug#10424).
10530
10531 2012-04-09 Glenn Morris <rgm@gnu.org>
10532
10533 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10534 not just in the obarray, before snarfing them. (Bug#11036)
10535
10536 * Makefile.in ($(leimdir)/leim-list.el):
10537 Pass EMACS rather than BUILT_EMACS.
10538
10539 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
10540
10541 * process.c (make_process):
10542 * process.h: Add integer `gnutls_handshakes_tried' member to
10543 process struct.
10544
10545 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10546 Add convenience `GNUTLS_LOG2i' macro.
10547
10548 * gnutls.c (gnutls_log_function2i): Convenience log function.
10549 (emacs_gnutls_read): Use new log functions,
10550 `gnutls_handshakes_tried' process member, and
10551 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10552 attempts per process (connection).
10553
10554 2012-04-09 Chong Yidong <cyd@gnu.org>
10555
10556 * eval.c (Fuser_variable_p, user_variable_p_eh)
10557 (lisp_indirect_variable): Functions deleted.
10558 (Fdefvar): Caller changed.
10559
10560 * callint.c (Finteractive, Fcall_interactively):
10561 * minibuf.c (Fread_variable): Callers changed.
10562
10563 2012-04-09 Eli Zaretskii <eliz@gnu.org>
10564
10565 * xdisp.c (set_cursor_from_row): If the display string appears in
10566 the buffer at position that is closer to point than the position
10567 after the display string, display the cursor on the first glyph of
10568 the display string. Fixes cursor display when a 'display' text
10569 property immediately follows invisible text. (Bug#11094)
10570
10571 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10572
10573 composite.c: use 'double' consistently
10574 * composite.c (get_composition_id): Use 'double' consistently
10575 instead of converting 'float' to 'double' and vice versa; this is
10576 easier to understand and avoids a GCC warning.
10577
10578 2012-04-09 Glenn Morris <rgm@gnu.org>
10579
10580 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10581 preparation for dumping it with emacs. (Bug#4789)
10582 (leimdir): New variable.
10583 ($(leimdir)/leim-list.el): New rule.
10584 (emacs$(EXEEXT)): Depend on leim-list.el.
10585
10586 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10587 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10588 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10589
10590 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10591
10592 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10593 proper alignment.
10594
10595 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
10596
10597 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10598 Remove unused local variable.
10599
10600 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10601
10602 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10603 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10604 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10605 objects, as mark_maybe_pointer will catch them otherwise.
10606 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10607 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10608
10609 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10610
10611 Fix typo that broke non-Windows builds.
10612 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10613
10614 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10615
10616 Support building on MS-Windows with libxml2.
10617
10618 * makefile.w32-in (OBJ2): Add xml.$(O).
10619 (GLOBAL_SOURCES): Add xml.c.
10620 ($(BLD)/xml.$(O)): New dependency list.
10621
10622 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10623 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10624 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10625 [!WINDOWSNT]: New macros.
10626 (init_libxml2_functions, libxml2_loaded_p): New functions.
10627 (parse_region): Call fn_xmlCheckVersion instead of using the macro
10628 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
10629 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10630 Calls xmlCleanupParser only if libxml2 was loaded (or statically
10631 linked in).
10632 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10633 Call init_libxml2_functions before calling libxml2 functions.
10634 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10635
10636 * emacs.c: Don't include libxml/parser.h.
10637 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10638 xmlCleanupParser directly.
10639
10640 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10641
10642 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10643
10644 * indent.c (Fvertical_motion): If there is a display string at
10645 point, use it.vpos to compute how many lines to backtrack after
10646 move_it_to point. (Bug#11133)
10647
10648 2012-04-06 Eli Zaretskii <eliz@gnu.org>
10649
10650 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10651 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10652 about subtle differences between FETCH_CHAR* and STRING_CHAR*
10653 macros related to unification of CJK characters. For the details,
10654 see the discussion following the message here:
10655 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10656
10657 2012-04-04 Chong Yidong <cyd@gnu.org>
10658
10659 * keyboard.c (Vdelayed_warnings_list): Doc fix.
10660
10661 2012-04-01 Eli Zaretskii <eliz@gnu.org>
10662
10663 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10664 instead of alloca. (Bug#11138)
10665
10666 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
10667
10668 * w32menu.c (is_simple_dialog): Properly check lisp types.
10669 (Bug#11141)
10670
10671 2012-03-31 Eli Zaretskii <eliz@gnu.org>
10672
10673 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10674 position we get to after a call to move_it_to fails the
10675 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10676 only if we wind up in a string from display property. (Bug#11063)
10677
10678 * window.c (Fdelete_other_windows_internal): Invalidate the row
10679 and column information about mouse highlight, so that redisplay
10680 restores it after reallocating the glyph matrices. (Bug#7464)
10681
10682 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10683 string comes from a `display' text property, use the buffer
10684 position of that property as if we actually saw that position in
10685 the row's glyphs.
10686 (move_it_by_lines): Remove the assertion that
10687 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10688 violated when there's a before-string at the beginning of a line.
10689 (Bug#11063)
10690
10691 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10692
10693 * xdisp.c (append_space_for_newline): If the default face was
10694 remapped, use the remapped face for the appended newline.
10695 (extend_face_to_end_of_line): Use the remapped default face for
10696 extending the face to the end of the line.
10697 (display_line): Call extend_face_to_end_of_line when the default
10698 face was remapped. (Bug#11068)
10699
10700 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10701
10702 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10703
10704 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10705
10706 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10707
10708 2012-03-27 Glenn Morris <rgm@gnu.org>
10709
10710 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10711 Doc fixes.
10712
10713 2012-03-26 Kenichi Handa <handa@m17n.org>
10714
10715 * dispextern.h (struct glyph): Fix previous change. Change the
10716 bit length of glyphless.ch to 25 (Bug#11082).
10717
10718 2012-03-26 Chong Yidong <cyd@gnu.org>
10719
10720 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10721 (command_loop_1): Use it; inhibit selection update for
10722 handle-select-window too (Bug#8996).
10723
10724 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10725
10726 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10727
10728 2012-03-25 Kenichi Handa <handa@m17n.org>
10729
10730 * dispextern.h (struct glyph): Change the bit length of
10731 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10732
10733 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10734
10735 * s/ms-w32.h (tzname): Include time.h before redirecting to
10736 _tzname. Fixes the MSVC build. (Bug#9960)
10737
10738 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10739
10740 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10741 characters.
10742
10743 * xterm.c (XTread_socket): Only modify handling_signal if
10744 !SYNC_INPUT. (Bug#11080)
10745
10746 2012-03-23 Eli Zaretskii <eliz@gnu.org>
10747
10748 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10749 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10750 when fetching a multibyte character consumes more bytes than
10751 CHAR_BYTES returns, due to unification of CJK characters in
10752 string_char. (Bug#11073)
10753
10754 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10755
10756 * process.c (wait_reading_process_output): Handle pty disconnect
10757 by refraining from sending oneself a SIGCHLD (bug#10933).
10758
10759 2012-03-22 Chong Yidong <cyd@gnu.org>
10760
10761 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10762
10763 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10764 Mark string as coming from a prefix property.
10765 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10766 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10767
10768 2012-03-21 Chong Yidong <cyd@gnu.org>
10769
10770 * xfaces.c (Vface_remapping_alist): Doc fix.
10771
10772 2012-03-20 Eli Zaretskii <eliz@gnu.org>
10773
10774 * w32proc.c (Fw32_set_console_codepage)
10775 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10776 Doc fixes.
10777
10778 2012-03-20 Chong Yidong <cyd@gnu.org>
10779
10780 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10781 to reflect default non-nil value of redisplay-dont-pause.
10782
10783 2012-03-19 Kenichi Handa <handa@m17n.org>
10784
10785 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10786 it fit in a valid range (Bug#11003).
10787
10788 2012-03-18 Eli Zaretskii <eliz@gnu.org>
10789
10790 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10791 that is not from display property, accept the row as a "cursor
10792 row" if one of the string's character has a non-nil `cursor'
10793 property. Fixes cursor positioning when there are newlines in
10794 overlay strings, e.g. in icomplete.el. (Bug#11035)
10795
10796 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10797
10798 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10799
10800 2012-03-12 Chong Yidong <cyd@gnu.org>
10801
10802 * eval.c (inhibit_lisp_code): Rename from
10803 inhibit_window_configuration_change_hook; move from window.c.
10804
10805 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10806 * window.c (run_window_configuration_change_hook)
10807 (syms_of_window): Callers changed.
10808
10809 2012-03-11 Chong Yidong <cyd@gnu.org>
10810
10811 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10812
10813 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10814
10815 2012-03-10 Chong Yidong <cyd@gnu.org>
10816
10817 * frame.c (other_visible_frames): Don't assume the selected frame
10818 is visible (Bug#10955).
10819
10820 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10821
10822 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10823
10824 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10825
10826 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10827 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10828 zero (Bug#10954).
10829
10830 2012-03-03 Glenn Morris <rgm@gnu.org>
10831
10832 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10833
10834 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10835
10836 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10837 position past the first glyph_row that ends at ZV. (Bug#10902)
10838 (redisplay_window, next_element_from_string): Fix typos in
10839 comments.
10840 (redisplay_window): Pass to move_it_vertically the margin in
10841 pixels, not in screen lines.
10842
10843 2012-03-02 Glenn Morris <rgm@gnu.org>
10844
10845 * buffer.c (buffer-list-update-hook): Doc fix.
10846
10847 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10848
10849 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10850 push_it before setting up the iterator for the first overlay
10851 string, even if we have an empty string loaded.
10852 (next_overlay_string): If there's an empty string on the iterator
10853 stack, pop the stack. (Bug#10903)
10854
10855 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10856
10857 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10858 Suggested by Stefan Monnier in
10859 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10860 * alloc.c (widen_to_Lisp_Object): New static function.
10861 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10862 and widening them to Lisp_Objects. This would work even if
10863 USE_LSB_TAG is defined and wide integers are used, which might
10864 happen in a future version of Emacs.
10865
10866 2012-02-25 Chong Yidong <cyd@gnu.org>
10867
10868 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10869 Doc fix.
10870
10871 * xselect.c (Fx_selection_exists_p): Doc fix.
10872 (x_clipboard_manager_save_all): Print an informative message
10873 before saving to clipboard manager.
10874
10875 2012-02-24 Chong Yidong <cyd@gnu.org>
10876
10877 * keyboard.c (process_special_events): Handle all X selection
10878 requests in kbd_buffer, not just the next one (Bug#8869).
10879
10880 2012-02-23 Chong Yidong <cyd@gnu.org>
10881
10882 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10883 call when setting menu-bar-lines and tool-bar-lines parameters.
10884 (unwind_create_frame_1): New helper function.
10885
10886 * window.c (inhibit_window_configuration_change_hook): New var.
10887 (run_window_configuration_change_hook): Obey it.
10888 (syms_of_window): Initialize it.
10889
10890 2012-02-22 Chong Yidong <cyd@gnu.org>
10891
10892 * xterm.c (x_draw_image_relief): Add missing type check for
10893 Vtool_bar_button_margin (Bug#10743).
10894
10895 2012-02-21 Chong Yidong <cyd@gnu.org>
10896
10897 * fileio.c (Vfile_name_handler_alist): Doc fix.
10898
10899 * buffer.c (Fget_file_buffer): Protect against invalid file
10900 handler return value.
10901
10902 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10903
10904 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10905 when computing $valmask.
10906
10907 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10908 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10909 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10910 It's useless in that case, and it can cause problems on hosts
10911 that allocate halves of EMACS_INT values separately.
10912 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10913 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10914 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10915 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10916 it avoids undefined behavior on hosts where shifting right by more
10917 than the word width has undefined behavior.
10918
10919 2012-02-19 Chong Yidong <cyd@gnu.org>
10920
10921 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10922 (Funhandled_file_name_directory, Ffile_name_as_directory)
10923 (Fdirectory_file_name, Fexpand_file_name)
10924 (Fsubstitute_in_file_name): Protect against invalid file handler
10925 return values (Bug#10845).
10926
10927 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10928
10929 * .gdbinit (pitx): Fix incorrect references to fields of the
10930 iterator stack.
10931
10932 2012-02-17 Chong Yidong <cyd@gnu.org>
10933
10934 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10935
10936 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10937
10938 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10939 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10940
10941 2012-02-15 Chong Yidong <cyd@gnu.org>
10942
10943 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10944 marked as special. Also, starting docstrings with * is obsolete.
10945
10946 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10947
10948 * gnutls.c (emacs_gnutls_write): Fix last change.
10949
10950 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10951
10952 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10953 send_process.
10954
10955 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10956
10957 * keymap.c (Fsingle_key_description): Handle char ranges.
10958
10959 2012-02-12 Chong Yidong <cyd@gnu.org>
10960
10961 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10962 as that creates a dangerous corner case.
10963
10964 * window.c (Fdelete_window_internal): Invalidate the mouse
10965 highlight (Bug#9904).
10966
10967 2012-02-12 Glenn Morris <rgm@gnu.org>
10968
10969 * xselect.c (Fx_own_selection_internal)
10970 (Fx_get_selection_internal, Fx_disown_selection_internal)
10971 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10972 * nsselect.m (Fx_own_selection_internal)
10973 (Fx_disown_selection_internal, Fx_selection_exists_p)
10974 (Fx_selection_owner_p, Fx_get_selection_internal):
10975 Sync docs and argument specs with the xselect.c versions.
10976
10977 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10978
10979 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10980
10981 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10982
10983 * w32select.c (Fx_selection_exists_p): Sync doc string and
10984 argument list with xselect.c. (Bug#10783)
10985
10986 * w16select.c (Fx_selection_exists_p): Sync doc string and
10987 argument list with xselect.c. (Bug#10783)
10988
10989 2012-02-10 Glenn Morris <rgm@gnu.org>
10990
10991 * fns.c (Fsecure_hash): Doc fix.
10992
10993 2012-02-09 Kenichi Handa <handa@m17n.org>
10994
10995 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10996
10997 2012-02-07 Chong Yidong <cyd@gnu.org>
10998
10999 * buffer.c (Fbuffer_local_variables)
11000 (buffer_lisp_local_variables): Handle unbound vars correctly;
11001 don't let Qunbound leak into Lisp.
11002
11003 2012-02-07 Glenn Morris <rgm@gnu.org>
11004
11005 * image.c (Fimagemagick_types): Doc fix.
11006
11007 * image.c (imagemagick-render-type): Change it from a lisp object
11008 to an integer. Move the doc here from the lisp manual.
11009 Treat all values not equal to 0 the same.
11010
11011 2012-02-06 Chong Yidong <cyd@gnu.org>
11012
11013 * doc.c (store_function_docstring): Avoid applying docstring of
11014 alias to base function (Bug#2603).
11015
11016 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11017
11018 * .gdbinit (pp1, pv1): Remove redundant defines.
11019 (pr): Use pp.
11020
11021 2012-02-04 Chong Yidong <cyd@gnu.org>
11022
11023 * nsterm.m: Declare a global (Bug#10694).
11024
11025 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11026
11027 * w32.c (get_emacs_configuration_options):
11028 Include --enable-checking, if specified, in the return value.
11029
11030 2012-02-04 Martin Rudalics <rudalics@gmx.at>
11031
11032 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11033 after rounding frame sizes. (Bug#9723)
11034
11035 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11036
11037 * keyboard.c (adjust_point_for_property): Don't position point
11038 before BEGV. (Bug#10696)
11039
11040 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11041
11042 Handle overflow when computing char display width (Bug#9496).
11043 * character.c (char_width): Return EMACS_INT, not int.
11044 (char_width, c_string_width): Check for overflow when
11045 computing the width; this is possible now that individual
11046 characters can have unbounded width. Problem introduced
11047 by merge from Emacs 23 on 2012-01-19.
11048
11049 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
11050
11051 * dbusbind.c (Fdbus_register_method): Mention the return value
11052 :ignore in the docstring.
11053
11054 2012-02-02 Glenn Morris <rgm@gnu.org>
11055
11056 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11057
11058 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11059 Unconditionally set to t. (Bug#10673)
11060 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11061 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11062 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11063
11064 2012-02-02 Kenichi Handa <handa@m17n.org>
11065
11066 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11067 0, do not call append_composite_glyph.
11068
11069 2012-02-02 Kenichi Handa <handa@m17n.org>
11070
11071 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11072 NULL (Bug#6988).
11073 (x_produce_glyphs): If the component of a composition is a null
11074 string, set it->pixel_width to 1 to avoid zero-width glyph.
11075
11076 2012-02-01 Eli Zaretskii <eliz@gnu.org>
11077
11078 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11079 first 2 arguments are identical. This makes inserting large
11080 output from a subprocess an order of magnitude faster on
11081 MS-Windows, where all sbrk'ed memory is always contiguous.
11082
11083 2012-01-31 Glenn Morris <rgm@gnu.org>
11084
11085 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11086 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11087 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11088
11089 2012-01-29 Glenn Morris <rgm@gnu.org>
11090
11091 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11092
11093 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11094
11095 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11096
11097 2012-01-28 Chong Yidong <cyd@gnu.org>
11098
11099 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11100
11101 2012-01-26 Chong Yidong <cyd@gnu.org>
11102
11103 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11104
11105 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11106 repeat counts (Bug#10507).
11107
11108 2012-01-26 Glenn Morris <rgm@gnu.org>
11109
11110 * lread.c (syms_of_lread): Doc fix.
11111
11112 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
11113
11114 * coding.c (encode_designation_at_bol): Change return value to
11115 EMACS_INT.
11116
11117 2012-01-25 Chong Yidong <cyd@gnu.org>
11118
11119 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11120
11121 2012-01-21 Chong Yidong <cyd@gnu.org>
11122
11123 * floatfns.c (Fcopysign): Make the second argument non-optional,
11124 since nil is not allowed anyway.
11125
11126 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
11127
11128 * process.c (read_process_output): Use p instead of XPROCESS (proc).
11129 (send_process): Likewise.
11130
11131 2012-01-19 Martin Rudalics <rudalics@gmx.at>
11132
11133 * window.c (save_window_save, Fcurrent_window_configuration)
11134 (Vwindow_persistent_parameters): Do not use Qstate.
11135 Rewrite doc-strings.
11136
11137 2012-01-19 Kenichi Handa <handa@m17n.org>
11138
11139 * character.c (char_width): New function.
11140 (Fchar_width, c_string_width, lisp_string_width):
11141 Use char_width (Bug#9496).
11142
11143 2012-01-16 Martin Rudalics <rudalics@gmx.at>
11144
11145 * window.c (Vwindow_persistent_parameters): New variable.
11146 (Fset_window_configuration, save_window_save): Handle persistent
11147 window parameters.
11148
11149 2012-01-14 Eli Zaretskii <eliz@gnu.org>
11150
11151 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11152 thrashing the stack of the thread. (Bug#9087)
11153
11154 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
11155
11156 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11157
11158 2012-01-11 Eli Zaretskii <eliz@gnu.org>
11159
11160 * xdisp.c (rows_from_pos_range): Handle the case where the
11161 highlight ends on a newline. (Bug#10464)
11162 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11163 he end column for display of highlight that ends on a newline
11164 before a R2L line.
11165
11166 2012-01-11 Glenn Morris <rgm@gnu.org>
11167
11168 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11169 from load-path also when installation-directory is nil. (Bug#10208)
11170
11171 2012-01-10 Glenn Morris <rgm@gnu.org>
11172
11173 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11174
11175 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11176 Update template values to be closer to their typical values these days.
11177
11178 2012-01-09 Eli Zaretskii <eliz@gnu.org>
11179
11180 * xdisp.c (rows_from_pos_range): Accept additional argument
11181 DISP_STRING, and accept any glyph in a row whose object is that
11182 string as eligible for mouse highlight. Fixes mouse highlight of
11183 display strings from overlays. (Bug#10464)
11184
11185 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
11186
11187 emacs: fix an auto-save permissions race condition (Bug#10400)
11188 * fileio.c (auto_saving_dir_umask): New static var.
11189 (Fmake_directory_internal): Use it.
11190 (do_auto_save_make_dir): Set it, instead of invoking chmod after
11191 creating the directory. The old code temporarily assigns
11192 too-generous permissions to the directory.
11193 (do_auto_save_eh): Clear it.
11194 (Fdo_auto_save): Catch all errors, not just file errors, so
11195 that the var is always cleared.
11196
11197 2012-01-07 Eli Zaretskii <eliz@gnu.org>
11198
11199 * search.c (scan_buffer): Pass character positions to
11200 know_region_cache, not byte positions. (Bug#6540)
11201
11202 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
11203
11204 * w32.c (sys_rename): Report EXDEV when rename of a directory
11205 fails because the target is on another logical disk. (Bug#10284)
11206
11207 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11208
11209 * xterm.c (x_embed_request_focus): New function.
11210
11211 * xterm.h: Add prototype.
11212
11213 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11214
11215 2012-01-05 Glenn Morris <rgm@gnu.org>
11216
11217 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11218
11219 2012-01-01 Eli Zaretskii <eliz@gnu.org>
11220
11221 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11222 Load gnutls_transport_set_lowat only if GnuTLS version is below
11223 2.11.1.
11224 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11225 GnuTLS versions below 2.11.1.
11226
11227 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11228
11229 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11230 to the doc string advising against its use for altering the way
11231 windows are scrolled.
11232
11233 2011-12-28 Kenichi Handa <handa@m17n.org>
11234
11235 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11236 coding-system ASCII compatible only when it does not produce BOM
11237 on encoding (Bug#10383).
11238
11239 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
11240
11241 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11242 can scroll.
11243 (create_and_show_popup_menu): Always use menu_position_func for
11244 Gtk3 (Bug#10361).
11245
11246 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
11247
11248 * callint.c (Fcall_interactively): Don't truncate prompt string.
11249
11250 2011-12-23 Eli Zaretskii <eliz@gnu.org>
11251
11252 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11253 property that ends at ZV, so that the bidi iteration could be
11254 resumed from there (after widening). (Bug#10360)
11255
11256 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
11257
11258 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11259
11260 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
11261
11262 * nsterm.m (x_free_frame_resources):
11263 Release f->output_data.ns->miniimage.
11264 (ns_index_color): Fix indentation. Do not retain
11265 color_table->colors[i].
11266
11267 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11268 before returning.
11269
11270 * nsfns.m (x_set_background_color): Assign return value from
11271 ns_index_color to face-background instead of NSColor*.
11272 (ns_implicitly_set_icon_type): Fix indentation.
11273 Change assignment in for loop to comparison.
11274
11275 * emacs.c (ns_pool): New variable.
11276 (main): Assign ns_pool.
11277 (Fkill_emacs): Call ns_release_autorelease_pool.
11278
11279 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11280 autorelease fdesc, release fdAttrs and tdict.
11281 (ns_get_covering_families): Release charset.
11282 (ns_findfonts): Release NSFontDescriptor created with new.
11283 (ns_uni_to_glyphs): Fix indentation.
11284 (setString): Release attrStr before assigning new value.
11285
11286 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11287
11288 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11289 and NS_IMPL_COCOA.
11290 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11291 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11292
11293 2011-12-18 David Reitter <reitter@cmu.edu>
11294
11295 * nsterm.m (ns_term_init): Subscribe for notifications
11296 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11297 to method trackingNotification in EmacsMenu.
11298
11299 * nsmenu.m (trackingMenu): New variable.
11300 (trackingNotification): New method (from Aquamacs).
11301 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
11302 from Aquamacs (Bug#7030).
11303
11304 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11305
11306 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11307 (symbol_to_nsstring): Fix indentation.
11308 (ns_symbol_to_pb): New function.
11309 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11310 (Fns_rotate_cut_buffers_internal): Remove.
11311 (Fns_store_selection_internal): Rename from
11312 Fns_store_cut_buffer_internal.
11313 (ns_get_foreign_selection, Fx_own_selection_internal)
11314 (Fx_disown_selection_internal, Fx_selection_exists_p)
11315 (Fns_get_selection_internal, Fns_store_selection_internal):
11316 Use ns_symbol_to_pb and check if return value is nil.
11317 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
11318 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
11319 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11320 renamed to Sns_store_selection_internal.
11321 (ns_handle_selection_request): Move code to Fx_own_selection_internal
11322 and remove this function.
11323 (ns_handle_selection_clear): Remove, never used.
11324 (Fx_own_selection_internal): Move code from ns_handle_selection_request
11325 here.
11326
11327 2011-12-17 Ken Brown <kbrown@cornell.edu>
11328
11329 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11330 GID is unknown (Bug#10257).
11331
11332 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
11333
11334 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11335 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11336 which caused a build failure on GNU/Linux IA-64. This problem was
11337 introduced by my 2011-10-07 patch.
11338
11339 2011-12-15 Juri Linkov <juri@jurta.org>
11340
11341 * image.c (imagemagick_error): New function. (Bug#10112)
11342 (imagemagick_load_image): Comment out `MagickSetResolution' call.
11343 Use `imagemagick_error' where ImageMagick functions return
11344 `MagickFalse'.
11345 (Fimagemagick_types): Add `Fnreverse' to return the list in the
11346 proper order.
11347
11348 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11349
11350 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11351 fill background (Bug#8992).
11352
11353 2011-12-13 Martin Rudalics <rudalics@gmx.at>
11354
11355 * window.c (Vwindow_combination_resize)
11356 (Vwindow_combination_limit): Use t instead of non-nil in
11357 doc-strings.
11358 (Vrecenter_redisplay): Add first sentence of doc-string on
11359 separate line.
11360 (Frecenter): Fix doc-string typo.
11361
11362 2011-12-11 Kenichi Handa <handa@m17n.org>
11363
11364 * coding.c (Funencodable_char_position): Pay attention to the
11365 buffer text relocation (Bug#9389).
11366
11367 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11368
11369 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11370 gtk_init (Bug#10100).
11371
11372 2011-12-10 Eli Zaretskii <eliz@gnu.org>
11373
11374 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
11375 IT->string is nil. (Bug#10263)
11376
11377 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11378
11379 * nsterm.h (x_free_frame_resources): Declare.
11380
11381 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
11382 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
11383
11384 * nsterm.h (ns_get_defaults_value): Declare.
11385
11386 * nsterm.m (ns_default): Call ns_get_defaults_value.
11387
11388 2011-12-09 Eli Zaretskii <eliz@gnu.org>
11389
11390 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
11391 (Bug#10170)
11392
11393 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11394
11395 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
11396 that where the value of an _OBJC_* symbol points to is in the .bss
11397 section (Bug#10240).
11398
11399 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11400
11401 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
11402 after the loop to call ccl_driver at least once (Bug#8619).
11403
11404 2011-12-08 Kenichi Handa <handa@m17n.org>
11405
11406 * ftfont.c (get_adstyle_property): Fix previous change
11407 (Bug#10233).
11408
11409 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
11410
11411 * w32.c (init_environment): If no_site_lisp, remove site-lisp
11412 dirs from the default value of EMACSLOADPATH (bug#10208).
11413
11414 2011-12-07 Glenn Morris <rgm@gnu.org>
11415
11416 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
11417 installation and source directories as well. (Bug#10208)
11418
11419 2011-12-06 Chong Yidong <cyd@gnu.org>
11420
11421 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
11422
11423 2011-12-06 Glenn Morris <rgm@gnu.org>
11424
11425 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
11426 as an error, not just -1. (Bug#10217)
11427
11428 2011-12-05 Chong Yidong <cyd@gnu.org>
11429
11430 * keyboard.c (process_special_events): New function.
11431 (swallow_events, Finput_pending_p): Use it (Bug#10195).
11432
11433 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
11434
11435 * coding.c (encode_designation_at_bol): Don't use uninitialized
11436 local variable (Bug#9318).
11437
11438 2011-12-05 Kenichi Handa <handa@m17n.org>
11439
11440 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
11441 return Qnil (Bug#8046, Bug#10193).
11442
11443 2011-12-05 Kenichi Handa <handa@m17n.org>
11444
11445 * coding.c (encode_designation_at_bol): New args charbuf_end and
11446 dst. Return the number of produced bytes. Callers changed.
11447 (coding_set_source): Return how many bytes coding->source was
11448 relocated.
11449 (coding_set_destination): Return how many bytes
11450 coding->destination was relocated.
11451 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
11452 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
11453
11454 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11455
11456 * coding.c (CODING_CHAR_CHARSET_P): New macro.
11457 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
11458 macro (Bug#9318).
11459
11460 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
11461
11462 The following changes are to fix Bug#9318.
11463
11464 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
11465 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
11466 (encode_coding_iso_2022, encode_coding_sjis)
11467 (encode_coding_big5, encode_coding_charset): Use the above macros.
11468
11469 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
11470
11471 * lisp.h (process_quit_flag): Fix external declaration.
11472
11473 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
11474
11475 Don't macro-inline non-performance-critical code.
11476 * eval.c (process_quit_flag): New function.
11477 * lisp.h (QUIT): Use it.
11478
11479 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
11480
11481 * nsfns.m (get_geometry_from_preferences): New function.
11482 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
11483
11484 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
11485
11486 * emacs.c (Qkill_emacs): Define.
11487 (syms_of_emacs): Initialize it.
11488 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
11489 Qquit_flag to `kill-emacs' instead.
11490 (quit_throw_to_read_char): Add parameter `from_signal'.
11491 All callers changed. Call Fkill_emacs if requested and safe.
11492 * lisp.h (QUIT): Call Fkill_emacs if requested.
11493
11494 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
11495
11496 * widget.c (update_wm_hints): Return if wmshell is null.
11497 (widget_update_wm_size_hints): New function.
11498
11499 * widget.h (widget_update_wm_size_hints): Declare.
11500
11501 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
11502 widget_update_wm_size_hints (Bug#10104).
11503
11504 2011-12-03 Eli Zaretskii <eliz@gnu.org>
11505
11506 * xdisp.c (handle_invisible_prop): If the invisible text ends just
11507 before a newline, prepare the bidi iterator for consuming the
11508 newline, and keep the current paragraph direction. (Bug#10183)
11509 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
11510
11511 2011-12-02 Juri Linkov <juri@jurta.org>
11512
11513 * search.c (Fword_search_regexp): New Lisp function created from
11514 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
11515 (Fword_search_backward, Fword_search_forward)
11516 (Fword_search_backward_lax, Fword_search_forward_lax):
11517 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
11518 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
11519
11520 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
11521
11522 * fileio.c (Finsert_file_contents): Move after-change-function call
11523 to before the "handled:" label, since all "goto handled" appear in
11524 cases where the *-change-functions have already been properly called
11525 (bug#10117).
11526
11527 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
11528
11529 * keyboard.c (interrupt_signal): Don't call kill-emacs when
11530 waiting for input. (Bug#10169)
11531
11532 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11533
11534 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11535 verifies glyph row's hash code--we have just reallocated the
11536 glyphs, so their contents can be complete garbage. (Bug#10164)
11537
11538 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
11539
11540 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11541
11542 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11543
11544 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11545 attributes are tested _before_ calling verify_row_hash, to protect
11546 against GCC re-ordering of the tests. (Bug#10164)
11547
11548 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
11549
11550 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11551
11552 * xterm.c (handle_one_xevent): Only set async_visible and friends
11553 if net_wm_state_hidden_seen is non-zero (Bug#10002)
11554 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11555 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11556
11557 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11558
11559 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11560 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11561 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11562 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11563 All uses changed to use GCPRO1 etc.
11564 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11565 Revert to old implementation (i.e., before 2011-03-11).
11566
11567 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11568
11569 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11570 of scroll runs so as to avoid assigning disabled bogus rows and
11571 unnecessary graphics copy operations.
11572
11573 2011-11-27 Eli Zaretskii <eliz@gnu.org>
11574
11575 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11576 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11577 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11578 (malloc, free, realloc, calloc): Redirect to e_* only when
11579 compiling Emacs.
11580
11581 * lisp.h (GCTYPEBITS): Move before first use.
11582 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11583 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11584 this macro definition.
11585
11586 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11587 _MSC_VER.
11588
11589 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11590
11591 * gtkutil.c (xg_create_frame_widgets):
11592 Call gtk_window_set_has_resize_grip (FALSE) if that function is
11593 present with Gtk+ 2.0.
11594
11595 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11596
11597 * fileio.c (Finsert_file_contents): Undo previous change; see
11598 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11599
11600 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11601
11602 Rename locals to avoid shadowing.
11603 * fileio.c (Finsert_file_contents):
11604 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11605 * process.c (wait_reading_process_output):
11606 Rename inner 'proc' to 'p' to avoid shadowing.
11607 Indent for consistency with usual Emacs style.
11608
11609 2011-11-25 Eli Zaretskii <eliz@gnu.org>
11610
11611 * xdisp.c (redisplay_window): If cursor row is not fully visible
11612 after recentering, and scroll-conservatively is set to a large
11613 number, scroll window by a few more lines to make the cursor fully
11614 visible and out of scroll-margin. (Bug#10105)
11615 (start_display): Don't move to the next line if the display should
11616 start at a newline that is part of a display vector or an overlay
11617 string. (Bug#10119)
11618
11619 2011-11-24 Juri Linkov <juri@jurta.org>
11620
11621 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11622 after the `MagickPingImage' call. (Bug#10112)
11623
11624 2011-11-23 Chong Yidong <cyd@gnu.org>
11625
11626 * window.c (Fcoordinates_in_window_p): Accept only live windows.
11627
11628 2011-11-23 Martin Rudalics <rudalics@gmx.at>
11629
11630 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11631 making another buffer current. (Bug#10114)
11632
11633 2011-11-23 Glenn Morris <rgm@gnu.org>
11634
11635 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
11636
11637 2011-11-23 Chong Yidong <cyd@gnu.org>
11638
11639 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11640 using it (Bug#5984).
11641
11642 2011-11-22 Eli Zaretskii <eliz@gnu.org>
11643
11644 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11645 and header-lines, as they don't have one computed for them.
11646 (Bug#10098)
11647
11648 * .gdbinit (prow): Make displayed values more self-explaining.
11649 Add row's hash code.
11650
11651 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
11652
11653 * process.c (wait_reading_process_output): Fix asynchrounous
11654 GnuTLS socket handling on some versions of the GnuTLS library.
11655 (wait_reading_process_output): Add comment and URL.
11656
11657 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
11658
11659 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11660
11661 2011-11-21 Chong Yidong <cyd@gnu.org>
11662
11663 * window.c (Fnext_window, Fprevious_window): Doc fix.
11664
11665 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11666
11667 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11668
11669 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11670
11671 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11672
11673 2011-11-20 Martin Rudalics <rudalics@gmx.at>
11674
11675 * window.c (Fset_window_combination_limit): Rename argument
11676 STATUS to LIMIT.
11677 (Vwindow_combination_limit): Remove "status" from doc-string.
11678
11679 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11680
11681 * m/ibms390.h: Remove.
11682 * m/ibms390x.h: Don't include "ibms390.h".
11683
11684 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11685
11686 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11687 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11688
11689 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11690
11691 * casetab.c (Fset_case_table):
11692 * charset.c (Fcharset_after): Fix typos.
11693
11694 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11695
11696 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11697 Otherwise, valgrind does not work on some platforms.
11698 Problem reported by Andreas Schwab in
11699 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11700 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11701 is set, removing the need for VIRT_ADDRESS_VARIES.
11702 (PURE_P): Use a more-efficient implementation that needs just one
11703 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11704 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11705 to 4 (xorl, subq, cmpq, setbe).
11706 * alloc.c (pure): Always extern now, since that's the
11707 VIRT_ADDR_VARIES behavior.
11708 (PURE_POINTER_P): Use a single comparison, not two, for
11709 consistency with the new puresize.h.
11710 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11711 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11712 Remove VIRT_ADDR_VARIES no longer needed.
11713
11714 2011-11-19 Eli Zaretskii <eliz@gnu.org>
11715
11716 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11717 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11718 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11719 behave as if the cursor position were at the window margin.
11720
11721 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11722 and the cursor position is out of bounds, behave as if the cursor
11723 position were at the window margin. (Bug#10075)
11724
11725 2011-11-18 Chong Yidong <cyd@gnu.org>
11726
11727 * window.c (Fwindow_combination_limit): Make first argument
11728 non-optional, since it is meaningless for live windows like the
11729 selected window.
11730
11731 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11732
11733 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11734
11735 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11736
11737 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11738 (graft_intervals_into_buffer): Simplify.
11739
11740 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11741
11742 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11743 hash values of the two rows.
11744 (copy_row_except_pointers): Preserve the used[] arrays and the
11745 hash values of the two rows. (Bug#10035)
11746 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11747
11748 * xdisp.c (row_hash): New function, body extracted from
11749 compute_line_metrics.
11750 (compute_line_metrics): Call row_hash, instead of computing the
11751 hash code inline.
11752
11753 * dispnew.c (verify_row_hash): Call row_hash for computing the
11754 hash code of a row, instead of duplicating code from xdisp.c.
11755
11756 * dispextern.h (row_hash): Add prototype.
11757
11758 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11759
11760 * frame.c (delete_frame): Don't delete the terminal when the last
11761 X frame is closed if emacs is built with GTK toolkit.
11762
11763 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
11764
11765 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11766
11767 2011-11-17 Martin Rudalics <rudalics@gmx.at>
11768
11769 * window.c (Vwindow_splits): Rename to
11770 Vwindow_combination_resize. Suggested by Juri Linkov.
11771 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11772 of Vwindow_splits.
11773
11774 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
11775
11776 * nsfns.m (Fns_font_name):
11777 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11778
11779 2011-11-16 Martin Rudalics <rudalics@gmx.at>
11780
11781 * window.h (window): Rename slot "nest" to "combination_limit".
11782 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11783 (Fset_window_nest): Rename to Fset_window_combination_limit.
11784 (Vwindow_nest): Rename to Vwindow_combination_limit.
11785 (recombine_windows, make_parent_window, make_window)
11786 (Fsplit_window_internal, saved_window)
11787 (Fset_window_configuration, save_window_save): Rename all
11788 occurrences of window_nest to window_combination_limit.
11789
11790 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
11791
11792 * image.c (imagemagick_load_image): Fix typo.
11793
11794 2011-11-14 Eli Zaretskii <eliz@gnu.org>
11795
11796 * xdisp.c (display_line): Move the call to
11797 highlight_trailing_whitespace before the call to
11798 compute_line_metrics, since the latter needs to see the final
11799 faces of all the glyphs to compute ROW's hash value.
11800 Fixes assertion violations in row_equal_p. (Bug#10035)
11801
11802 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11803
11804 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11805 just return (bug#10044).
11806
11807 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11808
11809 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11810 with user-defined heap size. Bump the default size of the temacs
11811 heap to 27MB, to avoid memory warning when running temacs.
11812 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11813
11814 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11815 current_matrix and desired_matrix. (Bug#9990)
11816 (verify_row_hash) [XASSERTS]: New function.
11817 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11818 that the hash value of glyph rows is correct.
11819
11820 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11821
11822 * window.h (window): Remove splits slot.
11823 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11824 (Fdelete_other_windows_internal, make_parent_window)
11825 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11826 (Fset_window_configuration, save_window_save): Don't deal with
11827 split status of windows.
11828 (saved_window): Remove splits slot.
11829 (Vwindow_splits): Rewrite doc-string.
11830
11831 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11832
11833 * xfns.c (unwind_create_frame):
11834 * nsfns.m (unwind_create_frame):
11835 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11836 Vframe_list (Bug#9999).
11837
11838 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11839
11840 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11841
11842 2011-11-11 Kenichi Handa <handa@m17n.org>
11843
11844 * callproc.c (Fcall_process): Set the member dst_multibyte of
11845 process_coding.
11846
11847 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11848
11849 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11850 avoid a crash (bug#9496).
11851
11852 2011-11-09 Chong Yidong <cyd@gnu.org>
11853
11854 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11855 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11856
11857 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11858
11859 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11860
11861 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11862
11863 Avoid some portability problems by eschewing 'extern inline' functions.
11864 The trivial performance wins aren't worth the portability hassles; see
11865 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11866 et seq.
11867 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11868 (window_box_width, window_box_left, window_box_left_offset)
11869 (window_box_right, window_box_right_offset): Undo previous change,
11870 by removing the "extern"s.
11871 * intervals.c (adjust_intervals_for_insertion)
11872 (adjust_intervals_for_deletion): Undo previous change,
11873 making these static again.
11874 (offset_intervals, temp_set_point_both, temp_set_point)
11875 (copy_intervals_to_string): No longer inline.
11876 * xdisp.c (window_text_bottom_y, window_box_width)
11877 (window_box_height, window_box_left_offset)
11878 (window_box_right_offset, window_box_left, window_box_right)
11879 (window_box): No longer inline.
11880
11881 2011-11-08 Chong Yidong <cyd@gnu.org>
11882
11883 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11884 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11885 Signal an error if not a live window.
11886 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11887 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11888
11889 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11890
11891 * lisp.h (syms_of_abbrev): Remove declaration.
11892 Reported by CHENG Gao <chenggao@royau.me>.
11893
11894 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11895
11896 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11897 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11898 of temacs in GUI mode.
11899
11900 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11901
11902 * window.h: Declare delete_all_child_windows instead of
11903 delete_all_subwindows.
11904 * window.c (Fwindow_nest, Fset_window_nest)
11905 (Fset_window_new_total, Fset_window_new_normal)
11906 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11907 (delete_all_subwindows): Rename to delete_all_child_windows.
11908 (Fdelete_other_windows_internal, Fset_window_configuration):
11909 Call delete_all_child_windows instead of delete_all_subwindows.
11910 * frame.c (delete_frame): Call delete_all_child_windows instead
11911 of delete_all_subwindows.
11912
11913 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11914
11915 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11916 This is also needed for porting to any host where GC_MARK_STACK is
11917 not GC_MAKE_GCPROS_NOOPS.
11918 (which_symbols): Use it.
11919
11920 2011-11-07 Kenichi Handa <handa@m17n.org>
11921
11922 * coding.c (coding_set_destination): Check coding->src_pos only
11923 when coding->src_object is a buffer (bug#9910).
11924
11925 * process.c (send_process): Set the member src_multibyte of coding
11926 to 0 (bug#9911) when sending a unibyte text.
11927
11928 * callproc.c (Fcall_process): Set the member src_multibyte of
11929 process_coding to 0 (bug#9912).
11930
11931 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11932
11933 * xmenu.c (cleanup_widget_value_tree): New function.
11934 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11935 calling free_menubar_widget_value_tree directly (Bug#9830).
11936
11937 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11938
11939 Fix some portability problems with 'inline'.
11940 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11941 (window_box_width, window_box_left, window_box_left_offset)
11942 (window_box_right, window_box_right_offset): Declare extern.
11943 Otherwise, these inline functions do not conform to C99 and
11944 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11945 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11946 * intervals.c (adjust_intervals_for_insertion)
11947 (adjust_intervals_for_deletion): Now extern, because otherwise the
11948 extern inline functions 'offset_intervals' couldn't refer to it.
11949 (static_offset_intervals): Remove.
11950 (offset_intervals): Rewrite using the old contents of
11951 static_offset_intervals. The old version didn't conform to C99
11952 because an extern inline function contained a reference to an
11953 identifier with static linkage.
11954
11955 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11956
11957 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11958 GC.
11959
11960 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11961
11962 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11963 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11964 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11965 return Qleft_to_right.
11966
11967 2011-11-06 Chong Yidong <cyd@gnu.org>
11968
11969 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11970 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11971 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11972 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11973 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11974 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11975 (Fwindow_vscroll): Doc fix.
11976 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11977 argument, since it makes no sense to pass a live window and for
11978 consistency with window-child.
11979
11980 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11981
11982 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11983 support MSVC.
11984
11985 2011-11-05 Jason Rumney <jasonr@gnu.org>
11986
11987 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11988 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11989 fonts (Bug#6029).
11990 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11991 bitwise arithmetic preventing use of unicode-sip and non-truetype
11992 opentype fonts.
11993
11994 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11995
11996 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11997 "emacs"-only part.
11998
11999 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12000 initialization code to keep similarity to xfns.c after changes
12001 from 2011-11-05.
12002
12003 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12004
12005 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12006 (unwind_create_frame): New function (Bug#9943).
12007 (Fx_create_frame): Restructure code to be more similar to the one in
12008 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12009 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12010 Move terminal->reference_count++ just before making the frame official
12011 (Bug#9943).
12012
12013 * nsterm.m (x_free_frame_resources): New function.
12014 (x_destroy_window): Move code to x_free_frame_resources.
12015
12016 * xfns.c (unwind_create_frame): Fix comment.
12017 (Fx_create_frame, x_create_tip_frame):
12018 Move terminal->reference_count++ just before making the frame
12019 official. Move initialization of image_cache_refcount and
12020 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12021
12022 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12023
12024 Support MSVC build with newer versions of Visual Studio.
12025 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12026 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12027 nt/gmake.defs.
12028
12029 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12030 which are not supported by MSVC.
12031 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12032 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12033 bitfields.
12034 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12035 types in bitfields.
12036 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12037
12038 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12039
12040 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
12041
12042 Support MSVC build with newer versions of Visual Studio.
12043 * w32.c: Don't include w32api.h for MSVC.
12044 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12045
12046 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12047 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12048 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12049 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12050 e_* cousins.
12051 (alloca) [_MSC_VER]: Define to _alloca.
12052
12053 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12054
12055 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12056
12057 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12058
12059 * xdisp.c (note_mouse_highlight): If either of
12060 previous/next-single-property-change returns nil, treat that as
12061 the beginning or the end of the buffer. (Bug#9955)
12062
12063 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12064
12065 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12066 label is not null (Bug#9951).
12067 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12068 may be NULL.
12069
12070 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12071
12072 * window.c (Fwindow_body_size): Mention in the doc string that the
12073 return value is in frame's canonical units. (Bug#9949)
12074
12075 2011-11-03 Eli Zaretskii <eliz@gnu.org>
12076
12077 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12078
12079 * w32fns.c (unwind_create_frame): If needed, free the glyph
12080 matrices of the partially constructed frame. (Bug#9943)
12081 * xfns.c (unwind_create_frame): Likewise.
12082
12083 2011-11-01 Eli Zaretskii <eliz@gnu.org>
12084
12085 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12086 Don't stop backward scan on the continuation glyph, even though
12087 its CHARPOS is positive.
12088 (mouse_face_from_buffer_pos, note_mouse_highlight):
12089 Rename cover_string to disp_string.
12090
12091 2011-11-01 Martin Rudalics <rudalics@gmx.at>
12092
12093 * window.c (temp_output_buffer_show): Don't use
12094 Vtemp_buffer_show_specifiers.
12095 (Vtemp_buffer_show_specifiers): Remove unused variable.
12096
12097 2011-10-30 Eli Zaretskii <eliz@gnu.org>
12098
12099 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12100 past the beginning of the current glyph matrix.
12101
12102 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
12103
12104 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12105 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12106 HAVE_GTK3 (Bug#9869).
12107
12108 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12109 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12110
12111 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12112
12113 * xterm.c: Declare x_handle_net_wm_state to return int.
12114 (handle_one_xevent): Check if we are iconified but don't have
12115 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
12116 (get_current_wm_state): Return non-zero if not hidden,
12117 check for _NET_WM_STATE_HIDDEN (Bug#9893).
12118 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12119 (x_handle_net_wm_state): Return what get_current_wm_state returns.
12120 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12121
12122 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
12123
12124 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12125 so that this new function doesn't get optimized away by a
12126 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
12127
12128 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12129
12130 * frame.h (MOUSE_HL_INFO): Remove excess parens.
12131
12132 2011-10-29 Eli Zaretskii <eliz@gnu.org>
12133
12134 Fix the `xbytecode' command.
12135 * .gdbinit (xprintbytestr): New command.
12136 (xwhichsymbols): Rename from `which'; all callers changed.
12137 (xbytecode): Print the byte-code string as well.
12138
12139 2011-10-29 Kim Storm <storm@cua.dk>
12140
12141 * alloc.c (which_symbols): New function.
12142
12143 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12144
12145 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12146 line. (Bug#9903)
12147
12148 2011-10-29 Glenn Morris <rgm@gnu.org>
12149
12150 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12151 Not clear what it was for, and it causes various bugs. (Bug#9839)
12152
12153 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12154
12155 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12156 possible random value that matches one of those tested as
12157 condition to clear the mouse face.
12158
12159 2011-10-28 Chong Yidong <cyd@gnu.org>
12160
12161 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12162
12163 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12164
12165 * window.c (make_window): Initialize phys_cursor_on_p.
12166
12167 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
12168
12169 * lisp.h (struct Lisp_Symbol): Update comments.
12170
12171 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
12172
12173 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12174
12175 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12176
12177 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
12178 <oslsachem@gmail.com> for helping to debug this.
12179
12180 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12181 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12182 (g_b_init_get_glyph_outline_w): New static variables.
12183 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12184 (GetGlyphOutlineW_Proc): New typedefs.
12185 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12186 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12187 New functions.
12188 (w32font_open_internal, compute_metrics):
12189 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12190 instead of calling the "wide" APIs directly.
12191
12192 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12193
12194 * w32.h (syms_of_w32font): Add prototype.
12195
12196 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12197
12198 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12199 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12200 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12201 (Fmove_to_window_line): Doc fix.
12202
12203 2011-10-27 Chong Yidong <cyd@gnu.org>
12204
12205 * process.c (make_process): Set gnutls_state to NULL.
12206
12207 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12208 non-NULL, regardless of GNUTLS_INITSTAGE.
12209 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12210 an error. Set process slots as soon as we allocate them.
12211
12212 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12213
12214 2011-10-27 Chong Yidong <cyd@gnu.org>
12215
12216 * gnutls.c (emacs_gnutls_deinit): New function.
12217 Deallocate credentials structures as well as calling gnutls_deinit.
12218 (Fgnutls_deinit, Fgnutls_boot): Use it.
12219
12220 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12221 (deactivate_process): Call emacs_gnutls_deinit.
12222
12223 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12224
12225 * image.c (x_create_x_image_and_pixmap):
12226 * w32.c (sys_rename, w32_delayed_load):
12227 * w32font.c (fill_in_logfont):
12228 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12229
12230 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
12231
12232 * w32fns.c (w32_default_color_map): New function,
12233 extracted from Fw32_default_color_map.
12234 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
12235
12236 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
12237
12238 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12239
12240 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
12241
12242 * keyboard.c (test_undefined): New function (bug#9751).
12243 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12244
12245 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
12246
12247 * sysdep.c (init_sys_modes): Fix the check for the controlling
12248 terminal (Bug#6649).
12249
12250 2011-10-20 Eli Zaretskii <eliz@gnu.org>
12251
12252 * dispextern.h (struct bidi_it): New member next_en_type.
12253
12254 * bidi.c (bidi_line_init): Initialize the next_en_type member.
12255 (bidi_resolve_explicit_1): When next_en_pos is valid for the
12256 current character, check also for next_en_type being WEAK_EN.
12257 (bidi_resolve_weak): Don't enter the expensive loop if the current
12258 position is before next_en_pos. Record the bidi type of the first
12259 non-ET, non-BN character we find, in addition to its position.
12260 (bidi_level_of_next_char): Invalidate next_en_type when
12261 next_en_pos is over-stepped.
12262
12263 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
12264
12265 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12266 * editfns.c: Rewrite current-time-zone so that it invokes
12267 the equivalent of (format-time-string "%Z") to get the time zone name.
12268 This fixes a bug when the time zone name contains characters that
12269 need converting from the system time locale to Emacs internal format.
12270 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12271 that patch fixed format-time-string to do the conversion, but
12272 I forgot to fix current-time-zone.
12273 (format_time_string): New function, containing most of
12274 what Fformat_time_string used to contain.
12275 (Fformat_time_string): Rewrite in terms of format_time_string.
12276 This doesn't change this function's behavior.
12277 (current-time-zone): Rewrite to use format_time_string.
12278 This fixes the bug reported by Michael Schierl in
12279 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12280 Jason Rumney's 2007-06-07 change worked around this bug, but
12281 didn't fix it.
12282 * systime.h (tzname, timezone): Remove no-longer-used declarations.
12283
12284 2011-10-19 Eli Zaretskii <eliz@gnu.org>
12285
12286 * xdisp.c (start_display): If the character at POS is displayed
12287 via a display vector, reset IT->current.dpvec_index to zero.
12288 (try_window_reusing_current_matrix): If a line ends in a display
12289 vector or the next line starts in a display vector, continue
12290 redrawing the window even though the character position of
12291 start_row was reached.
12292 (Bug#9771, part 2)
12293
12294 2011-10-18 Chong Yidong <cyd@gnu.org>
12295
12296 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12297 with nobreak-char-display too.
12298
12299 2011-10-18 Eli Zaretskii <eliz@gnu.org>
12300
12301 Fix part 3 of bug#9771.
12302 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12303 (bidi_resolve_neutral): Don't enter the expensive loop looking for
12304 non-neutral characters if the current character is a paragraph
12305 separator (a.k.a. Newline). This avoids running the same
12306 expensive loop twice, once when we consume the preceding newline
12307 and the other time when the line actually needs to be displayed.
12308 Avoid the loop when we see neutrals on the base embedding level
12309 following a character whose directionality is the same as the
12310 paragraph's. This avoids running the expensive loop when a line
12311 ends in a long sequence of neutrals, like control characters.
12312 Add assertion against STRONG_AL type. Slightly rearrange code
12313 that determines the type of a neutral given the first non-neutral
12314 that follows it.
12315 (bidi_level_of_next_char): Set next_en_pos to zero when
12316 invalidating its info.
12317
12318 2011-10-17 Eli Zaretskii <eliz@gnu.org>
12319
12320 * xdisp.c (push_display_prop): Determine whether to record string
12321 or buffer position by IT->string, not by IT->method. Allow
12322 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
12323 (move_it_vertically_backward): Don't look for character position
12324 immediately after the newline when in a continuation line.
12325 (Bug#9771, part 1)
12326
12327 2011-10-15 Martin Rudalics <rudalics@gmx.at>
12328
12329 * window.c (coordinates_in_window): Rewrite and delabelize
12330 vertical border check. (Bug#5357) (Bug#9618)
12331
12332 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
12333
12334 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12335 errors in XSetWindowBorder (bug#9310).
12336
12337 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
12338
12339 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12340 avoid crash when xmalloc overrun checking is enabled.
12341
12342 2011-10-13 Eli Zaretskii <eliz@gnu.org>
12343
12344 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12345 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
12346 cursor motion with <left> and <right> arrow keys.
12347
12348 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12349 some callers set that themselves.
12350
12351 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12352
12353 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12354 display string and the previous row comes from the same string and
12355 is empty. (Bug#9739) (Bug#9738)
12356
12357 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
12358
12359 * doc.c (get_doc_string): Encode file name (bug#9735).
12360
12361 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12362
12363 * bidi.c (bidi_level_of_next_char):
12364 * xdisp.c (get_visually_first_element): Remove old incorrect
12365 comments regarding the Unicode Line Separator character.
12366
12367 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12368
12369 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
12370
12371 * alloc.c (Fgc_status): Do not access beyond zombies array
12372 boundary if nzombies > MAX_ZOMBIES.
12373 * alloc.c (dump_zombies): Add missing format specifier.
12374
12375 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
12376
12377 * xdisp.c (set_cursor_from_row): Simplify conditionals,
12378 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
12379
12380 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
12381 Some packages use them to denote characters with modifiers.
12382
12383 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
12384
12385 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
12386 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
12387 matching a pp-number. Rename parameter var to var1.
12388
12389 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
12390
12391 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
12392
12393 2011-10-08 Glenn Morris <rgm@gnu.org>
12394
12395 * callint.c (Fcall_interactively): Give a more explicit error for the
12396 'c' case with a non-character input. (Bug#8479)
12397
12398 2011-10-08 Eli Zaretskii <eliz@gnu.org>
12399
12400 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
12401 lines.
12402 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
12403 lines that are hscrolled on the left.
12404
12405 * dispnew.c (buffer_posn_from_coords): Account for a possible
12406 presence of header-line. (Bug#4426)
12407
12408 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
12409
12410 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
12411 Don't advertise functionality which we discourage or doesn't work.
12412
12413 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
12414
12415 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
12416 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
12417 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
12418 this makes Emacs dump core during garbage collection on rare
12419 occasions. sizeof is obviously inferior to offsetof here, so
12420 stick with offsetof.
12421 (GC_POINTER_ALIGNMENT): New macro.
12422 (mark_memory): Omit 3rd (offset) arg; caller changed.
12423 Don't assume EMACS_INT alignment is the same as pointer alignment.
12424
12425 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
12426
12427 * keyboard.c (read_key_sequence_remapped): New var.
12428 (read_key_sequence): Compute remapping in the right buffer.
12429 (command_loop_1): Use read_key_sequence's remapping directly.
12430
12431 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
12432
12433 * dired.c (file_name_completion): Don't expand file name.
12434 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
12435 before checking file name handler.
12436
12437 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
12438 they've been requested explicitly (bug#9591).
12439
12440 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
12441
12442 * keymap.c (Fsingle_key_description): Use make_specified_string
12443 instead of build_string to build string from push_key_description.
12444 (Bug#5193)
12445
12446 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12447
12448 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
12449 This fixes a Y2038 bug on 64-bit hosts.
12450 * buffer.c (reset_buffer):
12451 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
12452 (Fclear_buffer_auto_save_failure):
12453 Use 0, not -1, to represent an unset failure time, since time_t
12454 might not be signed.
12455
12456 Remove dependency on glibc malloc internals.
12457 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12458 Move back here from lisp.h, but with their new implementations.
12459 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12460 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
12461 * charset.c (charset_table_init): New static var.
12462 (syms_of_charset): Use it instead of xmalloc. This removes a
12463 dependency on glibc malloc internals. See Eli Zaretskii's comment in
12464 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
12465 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12466 Move back to alloc.c.
12467 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12468 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
12469
12470 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
12471
12472 * nsterm.m (windowDidResize): Call x_set_window_size only when
12473 ns_in_resize is true. Otherwise set pixelwidth/height and
12474 call change_frame_size (Bug#9628).
12475
12476 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12477
12478 Port --enable-checking=all to Fedora 14 x86-64.
12479 * charset.c (syms_of_charset): Also account for glibc malloc's
12480 internal overhead when calculating the initial malloc maximum.
12481
12482 Port --enable-checking=all to Fedora 14 x86.
12483 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12484 Move to lisp.h.
12485 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
12486 (overrun_check_realloc, overrun_check_free):
12487 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
12488 That way, xmalloc returns a properly-aligned pointer even if
12489 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
12490 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
12491 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
12492 into account when calculating the initial malloc maximum.
12493 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12494 Move here from alloc.c, so that charset.c can use it too.
12495 Properly align; the old code wasn't right for common 32-bit hosts
12496 when configured with --enable-checking=all.
12497 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12498 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
12499
12500 2011-09-29 Eli Zaretskii <eliz@gnu.org>
12501
12502 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
12503 use EDOM.
12504
12505 2011-09-28 Eli Zaretskii <eliz@gnu.org>
12506
12507 * xdisp.c (compute_display_string_end): If there's no display
12508 string at CHARPOS, return -1.
12509
12510 * bidi.c (bidi_fetch_char): When compute_display_string_end
12511 returns a negative value, treat the character as a normal
12512 character not covered by a display string. (Bug#9624)
12513
12514 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
12515
12516 * lread.c (Fread_from_string): Fix typo in docstring.
12517
12518 2011-09-27 Eli Zaretskii <eliz@gnu.org>
12519
12520 * xdisp.c (handle_invisible_prop): If invisible text ends on a
12521 newline, reseat the iterator instead of bidi-iterating there one
12522 character at a time. (Bug#9610)
12523 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
12524 TO_CHARPOS if the bidi iterator is at base embedding level.
12525
12526 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
12527
12528 * lread.c (readevalloop): Use correct code for NBSP.
12529 (read1): Likewise. (Bug#9608)
12530
12531 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
12532
12533 * dbusbind.c (Fdbus_register_signal): When service is not
12534 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
12535
12536 2011-09-25 Glenn Morris <rgm@gnu.org>
12537
12538 * buffer.c (truncate-lines): Doc fix.
12539
12540 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
12541
12542 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12543 (Fset_window_next_buffers): Doc fix.
12544
12545 2011-09-24 Glenn Morris <rgm@gnu.org>
12546
12547 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
12548
12549 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
12550
12551 Fix minor problems found by static checking.
12552 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12553 * indent.c (Fvertical_motion): Fix == vs = typo.
12554
12555 2011-09-24 Eli Zaretskii <eliz@gnu.org>
12556
12557 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12558 Default value is now t. Doc fix.
12559
12560 * indent.c (Fvertical_motion): Compute and apply the overshoot
12561 logic when moving up, not only when moving down. Fix the
12562 confusing name and values of the it_overshoot_expected variable;
12563 logic changes accordingly. (Bug#9254) (Bug#9549)
12564
12565 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12566 CHARPOS is covered by a display string which includes newlines.
12567 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12568 is covered by a display string with embedded newlines.
12569
12570 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
12571
12572 * dbusbind.c (Fdbus_register_signal): Add match rule to
12573 Vdbus_registered_objects_table. (Bug#9581)
12574 (Fdbus_register_method, Vdbus_registered_objects_table):
12575 Fix docstring.
12576
12577 2011-09-24 Jim Meyering <meyering@redhat.com>
12578
12579 do not ignore write error for any output size
12580 The previous change was incomplete.
12581 While it makes emacs --batch detect the vast majority of stdout
12582 write failures, errors were still ignored whenever the output size is
12583 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12584 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12585 && echo FAIL: ignored write error
12586 FAIL: ignored write error
12587 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12588 && echo FAIL: ignored write error
12589 FAIL: ignored write error
12590 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12591
12592 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12593
12594 * emacs.c (Fkill_emacs): In noninteractive mode exit
12595 non-successfully if a write error occurred on stdout. (Bug#9574)
12596
12597 2011-09-21 Eli Zaretskii <eliz@gnu.org>
12598
12599 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12600 the xassert test.
12601
12602 * dispextern.h (struct it): Update the comment documenting what
12603 can it->OBJECT be.
12604
12605 2011-09-20 Eli Zaretskii <eliz@gnu.org>
12606
12607 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12608 a display string, extend search for cursor position to end of row.
12609 (find_row_edges): If the row ends in a newline from a display
12610 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12611 Handle the case of a display string with multiple newlines.
12612 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12613 non-empty line. Fixes confusing cursor motion with arrow keys at
12614 the beginning of a line that starts with whitespace.
12615
12616 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12617
12618 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12619 (bug#9493).
12620
12621 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
12622
12623 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12624 boolean (Bug#9154).
12625
12626 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12627
12628 * xdisp.c (display_line): Record maximum and minimum buffer
12629 positions even if no glyphs were produced (e.g., by a zero-width
12630 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
12631 buffer positions that will be removed from the glyph row because
12632 they don't fit.
12633 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12634 column is beyond frame width: don't subtract 1 "pixel" when
12635 computing width of the stretch.
12636 (reseat_at_next_visible_line_start): Undo the change made on
12637 2011-09-17 that saved paragraph information and restored it after
12638 the call to `reseat'. (Bug#9545)
12639
12640 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12641
12642 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12643 and turn window cursor on if cleared (Bug#9415).
12644
12645 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
12646
12647 * search.c (boyer_moore): Take unibyte characters from pattern
12648 literally. (Bug#9458)
12649
12650 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12651
12652 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12653
12654 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
12655
12656 Fix minor problem found by static checking.
12657 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12658 initialized, to pacify gcc -Wuninitialized.
12659
12660 * fileio.c: Report proper errno when syscall falls.
12661 (Finsert_file_contents): Save and restore errno,
12662 so that report_file_error outputs the correct diagnostic.
12663 (Fwrite_region) [CLASH_DETECTION]: Likewise.
12664
12665 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12666
12667 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12668
12669 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12670
12671 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12672 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
12673
12674 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12675
12676 * xdisp.c (reseat_at_next_visible_line_start): Keep information
12677 about the current paragraph and restore it after the call to reseat.
12678
12679 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12680 (bidi_find_paragraph_start): Search back for paragraph beginning
12681 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12682 (bidi_move_to_visually_next): Only trigger paragraph-related
12683 computations when the last character is a newline or at EOB, not
12684 just any NEUTRAL_B. (Bug#9470)
12685
12686 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12687 truncated lines if point is covered by a display string. (Bug#9524)
12688
12689 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12690
12691 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12692 (cons_to_x_long): New function.
12693 (lisp_data_to_selection_data): Use it. Correct the test for
12694 short-versus-long data; it was negated. Break out of vector
12695 loop, for efficiency, when a long datum is discovered.
12696
12697 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12698
12699 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12700
12701 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12702
12703 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12704 GCC PR/17406) by declaring this function with external scope.
12705
12706 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12707
12708 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12709 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12710
12711 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12712
12713 * editfns.c (Fformat): Correctly handle text properties on "%%".
12714
12715 2011-09-15 Eli Zaretskii <eliz@gnu.org>
12716
12717 * xterm.c (x_draw_composite_glyph_string_foreground):
12718 * w32term.c (x_draw_composite_glyph_string_foreground):
12719 * term.c (encode_terminal_code):
12720 * composite.c (composition_update_it, get_composition_id):
12721 * xdisp.c (get_next_display_element)
12722 (fill_composite_glyph_string): Add comments about special meaning
12723 of TAB characters in a composition.
12724
12725 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12726
12727 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12728 This occurs when processing a multibyte format.
12729 Problem reported by Wolfgang Jenker.
12730
12731 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12732
12733 * xdisp.c (try_cursor_movement): Only check for exact match if
12734 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12735
12736 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12737
12738 Remove unused external symbols.
12739 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12740 * xdisp.c (calc_pixel_width_or_height): Now static.
12741 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12742 * indent.c (check_display_width):
12743 * w32term.c: Fix comment to match code.
12744 * xterm.c, xterm.h (x_catching_errors): Remove.
12745
12746 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12747
12748 * xselect.c: Use signed conversions more consistently (Bug#9498).
12749 (selection_data_to_lisp_data): Assume incoming selection data are
12750 signed integers, not unsigned. This is to be consistent with
12751 outgoing selection data, which was modified to use signed integers
12752 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12753 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12754 expects long, not unsigned long.
12755
12756 2011-09-14 Eli Zaretskii <eliz@gnu.org>
12757
12758 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12759 computation of loop end. Reported by Johan Bockgård
12760 <bojohan@gnu.org>.
12761
12762 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
12763
12764 * frame.c (Fother_visible_frames_p): Function deleted.
12765
12766 2011-09-12 Eli Zaretskii <eliz@gnu.org>
12767
12768 * indent.c (compute_motion): Process display vector front to back
12769 rather than the other way around. (Bug#2496)
12770
12771 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12772
12773 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12774
12775 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
12776
12777 * minibuf.c (Fread_from_minibuffer): Doc fix.
12778
12779 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12780
12781 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12782 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12783
12784 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12785
12786 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12787 value for non-existent files.
12788
12789 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12790
12791 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12792 set its "size" to -1. This will set the modtime_size field of
12793 the corresponding buffer to -1, which is what
12794 verify-visited-file-modtime expects for files that do not exist.
12795 (Bug#9139)
12796
12797 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12798
12799 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12800 here ...
12801 * lisp.h: ... from here. push_key_description is no longer
12802 defined in keyboard.c, so its declaration should not be in
12803 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12804 logically belongs with push_key_description.
12805
12806 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12807
12808 * buffer.h: Include <sys/types.h> instead of <time.h>.
12809 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12810 Problem reported by Herbert J. Skuhra.
12811
12812 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12813
12814 * xml.c (parse_region): Make the parsing work for
12815 non-comment-starting XML files again (bug#9144).
12816
12817 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12818
12819 * image.c (gif_load): Fix calculation of bottom and right corner.
12820 (Bug#9468)
12821
12822 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12823
12824 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12825 redisplay in small windows.
12826
12827 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12828
12829 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12830
12831 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12832
12833 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12834 Operate on live windows only.
12835
12836 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12837
12838 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12839
12840 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12841
12842 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12843 only under bidi iteration.
12844
12845 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12846
12847 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12848
12849 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12850
12851 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12852 Without this fix, the command to link temacs failed due to an
12853 undefined symbol __builtin_isnan. This is because
12854 /usr/include/iso/math_c99.h #defines isnan(x) to
12855 __builtin_isnan(x), but the bundled gcc, which identifies itself
12856 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12857 a __builtin_isnan.
12858 * floatfns.c (isnan): #undef, and then #define to a clone of
12859 what's in data.c.
12860 (Fisnan): Always define, since it's always available now.
12861 (syms_of_floatfns): Always define isnan at the Lisp level.
12862
12863 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12864
12865 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12866
12867 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12868
12869 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12870 The previous code assumed that file offsets (off_t values) fit in
12871 EMACS_INT variables, which is not true on typical 32-bit hosts.
12872 The code messed up by falsely reporting buffer overflow in cases
12873 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12874 when "big" contains more than 2**29 bytes, even though this
12875 inserts just one byte and does not overflow the buffer.
12876 (Finsert_file_contents): Store file offsets as off_t
12877 values, not as EMACS_INT values. Check for overflow when
12878 converting between EMACS_INT and off_t. When checking for
12879 buffer overflow or for overlap, take the offsets into account.
12880 Don't use EMACS_INT for small values where int suffices.
12881 When checking for overlap, fix a typo: ZV was used where
12882 ZV_BYTE was intended.
12883 (Fwrite_region): Don't assume off_t fits into 'long'.
12884 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12885
12886 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12887
12888 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12889
12890 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12891
12892 sprintf-related integer and memory overflow issues (Bug#9412).
12893
12894 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12895 (esprintf, exprintf, evxprintf): New functions.
12896 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12897 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12898 (modify_event_symbol): Do not assume that the length of
12899 name_alist_or_stem is safe to alloca and fits in int.
12900 (Fexecute_extended_command): Likewise for function name and binding.
12901 (Frecursion_depth): Wrap around reliably on integer overflow.
12902 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12903 since some callers pass EMACS_INT values.
12904 (Fsingle_key_description): Don't crash if symbol name contains more
12905 than MAX_ALLOCA bytes.
12906 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12907 (get_minibuffer): Arg is now EMACS_INT, not int.
12908 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12909 (esprintf, exprintf, evxprintf): New decls.
12910 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12911
12912 * dbusbind.c (signature_cat): New function.
12913 (xd_signature, Fdbus_register_signal):
12914 Do not overrun buffer; instead, report string overflow.
12915
12916 * dispnew.c (add_window_display_history): Don't overrun buffer.
12917 Truncate instead; this is OK since it's just a log.
12918
12919 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12920 even if the time zone offset is outlandishly large.
12921 Don't mishandle offset == INT_MIN.
12922
12923 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12924 when creating daemon; the previous buffer-overflow check was incorrect.
12925
12926 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12927 which has the guts of the old verror function.
12928
12929 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12930 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12931
12932 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12933 (font_unparse_xlfd): Don't blindly alloca long strings.
12934 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12935 fits in int, when using sprintf. Use single snprintf to count
12936 length of string rather than counting it via multiple sprintfs;
12937 that's simpler and more reliable.
12938 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12939 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12940 sprintf, in case result does not fit in int.
12941
12942 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12943 (fontset_from_font): Print it.
12944
12945 * frame.c (tty_frame_count): Now printmax_t, not int.
12946 (make_terminal_frame, set_term_frame_name): Print it.
12947 (x_report_frame_params): In X, window IDs are unsigned long,
12948 not signed long, so print them as unsigned.
12949 (validate_x_resource_name): Check for implausibly long names,
12950 and don't assume name length fits in 'int'.
12951 (x_get_resource_string): Don't blindly alloca invocation name;
12952 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12953 not fit in int.
12954
12955 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12956 (xg_check_special_colors, xg_set_geometry):
12957 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12958
12959 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12960 Use esprintf, not sprintf, in case result does not fit in int.
12961
12962 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12963 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12964 it as a large positive number.
12965 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12966 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12967
12968 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12969 in case result does not fit in int.
12970
12971 * print.c (float_to_string): Detect width overflow more reliably.
12972 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12973 buffer overrun. Don't assume list length fits in 'int'. Treat
12974 print length of 0 as 0, not as infinity; to be consistent with other
12975 uses of print length in this function. Don't overflow print length
12976 index. Don't assume hash table size fits in 'long', or that
12977 vectorlike size fits in 'unsigned long'.
12978
12979 * process.c (make_process): Use printmax_t, not int, to format
12980 process-name gensyms.
12981
12982 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12983
12984 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12985 to avoid potential buffer overrun.
12986
12987 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12988 if X resource line is longer than 512 bytes.
12989
12990 * xfns.c (x_window): Make sprintf buffer a bit bigger
12991 to avoid potential buffer overrun.
12992
12993 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12994
12995 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12996
12997 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12998
12999 Integer overflow fixes for scrolling, etc.
13000 Without these, Emacs silently mishandles large integers sometimes.
13001 For example, "C-u 4294967297 M-x recenter" was treated as if
13002 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13003
13004 * xdisp.c (try_window_id): Check Emacs fixnum range before
13005 converting to 'int'.
13006
13007 * window.c (window_scroll_line_based, Frecenter):
13008 Check that an Emacs fixnum is in range before assigning it to 'int'.
13009 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13010 values converted from Emacs fixnums.
13011 (Frecenter): Don't wrap around a line count if it is out of 'int'
13012 range; instead, treat it as an extreme value.
13013 (Fset_window_configuration, compare_window_configurations):
13014 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13015
13016 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13017 that can exceed INT_MAX. Check that EMACS_INT value is in range
13018 before assigning it to the (possibly-narrower) index.
13019 (match_limit): Don't assume that a fixnum can fit in 'int'.
13020
13021 * print.c (print_object): Use ptrdiff_t, not int, for index that can
13022 exceed INT_MAX.
13023
13024 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13025 (Fvertical_motion): Don't wrap around LINES values that don't fit
13026 in 'int'. Instead, treat them as extreme values. This is good
13027 enough for windows, which can't have more than INT_MAX lines anyway.
13028
13029 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13030
13031 * Require libxml/parser.h to avoid compilation warning.
13032
13033 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13034
13035 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13036 since this reportedly can destroy thread storage.
13037
13038 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
13039
13040 * syntax.c (find_defun_start): Update all cache variables if
13041 exiting early (Bug#9401).
13042
13043 2011-08-30 Eli Zaretskii <eliz@gnu.org>
13044
13045 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13046
13047 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13048 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13049 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13050
13051 * term.c (tty_append_glyph): New function.
13052 (produce_stretch_glyph): Static function and its prototype deleted.
13053
13054 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13055 Add prototypes.
13056
13057 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13058
13059 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13060 when checking :margin (Bug#9390).
13061 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13062 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13063 so that the name doesn't mislead. All uses changed.
13064
13065 2011-08-28 Johan Bockgård <bojohan@gnu.org>
13066
13067 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13068 set_tty_hooks.
13069
13070 2011-08-27 Eli Zaretskii <eliz@gnu.org>
13071
13072 * xdisp.c (move_it_to): Don't bail out early when reaching
13073 position beyond to_charpos, if we are scanning backwards.
13074 (move_it_vertically_backward): When DY == 0, make sure we get to
13075 the first character in the line after the newline.
13076
13077 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13078
13079 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13080 (ccl_driver): Do not generate an out-of-range pointer.
13081 (Fccl_execute_on_string): Remove unnecessary check for
13082 integer overflow, noted by Stefan Monnier in
13083 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13084 Remove a FIXME that didn't need fixing.
13085 Simplify the newly-introduced buffer reallocation code.
13086
13087 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
13088
13089 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13090
13091 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
13092
13093 Integer and memory overflow issues (Bug#9196).
13094
13095 * doc.c (get_doc_string): Rework so that
13096 get_doc_string_buffer_size is the actual buffer size, rather than
13097 being 1 less than the actual buffer size; this makes xpalloc more
13098 convenient.
13099
13100 * image.c (x_allocate_bitmap_record, cache_image):
13101 * xselect.c (Fx_register_dnd_atom):
13102 Simplify previous changes by using xpalloc.
13103
13104 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13105 since either will do and ptrdiff_t is convenient with xpalloc.
13106
13107 * charset.c (charset_table_size)
13108 (struct charset_sort_data.priority): Now ptrdiff_t.
13109 (charset_compare): Don't overflow if priorities differ greatly.
13110 (Fsort_charsets): Don't assume list length fits in int.
13111 Check for size-calculation overflow when allocating sort data.
13112 (syms_of_charset): Allocate an initial charset table that is
13113 just under 64 KiB, to avoid problems with glibc malloc and mmap.
13114
13115 * cmds.c (internal_self_insert): Check for size-calculation overflow.
13116
13117 * composite.h (struct composition.glyph_len): Now int, not unsigned.
13118 The actual value is always <= INT_MAX, and leaving it unsigned made
13119 overflow checking harder.
13120
13121 * dispextern.h (struct glyph_matrix.rows_allocated)
13122 (struct face_cache.size): Now ptrdiff_t, for convenience in use
13123 with xpalloc. The values are still always <= INT_MAX.
13124
13125 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13126
13127 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13128 (SAFE_NALLOCA): New macro.
13129
13130 * region-cache.c (struct boundary.pos, find_cache_boundary)
13131 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13132 (set_cache_region, invalidate_region_cache)
13133 (revalidate_region_cache, know_region_cache, region_cache_forward)
13134 (region_cache_backward, pp_cache):
13135 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
13136 so that ptrdiff_t * can be passed to xpalloc.
13137 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13138 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13139 (pp_cache): Don't assume cache_len fits in int.
13140 * region-cache.h: Adjust extern decls to match.
13141
13142 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13143 EMACS_INT, since either will do, for xpalloc.
13144
13145 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13146 (xnmalloc, xnrealloc, xpalloc): New functions.
13147
13148 * bidi.c (bidi_shelve_header_size): New constant.
13149 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13150 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13151
13152 * bidi.c (bidi_cache_shrink):
13153 * buffer.c (overlays_at, overlays_in, record_overlay_string)
13154 (overlay_strings):
13155 Don't update size of array until after memory allocation succeeds,
13156 because xmalloc/xrealloc may not return.
13157 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13158 now that we have proper integer overflow checking.
13159 (record_overlay_string, overlay_strings): Catch overflows when
13160 calculating size of overlay_str_buf.
13161
13162 * callproc.c (Fcall_process): Check for size overflow when
13163 calculating size of args2.
13164 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13165 Normally we prefer signed values, but sticking with ptrdiff_t would
13166 require adding more-complicated checks.
13167
13168 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13169 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13170 Redo buffer-overflow calculations to avoid integer overflow.
13171 Add a FIXME comment where memory seems to be over-allocated.
13172
13173 * character.c (Fstring): Check for size-calculation overflow.
13174
13175 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13176 unnecessary integer overflow. Check for size overflow.
13177 (encode_coding_object): Don't update size until xmalloc succeeds.
13178
13179 * composite.c (get_composition_id): Check for overflow in glyph
13180 length calculations.
13181
13182 Integer and memory overflow fixes for display code.
13183 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13184 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13185 (scrolling_window): Check for overflow in size calculations.
13186 (line_draw_cost, realloc_glyph_pool, add_row_entry):
13187 Don't assume glyph table len fits in int.
13188 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13189 (row_table_size): Now ptrdiff_t, not int.
13190 (scrolling_window): Avoid overflow in size calculations.
13191 Don't update size until allocation succeeds.
13192 * fns.c (concat): Check for overflow in size calculations.
13193 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13194 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13195 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13196
13197 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13198 (get_doc_string): Check for size calculation overflow.
13199 Don't update size until allocation succeeds.
13200 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13201 EMACS_INT, where ptrdiff_t will do.
13202 (Fsubstitute_command_keys): Check for string overflow.
13203
13204 * editfns.c (set_time_zone_rule): Don't assume environment length
13205 fits in int.
13206 (message_length): Now ptrdiff_t, not int.
13207 (Fmessage_box): Don't update size until allocation succeeds.
13208 Don't assume message length fits in int.
13209 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13210
13211 * emacs.c (main): Do not reallocate argv, since there is a null at
13212 the end that can be overwritten, and this way there's no need to
13213 worry about size-calculation overflow.
13214 (sort_args): Check for size-calculation overflow.
13215
13216 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13217 alloc succeeds.
13218 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13219
13220 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13221 (x_set_scroll_bar_width, x_figure_window_size):
13222 Check for integer overflow.
13223 (x_set_alpha): Do not assume XINT fits in int.
13224
13225 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13226 This is for the members text_lines, text_cols, total_lines, total_cols,
13227 where the system imposes an 'int' limit.
13228
13229 * fringe.c (Fdefine_fringe_bitmap):
13230 Don't update size until alloc works.
13231
13232 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13233 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13234
13235 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13236 Check for size-calculation overflow.
13237 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13238 do, as we prefer signed integers.
13239 (id_to_widget.max_size, id_to_widget.used)
13240 (xg_store_widget_in_map, xg_remove_widget_from_map)
13241 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13242 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13243 Use and return ptrdiff_t, not int.
13244 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13245 * gtkutil.h: Change prototypes to match the above.
13246
13247 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13248 are duplicate now that they've been promoted to lisp.h.
13249 (x_allocate_bitmap_record, x_alloc_image_color)
13250 (make_image_cache, cache_image, xpm_load):
13251 Don't update size until alloc is done.
13252 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13253 (x_detect_edges):
13254 Check for size calculation overflow.
13255 (ct_colors_allocated_max): New constant.
13256 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13257 overflow.
13258
13259 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13260 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13261 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13262 Use ptrdiff_t, not int, to count maps.
13263 (read_char_minibuf_menu_prompt): Check for overflow in size
13264 calculations. Don't update size until allocation succeeds.
13265 Redo calculations to avoid overflow.
13266 * keyboard.h: Change prototypes to match the above.
13267
13268 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13269 to count maps.
13270 (current_minor_maps): Check for size calculation overflow.
13271 * keymap.h: Change prototypes to match the above.
13272
13273 * lread.c (read1, init_obarray): Don't update size until alloc done.
13274
13275 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13276 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13277
13278 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13279 Now ptrdiff_t, not int.
13280 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13281 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13282
13283 * process.c (Fnetwork_interface_list): Check for overflow
13284 in size calculation.
13285
13286 * region-cache.c (move_cache_gap): Check for size calculation overflow.
13287
13288 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13289 overflow. Don't bother calling xmalloc when xrealloc will do.
13290
13291 * search.c (Freplace_match): Check for size calculation overflow.
13292 (Fset_match_data): Don't assume list lengths fit in 'int'.
13293
13294 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13295 for command line length. Do not attempt to address one before the
13296 beginning of an array, as that's not portable.
13297
13298 * term.c (max_frame_lines): Remove; unused.
13299 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13300 not int.
13301 (encode_terminal_code, calculate_costs): Check for size
13302 calculation overflow.
13303 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13304 table lengths and related sizes. Don't update size until alloc
13305 done. Redo calculations to avoid overflow.
13306 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13307
13308 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13309 subtracting pointers.
13310 (gobble_line): Check for overflow more carefully. Don't update size
13311 until alloc done.
13312
13313 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13314 Don't update size until alloc done.
13315 Redo size calculations to avoid overflow.
13316 Check for size calculation overflow.
13317 (main) [DEBUG]: Fix typo in invoking tparam1.
13318
13319 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13320 Use ptrdiff_t, not int, for sizes.
13321 (store_mode_line_noprop_char): Don't update size until alloc done.
13322
13323 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13324 Use ptrdiff_t, not int, for sizes.
13325 (Finternal_make_lisp_face, cache_face):
13326 Check for size calculation overflow.
13327 (cache_face): Treat size calculation overflows as if they were
13328 memory exhaustion (the usual treatment), rather than aborting.
13329
13330 * xfns.c (x_encode_text, x_set_name_internal)
13331 (Fx_change_window_property): Use ptrdiff_t, not int, to count
13332 sizes, since they can exceed INT_MAX in size. Check for size
13333 calculation overflow.
13334
13335 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13336 (xg_select): Check for size calculation overflow.
13337 Don't update size until alloc done.
13338
13339 * xrdb.c (get_environ_db): Don't assume path length fits in int,
13340 as sprintf is limited to int lengths.
13341
13342 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13343 (X_LONG_MIN): New macros.
13344 Use them to make the following changes clearer.
13345 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13346 This change doesn't affect the value now, but it may help remind
13347 future maintainers not to raise the value too much later.
13348 (SELECTION_QUANTUM): Remove, replacing with ...
13349 (selection_quantum): ... new function, which avoids overflow.
13350 All uses changed.
13351 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13352 assumption that selection length fits in 'int'.
13353 (x_reply_selection_request, x_handle_selection_request)
13354 (x_get_window_property, receive_incremental_selection)
13355 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13356 (lisp_data_to_selection_data, clean_local_selection_data):
13357 Use ptrdiff_t, not int, to record length of selection.
13358 (x_reply_selection_request, x_get_window_property)
13359 (receive_incremental_selection, x_property_data_to_lisp):
13360 Redo calculations to avoid overflow.
13361 (x_reply_selection_request): When sending hint, ceiling it at
13362 X_LONG_MAX rather than relying on wraparound overflow to send
13363 something.
13364 (x_get_window_property, receive_incremental_selection)
13365 (lisp_data_to_selection_data, x_property_data_to_lisp):
13366 Check for size-calculation overflow.
13367 (x_get_window_property, receive_incremental_selection)
13368 (lisp_data_to_selection_data, Fx_register_dnd_atom):
13369 Don't store size until memory allocation succeeds.
13370 (x_get_window_property): Plug memory leak on memory exhaustion.
13371 Don't double-block input; malloc is safe here. Don't assume 2**34
13372 - 4 fits in unsigned long. Add an xassert to check
13373 XGetWindowProperty overflow. Be more careful about overflow
13374 calculations, and distinguish size from memory overflow better.
13375 (receive_incremental_selection): When tracing, don't assume
13376 unsigned int is less than INT_MAX.
13377 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
13378 harmful) conversions of unsigned short to int.
13379 (lisp_data_to_selection_data): Don't assume that integers
13380 in the range -65535 through -1 fit in an X unsigned short.
13381 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
13382 result parameters unless successful. Rely on cons_to_unsigned
13383 to report problems with elements; the old code wasn't right anyway.
13384 (x_check_property_data): Check for int overflow; we cannot use
13385 a wider type due to X limits.
13386 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
13387
13388 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
13389
13390 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
13391 (x_term_init): Check for size calculation overflow.
13392 (x_color_cells): Don't store size until memory allocation succeeds.
13393 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
13394 Don't assume alloca size is less than MAX_ALLOCA.
13395 (x_term_init): Don't assume length fits in int (sprintf is limited
13396 to int size).
13397
13398 Use ptrdiff_t for composition IDs.
13399 * character.c (lisp_string_width):
13400 * composite.c (composition_table_size, n_compositions)
13401 (get_composition_id, composition_gstring_from_id):
13402 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
13403 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
13404 * window.c (Frecenter):
13405 Use ptrdiff_t, not int, for composition IDs.
13406 * composite.c (get_composition_id): Check for integer overflow.
13407 * composite.h: Adjust prototypes to match the above changes.
13408
13409 Use ptrdiff_t for hash table indexes.
13410 * category.c (hash_get_category_set):
13411 * ccl.c (ccl_driver):
13412 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
13413 * coding.c (coding_system_charset_list, detect_coding_system):
13414 * coding.h (struct coding_system.id):
13415 * composite.c (get_composition_id, gstring_lookup_cache):
13416 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
13417 * image.c (xpm_get_color_table_h):
13418 * lisp.h (hash_lookup, hash_put):
13419 * minibuf.c (Ftest_completion):
13420 Use ptrdiff_t for hash table indexes, not int (which is too
13421 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
13422 32-bit --with-wide-int hosts).
13423
13424 * charset.c (Fdefine_charset_internal): Check for integer overflow.
13425 Add a FIXME comment about memory leaks.
13426 (syms_of_charset): Don't assume xmalloc returns.
13427
13428 Don't assume that stated character widths fit in int.
13429 * character.c (Fchar_width, c_string_width, lisp_string_width):
13430 * character.h (CHAR_WIDTH):
13431 * indent.c (MULTIBYTE_BYTES_WIDTH):
13432 Use sanitize_char_width to avoid undefined and/or bad behavior
13433 with outlandish widths.
13434 * character.h (sanitize_tab_width): Rename from sanitize_width,
13435 now that we have two such functions. All uses changed.
13436 (sanitize_char_width): New inline function.
13437
13438 Don't assume that tab-width fits in int.
13439 * character.h (sanitize_width): New inline function.
13440 (SANE_TAB_WIDTH): New macro.
13441 (ASCII_CHAR_WIDTH): Use it.
13442 * indent.c (sane_tab_width): Remove. All uses replaced by
13443 SANE_TAB_WIDTH (current_buffer).
13444 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
13445
13446 * fileio.c: Integer overflow issues with file modes.
13447 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
13448
13449 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
13450 Remove unreachable code.
13451 (read_hex, load_charset_map_from_file): Check for integer overflow.
13452
13453 * xterm.c: Don't go over XClientMessageEvent limit.
13454 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
13455 (x_send_scroll_bar_event): Likewise. Check that the size does not
13456 exceed limits imposed by XClientMessageEvent, as well as the usual
13457 ptrdiff_t and size_t limits.
13458
13459 * keyboard.c: Overflow, signedness and related fixes.
13460 (make_lispy_movement): Use same integer type in forward decl
13461 that is used in the definition.
13462 (read_key_sequence, keyremap_step):
13463 Change bufsize argument back to int, undoing my 2011-03-30 change.
13464 We prefer signed types, and int is wide enough here.
13465 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
13466 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
13467 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
13468 length, not size_t. Use ptrdiff_t for index, not int.
13469 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
13470 possibility of integer overflow.
13471
13472 Overflow, signedness and related fixes for images.
13473
13474 * dispextern.h (struct it.stack[0].u.image.image_id)
13475 (struct_it.image_id, struct image.id, struct image_cache.size)
13476 (struct image_cache.used, struct image_cache.ref_count):
13477 * gtkutil.c (update_frame_tool_bar):
13478 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
13479 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
13480 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
13481 * nsmenu.m (update_frame_tool_bar):
13482 * xdisp.c (calc_pixel_width_or_height):
13483 * xfns.c (image_cache_refcount):
13484 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
13485 on typical 64-bit hosts.
13486
13487 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13488 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
13489 Omit unnecessary casts to int.
13490 (parse_image_spec): Check that integers fall into 'int' range
13491 when the callers expect that.
13492 (image_ascent): Redo ascent calculation to avoid int overflow.
13493 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
13494 (lookup_image): Remove unnecessary tests.
13495 (xbm_image_p): Locals are now of int, not EMACS_INT,
13496 since parse_image_check makes sure they fit into int.
13497 (png_load, gif_load, svg_load_image):
13498 Prefer int to unsigned where either will do.
13499 (tiff_handler): New function, combining the cores of the
13500 old tiff_error_handler and tiff_warning_handler.
13501 This function is rewritten to use vsnprintf and thereby avoid
13502 stack buffer overflows. It uses only the features of vsnprintf
13503 that are common to both POSIX and native Microsoft.
13504 (tiff_error_handler, tiff_warning_handler): Use it.
13505 (tiff_load, gif_load, imagemagick_load_image):
13506 Don't assume :index value fits in 'int'.
13507 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
13508 (imagemagick_load_image): Check that crop parameters fit into
13509 the integer types that MagickCropImage accepts. Don't assume
13510 Vimagemagick_render_type has a nonnegative value. Don't assume
13511 size_t fits in 'long'.
13512 (gs_load): Use printmax_t to print the widest integers possible.
13513 Check for integer overflow when computing image height and width.
13514
13515 2011-08-26 Eli Zaretskii <eliz@gnu.org>
13516
13517 * xdisp.c (redisplay_window): Don't force window start if point
13518 will be invisible in the resulting window. (Bug#9324)
13519
13520 2011-08-25 Eli Zaretskii <eliz@gnu.org>
13521
13522 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
13523 the display spec is of the form `(space ...)'.
13524 (handle_display_spec): Return the value returned by
13525 handle_single_display_spec, not just 1 or zero.
13526 (handle_single_display_spec): If the display spec is of the form
13527 `(space ...)', and specifies display in the text area, return 2
13528 rather than 1.
13529 (try_cursor_movement): Check for the need to scroll more
13530 accurately, and prefer exact match for point under bidi.
13531 Don't advance `row' beyond the last row of the window.
13532
13533 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13534 into disp_prop; all users changed.
13535
13536 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13537 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13538 for the text covered by the display property.
13539
13540 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
13541
13542 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13543 Change return value to nil.
13544 (Frecord_buffer): Delete unused function.
13545
13546 2011-08-24 Eli Zaretskii <eliz@gnu.org>
13547
13548 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13549 buffers, return left-to-right.
13550 (set_cursor_from_row): Consider candidate row a win if its glyph
13551 represents a newline and point is on that newline. Fixes cursor
13552 positioning on the newline at EOL of R2L text within L2R
13553 paragraph, and vice versa.
13554 (try_cursor_movement): Check continued rows, in addition to
13555 continuation rows. Fixes unwarranted scroll when point enters a
13556 continued line of R2L text within an L2R paragraph, or vice versa.
13557 (cursor_row_p): Consider the case of point being equal to
13558 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13559 from the end of a short line to the beginning of a continued line
13560 of R2L text within L2R paragraph.
13561 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13562 composed characters.
13563
13564 * bidi.c (bidi_check_type): Use xassert.
13565 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13566 members.
13567
13568 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13569
13570 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13571 a character.
13572
13573 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
13574
13575 * nsfont.m (ns_otf_to_script): Fix typo.
13576
13577 2011-08-22 Kenichi Handa <handa@m17n.org>
13578
13579 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13580 extra slot even if the purpose is char-code-property-table.
13581
13582 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13583
13584 * xdisp.c (redisplay_window): When computing centering_position,
13585 account for the height of the header line. (Bug#8874)
13586
13587 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13588 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13589 candidate is selected by the mouse, and that candidate has a
13590 composed character under the mouse.
13591
13592 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13593 coordinates reported by pos-visible-in-window-p for a composed
13594 character in column zero.
13595
13596 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13597
13598 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13599
13600 2011-08-22 Eli Zaretskii <eliz@gnu.org>
13601
13602 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13603 consider it a hit if to_charpos is anywhere in the range of the
13604 composed buffer positions.
13605
13606 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
13607
13608 * image.c (gif_load): Don't assume that each subimage has the same
13609 dimensions as the base image. Handle disposal method that is
13610 "undefined" by the gif spec (Bug#9335).
13611
13612 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
13613
13614 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13615 (Fcondition_case): Document `debug' symbol in error handler.
13616
13617 2011-08-19 Eli Zaretskii <eliz@gnu.org>
13618
13619 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13620 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13621 from an Org mode buffer to a Speedbar frame.
13622
13623 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13624 a composition, take its buffer position from IT->cmp_it.charpos.
13625 Fixes cursor positioning at the beginning of a line that begins
13626 with a composed character.
13627
13628 2011-08-18 Eli Zaretskii <eliz@gnu.org>
13629
13630 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13631 character bidirectional type, use STRONG_L instead. Fixes crashes
13632 in a buffer produced by `describe-categories'.
13633
13634 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13635 members before the level stack, so they would be saved and
13636 restored when copying iterator state. Fixes incorrect reordering
13637 around TABs covered by display properties.
13638
13639 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
13640
13641 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13642
13643 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
13644
13645 * eval.c (internal_condition_case, internal_condition_case_1)
13646 (internal_condition_case_2, internal_condition_case_n):
13647 Remove unnecessary aborts (Bug#9081).
13648
13649 2011-08-17 Eli Zaretskii <eliz@gnu.org>
13650
13651 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13652 has no `load' handler, try opening the file locally. (Bug#9311)
13653
13654 2011-08-16 Ken Brown <kbrown@cornell.edu>
13655
13656 * gmalloc.c: Expand comment.
13657
13658 2011-08-16 Eli Zaretskii <eliz@gnu.org>
13659
13660 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13661 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
13662
13663 2011-08-16 Ken Brown <kbrown@cornell.edu>
13664
13665 Fix memory allocation problems in Cygwin build (Bug#9273).
13666
13667 * unexcw.c ( __malloc_initialized): Declare external variable.
13668 (fixup_executable): Force the dumped emacs to reinitialize malloc.
13669
13670 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13671 New variables.
13672 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13673 dumped emacs.
13674 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13675 in the static heap.
13676 [CYGWIN] (special_realloc): New function.
13677 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13678 requests to realloc storage in the static heap.
13679
13680 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13681
13682 * bidi.c (bidi_initialize): Remove unused local.
13683
13684 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13685
13686 * bidimirror.h:
13687 * biditype.h: Remove file.
13688 * makefile.w32-in ($(BLD)/bidi.$(O)):
13689 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13690
13691 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13692
13693 * chartab.c: Improve commentary for the uniprop_table API.
13694
13695 * bidi.c (bidi_paragraph_init): Support zero value of
13696 bidi_ignore_explicit_marks_for_paragraph_level.
13697 (bidi_initialize): Use uniprop_table instead of including
13698 biditype.h and bidimirror.h.
13699
13700 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13701 coordinates of the iterator when restoring from ppos_it.
13702 (Bug#9296)
13703
13704 2011-08-14 Kenichi Handa <handa@m17n.org>
13705
13706 * process.c (create_process): Call setup_process_coding_systems
13707 after the pid of the process is set to -1 (Bug#8162).
13708
13709 2011-08-14 Eli Zaretskii <eliz@gnu.org>
13710
13711 * xdisp.c (move_it_in_display_line_to): Don't invoke
13712 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13713 ppos_it. Fixes vertical cursor motion when line beginning is
13714 covered by an image. (Bug#9296)
13715
13716 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13717
13718 * nsterm.h (ns_run_ascript): Declare.
13719 (NSAPP_DATA2_RUNASSCRIPT): Define.
13720
13721 * nsfns.m (as_script, as_result, as_status): New static variables.
13722 (ns_run_ascript): New function.
13723 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
13724 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13725 the event loop. Get status from as_status (Bug#7276).
13726
13727 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13728 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13729 the event loop (Bug#7276).
13730
13731 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13732
13733 * gnutls.c (QCgnutls_bootprop_priority)
13734 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13735 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13736 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13737 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13738 (QCgnutls_bootprop_verify_hostname_error)
13739 (QCgnutls_bootprop_callbacks_verify): Rename from
13740 Qgnutls_bootprop_..., all uses changed.
13741
13742 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13743 uses changed.
13744
13745 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13746
13747 * xfaces.c (Qframe_set_background_mode): Now static.
13748 * dispextern.h (Qframe_set_background_mode): Remove decl.
13749
13750 * process.c (Fnetwork_interface_info): Declare local only if needed.
13751
13752 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13753
13754 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13755 (Fnetwork_interface_list): Allocate in increments of bytes instead
13756 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13757 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13758 sockaddr.
13759 (struct ifflag_def): notrailers is smart on OSX.
13760 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13761 Get hardware address with getifaddrs if available.
13762
13763 2011-08-12 Eli Zaretskii <eliz@gnu.org>
13764
13765 * xdisp.c (iterate_out_of_display_property): xassert that
13766 IT->position is set to within IT->object's boundaries. Break from
13767 the loop as soon as EOB is reached; avoids infloops in redisplay
13768 when IT->position is set up wrongly due to some bug.
13769 Set IT->current to match the bidi iterator unconditionally.
13770 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13771 entry. Force push_it to save on the stack the current
13772 buffer/string position, to be restored by pop_it. Fix flags in
13773 the iterator structure wrt the object coming from a display
13774 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13775 properties. (Bug#9284)
13776
13777 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
13778
13779 * fontset.c (fontset_get_font_group): Add proper type checks.
13780 (Bug#9172)
13781
13782 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13783
13784 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13785 and LC_VERSION_MIN_MACOSX.
13786 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13787 (dump_it) [LC_FUNCTION_STARTS]: Use it.
13788
13789 2011-08-08 Eli Zaretskii <eliz@gnu.org>
13790
13791 * xdisp.c (forward_to_next_line_start): Allow to use the
13792 no-display-properties-and-no-overlays under bidi display.
13793 Set disp_pos in the bidi iterator to avoid searches for display
13794 properties and overlays.
13795
13796 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
13797
13798 * editfns.c (Fset_time_zone_rule): Document relationship with the
13799 setenv function.
13800
13801 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13802 the font entity extracted from the cache (Bug#8109).
13803
13804 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13805
13806 * composite.c (autocmp_chars): Don't reset point. That is done by
13807 restore_point_unwind (Bug#5984).
13808
13809 2011-08-07 Juri Linkov <juri@jurta.org>
13810
13811 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13812 to show the arg `TIME' instead of `TIMEVAL'.
13813
13814 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13815
13816 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13817 display property strides EOL and includes a newline, as in
13818 longlines-mode. (Bug#9254)
13819 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13820 word-wrap under bidirectional display. (Bug#9224)
13821
13822 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13823 is non-zero, even if the data buffer is NULL. Fixes a crash in
13824 vertical-motion with longlines-mode. (Bug#9254)
13825
13826 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13827
13828 * bidi.c <bidi_cache_total_alloc>: Now static.
13829 (bidi_initialize): Initialize bidi_cache_total_alloc.
13830
13831 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13832 cache. (Bug#9221)
13833
13834 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13835 amount allocated this far in `bidi_cache_total_alloc'.
13836 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13837 non-zero, only free the data buffer without restoring the cache
13838 contents. All callers changed.
13839
13840 * dispextern.h (bidi_unshelve_cache): Update prototype.
13841
13842 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13843 (move_it_in_display_line, move_it_to)
13844 (move_it_vertically_backward, move_it_by_lines): Replace the call
13845 to xfree to an equivalent call to bidi_unshelve_cache.
13846 (move_it_in_display_line_to): Fix logic of returning
13847 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13848
13849 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13850
13851 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13852 came from a string character with a `cursor' property. (Bug#9229)
13853
13854 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13855
13856 * Makefile.in (LIB_PTHREAD): New variable.
13857 (LIBES): Add LIB_PTHREAD (Bug#9216).
13858
13859 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13860 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13861
13862 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13863
13864 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13865
13866 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13867
13868 * xterm.c (x_find_topmost_parent): New function.
13869 (x_set_frame_alpha): Find topmost parent window with
13870 x_find_topmost_parent and set the property there also (bug#9181).
13871 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13872
13873 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13874
13875 * callproc.c (Fcall_process): Avoid vfork clobbering
13876 the local vars buffer, coding_systems, current_dir.
13877
13878 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13879
13880 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13881
13882 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13883
13884 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13885 so that it is not optimized away.
13886
13887 * xdisp.c (compute_display_string_pos): Remove unused local.
13888
13889 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13890
13891 Fix slow cursor motion and scrolling in large buffers with
13892 selective display, like Org Mode buffers. (Bug#9218)
13893
13894 * dispextern.h (struct bidi_it): New member disp_prop_p.
13895
13896 * xdisp.c: Remove one-slot cache of display string positions.
13897 (compute_display_string_pos): Accept an additional argument
13898 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13899 for a display string or property. If found, set DISP_PROP_P
13900 non-zero.
13901
13902 * bidi.c (bidi_fetch_char): Accept an additional argument
13903 DISP_PROP_P, and pass it to compute_display_string_pos.
13904 Only handle text covered by a display string if DISP_PROP_P is returned
13905 non-zero. All callers of bidi_fetch_char changed.
13906
13907 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13908
13909 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13910
13911 2010-12-03 Don March <don@ohspite.net>
13912
13913 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13914 last character M-[char] is translated to ESC [char] (bug#7541).
13915
13916 2011-08-02 Kenichi Handa <handa@m17n.org>
13917
13918 * lisp.h (uniprop_table): Extern it.
13919
13920 * chartab.c (uniprop_table): Make it non-static.
13921
13922 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13923
13924 * xdisp.c (forward_to_next_line_start): Accept additional argument
13925 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13926 on the newline.
13927 (reseat_at_next_visible_line_start): Use the bidi iterator state
13928 returned by forward_to_next_line_start to restore the state of
13929 it->bidi_it after backing up to previous newline. (Bug#9212)
13930
13931 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13932
13933 * regex.c (re_comp): Protoize.
13934 (re_exec): Fix return type.
13935 (regexec): Fix type of `ret'. (Bug#9203)
13936
13937 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13938
13939 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13940 This is needed if max-image-size is a floating-point number.
13941
13942 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13943
13944 * print.c (print_object): Print empty symbol as ##.
13945
13946 * lread.c (read1): Read ## as empty symbol.
13947
13948 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13949
13950 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13951 setting frame foreground color (Bug#9175).
13952 (x_set_background_color): Likewise.
13953
13954 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13955 contents (Bug#9176).
13956 (EmacsTooltip -init): Remove bezels and add shadows to
13957 tooltip windows.
13958
13959 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13960 or scroll bar (Bug#8470).
13961
13962 * nsfont.m (nsfont_open): Remove assignment to voffset and
13963 unnecessary vars hshink, expand, hd, full_height, min_height.
13964 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13965
13966 * nsterm.h (nsfont_info): Remove voffset field.
13967
13968 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13969
13970 Implement strike-through and overline on NextStep (Bug#8863).
13971
13972 * nsfont.m (nsfont_open): Use underline position provided by font,
13973 instead of hard-coded value of 2.
13974 (nsfont_draw): Call ns_draw_text_decoration instead.
13975
13976 * nsterm.h: Add declaration for ns_draw_text_decoration.
13977
13978 * nsterm.m (ns_draw_text_decoration): New function for drawing
13979 underline, overline, and strike-through.
13980 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13981 ns_draw_text_decoration. Change treatment of cursor drawing to
13982 accommodate underlining, etc.
13983
13984 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13985
13986 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13987 default.
13988
13989 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13990
13991 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13992 Without this fix, if a signal arrives just after memory fills up,
13993 'malloc' might be invoked reentrantly.
13994
13995 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13996 In other words, assume that every image size is allowed, on non-X
13997 hosts. This assumption is probably wrong, but it lets Emacs compile.
13998
13999 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14000
14001 * regex.c (re_iswctype): Convert return values to boolean.
14002
14003 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14004
14005 * xdisp.c (compute_display_string_pos): Don't use cached display
14006 string position if the buffer had its restriction changed.
14007 (Bug#9184)
14008
14009 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14010
14011 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14012
14013 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14014
14015 Integer signedness and overflow and related fixes. (Bug#9079)
14016
14017 * bidi.c: Integer size and overflow fixes.
14018 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14019 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14020 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14021 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14022 (bidi_find_other_level_edge):
14023 Use ptrdiff_t instead of EMACS_INT where either will do.
14024 This works better on 32-bit hosts configured --with-wide-int.
14025 (bidi_cache_ensure_space): Check for size-calculation overflow.
14026 Use % rather than repeated addition, for better worst-case speed.
14027 Don't set bidi_cache_size until after xrealloc returns, because it
14028 might not return.
14029 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14030 (bidi_cache_ensure_space): Also check that the bidi cache size
14031 does not exceed that of the largest Lisp string or buffer. See Eli
14032 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14033
14034 * alloc.c (__malloc_size_t): Remove.
14035 All uses replaced by size_t. See Andreas Schwab's note
14036 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14037
14038 * image.c: Improve checking for integer overflow.
14039 (check_image_size): Assume that f is nonnull, since
14040 it is always nonnull in practice. This is one less thing to
14041 worry about when checking for integer overflow later.
14042 (x_check_image_size): New function, which checks for integer
14043 overflow issues inside X.
14044 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14045 This removes the need for a memory_full check.
14046 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14047 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14048 (xbm_read_bitmap_data): Change locals back to 'int', since
14049 their values must fit in 'int'.
14050 (xpm_load_image, png_load, tiff_load):
14051 Invoke x_create_x_image_and_pixmap earlier,
14052 to avoid much needless work if the image is too large.
14053 (tiff_load): Treat overly large images as if
14054 x_create_x_image_and_pixmap failed, not as malloc failures.
14055 (gs_load): Use x_check_image_size.
14056
14057 * gtkutil.c: Omit integer casts.
14058 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14059 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14060
14061 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14062
14063 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14064 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14065 would wrongly return t on a 64-bit host.
14066
14067 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14068 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14069 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14070 and therefore cause GCC to emit a bogus diagnostic in some cases.
14071
14072 * image.c: Integer signedness and overflow and related fixes.
14073 This is not an exhaustive set of fixes, but it's time to
14074 record what I've got.
14075 (lookup_pixel_color, check_image_size): Remove redundant decls.
14076 (check_image_size): Don't assume that arbitrary EMACS_INT values
14077 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14078 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14079 (tiff_load, imagemagick_load_image):
14080 Check for overflow in size calculations.
14081 (x_create_x_image_and_pixmap): Remove unnecessary test for
14082 xmalloc returning NULL; that can't happen.
14083 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14084 (xpm_color_bucket): Use better integer hashing function.
14085 (xpm_cache_color): Don't possibly over-allocate memory.
14086 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14087 (gif_memory_source):
14088 Use ptrdiff_t, not int or size_t, to record sizes.
14089 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14090 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14091 either works, as we prefer signed integers.
14092 (tiff_read_from_memory, tiff_write_from_memory):
14093 Return tsize_t, not size_t, since that's what the TIFF API wants.
14094 (tiff_read_from_memory): Don't fail simply because the read would
14095 go past EOF; instead, return a short read.
14096 (tiff_load): Omit no-longer-needed casts.
14097 (Fimagemagick_types): Don't assume size fits into 'int'.
14098
14099 Improve hashing quality when configured --with-wide-int.
14100 * fns.c (hash_string): New function, taken from sxhash_string.
14101 Do not discard information about ASCII character case; this
14102 discarding is no longer needed.
14103 (sxhash-string): Use it. Change sig to match it. Caller changed.
14104 * lisp.h: Declare it.
14105 * lread.c (hash_string): Remove, since we now use fns.c's version.
14106 The fns.c version returns a wider integer if --with-wide-int is
14107 specified, so this should help the quality of the hashing a bit.
14108
14109 * emacs.c: Integer overflow minor fix.
14110 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
14111 Define only if GNU_LINUX.
14112 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14113
14114 * dispnew.c: Integer signedness and overflow fixes.
14115 Remove unnecessary forward decls, that were a maintenance hassle.
14116 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14117 All uses changed.
14118 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14119 (scrolling_window): Use ptrdiff_t, not int, for byte count.
14120 (prepare_desired_row, line_draw_cost):
14121 Use int, not unsigned, where either works.
14122 (save_current_matrix, restore_current_matrix):
14123 Use ptrdiff_t, not size_t, where either works.
14124 (init_display): Check for overflow more accurately, and without
14125 relying on undefined behavior.
14126
14127 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14128 Remove, replacing with the new symbols in lisp.h. All uses changed.
14129 * fileio.c (make_temp_name):
14130 * filelock.c (lock_file_1, lock_file):
14131 * xdisp.c (message_dolog):
14132 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14133 Use pMd etc. instead.
14134 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14135 replacing the pWIDE etc. symbols removed from editfns.c.
14136
14137 * keyboard.h (num_input_events): Now uintmax_t.
14138 This is (very slightly) less likely to mess up due to wraparound.
14139 All uses changed.
14140
14141 * buffer.c: Integer signedness fixes.
14142 (alloc_buffer_text, enlarge_buffer_text):
14143 Use ptrdiff_t rather than size_t when either will do, as we prefer
14144 signed integers.
14145
14146 * alloc.c: Integer signedness and overflow fixes.
14147 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14148 (__malloc_size_t): Default to size_t, not to int.
14149 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14150 (Fgarbage_collect, mark_object_loop_halt, mark_object):
14151 Prefer ptrdiff_t to size_t when either would do, as we prefer
14152 signed integers.
14153 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14154 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14155 Now const. Initialize with values that are in range even if char
14156 is signed.
14157 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14158 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
14159 These functions do the right thing with sizes > 2**32.
14160 (check_depth): Now ptrdiff_t, not int.
14161 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14162 Adjust to new way of storing sizes. Check for size overflow bugs
14163 in rest of code.
14164 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
14165 slightly wrong anyway, as it missed one instance of
14166 XMALLOC_OVERRUN_CHECK_OVERHEAD.
14167 (refill_memory_reserve): Omit needless cast to size_t.
14168 (mark_object_loop_halt): Mark as externally visible.
14169
14170 * xselect.c: Integer signedness and overflow fixes.
14171 (Fx_register_dnd_atom, x_handle_dnd_message):
14172 Use ptrdiff_t, not size_t, since we prefer signed.
14173 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14174 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14175 x_dnd_atoms_size and x_dnd_atoms_length.
14176
14177 * doprnt.c: Prefer signed to unsigned when either works.
14178 * eval.c (verror):
14179 * doprnt.c (doprnt):
14180 * lisp.h (doprnt):
14181 * xdisp.c (vmessage):
14182 Use ptrdiff_t, not size_t, when using or implementing doprnt,
14183 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14184 prefer signed arithmetic to avoid comparison confusion.
14185 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14186 but is a bit tricky.
14187
14188 Assume freestanding C89 headers, string.h, stdlib.h.
14189 * data.c, doprnt.c, floatfns.c, print.c:
14190 Include float.h unconditionally.
14191 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14192 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
14193 * regex.c: Likewise for stddef.h, string.h.
14194 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
14195 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14196 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14197 (STDC_HEADERS): Remove obsolete defines.
14198 * sysdep.c: Include limits.h unconditionally.
14199
14200 Assume support for memcmp, memcpy, memmove, memset.
14201 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14202 * regex.c (memcmp, memcpy):
14203 Remove; we assume C89 now.
14204
14205 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14206 (__malloc_safe_bcopy): Remove; no longer needed.
14207
14208 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14209 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14210 well either way, and we prefer signed to unsigned.
14211
14212 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14213
14214 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14215 closes the connection while we're reading (bug#9182).
14216
14217 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
14218
14219 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14220 are specified (Bug#9168).
14221
14222 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14223
14224 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14225 Found by GCC static checking and --with-wide-int on a 32-bit host.
14226
14227 2011-07-25 Eli Zaretskii <eliz@gnu.org>
14228
14229 * xdisp.c (compute_display_string_pos): Fix logic of caching
14230 previous display string position. Initialize cached_prev_pos to
14231 -1. Fixes slow-down at the beginning of a buffer.
14232
14233 2011-07-24 Eli Zaretskii <eliz@gnu.org>
14234
14235 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14236 for attrs[LFACE_FONTSET_INDEX].
14237
14238 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
14239
14240 * xml.c (parse_region): Remove unused local
14241 that was recently introduced.
14242
14243 2011-07-23 Eli Zaretskii <eliz@gnu.org>
14244
14245 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14246 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14247
14248 * xdisp.c (move_it_in_display_line_to): Record the best matching
14249 position for TO_CHARPOS while scanning the line, and restore it on
14250 exit if none of the characters scanned was an exact match.
14251 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14252 when exact match is impossible due to invisible text, and the
14253 lines are truncated.
14254
14255 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
14256
14257 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14258 for OSX >= 10.7.
14259
14260 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14261
14262 Fix a significant slow-down of cursor motion with C-n, C-p,
14263 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14264 auto-repeat under bidi redisplay in fontified buffers.
14265 * xdisp.c (compute_stop_pos_backwards): New function.
14266 (next_element_from_buffer): Call compute_stop_pos_backwards to
14267 find a suitable prev_stop when we find ourselves before
14268 base_level_stop.
14269 (reseat): Don't look for prev_stop, as that could mean a very long
14270 run.
14271 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14272 <cached_disp_overlay_modiff>: Cache for last found display string
14273 position.
14274 (compute_display_string_pos): Return the cached position if asked
14275 about the same buffer in the same area of character positions, and
14276 the buffer wasn't changed since the time the display string
14277 position was cached.
14278
14279 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14280
14281 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14282 is an integer, which is important for empty lines. (Bug#9149)
14283
14284 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
14285
14286 * frame.c (Fmodify_frame_parameters): In tty case, update the
14287 default face if necessary (Bug#4238).
14288
14289 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
14290
14291 * editfns.c (Fstring_to_char): No need to explain what a character
14292 is in the docstring (Bug#6576).
14293
14294 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14295
14296 * xml.c (parse_region): Make sure we always return a tree.
14297
14298 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
14299
14300 * xml.c (parse_region): If a document contains only comments,
14301 return that, too.
14302
14303 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14304
14305 * xml.c (make_dom): Return comments, too.
14306
14307 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
14308
14309 Port to OpenBSD.
14310 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14311 and the surrounding thread.
14312 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14313 rather than fgets, and retry after EINTR. Otherwise, 'emacs
14314 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14315 timer goes off.
14316 * s/openbsd.h (BROKEN_SIGIO): Define.
14317 * unexelf.c (unexec) [__OpenBSD__]:
14318 Don't update the .mdebug section of the Alpha COFF symbol table.
14319
14320 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14321
14322 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14323 (bug#8460).
14324
14325 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
14326
14327 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14328 This fixes some race conditions on the permissions of any newly
14329 created file.
14330
14331 * alloc.c (valid_pointer_p): Use pipe, not open.
14332 This fixes some permissions issues when debugging.
14333
14334 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
14335 If fchown fails to set both uid and gid, try to set just gid,
14336 as that is sometimes allowed. Adjust the file's mode to eliminate
14337 setuid or setgid bits that are inappropriate if fchown fails.
14338
14339 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
14340
14341 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14342 to compare Lisp_Objects.
14343 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14344 global_gnutls_log_level, don't mistake it for a Lisp_Object.
14345 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14346
14347 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
14348
14349 * lread.c (read_integer): Unread even EOF character.
14350 (read1): Likewise. Properly record start position of symbol.
14351
14352 * lread.c (read1): Read `#:' as empty uninterned symbol if no
14353 symbol character follows.
14354
14355 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
14356
14357 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
14358 This works around a problem with the previous change to Fcopy_file.
14359 Recent glibc declares fchown with __attribute__((warn_unused_result)),
14360 and without this change, GCC might complain about discarding
14361 fchown's return value.
14362
14363 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
14364
14365 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14366
14367 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
14368
14369 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
14370
14371 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
14372
14373 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
14374 it's used from the C level.
14375
14376 * process.c: Use the same condition for POLL_FOR_INPUT in both
14377 keyboard.c and process.c (bug#1858).
14378
14379 2011-07-09 Lawrence Mitchell <wence@gmx.li>
14380
14381 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
14382 (Fgnutls_boot): Use it.
14383
14384 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
14385
14386 * doc.c (Fsubstitute_command_keys): Revert last change.
14387
14388 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
14389
14390 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
14391 quotes the next character, and doesn't affect other longer
14392 sequences (bug#8935).
14393
14394 * lread.c (syms_of_lread): Clarify that is isn't only
14395 `eval-buffer' and `eval-defun' that's affected by
14396 `lexical-binding' (bug#8460).
14397
14398 2011-07-15 Eli Zaretskii <eliz@gnu.org>
14399
14400 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
14401 bidi redisplay when a line includes both an image and is truncated.
14402
14403 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
14404
14405 Fix minor problems found by static checking.
14406 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
14407 (elsz): Now a signed constant, not a size_t var. We prefer signed
14408 types to unsigned, to avoid integer comparison confusion. Without
14409 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
14410 "cannot optimize loop, the loop counter may overflow", a symptom
14411 of the confusion.
14412 * indent.c (Fvertical_motion): Mark locals as initialized.
14413 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
14414
14415 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14416
14417 * search.c (Fre_search_backward): Mention `case-fold-search' in
14418 all the re_search_* functions (bug#8138).
14419
14420 * keyboard.c (Fopen_dribble_file): Document when the file is
14421 closed (bug#8056).
14422
14423 2011-07-14 Eli Zaretskii <eliz@gnu.org>
14424
14425 * bidi.c (bidi_dump_cached_states): Fix format of displaying
14426 bidi_cache_idx.
14427
14428 Support bidi reordering of display and overlay strings.
14429 * xdisp.c (compute_display_string_pos)
14430 (compute_display_string_end): Accept additional argument STRING.
14431 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
14432 (reseat_to_string): Initialize bidi_it->string.s and
14433 bidi_it->string.schars.
14434 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
14435 NULL (avoids a crash in bidi_paragraph_init).
14436 Initialize itb.string.lstring.
14437 (init_iterator): Call bidi_init_it only of a valid
14438 buffer position was specified. Initialize paragraph_embedding to
14439 L2R.
14440 (reseat_to_string): Initialize the bidi iterator.
14441 (display_string): If we need to ignore text properties of
14442 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
14443 original value of -1 will not work with bidi.)
14444 (compute_display_string_pos): First arg is now struct
14445 `text_pos *'; all callers changed. Support display properties on
14446 Lisp strings.
14447 (compute_display_string_end): Support display properties on Lisp
14448 strings.
14449 (init_iterator, reseat_1, reseat_to_string): Initialize the
14450 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
14451 when iterating on a string not from display properties).
14452 (compute_display_string_pos, compute_display_string_end):
14453 Fix calculation of the object to scan. Fixes an error when using
14454 arrow keys.
14455 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
14456 base_level_stop; instead, set base_level_stop to BEGV.
14457 Fixes crashes in vertical-motion.
14458 (next_element_from_buffer): Improve commentary for when
14459 the iterator is before prev_stop.
14460 (init_iterator): Initialize bidi_p from the default value of
14461 bidi-display-reordering, not from buffer-local value. Use the
14462 buffer-local value only if initializing for buffer iteration.
14463 (handle_invisible_prop): Support invisible properties on strings
14464 that are being bidi-reordered.
14465 (set_iterator_to_next): Support bidi reordering of C strings and
14466 Lisp strings.
14467 (next_element_from_string): Support bidi reordering of Lisp
14468 strings.
14469 (handle_stop_backwards): Support Lisp strings as well.
14470 (display_string): Support display of R2L glyph rows.
14471 Use IT_STRING_CHARPOS when displaying from a Lisp string.
14472 (init_iterator): Don't initialize it->bidi_p for strings
14473 here.
14474 (reseat_to_string): Initialize it->bidi_p for strings here.
14475 (next_element_from_string, next_element_from_c_string)
14476 (next_element_from_buffer): Add xassert's for correspondence
14477 between IT's object being iterated and it->bidi_it.string
14478 structure.
14479 (face_before_or_after_it_pos): Support bidi iteration.
14480 (next_element_from_c_string): Handle the case of the first string
14481 character that is not the first one in the visual order.
14482 (get_visually_first_element): New function, refactored from common
14483 parts of next_element_from_buffer, next_element_from_string, and
14484 next_element_from_c_string.
14485 (tool_bar_lines_needed, redisplay_tool_bar)
14486 (display_menu_bar): Force left-to-right direction. Add a FIXME
14487 comment for making that be controlled by a user option.
14488 (push_it, pop_it): Save and restore the state of the
14489 bidi iterator. Save and restore the bidi_p flag.
14490 (pop_it): Iterate out of display property for string iteration as
14491 well.
14492 (iterate_out_of_display_property): Support iteration over strings.
14493 (handle_single_display_spec): Set up it->bidi_it for iteration
14494 over a display string, and call bidi_init_it.
14495 (handle_single_display_spec, next_overlay_string)
14496 (get_overlay_strings_1, push_display_prop): Set up the bidi
14497 iterator for displaying display or overlay strings.
14498 (forward_to_next_line_start): Don't use the shortcut if
14499 bidi-iterating.
14500 (back_to_previous_visible_line_start): If handle_display_prop
14501 pushed the iterator stack, restore the internal state of the bidi
14502 iterator by calling bidi_pop_it same number of times.
14503 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
14504 and we are bidi-iterating, don't decrement the iterator position;
14505 instead, set the first_elt flag in the bidi iterator, to produce
14506 the same effect.
14507 (reseat_1): Remove redundant setting of string_from_display_prop_p.
14508 (push_display_prop): xassert that we are iterating a buffer.
14509 (push_it, pop_it): Save and restore paragraph_embedding member.
14510 (handle_single_display_spec, next_overlay_string)
14511 (get_overlay_strings_1, reseat_1, reseat_to_string)
14512 (push_display_prop): Set up the `unibyte' member of bidi_it.string
14513 correctly. Don't assume unibyte strings are not bidi-reordered.
14514 (compute_display_string_pos)
14515 (compute_display_string_end): Fix handling the case of C string.
14516 (push_it, pop_it): Save and restore from_disp_prop_p.
14517 (handle_single_display_spec, push_display_prop): Set the
14518 from_disp_prop_p flag.
14519 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
14520 (pop_it): Call iterate_out_of_display_property only if we are
14521 popping after iteration over a string that came from a display
14522 property. Fix a typo in popping stretch info. Add an assertion
14523 for verifying that the iterator position is in sync with the bidi
14524 iterator.
14525 (handle_single_display_spec, get_overlay_strings_1)
14526 (push_display_prop): Fix initialization of paragraph direction for
14527 string when that of the parent object is not yet determined.
14528 (reseat_1): Call bidi_init_it to resync the bidi
14529 iterator with IT's position. (Bug#7616)
14530 (find_row_edges): If ROW->start.pos gives position
14531 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
14532 (handle_stop, back_to_previous_visible_line_start, reseat_1):
14533 Reset the from_disp_prop_p flag.
14534 (SAVE_IT, RESTORE_IT): New macros.
14535 (pos_visible_p, face_before_or_after_it_pos)
14536 (back_to_previous_visible_line_start)
14537 (move_it_in_display_line_to, move_it_in_display_line)
14538 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14539 (try_scrolling, redisplay_window, display_line): Use them when
14540 saving a temporary copy of the iterator and restoring it back.
14541 (back_to_previous_visible_line_start, reseat_1)
14542 (init_iterator): Empty the bidi cache "stack".
14543 (move_it_in_display_line_to): If iterator ended up at
14544 EOL, but we never saw any buffer positions smaller than
14545 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
14546 motion in bidi-reordered lines.
14547 (move_it_in_display_line_to): Record prev_method and prev_pos
14548 immediately before the call to set_iterator_to_next. Fixes cursor
14549 motion in bidi-reordered lines with stretch glyphs and strings
14550 displayed in margins. (Bug#8133) (Bug#8867)
14551 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14552 TO_CHARPOS.
14553 (pos_visible_p): Support positions in bidi-reordered lines.
14554 Save and restore bidi cache.
14555
14556 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14557 (bidi_paragraph_info): Delete unused struct.
14558 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14559 (bidi_cache_start): New variable.
14560 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14561 to zero.
14562 (bidi_cache_fetch_state, bidi_cache_search)
14563 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14564 (bidi_cache_find, bidi_peek_at_next_level)
14565 (bidi_level_of_next_char, bidi_find_other_level_edge)
14566 (bidi_move_to_visually_next): Compare cache index with
14567 bidi_cache_start rather than with zero.
14568 (bidi_fetch_char): Accept new argument STRING; all callers
14569 changed. Support iteration over a string. Support strings with
14570 display properties. Support unibyte strings. Fix the type of
14571 `len' according to what STRING_CHAR_AND_LENGTH expects.
14572 (bidi_paragraph_init, bidi_resolve_explicit_1)
14573 (bidi_resolve_explicit, bidi_resolve_weak)
14574 (bidi_level_of_next_char, bidi_move_to_visually_next):
14575 Support iteration over a string.
14576 (bidi_set_sor_type, bidi_resolve_explicit_1)
14577 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14578 can now be zero (for strings); special values 0 and -1 were
14579 changed to -1 and -2, respectively.
14580 (bidi_char_at_pos): New function.
14581 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14582 Call it instead of FETCH_MULTIBYTE_CHAR.
14583 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14584 initialized to valid values.
14585 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14586 values.
14587 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14588 the test for valid cached positions. Fix the logic for looking up
14589 the sentinel state in the cache. GCPRO the Lisp string we are
14590 iterating.
14591 (bidi_push_it, bidi_pop_it): New functions.
14592 (bidi_initialize): Initialize the bidi cache start stack pointer.
14593 (bidi_cache_ensure_space): New function, refactored from part of
14594 bidi_cache_iterator_state. Don't assume the required size is just
14595 one BIDI_CACHE_CHUNK away.
14596 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14597 (bidi_count_bytes, bidi_char_at_pos): New functions.
14598 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14599 always valid if bidi_cache_idx is valid.
14600 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14601 is valid if it's going to be used.
14602 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14603 (bidi_cache_fetch_state, bidi_cache_search)
14604 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14605 (bidi_cache_iterator_state, bidi_cache_find)
14606 (bidi_find_other_level_edge, bidi_cache_start_stack):
14607 All variables related to cache indices are now EMACS_INT.
14608
14609 * dispextern.h (struct bidi_string_data): New structure.
14610 (struct bidi_it): New member `string'. Make flag members be 1-bit
14611 fields, and put them last in the struct.
14612 (compute_display_string_pos, compute_display_string_end):
14613 Update prototypes.
14614 (bidi_push_it, bidi_pop_it): Add prototypes.
14615 (struct iterator_stack_entry): New members bidi_p,
14616 paragraph_embedding, and from_disp_prop_p.
14617 (struct it): Member bidi_p is now a bit field 1 bit wide.
14618 (bidi_shelve_cache, bidi_unshelve_cache):
14619 Declare prototypes.
14620
14621 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14622 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14623 and vector-like objects.
14624
14625 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14626 cache around display iteration.
14627
14628 * window.c (Fwindow_end, window_scroll_pixel_based)
14629 (displayed_window_lines, Frecenter): Save and restore the bidi
14630 cache around display iteration.
14631
14632 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14633
14634 * editfns.c (Fdelete_region): Clarify the use of the named
14635 parameters (bug#6788).
14636
14637 2011-07-14 Martin Rudalics <rudalics@gmx.at>
14638
14639 * indent.c (Fvertical_motion): Set and restore w->pointm when
14640 saving and restoring the window's buffer (Bug#9006).
14641
14642 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
14643
14644 * editfns.c (Fstring_to_char): Clarify just what is returned
14645 (bug#6576). Text by Eli Zaretskii.
14646
14647 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
14648
14649 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14650
14651 2011-07-13 Eli Zaretskii <eliz@gnu.org>
14652
14653 * buffer.c (mmap_find): Fix a typo.
14654
14655 2011-07-13 Johan Bockgård <bojohan@gnu.org>
14656
14657 Fix execution of x selection hooks.
14658 * xselect.c (Qx_lost_selection_functions)
14659 (Qx_sent_selection_functions): New vars.
14660 (syms_of_xselect): DEFSYM them.
14661 (x_handle_selection_request): Pass Qx_sent_selection_functions
14662 rather than Vx_sent_selection_functions to Frun_hook_with_args.
14663 (x_handle_selection_clear,x_clear_frame_selections):
14664 Pass Qx_lost_selection_functions rather than
14665 Vx_lost_selection_functions to Frun_hook_with_args.
14666
14667 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
14668
14669 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14670 The old code sometimes used this field without initializing it.
14671
14672 * alloc.c (gc_sweep): Don't read past end of array.
14673 In theory, the old code could also have corrupted Emacs internals,
14674 though it'd be very unlikely.
14675
14676 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
14677
14678 * character.c (Fcharacterp): Don't advertise optional ignored
14679 argument. (Bug#4026)
14680
14681 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14682
14683 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14684 key" (bug#4257).
14685
14686 * window.c (Fset_window_start): Doc fix (bug#4199).
14687 (Fset_window_hscroll): Ditto.
14688
14689 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14690
14691 Fix minor new problems caught by GCC 4.6.1.
14692 * term.c (init_tty): Remove unused local.
14693 * xsettings.c (store_monospaced_changed): Define this function only
14694 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14695 not used otherwise.
14696
14697 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14698
14699 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14700
14701 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14702
14703 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14704 are the mini-buffer and the echo area (bug#3320).
14705
14706 * term.c (init_tty): Remove support for supdup, c10 and perq
14707 terminals, which are no longer supported (bug#1482).
14708
14709 2011-07-10 Johan Bockgård <bojohan@gnu.org>
14710
14711 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14712
14713 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14714
14715 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14716 for non-popups (Bug#3642).
14717
14718 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14719
14720 * alloc.c (reset_malloc_hooks): Protoize.
14721 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14722 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14723 * cm.c (losecursor): Likewise.
14724 * data.c (fmod): Likewise.
14725 * dispnew.c (swap_glyphs_in_rows): Likewise.
14726 * emacs.c (memory_warning_signal): Likewise.
14727 * floatfns.c (float_error): Likewise.
14728 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14729 (otf_open, font_otf_capability, generate_otf_features)
14730 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14731 Likewise.
14732 * image.c (pbm_read_file): Likewise.
14733 * indent.c (string_display_width): Likewise.
14734 * intervals.c (check_for_interval, search_for_interval)
14735 (inc_interval_count, count_intervals, root_interval)
14736 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14737 * lread.c (defalias): Likewise.
14738 * ralloc.c (r_alloc_check): Likewise.
14739 * regex.c (set_image_of_range_1, set_image_of_range)
14740 (regex_grow_registers): Likewise.
14741 * sysdep.c (strerror): Likewise.
14742 * termcap.c (valid_filename_p, tprint, main): Likewise.
14743 * tparam.c (main): Likewise.
14744 * unexhp9k800.c (run_time_remap, save_data_space)
14745 (update_file_ptrs, read_header, write_header, calculate_checksum)
14746 (copy_file, copy_rest, display_header): Likewise.
14747 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14748 Likewise.
14749 * xdisp.c (check_it): Likewise.
14750 * xfaces.c (register_color, unregister_color, unregister_colors):
14751 Likewise.
14752 * xfns.c (print_fontset_result): Likewise.
14753 * xrdb.c (member, fatal, main): Likewise.
14754
14755 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14756
14757 Fix minor problems found by static checking (Bug#9031).
14758 * chartab.c (char_table_set_range, map_sub_char_table):
14759 Remove unused locals.
14760 (uniprop_table): Now static.
14761 * composite.c (_work_char): Remove unused static var.
14762
14763 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
14764
14765 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14766
14767 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14768
14769 * gtkutil.c (qttip_cb): Remove code without function.
14770
14771 2011-07-09 Eli Zaretskii <eliz@gnu.org>
14772
14773 * w32.c (pthread_sigmask): New stub.
14774
14775 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
14776
14777 Use pthread_sigmask, not sigprocmask (Bug#9010).
14778 sigprocmask is portable only for single-threaded applications, and
14779 Emacs can be multi-threaded when it uses GTK.
14780 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14781 (LIBES): Use it.
14782 * callproc.c (Fcall_process):
14783 * process.c (create_process):
14784 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14785 Use pthread_sigmask, not sigprocmask.
14786
14787 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14788
14789 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14790 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14791 wrong (Bug#8591).
14792
14793 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14794
14795 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14796 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14797 (xg_hide_tooltip): Fix comment.
14798
14799 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14800 in registerServicesMenuSendTypes.
14801 (validRequestorForSendType): Don't check ns_return_types.
14802
14803 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14804 ns_return_type.
14805
14806 2011-07-08 Jason Rumney <jasonr@gnu.org>
14807
14808 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14809 SH_SHOW for hidden windows (Bug#5482).
14810
14811 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14812 frame struct members of non-existent frames (Bug#6284).
14813
14814 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14815
14816 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14817 variable firstTime not needed on OSX >= 10.6.
14818 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14819 >= 10.5. Use setKnobProportion, setDoubleValue.
14820
14821 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14822 (MAC_OS_X_VERSION_10_5): Define if not defined.
14823 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14824 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14825 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14826
14827 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14828 cString and lossyCString on OSX >= 10.4.
14829
14830 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14831 sizeToFit on OSX >= 10.2.
14832
14833 * nsimage.m (allocInitFromFile): Don't use deprecated method
14834 bestRepresentationForDevice on OSX >= 10.6.
14835
14836 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14837 to avoid warning.
14838
14839 * emacs.c: Declare unexec_init_emacs_zone.
14840
14841 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14842
14843 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14844
14845 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14846 on svcsMenu (Bug#8842).
14847
14848 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14849 ns_return_types.
14850 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14851
14852 * nsterm.m (QUTF8_STRING): Declare.
14853 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14854 (validRequestorForSendType): Return type is (id).
14855 Change indexOfObjectIdenticalTo to indexOfObject.
14856 Check if we have local selection before returning self (Bug#8842).
14857 (writeSelectionToPasteboard): Put local selection into paste board
14858 if we have a local selection (Bug#8842).
14859 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14860
14861 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14862 (ns_get_local_selection): Declare.
14863
14864 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14865
14866 * keymap.c (describe_map_tree): Don't insert a double newline at
14867 the end of the buffer (bug#1169) and return whether we inserted
14868 something.
14869
14870 * callint.c (Fcall_interactively): Change "reading args" to
14871 "providing args" to try to clarify what it does (bug#1010).
14872
14873 2011-07-07 Kenichi Handa <handa@m17n.org>
14874
14875 * composite.c (composition_compute_stop_pos): Ignore a static
14876 composition starting before CHARPOS (Bug#8915).
14877
14878 * xdisp.c (handle_composition_prop): Likewise.
14879
14880 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14881
14882 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14883 (Bug#9015)
14884
14885 2011-07-07 Kenichi Handa <handa@m17n.org>
14886
14887 * character.h (unicode_category_t): New enum type.
14888
14889 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14890 (Qchar_code_property_table): New variable.
14891 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14892 (UNIPROP_COMPRESSED_FORM_P): New macros.
14893 (char_table_ascii): Uncompress the compressed values.
14894 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14895 Uncompress the compressed values.
14896 (sub_char_table_ref_and_range): Likewise.
14897 (char_table_ref_and_range): Uncompress the compressed values.
14898 (sub_char_table_set): New arg is_uniprop. Callers changed.
14899 Uncompress the compressed values.
14900 (sub_char_table_set_range): Args changed. Callers changed.
14901 (char_table_set_range): Adjuted for the above change.
14902 (map_sub_char_table): Delete args default_val and parent. Add arg
14903 top. Give decoded values to a Lisp function.
14904 (map_char_table): Adjust for the above change. Give decoded
14905 values to a Lisp function. Gcpro more variables.
14906 (uniprop_table_uncompress)
14907 (uniprop_decode_value_run_length): New functions.
14908 (uniprop_decoder, uniprop_decoder_count): New variables.
14909 (uniprop_get_decoder, uniprop_encode_value_character)
14910 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14911 New functions.
14912 (uniprop_encoder, uniprop_encoder_count): New variables.
14913 (uniprop_get_encoder, uniprop_table)
14914 (Funicode_property_table_internal, Fget_unicode_property_internal)
14915 (Fput_unicode_property_internal): New functions.
14916 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14917 Sunicode_property_table_internal, Sget_unicode_property_internal,
14918 and Sput_unicode_property_internal. Defvar_lisp
14919 char-code-property-alist.
14920
14921 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14922 Vunicode_category_table.
14923
14924 * font.c (font_range): Adjust for the change of
14925 Vunicode_category_table.
14926
14927 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14928
14929 * m/iris4d.h: Remove file, move contents ...
14930 * s/irix6-5.h: ... here.
14931
14932 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14933
14934 Remove unportable assumption about struct layout (Bug#8884).
14935 * alloc.c (mark_buffer):
14936 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14937 (clone_per_buffer_values): Don't assume that
14938 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14939 This isn't true in general, and it's particularly not true
14940 if Emacs is configured with --with-wide-int.
14941 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14942 New macros, used in the buffer.c change.
14943
14944 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14945
14946 * xsettings.c: Use both GConf and GSettings if both are available.
14947 (store_config_changed_event): Add comment.
14948 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14949 (store_tool_bar_style_changed): New functions.
14950 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14951 (struct xsettings): Move font inside HAVE_XFT.
14952 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14953 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14954 Move inside HAVE_XFT.
14955 (something_changed_gsettingsCB): Rename from something_changedCB.
14956 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14957 also.
14958 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14959 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14960 (something_changed_gconfCB): Rename from something_changedCB.
14961 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14962 (parse_settings): Move check for font inside HAVE_XFT.
14963 (read_settings, apply_xft_settings): Add comment.
14964 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14965 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14966 call store_font_name_changed.
14967 (xft_settings_event): Add comment.
14968 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14969 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14970 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14971 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14972 (xsettings_initialize): Call init_gsettings last.
14973 (xsettings_get_system_font, xsettings_get_system_normal_font):
14974 Add comment.
14975
14976 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14977
14978 Random fixes. E.g., (random) never returned negative values.
14979 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14980 subseconds part to the entropy, as that's a bit more random.
14981 Prefer signed to unsigned, since the signedness doesn't matter and
14982 in general we prefer signed. When given a limit, use a
14983 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14984 latter isn't right if USE_2_TAGS_FOR_INTS.
14985 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14986 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14987
14988 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14989
14990 * textprop.c (text_property_stickiness):
14991 Obey Vtext_property_default_nonsticky.
14992 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14993 * w32fns.c (syms_of_w32fns):
14994 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14995
14996 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14997
14998 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14999 This is more efficient than Ffile_directory_p and avoids a minor race.
15000
15001 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15002
15003 * buffer.c (Foverlay_put): Say what the return value is
15004 (bug#7835).
15005
15006 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15007 is a directory before asking whether to use the file name
15008 (bug#7564).
15009 (barf_or_query_if_file_exists): Make the "File is a directory"
15010 error be more correct.
15011
15012 * fns.c (Frequire): Remove the mention of the .gz files, since
15013 that's installation-specific, but keep the mention of
15014 `get-load-suffixes'.
15015
15016 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15017
15018 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15019 Report string overflow if the output is too long.
15020
15021 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
15022
15023 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15024 (syms_of_gnutls): Remove duplicate DEFSYM for
15025 Qgnutls_bootprop_verify_hostname_error, an error for
15026 Qgnutls_bootprop_verify_error (which is no longer used).
15027
15028 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15029 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15030 Also (re)move comments that are misplaced or no longer relevant.
15031
15032 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15033
15034 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15035
15036 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
15037
15038 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15039 and background color parameters if they have been changed.
15040
15041 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15042
15043 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15044
15045 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15046
15047 * xsettings.c (SYSTEM_FONT): Define only when used.
15048 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15049
15050 * keymap.c (access_keymap_1): Now static.
15051
15052 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
15053
15054 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15055 leave any prefix arg for the up event (Bug#1586).
15056
15057 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15058
15059 * lread.c (syms_of_lread): Mention single symbols defined by
15060 `defvar' or `defconst' (bug#7154).
15061
15062 * fns.c (Frequire): Mention .el.gz files (bug#7314).
15063 (Frequire): Mention get-load-suffixes.
15064
15065 2011-07-02 Martin Rudalics <rudalics@gmx.at>
15066
15067 * window.h (window): Remove clone_number slot.
15068 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15069 Remove.
15070 (make_parent_window, make_window, saved_window)
15071 (Fset_window_configuration, save_window_save): Don't deal with
15072 clone numbers.
15073 * buffer.c (Qclone_number): Remove declaration.
15074 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15075
15076 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15077
15078 Add multiple inheritance to keymaps.
15079 * keymap.c (Fmake_composed_keymap): New function.
15080 (Fset_keymap_parent): Simplify.
15081 (fix_submap_inheritance): Remove.
15082 (access_keymap_1): New function extracted from access_keymap to handle
15083 embedded parents and handle lists of maps.
15084 (access_keymap): Use it.
15085 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15086 (Fcopy_keymap): Handle embedded parents.
15087 (Fcommand_remapping, define_as_prefix): Simplify.
15088 (Fkey_binding): Simplify.
15089 (syms_of_keymap): Move minibuffer-local-completion-map,
15090 minibuffer-local-filename-completion-map,
15091 minibuffer-local-must-match-map, and
15092 minibuffer-local-filename-must-match-map to Elisp.
15093 (syms_of_keymap): Defsubr make-composed-keymap.
15094 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15095 (parse_menu_item): Trivial simplification.
15096
15097 2011-07-01 Glenn Morris <rgm@gnu.org>
15098
15099 * Makefile.in (SETTINGS_LIBS): Fix typo.
15100
15101 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15102
15103 * coding.c (Fencode_coding_string): Record the last coding system
15104 used, as the function doc string says (bug#8738).
15105
15106 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15107
15108 * xsettings.c (store_monospaced_changed): Take new font as arg and
15109 check for change against current_mono_font.
15110 (EMACS_TYPE_SETTINGS): Remove this and related defines.
15111 (emacs_settings_constructor, emacs_settings_get_property)
15112 (emacs_settings_set_property, emacs_settings_class_init)
15113 (emacs_settings_init, gsettings_obj): Remove.
15114 (something_changedCB): New function for HAVE_GSETTINGS.
15115 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15116 with value as argument.
15117 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15118 g_settings_new (Bug#8967). Do not create gsettings_obj.
15119 Remove calls to g_settings_bind. Connect something_changedCB to
15120 "changed".
15121
15122 * xgselect.c: Add defined (HAVE_GSETTINGS).
15123 (xgselect_initialize): Ditto.
15124
15125 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15126 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15127 xg_select.
15128
15129 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
15130
15131 * eval.c (struct backtrace): Simplify and port the data structure.
15132 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15133 signed bit field, as this assumption is not portable and it makes
15134 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
15135 "char debug_on_exit : 1" as this is not portable either; instead,
15136 use the portable "unsigned int debug_on_exit : 1". Remove unused
15137 member evalargs. Remove obsolete comments about cc bombing out.
15138
15139 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
15140
15141 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15142 Let HAVE_GSETTINGS override HAVE_GCONF.
15143 (store_monospaced_changed): New function.
15144 (EMACS_SETTINGS): A new type derived from GObject to handle
15145 GSettings notifications.
15146 (emacs_settings_constructor, emacs_settings_get_property)
15147 (emacs_settings_set_property, emacs_settings_class_init):
15148 New functions.
15149 (gsettings_client, gsettings_obj): New variables.
15150 (GSETTINGS_SCHEMA): New define.
15151 (something_changedCB): Call store_monospaced_changed.
15152 (init_gsettings): New function.
15153 (xsettings_initialize): Call init_gsettings.
15154 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15155 to NULL.
15156
15157 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15158 GCONF_CFLAGS/LIBS.
15159
15160 2011-06-29 Martin Rudalics <rudalics@gmx.at>
15161
15162 * window.c (resize_root_window, grow_mini_window)
15163 (shrink_mini_window): Rename Qresize_root_window to
15164 Qwindow_resize_root_window and Qresize_root_window_vertically to
15165 Qwindow_resize_root_window_vertically.
15166
15167 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
15168
15169 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15170
15171 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
15172
15173 * makefile.w32-in: Redesign dependencies so they reflect more
15174 clearly which files are directly included by each source file,
15175 and not through other includes.
15176
15177 2011-06-27 Martin Rudalics <rudalics@gmx.at>
15178
15179 * buffer.c (Qclone_number): Declare static and DEFSYM it.
15180 (sort_overlays, overlay_strings): When an overlay's clone number
15181 matches the window's clone number process the overlay even if
15182 the overlay's window property doesn't match the current window.
15183
15184 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15185 (Fwindow_hchild): Rename to Fwindow_left_child.
15186 (Fwindow_next): Rename to Fwindow_next_sibling.
15187 (Fwindow_prev): Rename to Fwindow_prev_sibling.
15188 (resize_window_check): Rename to window_resize_check.
15189 (resize_window_apply): Rename to window_resize_apply.
15190 (Fresize_window_apply): Rename to Fwindow_resize_apply.
15191 (Fdelete_other_windows_internal, resize_frame_windows)
15192 (Fsplit_window_internal, Fdelete_window_internal)
15193 (grow_mini_window, shrink_mini_window)
15194 (Fresize_mini_window_internal): Fix callers accordingly.
15195
15196 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15197
15198 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15199 (emacs_fixed_set_min_size): Remove.
15200 (emacs_fixed_new): Take frame as argument.
15201
15202 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15203 (_EmacsFixedPrivate): Remove minwidth/height.
15204 Add struct frame *f.
15205 (emacs_fixed_init): Initialize priv->f.
15206 (get_parent_class, emacs_fixed_set_min_size): Remove.
15207 (emacs_fixed_new): Set priv->f to argument.
15208 (emacs_fixed_get_preferred_width)
15209 (emacs_fixed_get_preferred_height): Use min_width/height from
15210 frames size_hint to set minimum and natural (Bug#8919).
15211 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15212 and use min_width/height from frames size_hint to set
15213 min_width/height (Bug#8919).
15214
15215 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15216 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15217 Fix indentation.
15218
15219 2011-06-26 Eli Zaretskii <eliz@gnu.org>
15220
15221 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15222 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15223 called at ZV.
15224
15225 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
15226
15227 * process.c (wait_reading_process_output): Bypass select if
15228 waiting for a cell while ignoring keyboard input, and input is
15229 pending. Suggested by Jan Djärv (Bug#8869).
15230
15231 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
15232
15233 Use gnulib's dup2 module instead of rolling our own.
15234 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15235
15236 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15237
15238 * dispnew.c (scrolling_window): Before scrolling, turn off a
15239 mouse-highlight in the window being scrolled.
15240
15241 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
15242
15243 Move DEFSYM to lisp.h and use everywhere.
15244
15245 * character.h (DEFSYM): Move declaration...
15246 * lisp.h (DEFSYM): ...here.
15247
15248 * gnutls.c:
15249 * minibuf.c:
15250 * w32menu.c:
15251 * w32proc.c:
15252 * w32select.c: Don't include character.h.
15253
15254 * alloc.c (syms_of_alloc):
15255 * buffer.c (syms_of_buffer):
15256 * bytecode.c (syms_of_bytecode):
15257 * callint.c (syms_of_callint):
15258 * casefiddle.c (syms_of_casefiddle):
15259 * casetab.c (init_casetab_once):
15260 * category.c (init_category_once, syms_of_category):
15261 * ccl.c (syms_of_ccl):
15262 * cmds.c (syms_of_cmds):
15263 * composite.c (syms_of_composite):
15264 * dbusbind.c (syms_of_dbusbind):
15265 * dired.c (syms_of_dired):
15266 * dispnew.c (syms_of_display):
15267 * doc.c (syms_of_doc):
15268 * editfns.c (syms_of_editfns):
15269 * emacs.c (syms_of_emacs):
15270 * eval.c (syms_of_eval):
15271 * fileio.c (syms_of_fileio):
15272 * fns.c (syms_of_fns):
15273 * frame.c (syms_of_frame):
15274 * fringe.c (syms_of_fringe):
15275 * insdel.c (syms_of_insdel):
15276 * keymap.c (syms_of_keymap):
15277 * lread.c (init_obarray, syms_of_lread):
15278 * macros.c (syms_of_macros):
15279 * msdos.c (syms_of_msdos):
15280 * print.c (syms_of_print):
15281 * process.c (syms_of_process):
15282 * search.c (syms_of_search):
15283 * sound.c (syms_of_sound):
15284 * syntax.c (init_syntax_once, syms_of_syntax):
15285 * terminal.c (syms_of_terminal):
15286 * textprop.c (syms_of_textprop):
15287 * undo.c (syms_of_undo):
15288 * w32.c (globals_of_w32):
15289 * window.c (syms_of_window):
15290 * xdisp.c (syms_of_xdisp):
15291 * xfaces.c (syms_of_xfaces):
15292 * xfns.c (syms_of_xfns):
15293 * xmenu.c (syms_of_xmenu):
15294 * xsettings.c (syms_of_xsettings):
15295 * xterm.c (syms_of_xterm): Use DEFSYM.
15296
15297 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
15298
15299 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
15300
15301 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
15302
15303 Integer and buffer overflow fixes (Bug#8873).
15304
15305 * print.c (printchar, strout): Check for string overflow.
15306 (PRINTPREPARE, printchar, strout):
15307 Don't set size unless allocation succeeds.
15308
15309 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15310 for sizes. Check for string overflow more accurately.
15311 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15312
15313 * macros.c: Integer and buffer overflow fixes.
15314 * keyboard.h (struct keyboard.kbd_macro_bufsize):
15315 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15316 Use ptrdiff_t, not int, for sizes.
15317 Don't increment bufsize until after realloc succeeds.
15318 Check for size-calculation overflow.
15319 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15320
15321 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15322
15323 * lread.c: Integer overflow fixes.
15324 (read_integer): Radix is now EMACS_INT, not int,
15325 to improve quality of diagnostics for out-of-range radices.
15326 Calculate buffer size correctly for out-of-range radices.
15327 (read1): Check for integer overflow in radices, and in
15328 read-circle numbers.
15329 (read_escape): Avoid int overflow.
15330 (Fload, openp, read_buffer_size, read1)
15331 (substitute_object_recurse, read_vector, read_list, map_obarray):
15332 Use ptrdiff_t, not int, for sizes.
15333 (read1): Use EMACS_INT, not int, for sizes.
15334 Check for size overflow.
15335
15336 * image.c (cache_image): Check for size arithmetic overflow.
15337
15338 * lread.c: Integer overflow issues.
15339 (saved_doc_string_size, saved_doc_string_length)
15340 (prev_saved_doc_string_size, prev_saved_doc_string_length):
15341 Now ptrdiff_t, not int.
15342 (read1): Don't assume doc string length fits in int. Check for
15343 out-of-range doc string lengths.
15344 (read_list): Don't assume file position fits in int.
15345 (read_escape): Check for hex character overflow.
15346
15347 2011-06-22 Leo Liu <sdl.web@gmail.com>
15348
15349 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15350 Move to minibuffer.el.
15351
15352 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15353
15354 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
15355 The following patches are for when GLYPH_DEBUG && !XASSERT.
15356 * dispextern.h (trace_redisplay_p, dump_glyph_string):
15357 * dispnew.c (flush_stdout):
15358 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15359 Mark as externally visible.
15360 * dispnew.c (check_window_matrix_pointers): Now static.
15361 * dispnew.c (window_to_frame_vpos):
15362 * xfns.c (unwind_create_frame):
15363 * xterm.c (x_check_font): Remove unused local.
15364 * scroll.c (CHECK_BOUNDS):
15365 * xfaces.c (cache_fache): Rename local to avoid shadowing.
15366 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15367 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15368 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15369 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15370 Now static.
15371 (debug_method_add): Use va_list and vsprintf rather than relying
15372 on undefined behavior with wrong number of arguments.
15373 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
15374 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
15375 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
15376 since we're not interested in debugging glyphs with old libraries.
15377 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
15378 GCC 4.6.0's static checking.
15379
15380 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15381
15382 Integer overflow and signedness fixes (Bug#8873).
15383 A few related buffer overrun fixes, too.
15384
15385 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
15386
15387 * dispextern.h (struct face.stipple):
15388 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
15389 (x_bitmap_mask, x_allocate_bitmap_record)
15390 (x_create_bitmap_from_data, x_create_bitmap_from_file)
15391 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
15392 (x_create_bitmap_from_xpm_data):
15393 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
15394 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
15395 (.bitmaps_last):
15396 * xfaces.c (load_pixmap):
15397 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
15398 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
15399 (.bitmaps_last, struct x_output.icon_bitmap):
15400 Use ptrdiff_t, not int, for bitmap indexes.
15401 (x_allocate_bitmap_record): Check for size overflow.
15402 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
15403
15404 Use ptrdiff_t, not int, for overlay counts.
15405 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
15406 * editfns.c (overlays_around, get_pos_property):
15407 * textprop.c (get_char_property_and_overlay):
15408 * xdisp.c (next_overlay_change, note_mouse_highlight):
15409 * xfaces.c (face_at_buffer_position):
15410 * buffer.c (OVERLAY_COUNT_MAX): New macro.
15411 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
15412 (Fnext_overlay_change, Fprevious_overlay_change)
15413 (mouse_face_overlay_overlaps, Foverlays_in):
15414 Use ptrdiff_t, not int, for sizes.
15415 (overlays_at, overlays_in): Check for size-calculation overflow.
15416
15417 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
15418
15419 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
15420 (x_session_initialize): Do not assume string length fits in int.
15421
15422 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
15423 This is unlikely, but can occur if DPI is outlandish.
15424
15425 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
15426 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
15427
15428 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
15429 * xrdb.c (magic_file_p, search_magic_path):
15430 Omit last arg SUFFIX; it was always 0. All callers changed.
15431 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
15432
15433 * xfont.c (xfont_match): Avoid need for strlen.
15434
15435 * xfns.c: Don't assume strlen fits in int.
15436 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
15437
15438 * xdisp.c (message_log_check_duplicate): Return intmax_t,
15439 not unsigned long, as we prefer signed integers. All callers changed.
15440 Detect integer overflow in repeat count.
15441 (message_dolog): Don't assume print length fits in 39 bytes.
15442 (display_mode_element): Don't assume strlen fits in int.
15443
15444 * termcap.c: Don't assume sizes fit in int and never overflow.
15445 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
15446 (gobble_line): Check for size-calculation overflow.
15447
15448 * minibuf.c (Fread_buffer):
15449 * lread.c (intern, intern_c_string):
15450 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
15451 Don't assume string length fits in int.
15452
15453 * keyboard.c (parse_tool_bar_item):
15454 * gtkutil.c (style_changed_cb): Avoid need for strlen.
15455
15456 * font.c: Don't assume string length fits in int.
15457 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
15458 Use ptrdiff_t, not int.
15459 (font_intern_prop): Don't assume string length fits in int.
15460 Don't assume integer property fits in fixnum.
15461 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
15462
15463 * filelock.c: Fix some buffer overrun and integer overflow issues.
15464 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
15465 Reformulate so as not to need the command string.
15466 Invoke gzip -cd rather than gunzip, as it's more portable.
15467 (lock_info_type, lock_file_1, lock_file):
15468 Don't assume pid_t and time_t fit in unsigned long.
15469 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
15470 (current_lock_owner): Prefer signed type for sizes.
15471 Use memcpy, not strncpy, where memcpy is what is really wanted.
15472 Don't assume (via atoi) that time_t and pid_t fit in int.
15473 Check for time_t and/or pid_t out of range, e.g., via a network share.
15474 Don't alloca where an auto var works fine.
15475
15476 * fileio.c: Fix some integer overflow issues.
15477 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
15478 Don't assume string length fits in int.
15479 (directory_file_name): Don't assume string length fits in long.
15480 (make_temp_name): Don't assume pid fits in int, or that its print
15481 length is less than 20.
15482
15483 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
15484
15485 * coding.c (make_subsidiaries): Don't assume string length fits in int.
15486
15487 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
15488
15489 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
15490 We prefer signed integers, even for size calculations.
15491
15492 * emacs.c: Don't assume string length fits in 'int'.
15493 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
15494 (main): Don't invoke strlen when not needed.
15495
15496 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
15497 (XD_DEBUG_MESSAGE): Don't waste a byte.
15498
15499 * callproc.c (getenv_internal_1, getenv_internal)
15500 (Fgetenv_internal):
15501 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
15502
15503 * lread.c (invalid_syntax): Omit length argument.
15504 All uses changed. This doesn't fix a bug, but it simplifies the
15505 code away from its former Hollerith-constant appearance, and it's
15506 one less 'int' to worry about when looking at integer-overflow issues.
15507 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
15508
15509 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
15510 This didn't break anything, but it didn't help either.
15511 It's confusing to put a bogus integer in a place where the actual
15512 value does not matter.
15513 (LIST_END_P): Remove unused macro and its bogus comment.
15514 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
15515
15516 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
15517 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
15518 implementation.
15519 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
15520 We prefer signed types, and the value cannot exceed the EMACS_INT
15521 range anyway (because otherwise the length would not be representable).
15522 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
15523 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
15524 This avoids a GCC warning when WIDE_EMACS_INT.
15525
15526 * indent.c (sane_tab_width): New function.
15527 (current_column, scan_for_column, Findent_to, position_indentation)
15528 (compute_motion): Use it. This is just for clarity.
15529 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
15530
15531 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
15532
15533 * lisp.h (lint_assume): New macro.
15534 * composite.c (composition_gstring_put_cache):
15535 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15536
15537 * editfns.c, insdel.c:
15538 Omit unnecessary forward decls, to simplify future changes.
15539
15540 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15541
15542 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15543
15544 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15545 Use much-faster test for byte-length change.
15546 Don't assume string byte-length fits in 'int'.
15547 Check that character arg fits in 'int'.
15548 (mapcar1): Declare byte as byte, for clarity.
15549
15550 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15551
15552 * fns.c (concat): Catch string overflow earlier.
15553 Do not rely on integer wraparound.
15554
15555 * dispextern.h (struct it.overlay_strings_charpos)
15556 (struct it.selective): Now EMACS_INT, not int.
15557 * xdisp.c (forward_to_next_line_start)
15558 (back_to_previous_visible_line_start)
15559 (reseat_at_next_visible_line_start, next_element_from_buffer):
15560 Don't arbitrarily truncate the value of 'selective' to int.
15561
15562 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15563
15564 * composite.c: Don't truncate sizes to 'int'.
15565 (composition_gstring_p, composition_reseat_it)
15566 (composition_adjust_point): Use EMACS_INT, not int.
15567 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15568 not EMACS_UINT, for indexes.
15569
15570 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15571
15572 * buffer.c: Include <verify.h>.
15573 (struct sortvec.priority, struct sortstr.priority):
15574 Now EMACS_INT, not int.
15575 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15576 (struct sortstr.size, record_overlay_string)
15577 (struct sortstrlist.size, struct sortlist.used):
15578 Don't truncate size to int.
15579 (record_overlay_string): Check for size-calculation overflow.
15580 (init_buffer_once): Check at compile-time, not run-time.
15581
15582 2011-06-22 Jim Meyering <meyering@redhat.com>
15583
15584 Don't leak an XBM-image-sized buffer
15585 * image.c (xbm_load): Free the image buffer after using it.
15586
15587 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15588
15589 Port to Sun C.
15590 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15591 that Sun C diagnosed.
15592 * fns.c (secure_hash): Fix pointer signedness issue.
15593 * intervals.c (static_offset_intervals): New function.
15594 (offset_intervals): Use it.
15595
15596 2011-06-21 Leo Liu <sdl.web@gmail.com>
15597
15598 * deps.mk (fns.o):
15599 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15600 sha512.h.
15601
15602 * fns.c (secure_hash): Rename from crypto_hash_function and change
15603 the first arg to accept symbols.
15604 (Fsecure_hash): New primitive.
15605 (syms_of_fns): New symbols.
15606
15607 2011-06-20 Deniz Dogan <deniz@dogan.se>
15608
15609 * process.c (Fset_process_buffer): Clarify return value in
15610 docstring.
15611
15612 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
15613
15614 * dispnew.c (add_window_display_history): Use BVAR.
15615
15616 * xdisp.c (debug_method_add): Use BVAR.
15617 (check_window_end, dump_glyph_matrix, dump_glyph)
15618 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15619
15620 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15621 Likewise.
15622
15623 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15624 check till after the cache is created in init_frame_faces.
15625
15626 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
15627
15628 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15629
15630 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
15631
15632 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15633 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15634 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15635
15636 Improve buffer-overflow checking (Bug#8873).
15637 * fileio.c (Finsert_file_contents):
15638 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15639 Remove the old (too-loose) buffer overflow checks.
15640 They weren't needed, since make_gap checks for buffer overflow.
15641 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15642 The old code merely checked for Emacs fixnum overflow, and relied
15643 on undefined (wraparound) behavior. The new code avoids undefined
15644 behavior, and also checks for ptrdiff_t and/or size_t overflow.
15645
15646 * editfns.c (Finsert_char): Don't dump core with very negative counts.
15647 Tune. Don't use wider integers than needed. Don't use alloca.
15648 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
15649
15650 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15651
15652 * insdel.c, lisp.h (buffer_overflow): New function.
15653 (insert_from_buffer_1, replace_range, replace_range_2):
15654 * insdel.c (make_gap_larger):
15655 * editfns.c (Finsert_char):
15656 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15657
15658 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15659
15660 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
15661
15662 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15663
15664 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15665 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15666
15667 * fileio.c: Don't assume EMACS_INT fits in off_t.
15668 (emacs_lseek): New static function.
15669 (Finsert_file_contents, Fwrite_region): Use it.
15670 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15671
15672 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15673
15674 * fns.c: Don't overflow int when computing a list length.
15675 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15676 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15677 truncation on 64-bit hosts. Check for QUIT every
15678 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15679 faster and is responsive enough.
15680 (Flength): Report an error instead of overflowing an integer.
15681 (Fsafe_length): Return a float if the value is not representable
15682 as a fixnum. This shouldn't happen except in contrived situations.
15683 (Fnthcdr, Fsort): Don't assume list length fits in int.
15684 (Fcopy_sequence): Don't assume vector length fits in int.
15685
15686 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15687 (header_size, word_size): New constants.
15688 (allocate_vectorlike): Don't check size overflow here.
15689 (allocate_vector): Check it here instead, since this is the only
15690 caller of allocate_vectorlike that could cause overflow.
15691 Check that the new vector's length is representable as a fixnum.
15692
15693 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15694 The previous code was bogus. For example, next_almost_prime (32)
15695 returned 39, which is undesirable as it is a multiple of 3; and
15696 next_almost_prime (24) returned 25, which is a multiple of 5 so
15697 why was the code bothering to check for multiples of 7?
15698
15699 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15700
15701 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15702
15703 Variadic C functions now count arguments with ptrdiff_t.
15704 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15705 Back then I didn't know that the Emacs coding style prefers signed int.
15706 Also, in the meantime I found a few more instances where arguments
15707 were being counted with int, which may truncate counts on 64-bit
15708 machines, or EMACS_INT, which may be unnecessarily wide.
15709 * lisp.h (struct Lisp_Subr.function.aMANY)
15710 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15711 Arg counts are now ptrdiff_t, not size_t.
15712 All variadic functions and their callers changed accordingly.
15713 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15714 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15715 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15716 * callint.c (Fcall_interactively): Check arg count for overflow,
15717 to avoid potential buffer overrun. Use signed char, not 'int',
15718 for 'varies' array, so that we needn't bother to check its size
15719 calculation for overflow.
15720 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15721 * eval.c (apply_lambda):
15722 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15723 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15724 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15725
15726 * callint.c (Fcall_interactively): Don't use index var as event count.
15727
15728 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15729 * mem-limits.h (SIZE): Remove; no longer used.
15730
15731 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15732
15733 Remove unnecessary casts.
15734 * xterm.c (x_term_init):
15735 * xfns.c (x_set_border_pixel):
15736 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15737 These aren't needed now that we assume ANSI C.
15738
15739 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15740 It's more likely to cause problems (due to unsigned overflow)
15741 than to cure them.
15742
15743 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15744
15745 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15746
15747 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15748
15749 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15750
15751 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15752
15753 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15754
15755 GLYPH_CODE_FACE returns EMACS_INT, not int.
15756 * dispextern.h (merge_faces):
15757 * xfaces.c (merge_faces):
15758 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15759 Don't assume EMACS_INT fits in int.
15760
15761 * character.h (CHAR_VALID_P): Remove unused parameter.
15762 * fontset.c, lisp.h, xdisp.c: All uses changed.
15763
15764 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15765
15766 * fns.c (concat): Minor tuning based on overflow analysis.
15767 This doesn't fix any bugs. Use int to hold character, instead
15768 of constantly refetching from Emacs object. Use XFASTINT, not
15769 XINT, for value known to be a character. Don't bother comparing
15770 a single byte to 0400, as it's always less.
15771
15772 * floatfns.c (Fexpt):
15773 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15774
15775 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15776 for characters.
15777
15778 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15779
15780 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15781 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15782 incorrectly succeed when S was a string, because 4294967386 was
15783 truncated before it was used.
15784
15785 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15786 Otherwise, an out-of-range integer could cause undefined behavior
15787 on a 64-bit host.
15788
15789 * composite.c: Use int, not EMACS_INT, for characters.
15790 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15791 EMACS_INT, for values that are known to be in character range.
15792 This doesn't fix any bugs but is the usual style inside Emacs and
15793 may generate better code on 32-bit machines.
15794
15795 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15796 This is for reasons similar to the recent CHAR_STRING fix.
15797 * charset.c (Fencode_char): Check that character arg is actually
15798 a character. Pass an int to ENCODE_CHAR.
15799 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15800 wider than 'int', as a compile-time check to prevent future regressions
15801 in this area.
15802
15803 * character.c (char_string): Remove unnecessary casts.
15804
15805 Make sure a 64-bit char is never passed to CHAR_STRING.
15806 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15807 by silently ignoring the top 32 bits, allowing some values
15808 that were far too large to be valid characters.
15809 * character.h: Include <verify.h>.
15810 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15811 arguments are no wider than unsigned, as a compile-time check
15812 to prevent future regressions in this area.
15813 * data.c (Faset):
15814 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15815 (Fsubst_char_in_region):
15816 * fns.c (concat):
15817 * xdisp.c (decode_mode_spec_coding):
15818 Adjust to CHAR_STRING's new requirement.
15819 * editfns.c (Finsert_char, Fsubst_char_in_region):
15820 * fns.c (concat): Check that character args are actually
15821 characters. Without this test, these functions did the wrong
15822 thing with wildly out-of-range values on 64-bit hosts.
15823
15824 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15825 These casts should not be needed on 32-bit hosts, either.
15826 * keyboard.c (read_char):
15827 * lread.c (Fload): Remove casts to unsigned.
15828
15829 * lisp.h (UNSIGNED_CMP): New macro.
15830 This fixes comparison bugs on 64-bit hosts.
15831 (ASCII_CHAR_P): Use it.
15832 * casefiddle.c (casify_object):
15833 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15834 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15835 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15836 * dispextern.h (FACE_FROM_ID):
15837 * keyboard.c (read_char): Use UNSIGNED_CMP.
15838
15839 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15840 not to EMACS_INT, to avoid GCC warning.
15841
15842 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15843
15844 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15845 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15846 isn't needed on 32-bit machines.
15847
15848 * buffer.c (Fgenerate_new_buffer_name):
15849 Use EMACS_INT for count, not int.
15850 (advance_to_char_boundary): Return EMACS_INT, not int.
15851
15852 * data.c (Qcompiled_function): Now static.
15853
15854 * window.c (window_body_lines): Now static.
15855
15856 * image.c (gif_load): Rename local to avoid shadowing.
15857
15858 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15859 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15860 * alloc.c (make_save_value): Integer argument is now of type
15861 ptrdiff_t, not int.
15862 (mark_object): Use ptrdiff_t, not int.
15863 * lisp.h (pD): New macro.
15864 * print.c (print_object): Use it.
15865
15866 * alloc.c: Use EMACS_INT, not int, to count objects.
15867 (total_conses, total_markers, total_symbols, total_vector_size)
15868 (total_free_conses, total_free_markers, total_free_symbols)
15869 (total_free_floats, total_floats, total_free_intervals)
15870 (total_intervals, total_strings, total_free_strings):
15871 Now EMACS_INT, not int. All uses changed.
15872 (Fgarbage_collect): Compute overall total using a double, so that
15873 integer overflow is less likely to be a problem. Check for overflow
15874 when converting back to an integer.
15875 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15876 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15877 These were 'int' variables that could overflow on 64-bit hosts;
15878 they were never used, so remove them instead of repairing them.
15879 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15880 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15881 Previously, this ceilinged at INT_MAX, but that doesn't work on
15882 64-bit machines.
15883 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15884
15885 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15886 (allocate_vectorlike): Check for ptrdiff_t overflow.
15887 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15888 when a (possibly-narrower) signed value would do just as well.
15889 We prefer using signed arithmetic, to avoid comparison confusion.
15890
15891 * alloc.c: Catch some string size overflows that we were missing.
15892 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15893 for convenience in STRING_BYTES_MAX.
15894 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15895 The definition here is exact; the one in lisp.h was approximate.
15896 (allocate_string_data): Check for string overflow. This catches
15897 some instances we weren't catching before. Also, it catches
15898 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15899 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15900 and ptrdiff_t and EMACS_INT are both 64 bits.
15901
15902 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15903 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15904 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15905
15906 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15907
15908 * alloc.c (Fmake_string): Check for out-of-range init.
15909
15910 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15911
15912 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15913
15914 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15915
15916 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15917 xg_get_default_scrollbar_width.
15918
15919 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15920 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15921 (style_changed_cb): Call update_theme_scrollbar_width and call
15922 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15923 all frames (Bug#8505).
15924 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15925 Call gtk_window_set_resizable if HAVE_GTK3.
15926 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15927 and height if HAVE_GTK3 (Bug#8505).
15928 (scroll_bar_width_for_theme): New variable.
15929 (update_theme_scrollbar_width): New function.
15930 (xg_get_default_scrollbar_width): Move code to
15931 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15932 (xg_initialize): Call update_theme_scrollbar_width.
15933
15934 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15935
15936 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15937
15938 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15939
15940 * frame.c (make_frame): Call other_buffer_safely instead of
15941 other_buffer.
15942
15943 * window.c (temp_output_buffer_show): Call display_buffer with
15944 second argument Vtemp_buffer_show_specifiers and reset latter
15945 immediately after the call.
15946 (Vtemp_buffer_show_specifiers): New variable.
15947 (auto_window_vscroll_p, next_screen_context_lines)
15948 (Vscroll_preserve_screen_position): Remove leading asterisks from
15949 doc-strings.
15950
15951 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15952
15953 Fix minor problems found by GCC 4.6.0 static checking.
15954 * buffer.c (Qclone_number): Remove for now, as it's unused.
15955 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15956 (record_buffer): Remove unused local.
15957 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15958 (set_frame_buffer_list): Remove; unused.
15959 * frame.h (other_visible_frames): Remove decl.
15960 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15961 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15962 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15963 if HAVE_GPM.
15964 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15965 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15966 Define only if HAVE_GPM.
15967 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15968 (update_hints_inhibit): Remove; never set. All uses removed.
15969 * widgetprv.h (emacsFrameClassRec): Remove decl.
15970 * window.c (delete_deletable_window): Now returns void, since it
15971 wasn't returning anything.
15972 (compare_window_configurations): Remove unused locals.
15973 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15974 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15975 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15976 the same widths as pointers. This follows up on the 2011-05-06 patch.
15977 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15978 * xterm.h: Likewise.
15979 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15980
15981 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15982
15983 * makefile.w32-in: Update dependencies.
15984 (LISP_H): Add lib/intprops.h.
15985
15986 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15987
15988 * image.c (gif_load): Add animation frame delay to the metadata.
15989 (syms_of_image): Use DEFSYM. New symbol `delay'.
15990
15991 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15992
15993 * window.c (delete_deletable_window): Re-add.
15994 (Fset_window_configuration): Rewrite to handle dead buffers and
15995 consequently deletable windows.
15996 (window_tree, Fwindow_tree): Remove. Supply functionality in
15997 window.el.
15998 (compare_window_configurations): Simplify code.
15999
16000 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16001
16002 * image.c (imagemagick_load_image): Fix type mismatch.
16003 (Fimagemagick_types): Likewise.
16004
16005 * window.h (replace_buffer_in_windows): Declare.
16006
16007 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16008
16009 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16010 Qclone_number. Remove external declaration of Qdelete_window.
16011 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16012 code.
16013 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16014 Run Qbuffer_list_update_hook if allowed.
16015 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16016 buffer list implementation.
16017 (other_buffer_safely): New function.
16018 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16019 calls to replace_buffer_in_windows and
16020 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16021 if allowed.
16022 (record_buffer): Inhibit quitting and rewrite using quittable
16023 functions. Run Qbuffer_list_update_hook if allowed.
16024 (Frecord_buffer, Funrecord_buffer): New functions.
16025 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16026 Move switch-to-buffer to window.el.
16027 (bury-buffer): Move to window.el.
16028 (Vbuffer_list_update_hook): New variable.
16029
16030 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16031 section.
16032
16033 * window.h (resize_frame_windows): Move up in code.
16034 (Fwindow_frame): Remove EXFUN.
16035 (replace_buffer_in_all_windows): Remove prototype.
16036 (replace_buffer_in_windows_safely): Add prototype.
16037
16038 * window.c: Declare Qdelete_window static again. Move down
16039 declaration of select_count.
16040 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16041 (Fother_window): Move to window.el.
16042 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16043 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16044 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16045 window.el.
16046 (replace_buffer_in_windows): Implement by calling
16047 Qreplace_buffer_in_windows.
16048 (replace_buffer_in_all_windows): Remove with some functionality
16049 moved into replace_buffer_in_windows_safely.
16050 (replace_buffer_in_windows_safely): New function.
16051 (select_window_norecord, select_frame_norecord): Move in front
16052 of run_window_configuration_change_hook. Remove now obsolete
16053 declarations.
16054 (Fset_window_buffer): Rewrite doc-string.
16055 Call Qrecord_window_buffer.
16056 (keys_of_window): Move binding for other-window to window.el.
16057
16058 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16059
16060 * dispextern.h (struct image): Replace data member, whose int_val
16061 and ptr_val fields were not used by anything, with a single
16062 lisp_val object.
16063
16064 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16065 (gif_clear_image, gif_load, imagemagick_load_image)
16066 (gs_clear_image, gs_load): Callers changed.
16067
16068 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16069
16070 * buffer.h: Include <time.h>, for time_t.
16071 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16072
16073 Fix minor problems found by static checking.
16074
16075 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16076
16077 Make identifiers static if they are not used in other modules.
16078 * data.c (Qcompiled_function, Qframe, Qvector):
16079 * image.c (QimageMagick, Qsvg):
16080 * minibuf.c (Qmetadata):
16081 * window.c (resize_window_check, resize_root_window): Now static.
16082 * window.h (resize_window_check, resize_root_window): Remove decls.
16083
16084 * window.c (window_deletion_count, delete_deletable_window):
16085 Remove; unused.
16086 (window_body_lines): Now static.
16087 (Fdelete_other_windows_internal): Mark vars as initialized.
16088 Make sure 'resize_failed' is initialized.
16089 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16090 (resize_window_apply): Remove unused local.
16091 * window.h (delete_deletable_window): Remove decl.
16092
16093 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16094 (imagemagick_load_image): Fix pointer signedness problem by changing
16095 last arg from unsigned char * to char *. All uses changed.
16096 Also, fix a local for similar reasons.
16097 Remove unused locals. Remove locals to avoid shadowing.
16098 (fn_rsvg_handle_free): Remove; unused.
16099 (svg_load, svg_load_image): Fix pointer signedness problem.
16100 (imagemagick_load_image): Don't use garbage pointer image_wand.
16101
16102 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16103
16104 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
16105
16106 * image.c (gif_load): Fix omitted cast error introduced by
16107 2011-06-06 change.
16108
16109 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16110
16111 * window.h (resize_proportionally, orig_total_lines)
16112 (orig_top_line): Remove from window structure.
16113 (set_window_height, set_window_width, change_window_heights)
16114 (Fdelete_window): Remove prototypes.
16115 (resize_frame_windows): Remove duplicate declaration.
16116
16117 2011-06-10 Eli Zaretskii <eliz@gnu.org>
16118
16119 * window.h (resize_frame_windows, resize_window_check)
16120 (delete_deletable_window, resize_root_window)
16121 (resize_frame_windows): Declare prototypes.
16122
16123 * window.c (resize_window_apply): Make definition be "static" to
16124 match the prototype.
16125
16126 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16127
16128 * window.c: Remove declarations of Qwindow_size_fixed,
16129 window_min_size_1, window_min_size_2, window_min_size,
16130 size_window, window_fixed_size_p, enlarge_window, delete_window.
16131 Remove static from declaration of Qdelete_window, it's
16132 temporarily needed by Fbury_buffer.
16133 (replace_window): Don't assign orig_top_line and
16134 orig_total_lines.
16135 (Fdelete_window, delete_window): Remove. Window deletion is
16136 handled by window.el.
16137 (window_loop): Remove DELETE_OTHER_WINDOWS case.
16138 Replace Fdelete_window calls with calls to Qdelete_window.
16139 (Fdelete_other_windows): Remove. Deleting other windows is
16140 handled by window.el.
16141 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
16142 handled in window.el.
16143 (window_min_size_2, window_min_size_1, window_min_size): Remove.
16144 Window minimum sizes are handled in window.el.
16145 (shrink_windows, size_window, set_window_height)
16146 (set_window_width, change_window_heights, window_height)
16147 (window_width, CURBEG, CURSIZE, enlarge_window)
16148 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16149 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
16150 handled in window.el.
16151 (make_dummy_parent): Rename to make_parent_window and give it a
16152 second argument horflag.
16153 (make_window): Don't set resize_proportionally any more.
16154 (Fsplit_window): Remove. Windows are split in window.el.
16155 (save_restore_action, save_restore_orig_size)
16156 (shrink_window_lowest_first, save_restore_orig_size): Remove.
16157 Resize mini windows in window.el.
16158 (grow_mini_window, shrink_mini_window): Implement by calling
16159 Qresize_root_window_vertically, resize_window_check and
16160 resize_window_apply.
16161 (saved_window, Fset_window_configuration, save_window_save):
16162 Do not handle orig_top_line, orig_total_lines, and
16163 resize_proportionally.
16164 (window_min_height, window_min_width): Move to window.el.
16165 (keys_of_window): Move bindings for delete-other-windows,
16166 split-window, delete-window and enlarge-window to window.el.
16167
16168 * buffer.c: Temporarily extern Qdelete_window.
16169 (Fbury_buffer): Temporarily call Qdelete_window instead of
16170 Fdelete_window (Fbury_buffer will move to window.el soon).
16171
16172 * frame.c (set_menu_bar_lines_1): Remove code handling
16173 orig_top_line and orig_total_lines.
16174
16175 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16176 set_window_height but set heights directly.
16177 (change_frame_size_1): Use resize_frame_windows.
16178
16179 * xdisp.c (init_xdisp): Don't use set_window_height but set
16180 heights directly.
16181
16182 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16183 Use resize_frame_windows instead of change_window_heights and run
16184 run_window_configuration_change_hook.
16185
16186 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16187 instead of change_window_heights and run
16188 run_window_configuration_change_hook.
16189
16190 2011-06-09 Martin Rudalics <rudalics@gmx.at>
16191
16192 * window.c (replace_window): Rename second argument REPLACEMENT to
16193 NEW. New third argument SETFLAG. Rewrite.
16194 (delete_window, make_dummy_parent): Call replace_window with
16195 third argument 1.
16196 (window_list_1): Move down in code.
16197 (run_window_configuration_change_hook): Move set_buffer part
16198 before select_frame_norecord part in order to unwind correctly.
16199 Rename count1 to count.
16200 (recombine_windows, delete_deletable_window, resize_root_window)
16201 (Fdelete_other_windows_internal)
16202 (Frun_window_configuration_change_hook, make_parent_window)
16203 (resize_window_check, resize_window_apply, Fresize_window_apply)
16204 (resize_frame_windows, Fsplit_window_internal)
16205 (Fdelete_window_internal, Fresize_mini_window_internal):
16206 New functions.
16207 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16208
16209 2011-06-08 Martin Rudalics <rudalics@gmx.at>
16210
16211 * window.h (window): Add some new members to window structure -
16212 normal_lines, normal_cols, new_total, new_normal, clone_number,
16213 splits, nest, prev_buffers, next_buffers.
16214 (WINDOW_TOTAL_SIZE): Move here from window.c.
16215 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16216
16217 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16218 Remove.
16219 (make_dummy_parent): Set new members of windows structure.
16220 (make_window): Move down in code. Handle new members of window
16221 structure.
16222 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16223 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16224 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16225 (Fset_window_prev_buffers, Fwindow_next_buffers)
16226 (Fset_window_next_buffers, Fset_window_clone_number):
16227 New functions.
16228 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16229 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16230 Doc-string fixes.
16231 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16232 Argument WINDOW can be now internal window too.
16233 (Fwindow_use_time): Move up in code.
16234 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16235 Rewrite doc-string.
16236 (Fset_window_configuration, saved_window)
16237 (Fcurrent_window_configuration, save_window_save): Handle new
16238 members of window structure.
16239 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16240 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16241 (syms_of_window): New Lisp objects Qrecord_window_buffer,
16242 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16243 Qget_mru_window, Qresize_root_window,
16244 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16245 Qauto_buffer_name; staticpro them.
16246
16247 2011-06-07 Martin Rudalics <rudalics@gmx.at>
16248
16249 * window.c (Fwindow_total_size, Fwindow_left_column)
16250 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16251 (Fwindow_list_1): New functions.
16252 (window_box_text_cols): Replace with window_body_cols.
16253 (Fwindow_width, Fscroll_left, Fscroll_right):
16254 Use window_body_cols instead of window_box_text_cols.
16255 (delete_window, Fset_window_configuration):
16256 Call delete_all_subwindows with window as argument.
16257 (delete_all_subwindows): Take a window as argument and not a
16258 structure. Rewrite.
16259 (window_loop): Remove handling of GET_LRU_WINDOW and
16260 GET_LARGEST_WINDOW.
16261 (Fget_lru_window, Fget_largest_window): Move to window.el.
16262
16263 * window.h: Extern window_body_cols instead of
16264 window_box_text_cols. delete_all_subwindows now takes a
16265 Lisp_Object as argument.
16266
16267 * indent.c (compute_motion, Fcompute_motion):
16268 Use window_body_cols instead of window_box_text_cols.
16269
16270 * frame.c (delete_frame): Call delete_all_subwindows with root
16271 window as argument.
16272
16273 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
16274
16275 * fns.c (Fputhash): Document return value.
16276
16277 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
16278
16279 * image.c (gif_load): Implement gif89a spec "no disposal" method.
16280
16281 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16282
16283 Cons<->int and similar integer overflow fixes (Bug#8794).
16284
16285 Check for overflow when converting integer to cons and back.
16286 * charset.c (Fdefine_charset_internal, Fdecode_char):
16287 Use cons_to_unsigned to catch overflow.
16288 (Fencode_char): Use INTEGER_TO_CONS.
16289 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16290 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16291 * data.c (long_to_cons, cons_to_long): Remove.
16292 (cons_to_unsigned, cons_to_signed): New functions.
16293 These signal an error for invalid or out-of-range values.
16294 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16295 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16296 * font.c (Ffont_variation_glyphs):
16297 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16298 * lisp.h: Include <intprops.h>.
16299 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16300 (cons_to_signed, cons_to_unsigned): New decls.
16301 (long_to_cons, cons_to_long): Remove decls.
16302 * undo.c (record_first_change): Use INTEGER_TO_CONS.
16303 (Fprimitive_undo): Use CONS_TO_INTEGER.
16304 * xfns.c (Fx_window_property): Likewise.
16305 * xselect.c: Include <limits.h>.
16306 (x_own_selection, selection_data_to_lisp_data):
16307 Use INTEGER_TO_CONS.
16308 (x_handle_selection_request, x_handle_selection_clear)
16309 (x_get_foreign_selection, Fx_disown_selection_internal)
16310 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16311 (lisp_data_to_selection_data): Use cons_to_unsigned.
16312 (x_fill_property_data): Use cons_to_signed.
16313 Report values out of range.
16314
16315 Check for buffer and string overflow more precisely.
16316 * buffer.h (BUF_BYTES_MAX): New macro.
16317 * lisp.h (STRING_BYTES_MAX): New macro.
16318 * alloc.c (Fmake_string):
16319 * character.c (string_escape_byte8):
16320 * coding.c (coding_alloc_by_realloc):
16321 * doprnt.c (doprnt):
16322 * editfns.c (Fformat):
16323 * eval.c (verror):
16324 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16325 since they may not be the same number.
16326 * editfns.c (Finsert_char):
16327 * fileio.c (Finsert_file_contents):
16328 Likewise for BUF_BYTES_MAX.
16329
16330 * image.c: Use ptrdiff_t, not int, for sizes.
16331 (slurp_file): Switch from int to ptrdiff_t.
16332 All uses changed.
16333 (slurp_file): Check that file size fits in both size_t (for
16334 malloc) and ptrdiff_t (for sanity and safety).
16335
16336 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16337 if b->modtime has its maximal value.
16338
16339 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16340
16341 Don't assume time_t can fit into int.
16342 * buffer.h (struct buffer.modtime): Now time_t, not int.
16343 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16344 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16345
16346 Minor fixes for signed vs unsigned integers.
16347 * character.h (MAYBE_UNIFY_CHAR):
16348 * charset.c (maybe_unify_char):
16349 * keyboard.c (read_char, reorder_modifiers):
16350 XINT -> XFASTINT, since the integer must be nonnegative.
16351 * ftfont.c (ftfont_spec_pattern):
16352 * keymap.c (access_keymap, silly_event_symbol_error):
16353 XUINT -> XFASTINT, since the integer must be nonnegative.
16354 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16355 since it makes no difference and we prefer signed.
16356 * keyboard.c (record_char): Use XUINT when all the neighbors do.
16357 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16358 nonnegative.
16359
16360 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
16361
16362 * window.h (Fwindow_frame): Declare.
16363
16364 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16365
16366 * alloc.c: Simplify handling of large-request failures (Bug#8800).
16367 (SPARE_MEMORY): Always define.
16368 (LARGE_REQUEST): Remove.
16369 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16370
16371 2011-06-06 Martin Rudalics <rudalics@gmx.at>
16372
16373 * lisp.h: Move EXFUNS for Fframe_root_window,
16374 Fframe_first_window and Fset_frame_selected_window to window.h.
16375
16376 * window.h: Move EXFUNS for Fframe_root_window,
16377 Fframe_first_window and Fset_frame_selected_window here from
16378 lisp.h.
16379
16380 * frame.c (Fwindow_frame, Fframe_first_window)
16381 (Fframe_root_window, Fframe_selected_window)
16382 (Fset_frame_selected_window): Move to window.c.
16383 (Factive_minibuffer_window): Move to minibuf.c.
16384 (Fother_visible_frames_p): New function.
16385
16386 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
16387
16388 * window.c (decode_window, decode_any_window): Move up in code.
16389 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
16390 (inhibit_frame_unsplittable): Remove unused variable.
16391 (Fwindow_buffer): Move up and rewrite doc-string.
16392 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
16393 (Fwindow_prev): New functions.
16394 (Fwindow_frame): Move here from frame.c. Accept any window as
16395 argument.
16396 (Fframe_root_window, Fframe_first_window)
16397 (Fframe_selected_window): Move here from frame.c. Accept frame
16398 or arbitrary window as argument. Update doc-strings.
16399 (Fminibuffer_window): Move up in code.
16400 (Fwindow_minibuffer_p): Move up in code and simplify.
16401 (Fset_frame_selected_window): Move here from frame.c.
16402 Marginal rewrite.
16403 (Fselected_window, select_window, Fselect_window): Move up in
16404 code. Minor doc-string fixes.
16405
16406 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16407
16408 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
16409 Do not assume that spare memory exists; that assumption is valid
16410 only if SYSTEM_MALLOC.
16411 (LARGE_REQUEST): New macro, so that the issue of large requests
16412 is separated from the issue of spare memory.
16413
16414 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
16415
16416 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
16417 format. (Bug#8806)
16418
16419 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
16420
16421 * xfns.c (x_set_scroll_bar_default_width): Move declarations
16422 before statements.
16423
16424 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
16425
16426 * gtkutil.c (xg_get_default_scrollbar_width): New function.
16427
16428 * gtkutil.h: Declare xg_get_default_scrollbar_width.
16429
16430 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
16431 min width by calling x_set_scroll_bar_default_width (Bug#8505).
16432
16433 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
16434
16435 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
16436
16437 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
16438
16439 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
16440 (x_clipboard_manager_save): Add return value.
16441 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
16442 New error handlers.
16443 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
16444 Obey Vx_select_enable_clipboard_manager. Catch errors in
16445 x_clipboard_manager_save (Bug#8779).
16446 (Vx_select_enable_clipboard_manager): New variable.
16447 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
16448
16449 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
16450
16451 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
16452
16453 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16454
16455 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
16456 in the current matrix if keep_current_p is non-zero.
16457
16458 2011-06-04 Eli Zaretskii <eliz@gnu.org>
16459
16460 * bidi.c (bidi_level_of_next_char): Fix last change.
16461
16462 2011-06-03 Eli Zaretskii <eliz@gnu.org>
16463
16464 Support bidi reordering of text covered by display properties.
16465
16466 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
16467 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
16468 (bidi_cache_search, bidi_cache_iterator_state)
16469 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
16470 (bidi_level_of_next_char, bidi_move_to_visually_next):
16471 Support character positions inside a run of characters covered by a
16472 display string.
16473 (bidi_paragraph_init, bidi_resolve_explicit_1)
16474 (bidi_level_of_next_char): Call bidi_fetch_char and
16475 bidi_fetch_char_advance instead of FETCH_CHAR and
16476 FETCH_CHAR_ADVANCE.
16477 (bidi_init_it): Initialize new members.
16478 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
16479 definitions.
16480 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
16481 instead of using explicit *_CHAR codes.
16482 (bidi_resolve_explicit, bidi_resolve_weak):
16483 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
16484 bidirectional text is supported only in multibyte buffers.
16485 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
16486 it to initialize the frame_window_p member of struct bidi_it.
16487 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
16488 (bidi_resolve_explicit, bidi_resolve_weak)
16489 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
16490 bidi_it->nchars is non-positive.
16491 (bidi_level_of_next_char): Don't try to lookup the cache for the
16492 next/previous character if nothing is cached there yet, or if we
16493 were just reseat()'ed to a new position.
16494
16495 * xdisp.c (set_cursor_from_row): Set start and stop points
16496 according to the row's direction when priming the loop that looks
16497 for the glyph on which to display cursor.
16498 (single_display_spec_intangible_p): Function deleted.
16499 (display_prop_intangible_p): Reimplement to call
16500 handle_display_spec instead of single_display_spec_intangible_p.
16501 Accept 3 additional arguments needed by handle_display_spec.
16502 This fixes incorrect cursor motion across display property with complex
16503 values: lists, `(when COND...)' forms, etc.
16504 (single_display_spec_string_p): Support property values that are
16505 lists with the argument STRING its top-level element.
16506 (display_prop_string_p): Fix the condition for processing a
16507 property that is a list to be consistent with handle_display_spec.
16508 (handle_display_spec): New function, refactored from the
16509 last portion of handle_display_prop.
16510 (compute_display_string_pos): Accept additional argument
16511 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
16512 value of a `display' property is a "replacing spec".
16513 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
16514 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
16515 the display property, but just return a value indicating whether
16516 the display property will replace the characters it covers.
16517 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
16518 frame_window_p members of struct bidi_it.
16519 (compute_display_string_pos, compute_display_string_end):
16520 New functions.
16521 (push_it): Accept second argument POSITION, where pop_it should
16522 jump to continue iteration.
16523 (reseat_1): Initialize bidi_it.disp_pos.
16524
16525 * keyboard.c (adjust_point_for_property): Adjust the call to
16526 display_prop_intangible_p to its new signature.
16527
16528 * dispextern.h (struct bidi_it): New member frame_window_p.
16529 (bidi_init_it): Update prototypes.
16530 (display_prop_intangible_p): Update prototype.
16531 (compute_display_string_pos, compute_display_string_end):
16532 Declare prototypes.
16533 (struct bidi_it): New members nchars and disp_pos. ch_len is now
16534 EMACS_INT.
16535
16536 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
16537
16538 Malloc failure behavior now depends on size of allocation.
16539 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16540 * lisp.h: Change signatures accordingly.
16541 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16542 All callers changed. (Bug#8762)
16543
16544 * gnutls.c: Use Emacs's memory allocators.
16545 Without this change, the gnutls library would invoke malloc etc.
16546 directly, which causes problems on non-SYNC_INPUT hosts, and which
16547 runs afoul of improving memory_full behavior. (Bug#8761)
16548 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16549 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16550 xfree instead of the default malloc, realloc, free.
16551 (Fgnutls_boot): No need to check for memory allocation failure,
16552 since xmalloc does that for us.
16553
16554 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
16555 * category.c (hash_get_category_set):
16556 * ccl.c (ccl_driver):
16557 * charset.c (Fdefine_charset_internal):
16558 * charset.h (struct charset.hash_index):
16559 * composite.c (get_composition_id, gstring_lookup_cache)
16560 (composition_gstring_put_cache):
16561 * composite.h (struct composition.hash_index):
16562 * dispextern.h (struct image.hash):
16563 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16564 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16565 (hashfn_equal, hashfn_user_defined, make_hash_table)
16566 (maybe_resize_hash_table, hash_lookup, hash_put)
16567 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16568 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16569 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16570 * image.c (make_image, search_image_cache, lookup_image)
16571 (xpm_put_color_table_h):
16572 * lisp.h (struct Lisp_Hash_Table):
16573 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16574 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16575 for hashes and hash indexes, instead of 'unsigned' and 'int'.
16576 * alloc.c (allocate_vectorlike):
16577 Check for overflow in vector size calculations.
16578 * ccl.c (ccl_driver):
16579 Check for overflow when converting EMACS_INT to int.
16580 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16581 need to be updated by these changes.
16582 * fns.c (make_hash_table, maybe_resize_hash_table):
16583 Check for integer overflow with large hash tables.
16584 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16585 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16586 (SXHASH_REDUCE): New macro.
16587 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16588 Use it instead of discarding useful hash info with large hash values.
16589 (sxhash_float): New function.
16590 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16591 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16592 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16593 Rewrite to use FIXNUM_BITS, as this simplifies things.
16594 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16595 Adjust signatures to match updated version of code.
16596 (consing_since_gc): Now EMACS_INT, since a single hash table can
16597 use more than INT_MAX bytes.
16598
16599 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16600
16601 Make it possible to build with GCC-4.6+ -O2 -flto.
16602
16603 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16604
16605 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16606
16607 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16608 Call minibuffer-inactive-mode.
16609
16610 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
16611
16612 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16613 Update dependencies.
16614
16615 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16616
16617 * data.c (init_data): Remove code for UTS, this system is not
16618 supported anymore.
16619
16620 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16621
16622 Don't force ./temacs to start in terminal mode.
16623
16624 * frame.c (make_initial_frame): Initialize faces in all cases, not
16625 only when CANNOT_DUMP is defined.
16626 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16627
16628 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16629
16630 * dispnew.c (add_window_display_history): Use const for the string
16631 pointer. Remove declaration, not needed.
16632
16633 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16634
16635 Use 'inline', not 'INLINE'.
16636 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16637 * alloc.c, fontset.c (INLINE): Remove.
16638 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16639 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16640 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16641 * gmalloc.c (register_heapinfo): Use inline unconditionally.
16642 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16643
16644 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16645
16646 Make it possible to run ./temacs.
16647
16648 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16649 syms_of_callproc does the same thing. Remove test for
16650 "initialized", do it in the caller.
16651 * emacs.c (main): Avoid calling set_initial_environment when dumping.
16652
16653 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
16654
16655 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16656 (read_minibuf): Use get_minibuffer.
16657 (syms_of_minibuf): Use DEFSYM.
16658 (Qmetadata): New var.
16659 * data.c (Qbuffer): Don't make it static.
16660 (syms_of_data): Use DEFSYM.
16661
16662 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16663
16664 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
16665 (CCL_CODE_MIN): New macro.
16666
16667 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
16668
16669 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16670
16671 * eval.c (Qdebug): Now static.
16672 * lisp.h (Qdebug): Remove decl. This reverts a part of the
16673 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16674 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16675
16676 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16677
16678 * image.c: Various fixes to ImageMagick code comments.
16679 (Fimagemagick_types): Doc fix.
16680
16681 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16682
16683 Minor fixes prompted by GCC 4.6.0 warnings.
16684
16685 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16686
16687 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16688 (x_clipboard_manager_save_all): Move extern decl to ...
16689 * xterm.h: ... here, so that it can be checked for consistency.
16690
16691 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16692
16693 * xselect.c (x_clipboard_manager_save_frame)
16694 (x_clipboard_manager_save_all): New functions.
16695 (Fx_clipboard_manager_save): Lisp function deleted.
16696
16697 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16698 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16699
16700 * xterm.h: Update prototype.
16701
16702 2011-05-28 William Xu <william.xwl@gmail.com>
16703
16704 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16705 exiting (Bug#8239).
16706
16707 2011-05-28 Jim Meyering <meyering@redhat.com>
16708
16709 Avoid a sign-extension bug in crypto_hash_function.
16710 * fns.c (to_uchar): Define.
16711 (crypto_hash_function): Use it to convert some newly-signed
16712 variables to unsigned, to avoid sign-extension bugs. For example,
16713 without this change, (md5 "truc") would evaluate to
16714 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16715 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
16716 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16717
16718 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16719
16720 Integer overflow fixes.
16721
16722 * dbusbind.c: Serial number integer overflow fixes.
16723 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16724 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16725 to hold a serial number that is too large for a fixnum.
16726 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16727 Check for serial numbers out of range. Decode any serial number
16728 that was so large that it became a float. (Bug#8722)
16729
16730 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16731 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16732 Use XFASTINT rather than XUINT when numbers are nonnegative.
16733 (xd_append_arg, Fdbus_method_return_internal):
16734 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16735 arguments, check that Lisp number is nonnegative, rather than
16736 silently wrapping negative numbers around. (Bug#8722)
16737 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16738 (Bug#8722)
16739
16740 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16741
16742 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16743
16744 ccl: Add integer overflow checks.
16745 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16746 (IN_INT_RANGE): New macros.
16747 (ccl_driver): Use them to check for integer overflow when
16748 decoding a CCL program. Many of the new checks are whether XINT (x)
16749 fits in int; it doesn't always, on 64-bit hosts. The new version
16750 doesn't catch all possible integer overflows, but it's an
16751 improvement. (Bug#8719)
16752
16753 * alloc.c (make_event_array): Use XINT, not XUINT.
16754 There's no need for unsigned here.
16755
16756 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16757 This follows up to the 2011-05-06 change that substituted uintptr_t
16758 for EMACS_INT. This case wasn't caught back then.
16759
16760 Rework Fformat to avoid integer overflow issues.
16761 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16762 now (part of C89). Include <verify.h>.
16763 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16764 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16765 (Fformat): Avoid the prepass trying to compute sizes; it was only
16766 approximate and thus did not catch overflow reliably. Instead, walk
16767 through the format just once, formatting and computing sizes as we go,
16768 checking for integer overflow at every step, and allocating a larger
16769 buffer as needed. Keep track separately whether the format is
16770 multibyte. Keep only the most-recently calculated precision, rather
16771 than them all. Record whether each argument has been converted to
16772 string. Use EMACS_INT, not int, for byte and char and arg counts.
16773 Support field widths and precisions larger than INT_MAX. Avoid
16774 sprintf's undefined behavior with conversion specifications such as %#d
16775 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16776 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16777 formatting out-of-range floating point numbers with int
16778 formats. (Bug#8668)
16779
16780 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16781
16782 * data.c: Avoid integer truncation in expressions involving floats.
16783 * data.c: Include <intprops.h>.
16784 (arith_driver): When there's an integer overflow in an expression
16785 involving floating point, convert the integers to floating point
16786 so that the resulting value does not suffer from catastrophic
16787 integer truncation. For example, on a 64-bit host (* 4
16788 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16789 Do not rely on undefined behavior after integer overflow.
16790
16791 merge count_size_as_multibyte, parse_str_to_multibyte
16792 * character.c, character.h (count_size_as_multibyte):
16793 Rename from parse_str_to_multibyte; all uses changed.
16794 Check for integer overflow.
16795 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16796 since it's now a duplicate of the other. This is more of
16797 a character than a buffer op, so better that it's in character.c.
16798 * fns.c, print.c: Adjust to above changes.
16799
16800 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16801
16802 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16803
16804 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16805
16806 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16807 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16808 (x_clipboard_manager_save): Now static.
16809 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16810
16811 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16812 (crypto_hash_function): Now static.
16813 Fix pointer signedness problems. Avoid unnecessary initializations.
16814
16815 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16816
16817 * termhooks.h (Vselection_alist): Make it terminal-local.
16818
16819 * terminal.c (create_terminal): Initialize it.
16820
16821 * xselect.c: Support for clipboard managers.
16822 (Vselection_alist): Move to termhooks.h as terminal-local var.
16823 (LOCAL_SELECTION): New macro.
16824 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16825 (symbol_to_x_atom): Remove gratuitous arg.
16826 (x_handle_selection_request, lisp_data_to_selection_data)
16827 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16828 (x_own_selection, x_get_local_selection, x_convert_selection):
16829 New arg, specifying work frame. Use terminal-local Vselection_alist.
16830 (some_frame_on_display): Delete unused function.
16831 (Fx_own_selection_internal, Fx_get_selection_internal)
16832 (Fx_disown_selection_internal, Fx_selection_owner_p)
16833 (Fx_selection_exists_p): New optional frame arg.
16834 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16835 (x_handle_selection_clear): Don't treat other terminals with the
16836 same keyboard specially. Use the terminal-local Vselection_alist.
16837 (x_clear_frame_selections): Use Frun_hook_with_args.
16838
16839 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16840
16841 * xterm.h: Add support for those atoms.
16842
16843 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16844
16845 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16846 (converted_selections, conversion_fail_tag): New global variables.
16847 (x_selection_request_lisp_error): Free the above.
16848 (x_get_local_selection): Remove unnecessary code.
16849 (x_reply_selection_request): Args changed; handle arbitrary array
16850 of converted selections stored in converted_selections.
16851 Separate the XChangeProperty and SelectionNotify steps.
16852 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16853 (x_convert_selection): New function.
16854 (x_handle_selection_event): Simplify.
16855 (x_get_foreign_selection): Don't ignore incoming requests while
16856 waiting for an answer; this will fail when we implement
16857 SAVE_TARGETS, and seems unnecessary anyway.
16858 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16859 (Vx_sent_selection_functions): Doc fix.
16860
16861 2011-05-26 Leo Liu <sdl.web@gmail.com>
16862
16863 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16864
16865 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16866
16867 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16868
16869 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16870 for fringe update if it has periodic bitmap.
16871 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16872 and fringe_bitmap_periodic_p.
16873
16874 * fringe.c (get_fringe_bitmap_data): New function.
16875 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16876 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16877 row. Mark glyph row for fringe update if periodicity changed.
16878
16879 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16880 for fringe update unless it has periodic bitmap.
16881
16882 2011-05-25 Kenichi Handa <handa@m17n.org>
16883
16884 * xdisp.c (get_next_display_element): Set correct it->face_id for
16885 a static composition.
16886
16887 2011-05-24 Leo Liu <sdl.web@gmail.com>
16888
16889 * deps.mk (fns.o):
16890 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16891
16892 * fns.c (crypto_hash_function, Fsha1): New function.
16893 (Fmd5): Use crypto_hash_function.
16894 (syms_of_fns): Add Ssha1.
16895
16896 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16897
16898 * gnutls.c: Remove unused macros.
16899 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16900 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16901 Remove macros that are defined and never used.
16902 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16903
16904 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16905
16906 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16907 (Fx_get_selection_internal): Minor cleanup.
16908 (Fx_own_selection_internal): Rename arguments for consistency with
16909 select.el.
16910
16911 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16912
16913 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16914
16915 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16916
16917 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16918
16919 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16920
16921 * dispnew.c (scrolling_window): Don't exclude the case that the
16922 last enabled row in the desired matrix touches the bottom boundary.
16923
16924 2011-05-21 Glenn Morris <rgm@gnu.org>
16925
16926 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16927 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16928 and add some more files.
16929
16930 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16931
16932 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16933 report_file_error introduced by the change from 2011-05-07.
16934
16935 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16936
16937 * systime.h (Time): Define only if emacs is defined.
16938 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16939 where the include path doesn't have X11/X.h by default. See
16940 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16941
16942 2011-05-20 Kenichi Handa <handa@m17n.org>
16943
16944 * composite.c (find_automatic_composition): Fix previous change.
16945
16946 2011-05-20 Glenn Morris <rgm@gnu.org>
16947
16948 * lisp.mk: New file, split from Makefile.in.
16949 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16950 (shortlisp): Remove.
16951 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16952
16953 2011-05-19 Glenn Morris <rgm@gnu.org>
16954
16955 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16956 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16957 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16958 (lisp): Set the order to that of loadup.el.
16959 (shortlisp): Make it a copy of $lisp.
16960 (SOME_MACHINE_LISP): Remove.
16961 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16962 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16963
16964 2011-05-18 Kenichi Handa <handa@m17n.org>
16965
16966 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16967 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16968 (find_automatic_composition): Mostly rewrite for efficiency.
16969
16970 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16971
16972 * makefile.w32-in: Update dependencies.
16973
16974 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16975
16976 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16977 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16978
16979 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16980
16981 Fix some integer overflow issues, such as string length overflow.
16982
16983 * insdel.c (count_size_as_multibyte): Check for string overflow.
16984
16985 * character.c (lisp_string_width): Check for string overflow.
16986 Use EMACS_INT, not int, for string indexes and lengths; in
16987 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16988 the resulting string length overflows an EMACS_INT; instead,
16989 report a string overflow if no precision given. When checking for
16990 precision exhaustion, use a check that cannot possibly have
16991 integer overflow. (Bug#8675)
16992 * character.h (lisp_string_width): Adjust to new signature.
16993
16994 * alloc.c (string_overflow): New function.
16995 (Fmake_string): Use it. This doesn't change behavior, but saves
16996 a few bytes and will simplify future changes.
16997 * character.c (string_escape_byte8): Likewise.
16998 * lisp.h (string_overflow): New decl.
16999
17000 Fixups, following up to the user-interface timestamp change.
17001 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17002 for UI timestamps, instead of unsigned long.
17003 * msdos.c (mouse_get_pos): Likewise.
17004 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17005 * w32gui.h (Time): Define by including "systime.h" rather than by
17006 declaring it ourselves. (Bug#8664)
17007
17008 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17009 * image.c (clear_image_cache): Likewise.
17010
17011 * term.c (term_mouse_position): Don't assume time_t wraparound.
17012
17013 Be more systematic about user-interface timestamps.
17014 Before, the code sometimes used 'Time', sometimes 'unsigned long',
17015 and sometimes 'EMACS_UINT', to represent these timestamps.
17016 This change causes it to use 'Time' uniformly, as that's what X uses.
17017 This makes the code easier to follow, and makes it easier to catch
17018 integer overflow bugs such as Bug#8664.
17019 * frame.c (Fmouse_position, Fmouse_pixel_position):
17020 Use Time, not unsigned long, for user-interface timestamps.
17021 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17022 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17023 * keyboard.h (last_event_timestamp): Likewise.
17024 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17025 * menu.h (xmenu_show): Likewise.
17026 * term.c (term_mouse_position): Likewise.
17027 * termhooks.h (struct input_event.timestamp): Likewise.
17028 (struct terminal.mouse_position_hook): Likewise.
17029 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17030 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17031 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17032 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17033 what it was before.
17034 * menu.h, termhooks.h: Include "systime.h", for Time.
17035
17036 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17037 Don't assume that the difference between two unsigned long values
17038 can fit into an integer. At this point, we know button_down_time
17039 <= event->timestamp, so the difference must be nonnegative, so
17040 there's no need to cast the result if double-click-time is
17041 nonnegative, as it should be; check that it's nonnegative, just in
17042 case. This bug is triggered when events are more than 2**31 ms
17043 apart (about 25 days). (Bug#8664)
17044
17045 * xselect.c (last_event_timestamp): Remove duplicate decl.
17046 (x_own_selection): Remove needless cast to unsigned long.
17047
17048 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17049 that always fit in int. Use a sentinel instead of a counter, to
17050 avoid a temp and to allay GCC's concerns about possible int overflow.
17051 * frame.h (struct frame): Use int for menu_bar_items_used
17052 instead of EMACS_INT, since it always fits in int.
17053
17054 * menu.c (grow_menu_items): Check for int overflow.
17055
17056 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17057
17058 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17059 Before, the code was not consistent. These values cannot exceed
17060 2**31 - 1 so there's no need to make them unsigned.
17061 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17062 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17063 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17064 as modifiers.
17065 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17066
17067 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17068 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17069 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17070 presumably because the widths might not match.
17071
17072 * window.c (size_window): Avoid needless test at loop start.
17073
17074 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17075
17076 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17077
17078 2011-05-12 Drew Adams <drew.adams@oracle.com>
17079
17080 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17081
17082 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17083
17084 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17085 `width' to `bar_area_x' and `bar_area_width', respectively.
17086 (x_scroll_run): Take account of fringe background extension.
17087
17088 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17089 Rename local vars `left' and `width' to `bar_area_x' and
17090 `bar_area_width', respectively.
17091 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17092 background extension.
17093
17094 2011-05-10 Jim Meyering <meyering@redhat.com>
17095
17096 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17097
17098 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
17099
17100 * image.c (Finit_image_library): Return t for built-in image types,
17101 like pbm and xbm. (Bug#8640)
17102
17103 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17104
17105 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17106
17107 2011-05-07 Eli Zaretskii <eliz@gnu.org>
17108
17109 * w32console.c (Fset_screen_color): Doc fix.
17110 (Fget_screen_color): New function.
17111 (syms_of_ntterm): Defsubr it.
17112
17113 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17114 unlink the temporary file if Fcall_process didn't create it in the
17115 first place.
17116 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17117 child process will be redirected to a file specified with `:file'.
17118 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17119 cue to call_process_cleanup not to close that handle.
17120
17121 2011-05-07 Ben Key <bkey76@gmail.com>
17122
17123 * makefile.w32-in: The bootstrap-temacs rule now makes use of
17124 one of two shell specific rules, either bootstrap-temacs-CMD or
17125 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
17126 to the previous implementation of the bootstrap-temacs rule.
17127 The bootstrap-temacs-CMD rule is similar to the previous
17128 implementation of the bootstrap-temacs rule except that it
17129 makes use of the ESC_CFLAGS variable instead of the CFLAGS
17130 variable.
17131
17132 These changes, along with some changes to nt/configure.bat,
17133 nt/gmake.defs, and nt/nmake.defs, are required to extend my
17134 earlier fix to add support for --cflags and --ldflags options
17135 that include quotes so that it works whether make uses cmd or
17136 sh as the shell.
17137
17138 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
17139
17140 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17141 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17142 is a constant.
17143 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17144 a string. Handle both cases.
17145 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17146 (Fdbus_register_method): Use Qinvalid_function.
17147
17148 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17149
17150 * makefile.w32-in: Update dependencies.
17151 (LISP_H): Add inttypes.h and stdin.h.
17152 (PROCESS_H): Add unistd.h.
17153
17154 2011-05-06 Eli Zaretskii <eliz@gnu.org>
17155
17156 * lread.c: Include limits.h (fixes the MS-Windows build broken by
17157 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17158
17159 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
17160
17161 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17162
17163 * term.c (vfatal): Remove stray call to va_end.
17164 It's not needed and the C Standard doesn't allow it here anyway.
17165
17166 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17167 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
17168
17169 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17170 bytes.
17171
17172 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17173
17174 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17175
17176 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17177
17178 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17179
17180 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17181
17182 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17183 * charset.c (Fdefine_charset_internal): Don't initialize
17184 charset.code_space[15]. The value was garbage, on hosts with
17185 32-bit int (Bug#8600).
17186
17187 * lread.c (read_integer): Be more consistent with string-to-number.
17188 Use string_to_number to do the actual conversion; this avoids
17189 rounding errors and fixes some other screwups. Without this fix,
17190 for example, #x1fffffffffffffff was misread as -2305843009213693952.
17191 (digit_to_number): Move earlier, for benefit of read_integer.
17192 Return -1 if the digit is out of range for the base, -2 if it is
17193 not a digit in any supported base. (Bug#8602)
17194
17195 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17196
17197 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17198 to match comment at start of function. This also removes a
17199 GCC warning about overflow in a 32+64-bit port.
17200
17201 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17202
17203 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17204 Reported by Stefan Monnier in
17205 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17206 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17207 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17208
17209 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17210 (EMACS_UINTPTR): Likewise, with uintptr_t.
17211
17212 * lisp.h: Prefer 64-bit EMACS_INT if available.
17213 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17214 on 32-bit hosts that have 64-bit int, so that they can access
17215 large files.
17216 However, temporarily disable this change unless the temporary
17217 symbol WIDE_EMACS_INT is defined.
17218
17219 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17220
17221 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17222 This removes an assumption that EMACS_INT and long are the same
17223 width as pointers. The assumption is true for Emacs porting targets
17224 now, but we want to make other targets possible.
17225 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17226 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17227 In the rest of the code, change types of integers that hold casted
17228 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17229 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17230 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17231 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17232 No need to cast type when ORing.
17233 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17234 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17235 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17236 assume EMACS_INT is the same width as char *.
17237 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17238 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17239 Remove no-longer-needed casts.
17240 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17241 (xg_tool_bar_help_callback, xg_make_tool_item):
17242 Use EMACS_INTPTR to hold an integer
17243 that will be cast to void *; this can avoid a GCC warning
17244 if EMACS_INT is not the same width as void *.
17245 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17246 * xdisp.c (display_echo_area_1, resize_mini_window_1):
17247 (current_message_1, set_message_1):
17248 Use a local to convert to proper width without a cast.
17249 * xmenu.c (dialog_selection_callback): Likewise.
17250
17251 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17252 Also, don't assume VALBITS / RAND_BITS is less than 5,
17253 and don't rely on undefined behavior when shifting a 1 left into
17254 the sign bit.
17255 * lisp.h (get_random): Change signature to match.
17256
17257 * lread.c (hash_string): Use size_t, not int, for hash computation.
17258 Normally we prefer signed values; but hashing is special, because
17259 it's better to use unsigned division on hash table sizes so that
17260 the remainder is nonnegative. Also, size_t is the natural width
17261 for hashing into memory. The previous code used 'int', which doesn't
17262 retain enough info to hash well into very large tables.
17263 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17264
17265 * dbusbind.c: Don't possibly lose pointer info when converting.
17266 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17267 Use XPNTR rather than XHASH, so that the high-order bits of
17268 the pointer aren't lost when converting through void *.
17269
17270 * eval.c (Fautoload): Don't double-shift a pointer.
17271
17272 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17273
17274 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17275
17276 * gnutls.c (DEF_GNUTLS_FN):
17277 * image.c (DEF_IMGLIB_FN): Make function pointers static.
17278
17279 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
17280
17281 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17282 marker. (Bug#8610)
17283
17284 2011-05-05 Eli Zaretskii <eliz@gnu.org>
17285
17286 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17287 New version that can reserve upto 2GB of heap space.
17288
17289 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
17290
17291 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17292
17293 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
17294
17295 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17296 `gnutls_certificate_set_x509_key_file'.
17297
17298 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
17299
17300 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17301 Update dependencies.
17302
17303 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17304
17305 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17306 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17307 Remove unused parameter `fildes'.
17308 * process.c (read_process_output, send_process): Don't pass it.
17309
17310 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17311
17312 Fix previous change: the library cache is defined in w32.c.
17313 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17314 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17315
17316 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17317
17318 Implement dynamic loading of GnuTLS on Windows.
17319
17320 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17321 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17322 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17323 Declare.
17324
17325 * gnutls.c (Qgnutls_dll): Define.
17326 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17327 (gnutls_*): Declare function pointers.
17328 (init_gnutls_functions): New function to initialize function pointers.
17329 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17330 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17331 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17332 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17333 (emacs_gnutls_write, emacs_gnutls_read)
17334 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17335 (Fgnutls_available_p): New function.
17336 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
17337 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17338 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17339
17340 * image.c: Include w32.h.
17341 (Vimage_type_cache): Delete.
17342 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17343 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17344 (w32_delayed_load): Move to w32.c.
17345
17346 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17347
17348 * w32.c (QCloaded_from, Vlibrary_cache): Define.
17349 (w32_delayed_load): Move from image.c. When loading a library, record
17350 its filename in the :loaded-from property of the library id.
17351 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17352 Initialize and staticpro them.
17353 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17354
17355 * process.c: Include lisp.h before w32.h, not after.
17356 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17357 instead of gnutls_record_check_pending.
17358
17359 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17360
17361 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
17362
17363 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17364 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
17365 as passed in.
17366
17367 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
17368
17369 * xterm.c (x_set_frame_alpha): Do not set property on anything
17370 else than FRAME_X_OUTER_WINDOW (Bug#8608).
17371
17372 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17373
17374 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
17375
17376 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17377
17378 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
17379 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
17380 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
17381 (gnutls_global_initialized, Qgnutls_bootprop_priority)
17382 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
17383 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
17384 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
17385 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
17386 (Qgnutls_bootprop_callbacks_verify): Make static.
17387
17388 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
17389
17390 * callproc.c: Indentation fixup.
17391
17392 * sysdep.c (wait_for_termination_1): Make static.
17393 (wait_for_termination, interruptible_wait_for_termination):
17394 Move after wait_for_termination_1.
17395
17396 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
17397
17398 * sysdep.c (interruptible_wait_for_termination): New function
17399 which is like wait_for_termination, but allows keyboard
17400 interruptions.
17401
17402 * callproc.c (Fcall_process): Add (:file "file") as an option for
17403 the STDOUT buffer.
17404 (Fcall_process_region): Ditto.
17405
17406 2011-04-30 Eli Zaretskii <eliz@gnu.org>
17407
17408 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
17409 rather than `XVECTOR (FOO)->size'.
17410
17411 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
17412 inttypes.h, as a gnulib replacement is used if it not available in
17413 system headers.
17414
17415 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17416
17417 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
17418 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
17419 of MOST_POSITIVE_FIXNUM. (Bug#8528)
17420
17421 * coding.c (coding_alloc_by_realloc): Error out if destination
17422 will grow beyond MOST_POSITIVE_FIXNUM.
17423 (decode_coding_emacs_mule): Abort if there isn't enough place in
17424 charbuf for the composition carryover bytes. Reserve an extra
17425 space for up to 2 characters produced in a loop.
17426 (decode_coding_iso_2022): Abort if there isn't enough place in
17427 charbuf for the composition carryover bytes.
17428
17429 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17430
17431 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
17432 aborting when %lld or %lll format is passed.
17433 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
17434 %llo or %llx format is passed. (Bug#8545)
17435
17436 * window.c (window_scroll_line_based): Use a marker instead of
17437 simple variables to record original value of point. (Bug#7952)
17438
17439 * doprnt.c (doprnt): Fix the case where a multibyte sequence
17440 produced by %s or %c overflows available buffer space. (Bug#8545)
17441
17442 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
17443
17444 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
17445 (SIZE_MAX): Move defn after all includes, as they might #define it.
17446
17447 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17448
17449 * w32.c (init_environment): Warn about defaulting HOME to C:\.
17450
17451 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17452
17453 * keyboard.c (Qdelayed_warnings_hook): Define.
17454 (command_loop_1): Run `delayed-warnings-hook'
17455 if Vdelayed_warnings_list is non-nil.
17456 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
17457 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
17458
17459 2011-04-28 Eli Zaretskii <eliz@gnu.org>
17460
17461 * doprnt.c (doprnt): Don't return value smaller than the buffer
17462 size if the message was truncated. (Bug#8545).
17463
17464 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17465
17466 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
17467 (Fx_window_property): #if-0 the whole functions, not just the bodies.
17468
17469 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17470
17471 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
17472
17473 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
17474
17475 * makefile.w32-in: Update dependencies.
17476
17477 2011-04-27 Eli Zaretskii <eliz@gnu.org>
17478
17479 Improve `doprnt' and its usage. (Bug#8545)
17480 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
17481 `format_end'. Remove support for %l as a conversion specifier.
17482 Don't use xrealloc. Improve diagnostics when the %l size modifier
17483 is used. Update the commentary.
17484
17485 * eval.c (verror): Simplify calculation of size_t.
17486
17487 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
17488 messages.
17489
17490 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
17491
17492 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
17493 change.
17494
17495 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17496
17497 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
17498 This makes this file independent of the recent pseudovector change.
17499
17500 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
17501
17502 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
17503
17504 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
17505 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
17506 Remove unused local.
17507 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
17508
17509 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
17510 GCC 4.6.0 optimizes based on type-based alias analysis.
17511 For example, if b is of type struct buffer * and v of type struct
17512 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
17513 != &v->size, and therefore "v->size = 1; b->size = 2; return
17514 v->size;" must therefore return 1. This assumption is incorrect
17515 for Emacs, since it type-puns struct Lisp_Vector * with many other
17516 types. To fix this problem, this patch adds a new type struct
17517 vectorlike_header that documents the constraints on layout of vectors
17518 and pseudovectors, and helps optimizing compilers not get fooled
17519 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
17520 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
17521 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
17522 the size member.
17523 (XSETPVECTYPE): Rewrite in terms of new macro.
17524 (XSETPVECTYPESIZE): New macro, specifying both type and size.
17525 This is a bit clearer, and further avoids the possibility of
17526 undesirable aliasing.
17527 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
17528 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
17529 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17530 since Lisp_Subr is a special case (no "next" field).
17531 (ASIZE): Now uses header.size rather than size.
17532 All previous uses of XVECTOR (foo)->size replaced to use this macro,
17533 to avoid the hassle of writing XVECTOR (foo)->header.size.
17534 (struct vectorlike_header): New type.
17535 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17536 object, to help avoid aliasing.
17537 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17538 (SUBRP): Likewise, since Lisp_Subr is a special case.
17539 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17540 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17541 (struct Lisp_Hash_Table): Combine first two members into a single
17542 struct vectorlike_header member. All uses of "size" and "next" members
17543 changed to be "header.size" and "header.next".
17544 * buffer.h (struct buffer): Likewise.
17545 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17546 * frame.h (struct frame): Likewise.
17547 * process.h (struct Lisp_Process): Likewise.
17548 * termhooks.h (struct terminal): Likewise.
17549 * window.c (struct save_window_data, struct saved_window): Likewise.
17550 * window.h (struct window): Likewise.
17551 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17552 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17553 * buffer.c (init_buffer_once): Likewise.
17554 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17555 special case.
17556 * process.c (Fformat_network_address): Use local var for size,
17557 for brevity.
17558
17559 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17560
17561 Make the Lisp reader and string-to-float more consistent (Bug#8525)
17562 * data.c (atof): Remove decl; no longer used or needed.
17563 (digit_to_number): Move to lread.c.
17564 (Fstring_to_number): Use new string_to_number function, to be
17565 consistent with how the Lisp reader treats infinities and NaNs.
17566 Do not assume that floating-point numbers represent EMACS_INT
17567 without losing information; this is not true on most 64-bit hosts.
17568 Avoid double-rounding errors, by insisting on integers when
17569 parsing non-base-10 numbers, as the documentation specifies.
17570 * lisp.h (string_to_number): New decl, replacing ...
17571 (isfloat_string): Remove.
17572 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17573 (read1): Do not accept +. and -. as integers; this
17574 appears to have been a coding error. Similarly, do not accept
17575 strings like +-1e0 as floating point numbers. Do not report
17576 overflow for integer overflows unless the base is not 10 which
17577 means we have no simple and reliable way to continue.
17578 Break out the floating-point parsing into a new
17579 function string_to_number, so that Fstring_to_number parses
17580 floating point numbers consistently with the Lisp reader.
17581 (digit_to_number): Move here from data.c. Make it static inline.
17582 (E_CHAR, EXP_INT): Remove, replacing with ...
17583 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17584 (string_to_number): New function, replacing isfloat_string.
17585 This function checks for valid syntax and produces the resulting
17586 Lisp float number too. Rework it so that string-to-number
17587 no longer mishandles examples like "1.0e+". Use strtoumax,
17588 so that overflow for non-base-10 numbers is reported only when
17589 there's no portable and simple way to convert to floating point.
17590
17591 * textprop.c (set_text_properties_1): Rewrite for clarity,
17592 and to avoid GCC warning about integer overflow.
17593
17594 * intervals.h (struct interval): Use EMACS_INT for members
17595 where EMACS_UINT might cause problems. See
17596 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17597 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17598 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17599 All uses changed.
17600 (offset_intervals): Tell GCC not to worry about length overflow
17601 when negating a negative length.
17602
17603 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17604 (overrun_check_free): Likewise.
17605
17606 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17607 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17608 word size.
17609
17610 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17611 (gnutls_make_error): Rename local to avoid shadowing.
17612 (gnutls_emacs_global_deinit): ifdef out; not used.
17613 (Fgnutls_boot): Use const for pointer to readonly storage.
17614 Comment out unused local. Fix pointer signedness problems.
17615
17616 * lread.c (openp): Don't stuff size_t into an 'int'.
17617 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17618 about possible signed overflow.
17619
17620 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17621 (GDK_KEY_g): Don't define if already defined.
17622 (xg_prepare_tooltip): Avoid pointer signedness problem.
17623 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17624
17625 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17626 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
17627
17628 * xfns.c (Fx_window_property): Simplify a bit,
17629 to make a bit faster and to avoid GCC 4.6.0 warning.
17630 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17631
17632 * fns.c (internal_equal): Don't assume size_t fits in int.
17633
17634 * alloc.c (compact_small_strings): Tighten assertion a little.
17635
17636 Replace pEd with more-general pI, and fix some printf arg casts.
17637 * lisp.h (pI): New macro, generalizing old pEd macro to other
17638 conversion specifiers. For example, use "...%"pI"d..." rather
17639 than "...%"pEd"...".
17640 (pEd): Remove. All uses replaced with similar uses of pI.
17641 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17642 * alloc.c (check_pure_size): Don't overflow by converting size to int.
17643 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17644 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17645 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17646 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17647 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17648 64-bit hosts.
17649 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17650 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17651 * print.c (safe_debug_print, print_object): Likewise.
17652 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17653 to int.
17654 Use pI instead of if-then-else-abort. Use %p to avoid casts,
17655 avoiding the 0 flag, which is not portable.
17656 * process.c (Fmake_network_process): Use pI to avoid cast.
17657 * region-cache.c (pp_cache): Likewise.
17658 * xdisp.c (decode_mode_spec): Likewise.
17659 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17660 behavior on 64-bit hosts with printf arg.
17661 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17662 (x_stop_queuing_selection_requests): Likewise.
17663 (x_get_window_property): Don't truncate byte count to an 'int'
17664 when tracing.
17665
17666 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17667 here, since it parses constructs like leading '-' and spaces,
17668 which are not wanted; and it overflows with large numbers.
17669 Instead, simply match F[0-9]+, which is what is wanted anyway.
17670
17671 * alloc.c: Remove unportable assumptions about struct layout.
17672 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17673 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17674 (allocate_vectorlike, make_pure_vector): Use the new macros,
17675 plus offsetof, to remove unportable assumptions about struct layout.
17676 These assumptions hold on all porting targets that I know of, but
17677 they are not guaranteed, they're easy to remove, and removing them
17678 makes further changes easier.
17679
17680 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17681 This doesn't fix a bug but makes the code clearer.
17682 (string_overrun_cookie): Now const. Use initializers that
17683 don't formally overflow signed char, to avoid warnings.
17684 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17685 can cause Emacs to crash when string overrun checking is enabled.
17686 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17687 multiple of sizeof (EMACS_INT); it need not be, if
17688 alignof(EMACS_INT) < sizeof (EMACS_INT).
17689 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17690
17691 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17692
17693 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17694
17695 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17696
17697 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17698 supposed to be handshaking. (Bug#8556)
17699 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17700
17701 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17702
17703 * lisp.h (Qdebug): List symbol.
17704 * eval.c (Qdebug): Restore global linkage.
17705 * keyboard.c (debug-on-event): New variable.
17706 (handle_user_signal): Break into debugger when debug-on-event
17707 matches the current signal symbol.
17708
17709 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17710
17711 * alloc.c (check_sblock, check_string_bytes)
17712 (check_string_free_list): Convert to standard C.
17713
17714 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17715
17716 * w32.c (emacs_gnutls_push): Fix typo.
17717
17718 2011-04-25 Eli Zaretskii <eliz@gnu.org>
17719
17720 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17721 "cast to pointer from integer of different size".
17722
17723 Improve doprnt and its use in verror. (Bug#8545)
17724 * doprnt.c (doprnt): Document the set of format control sequences
17725 supported by the function. Use SAFE_ALLOCA instead of always
17726 using `alloca'.
17727
17728 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17729 is one byte too soon. Don't use xrealloc; instead xfree and
17730 xmalloc anew.
17731
17732 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17733
17734 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17735 callbacks stage.
17736
17737 * gnutls.c: Renamed global_initialized to
17738 gnutls_global_initialized. Added internals for the
17739 :verify-hostname-error, :verify-error, and :verify-flags
17740 parameters of `gnutls-boot' and documented those parameters in the
17741 docstring. Start callback support.
17742 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17743 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17744 on error. Return error code.
17745 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17746 (emacs_gnutls_read): Likewise.
17747 (Fgnutls_boot): Return handshake error code.
17748 (emacs_gnutls_handle_error): New function.
17749 (wsaerror_to_errno): Likewise.
17750
17751 * w32.h (emacs_gnutls_pull): Add prototype.
17752 (emacs_gnutls_push): Likewise.
17753
17754 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17755 (emacs_gnutls_push): Likewise.
17756
17757 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17758
17759 * process.c (wait_reading_process_output): Check if GnuTLS
17760 buffered some data internally if no FDs are set for TLS
17761 connections.
17762
17763 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17764 (LIBS): Link to USER_LIBS.
17765 ($(BLD)/gnutls.$(0)): New target.
17766
17767 2011-04-24 Eli Zaretskii <eliz@gnu.org>
17768
17769 * xdisp.c (handle_single_display_spec): Rename the
17770 display_replaced_before_p argument into display_replaced_p, to
17771 make it consistent with the commentary. Fix typos in the
17772 commentary.
17773
17774 * textprop.c (syms_of_textprop): Remove dead code.
17775 (copy_text_properties): Delete obsolete commentary about an
17776 interface that was deleted long ago. Fix typos in the description
17777 of arguments.
17778
17779 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17780 to changes in oldXMenu/XMenu.h from 2011-04-16.
17781 <menu_help_message, prev_menu_help_message>: Constify.
17782 (IT_menu_make_room): menu->help_text is now `const char **';
17783 adjust.
17784
17785 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17786 to changes in oldXMenu/XMenu.h from 2011-04-16.
17787 (struct XMenu): Declare `help_text' `const char **'.
17788
17789 * xfaces.c <Qunspecified>: Make extern again.
17790
17791 * syntax.c: Include sys/types.h before including regex.h, as
17792 required by POSIX.
17793
17794 * doc.c (get_doc_string): Improve the format passed to `error'.
17795
17796 * doprnt.c (doprnt): Improve commentary.
17797
17798 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17799
17800 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17801 them with etags.
17802
17803 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17804 changes in globals.h immediately force recompilation.
17805 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17806 $(CURDIR)/s/ms-w32.h.
17807 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17808
17809 * character.c (Fchar_direction): Function deleted.
17810 (syms_of_character): Don't defsubr it.
17811 <char-direction-table>: Deleted.
17812
17813 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17814
17815 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17816 * doprnt.c: Include limits.h.
17817 (SIZE_MAX): New macro.
17818 (doprnt): Return a size_t value. 2nd arg is now size_t.
17819 Many local variables are now size_t instead of int or unsigned.
17820 Improve overflow protection. Support `l' modifier for integer
17821 conversions. Support %l conversion. Don't assume an EMACS_INT
17822 argument for integer conversions and for %c.
17823
17824 * lisp.h (doprnt): Restore prototype.
17825
17826 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17827 $(SRC)/character.h.
17828
17829 * Makefile.in (base_obj): Add back doprnt.o.
17830
17831 * deps.mk (doprnt.o): Add back prerequisites.
17832 (callint.o): Depend on character.h.
17833
17834 * eval.c (internal_lisp_condition_case): Include the handler
17835 representation in the error message.
17836 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17837 when breaking from the loop.
17838
17839 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17840
17841 * callint.c (Fcall_interactively): When displaying error message
17842 about invalid control letter, pass the character's codepoint, not
17843 a pointer to its multibyte form. Improve display of the character
17844 in octal and display also its hex code.
17845
17846 * character.c (char_string): Use %x to display the (unsigned)
17847 codepoint of an invalid character, to avoid displaying a bogus
17848 negative value.
17849
17850 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17851 `error', not SYMBOL_NAME itself.
17852
17853 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17854 character arguments to `error'.
17855
17856 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17857 to `error' in error message about FINAL_CHAR argument. Make sure
17858 FINAL_CHAR is a character, and use %c when it is passed as
17859 argument to `error'.
17860
17861 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17862
17863 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17864
17865 * w32.c: Include <time.h>.
17866 (sys_localtime): New function.
17867
17868 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17869
17870 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17871
17872 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17873
17874 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17875
17876 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17877 zombies (Bug#8467).
17878
17879 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17880
17881 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17882 gl_state.e_property when gl_state.object is Qt.
17883
17884 * insdel.c (make_gap_larger): Remove limitation of buffer size
17885 to <= INT_MAX.
17886
17887 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17888
17889 * xdisp.c (lookup_glyphless_char_display)
17890 (produce_glyphless_glyph): Handle cons cell entry in
17891 glyphless-char-display.
17892 (Vglyphless_char_display): Document it.
17893
17894 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17895 glyphless-char-display.
17896
17897 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17898
17899 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17900
17901 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17902
17903 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17904 definition for no-X builds.
17905
17906 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17907
17908 Static checks with GCC 4.6.0 and non-default toolkits.
17909
17910 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17911
17912 * process.c (keyboard_bit_set): Define only if SIGIO.
17913 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17914 (send_process): Repair possible setjmp clobbering.
17915
17916 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17917
17918 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17919
17920 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17921
17922 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17923 Define only if needed.
17924
17925 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17926 by pacifying GCC about it. Maybe it's time to retire it?
17927 * xfaces.c (USG, __TIMEVAL__): Likewise.
17928
17929 * dispextern.h (struct redisplay_interface): Rename param
17930 to avoid shadowing.
17931 * termhooks.h (struct terminal): Likewise.
17932 * xterm.c (xembed_send_message): Likewise.
17933
17934 * insdel.c (make_gap_smaller): Define only if
17935 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17936
17937 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17938 it.
17939
17940 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17941 so that we aren't warned about unused symbols.
17942
17943 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17944
17945 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17946
17947 * xfns.c (x_real_positions): Mark locals as initialized.
17948
17949 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17950
17951 * xterm.c: Fix problems found by static analysis with other toolkits.
17952 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17953 (x_dispatch_event): Declare static if USE_GTK, and
17954 define if USE_GTK || USE_X_TOOLKIT.
17955 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17956 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17957 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17958 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17959
17960 * xmenu.c (menu_help_callback): Pointer type fixes.
17961 Use const pointers when pointing at readonly data. Avoid pointer
17962 signedness clashes.
17963 (FALSE): Remove unused macro.
17964 (update_frame_menubar): Remove unused decl.
17965
17966 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17967
17968 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17969 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17970 (single_menu_item): Rename local to avoid shadowing.
17971
17972 * keyboard.c (make_lispy_event): Remove unused local var.
17973
17974 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17975 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17976
17977 * bitmaps: Change bitmaps from unsigned char back to the X11
17978 compatible char. Avoid the old compiler warnings about
17979 out-of-range initializers by using, for example, '\xab' rather
17980 than 0xab.
17981
17982 * xgselect.c (xgselect_initialize): Check vs interface
17983 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17984
17985 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17986
17987 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17988 to read-only memory.
17989
17990 * fns.c (vector): Remove; this old hack is no longer needed.
17991
17992 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17993 Remove unused var.
17994 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17995
17996 * xrdb.c (x_load_resources): Omit unused local.
17997
17998 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17999 (x_window): Rename locals to avoid shadowing.
18000 (USG): Use the kludged USG macro, to pacify gcc.
18001
18002 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18003 (x_term_init): Remove local to avoid shadowing.
18004
18005 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18006
18007 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18008 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18009
18010 2011-04-16 Eli Zaretskii <eliz@gnu.org>
18011
18012 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18013
18014 Fix regex.c, syntax.c and friends for buffers > 2GB.
18015 * syntax.h (struct gl_state_s): Declare character position members
18016 EMACS_INT.
18017
18018 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18019
18020 * textprop.c (verify_interval_modification, interval_of):
18021 Declare arguments EMACS_INT.
18022
18023 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18024 EMACS_INT.
18025
18026 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18027
18028 * indent.c (Fvertical_motion): Local variable it_start is now
18029 EMACS_INT.
18030
18031 * regex.c (re_match, re_match_2, re_match_2_internal)
18032 (bcmp_translate, regcomp, regexec, print_double_string)
18033 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18034 (re_compile_pattern, re_exec): Declare arguments and local
18035 variables `size_t' and `ssize_t' and return values `regoff_t', as
18036 appropriate.
18037 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18038 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18039 <compile_stack_type>: `size' and `avail' are now `size_t'.
18040
18041 * regex.h <regoff_t>: Use ssize_t, not int.
18042 (re_search, re_search_2, re_match, re_match_2): Arguments that
18043 specify buffer/string position and length are now ssize_t and
18044 size_t. Return type is regoff_t.
18045
18046 2011-04-16 Ben Key <bkey76@gmail.com>
18047
18048 * nsfont.m: Fixed bugs in ns_get_family and
18049 ns_descriptor_to_entity that were caused by using free to
18050 deallocate memory blocks that were allocated by xmalloc (via
18051 xstrdup). This caused Emacs to crash when compiled with
18052 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18053 --enable-checking=xmallocoverrun). xfree is now used to
18054 deallocate these memory blocks.
18055
18056 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
18057
18058 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18059
18060 emacs_write: Accept and return EMACS_INT for sizes.
18061 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18062 et seq.
18063 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18064 Accept and return EMACS_INT.
18065 (emacs_gnutls_write): Return the number of bytes written on
18066 partial writes.
18067 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18068 (emacs_read, emacs_write): Remove check for negative size, as the
18069 Emacs source code has been audited now.
18070 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18071 (emacs_read, emacs_write): Use it.
18072 * process.c (send_process): Adjust to the new signatures of
18073 emacs_write and emacs_gnutls_write. Do not attempt to store
18074 a byte offset into an 'int'; it might overflow.
18075 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18076
18077 * sound.c: Don't assume sizes fit in 'int'.
18078 (struct sound_device.period_size, alsa_period_size):
18079 Return EMACS_INT, not int.
18080 (struct sound_device.write, vox_write, alsa_write):
18081 Accept EMACS_INT, not int.
18082 (wav_play, au_play): Use EMACS_INT to store sizes and to
18083 record read return values.
18084
18085 2011-04-15 Ben Key <bkey76@gmail.com>
18086
18087 * keyboard.c (Qundefined): Don't declare static since it is used
18088 in nsfns.m.
18089 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18090 static since they are used in nsfont.m.
18091
18092 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18093
18094 * process.c (Qprocessp): Don't declare static.
18095 * lisp.h (Qprocessp): Declare again.
18096
18097 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
18098
18099 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18100
18101 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18102
18103 Improve C-level modularity by making more things 'static'.
18104
18105 Don't publish debugger-only interfaces to other modules.
18106 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18107 (verify_bytepos, count_markers): Move decls to the only modules
18108 that need them.
18109 * region-cache.h (pp_cache): Likewise.
18110 * window.h (check_all_windows): Likewise.
18111 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18112
18113 * sysdep.c (croak): Now static, if
18114 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18115 * syssignal.h (croak): Declare only if not static.
18116
18117 * alloc.c (refill_memory_reserve): Now static if
18118 !defined REL_ALLOC || defined SYSTEM_MALLOC.
18119 * lisp.h (refill_memory_reserve): Declare only if not static.
18120
18121 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18122 Define only if USE_LUCID.
18123
18124 * xrdb.c (x_customization_string, x_rm_string): Now static.
18125
18126 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18127 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18128
18129 * xdisp.c (draw_row_with_mouse_face): Now static.
18130 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18131
18132 * window.h (check_all_windows): Mark externally visible.
18133
18134 * window.c (window_deletion_count): Now static.
18135
18136 * undo.c: Make symbols static if they're not exported.
18137 (last_undo_buffer, last_boundary_position, pending_boundary):
18138 Now static.
18139
18140 * textprop.c (interval_insert_behind_hooks): Now static.
18141 (interval_insert_in_front_hooks): Likewise.
18142
18143 * term.c: Make symbols static if they're not exported.
18144 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18145 (max_frame_lines, tty_set_terminal_modes):
18146 (tty_reset_terminal_modes, tty_turn_off_highlight):
18147 (get_tty_terminal): Now static.
18148 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18149 * termhooks.h (term_mouse_moveto): Do not declare if
18150 HAVE_WINDOW_SYSTEM.
18151 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18152 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18153
18154 * sysdep.c: Make symbols static if they're not exported.
18155 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18156 Now static.
18157 (sigprocmask_set, full_mask): Remove; unused.
18158 (wait_debugging): Mark as visible.
18159 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18160 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18161
18162 * syntax.c (syntax_temp): Define only if !__GNUC__.
18163
18164 * sound.c (current_sound_device, current_sound): Now static.
18165
18166 * search.c (searchbufs, searchbuf_head): Now static.
18167
18168 * scroll.c (scroll_cost): Remove; unused.
18169 * dispextern.h (scroll_cost): Remove decl.
18170
18171 * region-cache.h (pp_cache): Mark as externally visible.
18172
18173 * process.c: Make symbols static if they're not exported.
18174 (process_tick, update_tick, create_process, chan_process):
18175 (Vprocess_alist, proc_buffered_char, datagram_access):
18176 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18177 (deactivate_process): Mark defn as static, as well as decl.
18178 * lisp.h (create_process): Remove decl.
18179 * process.h (chan_process, Vprocess_alist): Remove decls.
18180
18181 * print.c: Make symbols static if they're not exported.
18182 (print_depth, new_backquote_output, being_printed, print_buffer):
18183 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18184 (print_interval, print_number_index, initial_stderr_stream):
18185 Now static.
18186 * lisp.h (Fprinc): Remove decl.
18187 (debug_output_compilation_hack): Mark as externally visible.
18188
18189 * sysdep.c (croak): Move decl from here to syssignal.h.
18190 * syssignal.h (croak): Put it here, so the API can be checked when
18191 'croak' is called from dissociate_if_controlling_tty.
18192
18193 * minibuf.c: Make symbols static if they're not exported.
18194 (minibuf_save_list, choose_minibuf_frame): Now static.
18195 * lisp.h (choose_minibuf_frame): Remove decl.
18196
18197 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18198
18199 * lread.c: Make symbols static if they're not exported.
18200 (read_objects, initial_obarray, oblookup_last_bucket_number):
18201 Now static.
18202 (make_symbol): Remove; unused.
18203 * lisp.h (initial_obarray, make_symbol): Remove decls.
18204
18205 * keyboard.c: Make symbols static if they're not exported.
18206 (single_kboard, recent_keys_index, total_keys, recent_keys):
18207 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18208 (this_single_command_key_start, echoing, last_auto_save):
18209 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18210 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18211 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18212 (Vlispy_mouse_stem, double_click_count):
18213 Now static.
18214 (force_auto_save_soon): Define only if SIGDANGER.
18215 (ignore_mouse_drag_p): Now static if
18216 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18217 (print_help): Remove; unused.
18218 (stop_character, last_timer_event): Mark as externally visible.
18219 * keyboard.h (ignore_mouse_drag_p): Declare only if
18220 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18221 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18222 * lisp.h (echoing): Remove decl.
18223 (force_auto_save_soon): Declare only if SIGDANGER.
18224 * xdisp.c (redisplay_window): Simplify code, to make it more
18225 obvious that ignore_mouse_drag_p is not accessed if !defined
18226 USE_GTK && !defined HAVE_NS.
18227
18228 * intervals.c: Make symbols static if they're not exported.
18229 (merge_properties_sticky, merge_interval_right, delete_interval):
18230 Now static.
18231 * intervals.h (merge_interval_right, delete_interval): Remove decls.
18232
18233 * insdel.c: Make symbols static if they're not exported.
18234 However, leave prepare_to_modify_buffer alone. It's never
18235 called from outside this function, but that appears to be a bug.
18236 (combine_after_change_list, combine_after_change_buffer):
18237 (adjust_after_replace, signal_before_change): Now static.
18238 (adjust_after_replace_noundo): Remove; unused.
18239 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18240 (signal_before_change): Remove decls.
18241
18242 * indent.c (val_compute_motion, val_vmotion): Now static.
18243
18244 * image.c: Make symbols static if they're not exported.
18245 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18246 if USE_GTK.
18247 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18248 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18249
18250 * fringe.c (standard_bitmaps): Now static.
18251 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18252
18253 * frame.c: Make symbols static if they're not exported.
18254 (x_report_frame_params, make_terminal_frame): Now static.
18255 (get_frame_param): Now static, unless HAVE_NS.
18256 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18257 (x_get_resource_string): Remove; not used.
18258 * frame.h (make_terminal_frame, x_report_frame_params):
18259 (x_get_resource_string); Remove decls.
18260 (x_fullscreen_adjust): Declare only if WINDOWSNT.
18261 * lisp.h (get_frame_param): Declare only if HAVE_NS.
18262
18263 * font.c, fontset.c: Make symbols static if they're not exported.
18264 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18265 (FACE_SUITABLE_FOR_CHAR_P): Use it.
18266 * font.c (font_close_object): Now static.
18267 * font.h (font_close_object): Remove.
18268 * fontset.c (FONTSET_OBJLIST): Remove.
18269 (free_realized_fontset) #if-0 the body, which does nothing.
18270 (face_suitable_for_char_p): #if-0, as it's never called.
18271 * fontset.h (face_suitable_for_char_p): Remove decl.
18272 * xfaces.c (face_at_string_position):
18273 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18274 since 0 is always ASCII.
18275
18276 * fns.c (weak_hash_tables): Now static.
18277
18278 * fileio.c: Make symbols static if they're not exported.
18279 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18280 (Vwrite_region_annotation_buffers): Now static.
18281
18282 * eval.c: Make symbols static if they're not exported.
18283 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18284 * lisp.h (backtrace_list): Remove decl.
18285
18286 * emacs.c: Make symbols static if they're not exported.
18287 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18288 (fatal_error_code, fatal_error_signal_hook, standard_args):
18289 Now static.
18290 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18291 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18292 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18293 * lisp.h (fatal_error_signal_hook): Remove decl.
18294 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18295
18296 * editfns.c: Move a (normally-unused) function to its only use.
18297 * editfns.c, lisp.h (get_operating_system_release): Remove.
18298 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18299 worth the hassle of breaking this out.
18300
18301 * xterm.c: Make symbols static if they're not exported.
18302 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18303 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18304 (x_destroy_window, x_delete_display):
18305 Now static.
18306 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18307 (x_mouse_leave): Remove; unused.
18308 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18309 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18310 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18311 Remove decls.
18312 (x_mouse_leave): Declare only if WINDOWSNT.
18313 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18314 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18315 USE_X_TOOLKIT.
18316
18317 * ftxfont.c: Make symbols static if they're not exported.
18318 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18319 HAVE_FREETYPE.
18320 * font.h (ftxfont_driver): Likewise.
18321
18322 * xfns.c: Make symbols static if they're not exported.
18323 (x_last_font_name, x_display_info_for_name):
18324 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18325 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18326 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18327 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18328 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18329 (last_show_tip_args): Now static.
18330 (xic_defaut_fontset, xic_create_fontsetname): Define only if
18331 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18332 (x_screen_planes): Remove; unused.
18333 * dispextern.h (x_screen_planes): Remove decl.
18334
18335 * dispnew.c: Make symbols static if they're not exported.
18336 * dispextern.h (redraw_garbaged_frames, scrolling):
18337 (increment_row_positions): Remove.
18338 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18339 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18340 Now static.
18341 (redraw_garbaged_frames): Remove; unused.
18342
18343 * xfaces.c: Make symbols static if they're not exported.
18344 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18345 Remove decls.
18346 * xterm.h (defined_color): Remove decls.
18347 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18348 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18349 (menu_face_changed_default, defined_color, free_realized_face):
18350 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18351 (ascii_face_of_lisp_face): Remove; unused.
18352
18353 * xdisp.c: Make symbols static if they're not exported.
18354 * dispextern.h (scratch_glyph_row, window_box_edges):
18355 (glyph_to_pixel_coords, set_cursor_from_row):
18356 (get_next_display_element, set_iterator_to_next):
18357 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18358 (show_mouse_face): Remove decls
18359 * frame.h (message_buf_print): Likewise.
18360 * lisp.h (pop_message, set_message, check_point_in_composition):
18361 Likewise.
18362 * xterm.h (set_vertical_scroll_bar): Likewise.
18363 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18364 (message_buf_print, scratch_glyph_row, displayed_buffer):
18365 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18366 (get_next_display_element, show_mouse_face, window_box_edges):
18367 (frame_to_window_pixel_xy, check_point_in_composition):
18368 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18369 (glyph_to_pixel_coords): Remove; unused.
18370
18371 * dired.c (file_name_completion): Now static.
18372
18373 * dbusbind.c (xd_in_read_queued_messages): Now static.
18374
18375 * lisp.h (circular_list_error, FOREACH): Remove; unused.
18376 * data.c (circular_list_error): Remove.
18377
18378 * commands.h (last_point_position, last_point_position_buffer):
18379 (last_point_position_window): Remove decls.
18380 * keyboard.c: Make these variables static.
18381
18382 * coding.h (coding, code_convert_region, encode_coding_gap):
18383 Remove decls.
18384 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
18385 (iso_code_class, detect_coding, code_convert_region): Now static.
18386 (encode_coding_gap): Remove; unused.
18387
18388 * chartab.c (chartab_chars, chartab_bits): Now static.
18389
18390 * charset.h (charset_iso_8859_1): Remove decl.
18391 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
18392 Now static.
18393
18394 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
18395 * ccl.c (Vccl_program_table): Now static.
18396 (check_ccl_update): Remove; unused.
18397
18398 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
18399 * category.h: ... from here.
18400 * category.c (check_category_table, set_category_set): Now static.
18401
18402 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
18403 * lisp.h: Remove these decls.
18404
18405 * buffer.c (buffer_count): Remove unused var.
18406
18407 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
18408 so that it's not optimized away.
18409 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
18410 * dispextern.h (bidi_dump_cached_states): Remove, since it's
18411 exported only to the debugger.
18412
18413 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
18414 * atimer.h (run_all_atimers): Remove; not exported.
18415
18416 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
18417 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
18418 was inaccessible from Lisp.
18419 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
18420 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
18421
18422 alloc.c: Import and export fewer symbols, and remove unused items.
18423 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
18424 is defined.
18425 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
18426 it's not optimized away by whole-program optimization.
18427 (message_enable_multibyte, free_misc): Remove.
18428 (catchlist, handlerlist, mark_backtrace):
18429 Declare only if BYTE_MARK_STACK.
18430 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
18431 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
18432 (message_enable_multibyte): Remove decl.
18433 (free_misc, interval_free_list, float_block, float_block_index):
18434 (n_float_blocks, float_free_list, cons_block, cons_block_index):
18435 (cons_free_list, last_marked_index):
18436 Now static.
18437 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
18438 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
18439 (mark_backtrace): Define only if BYTE_MARK_STACK.
18440 * xdisp.c (message_enable_multibyte): Now static.
18441
18442 Declare Lisp_Object Q* variables to be 'static' if not exported.
18443 This makes it easier for human readers (and static analyzers)
18444 to see whether these variables are used from other modules.
18445 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
18446 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
18447 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
18448 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
18449 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
18450 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
18451 * xmenu.c, xselect.c:
18452 Declare Q* vars static if they are not used in other modules.
18453 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
18454 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
18455 Remove decls of unexported vars.
18456 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
18457
18458 * lisp.h (DEFINE_FUNC): Make sname 'static'.
18459
18460 Make Emacs functions such as Fatom 'static' by default.
18461 This makes it easier for human readers (and static analyzers)
18462 to see whether these functions can be called from other modules.
18463 DEFUN now defines a static function. To make the function external
18464 so that it can be used in other C modules, use the new macro DEFUE.
18465 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
18466 (Finit_image_library):
18467 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
18468 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
18469 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
18470 Remove decls, since these functions are now static.
18471 (Funintern, Fget_internal_run_time): New decls, since these functions
18472 were already external.
18473
18474 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
18475 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
18476 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
18477 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
18478 * keyboard.c, keymap.c, lread.c:
18479 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
18480 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
18481 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
18482 Mark functions with DEFUE instead of DEFUN,
18483 if they are used in other modules.
18484 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
18485 decls for now-static functions.
18486 * buffer.h (Fdelete_overlay): Remove decl.
18487 * callproc.c (Fgetenv_internal): Mark as internal.
18488 * composite.c (Fremove_list_of_text_properties): Remove decl.
18489 (Fcomposition_get_gstring): New forward static decl.
18490 * composite.h (Fcomposite_get_gstring): Remove decl.
18491 * dired.c (Ffile_attributes): New forward static decl.
18492 * doc.c (Fdocumntation_property): New forward static decl.
18493 * eval.c (Ffetch_bytecode): New forward static decl.
18494 (Funintern): Remove extern decl; now in .h file where it belongs.
18495 * fileio.c (Fmake_symbolic_link): New forward static decl.
18496 * image.c (Finit_image_library): New forward static decl.
18497 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
18498 * intervals.h (Fprevious_property_change):
18499 (Fremove_list_of_text_properties): Remove decls.
18500 * keyboard.c (Fthis_command_keys): Remove decl.
18501 (Fcommand_execute): New forward static decl.
18502 * keymap.c (Flookup_key): New forward static decl.
18503 (Fcopy_keymap): Now static.
18504 * keymap.h (Flookup_key): Remove decl.
18505 * process.c (Fget_process): New forward static decl.
18506 (Fprocess_datagram_address): Mark as internal.
18507 * syntax.c (Fsyntax_table_p): New forward static decl.
18508 (skip_chars): Remove duplicate decl.
18509 * textprop.c (Fprevious_property_change): New forward static decl.
18510 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
18511 Now internal.
18512 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
18513 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
18514
18515 * editfns.c (Fformat): Remove unreachable code.
18516
18517 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
18518
18519 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
18520 change. (Bug#8496)
18521
18522 2011-04-13 Eli Zaretskii <eliz@gnu.org>
18523
18524 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
18525 when at ZV. (Bug#8487)
18526
18527 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
18528
18529 * charset.c (Fclear_charset_maps): Use xfree instead of free.
18530 (Bug#8437)
18531 * keyboard.c (parse_tool_bar_item): Likewise.
18532 * sound.c (sound_cleanup, alsa_close): Likewise.
18533 * termcap.c (tgetent): Likewise.
18534 * xfns.c (x_default_font_parameter): Likewise.
18535 * xsettings.c (read_and_apply_settings): Likewise.
18536
18537 * alloc.c (overrun_check_malloc, overrun_check_realloc)
18538 (overrun_check_free): Protoize.
18539
18540 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
18541
18542 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18543 since callers should never pass a negative size.
18544 Change the signature to match that of plain 'read' and 'write'; see
18545 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18546 * lisp.h: Update prototypes of emacs_write and emacs_read.
18547
18548 2011-04-11 Eli Zaretskii <eliz@gnu.org>
18549
18550 * xdisp.c (redisplay_window): Don't try to determine the character
18551 position of the scroll margin if the window start point w->startp
18552 is outside the buffer's accessible region. (Bug#8468)
18553
18554 2011-04-10 Eli Zaretskii <eliz@gnu.org>
18555
18556 Fix write-region and its subroutines for buffers > 2GB.
18557 * fileio.c (a_write, e_write): Modify declaration of arguments and
18558 local variables to support buffers larger than 2GB.
18559 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18560
18561 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18562 argument, local variables, and return value.
18563
18564 * lisp.h: Update prototypes of emacs_write and emacs_read.
18565
18566 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18567
18568 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
18569
18570 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18571
18572 Fix more problems found by GCC 4.6.0's static checks.
18573
18574 * xdisp.c (vmessage): Use a better test for character truncation.
18575
18576 * charset.c (load_charset_map): <, not <=, for optimization,
18577 and to avoid potential problems with integer overflow.
18578 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18579 * casetab.c (set_identity, shuffle): Likewise.
18580 * editfns.c (Fformat): Likewise.
18581 * syntax.c (skip_chars): Likewise.
18582
18583 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18584 This also lets GCC 4.6.0 generate slightly better loop code.
18585
18586 * callint.c (Fcall_interactively): <, not <=, for optimization.
18587 (Fcall_interactively): Count the number of arguments produced,
18588 not the number of arguments given. This is simpler and lets GCC
18589 4.6.0 generate slightly better code.
18590
18591 * ftfont.c: Distingish more carefully between FcChar8 and char.
18592 The previous code passed unsigned char * to a functions like
18593 strlen and xstrcasecmp that expect char *, which does not
18594 conform to the C standard.
18595 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18596 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18597 char * when the C standard requires it.
18598
18599 * keyboard.c (read_char): Remove unused var.
18600
18601 * eval.c: Port to Windows vsnprintf (Bug#8435).
18602 Include <limits.h>.
18603 (SIZE_MAX): Define if the headers do not.
18604 (verror): Do not give up if vsnprintf returns a negative count.
18605 Instead, grow the buffer. This ports to Windows vsnprintf, which
18606 does not conform to C99. Problem reported by Eli Zaretskii.
18607 Also, simplify the allocation scheme, by avoiding the need for
18608 calling realloc, and removing the ALLOCATED variable.
18609
18610 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18611
18612 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18613 But keep the doprint source code for now, as we might revamp it
18614 and use it again (Bug#8435).
18615 * lisp.h (doprnt): Remove.
18616 * Makefile.in (base_obj): Remove doprnt.o.
18617 * deps.mk (doprnt.o): Remove.
18618
18619 error: Print 32- and 64-bit integers portably (Bug#8435).
18620 Without this change, on typical 64-bit hosts error ("...%d...", N)
18621 was used to print both 32- and 64-bit integers N, which relied on
18622 undefined behavior.
18623 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18624 * lisp.h (error, verror): Mark as printf-like functions.
18625 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18626 Report overflow in size calculations when allocating printf buffer.
18627 Do not truncate output string at its first null byte.
18628 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18629 Truncate the output at a character boundary, since vsnprintf does not
18630 do that.
18631 * charset.c (check_iso_charset_parameter): Convert internal
18632 character to string before calling 'error', since %c now has the
18633 printf meaning.
18634 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18635 overflow when computing char to be passed to 'error'. Do not
18636 pass Lisp_Object to 'error'; pass the integer instead.
18637 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18638 formatted with plain %d.
18639
18640 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18641
18642 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18643
18644 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18645
18646 * xterm.c (x_catch_errors): Remove duplicate declaration.
18647
18648 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18649
18650 * xdisp.c, lisp.h (message_nolog): Remove; unused.
18651
18652 2011-04-10 Jim Meyering <meyering@redhat.com>
18653
18654 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18655 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18656 return ssize_t not "int", and use size_t as the buffer length.
18657 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18658 * gnutls.h: Update declarations.
18659 * process.c (read_process_output): Use ssize_t, to match.
18660 (send_process): Likewise.
18661
18662 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18663
18664 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18665
18666 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18667
18668 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18669 Use unsigned char, to match FcChar8 type definition.
18670
18671 * xterm.c (handle_one_xevent):
18672 * xmenu.c (create_and_show_popup_menu):
18673 * xselect.c (x_decline_selection_request)
18674 (x_reply_selection_request): Avoid type-punned deref of X events.
18675
18676 2011-04-09 Eli Zaretskii <eliz@gnu.org>
18677
18678 Fix some uses of `int' instead of EMACS_INT.
18679 * search.c (string_match_1, fast_string_match)
18680 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18681 (scan_buffer, find_next_newline_no_quit)
18682 (find_before_next_newline, search_command, Freplace_match)
18683 (Fmatch_data): Make some `int' variables be EMACS_INT.
18684
18685 * xdisp.c (display_count_lines): 3rd argument and return value now
18686 EMACS_INT. All callers changed.
18687 (pint2hrstr): Last argument is now EMACS_INT.
18688
18689 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18690 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18691 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18692 (decode_coding_utf_16, decode_coding_emacs_mule)
18693 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18694 (decode_coding_ccl, decode_coding_charset)
18695 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18696 (decode_coding_iso_2022, decode_coding_emacs_mule)
18697 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18698 <char_offset, last_offset>: Declare EMACS_INT.
18699 (encode_coding_utf_8, encode_coding_utf_16)
18700 (encode_coding_emacs_mule, encode_invocation_designation)
18701 (encode_designation_at_bol, encode_coding_iso_2022)
18702 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18703 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18704 Declare EMACS_INT.
18705 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18706 (encode_invocation_designation): Last argument P_NCHARS is now
18707 EMACS_INT.
18708 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18709 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18710
18711 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18712 All users changed.
18713
18714 * ccl.c (Fccl_execute_on_string): Declare some variables
18715 EMACS_INT.
18716
18717 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
18718
18719 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18720
18721 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18722
18723 * process.c (Fformat_network_address): Doc fix.
18724
18725 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18726
18727 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18728
18729 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18730
18731 * keyboard.c (read_char): Call Lisp function help-form-show,
18732 instead of using internal_with_output_to_temp_buffer.
18733 (Qhelp_form_show): New var.
18734 (syms_of_keyboard): Use DEFSYM macro.
18735
18736 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18737
18738 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18739
18740 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18741
18742 * process.c (Flist_processes): Remove to Lisp.
18743 (list_processes_1): Delete.
18744
18745 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18746
18747 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18748
18749 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18750
18751 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
18752
18753 Fix more problems found by GCC 4.6.0's static checks.
18754
18755 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18756
18757 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18758
18759 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18760
18761 * xdisp.c (vmessage): Mark as a printf-like function.
18762
18763 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18764
18765 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18766
18767 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18768 printf-like functions.
18769 (tiff_load): Add casts to remove these marks before passing them
18770 to system-supplied API.
18771
18772 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18773
18774 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18775 This avoids several warnings with gcc -Wstrict-overflow.
18776 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18777 directly, rather than having caller test rule sign. This avoids
18778 some unnecessary tests.
18779 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18780 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18781 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18782
18783 * xfont.c (xfont_text_extents): Remove var that was set but not used.
18784 (xfont_open): Avoid unnecessary tests.
18785
18786 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18787
18788 * composite.h, composite.c (composition_gstring_put_cache):
18789 Use EMACS_INT, not int, for length.
18790
18791 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18792 breaking out part of COMPOSITION_DECODE_RULE.
18793 (COMPOSITION_DECODE_RULE): Use it.
18794 * composite.c (get_composition_id): Remove unused local vars,
18795 by using the new macro.
18796
18797 * textprop.c (set_text_properties_1): Change while to do-while,
18798 since the condition is always true at first.
18799
18800 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18801 (interval_deletion_adjustment): Return unsigned value.
18802 All uses changed.
18803
18804 * process.c (list_processes_1, create_pty, read_process_output):
18805 (exec_sentinel): Remove vars that were set but not used.
18806 (create_pty): Remove unnecessary "volatile"s.
18807 (Fnetwork_interface_info): Avoid possibility of int overflow.
18808 (read_process_output): Do adaptive read buffering even if carryover.
18809 (read_process_output): Simplify nbytes computation if buffered.
18810
18811 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18812
18813 * syntax.c (scan_words): Remove var that was set but not used.
18814 (update_syntax_table): Use unsigned instead of int.
18815
18816 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18817 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18818 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18819
18820 * print.c (print_error_message): Avoid int overflow.
18821
18822 * font.c (font_list_entities): Redo for clarity,
18823 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18824
18825 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18826 (font_score): Avoid potential overflow in diff calculation.
18827
18828 * fns.c (substring_both): Remove var that is set but not used.
18829 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18830
18831 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18832
18833 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18834 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18835 can always succeed if overflow has undefined behavior.
18836
18837 * search.c (boyer_moore, wordify): Remove vars set but not used.
18838 (wordify): Omit three unnecessary tests.
18839
18840 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18841 All callers changed. This avoids the need for an unused var.
18842
18843 * casefiddle.c (casify_region): Remove var that is set but not used.
18844
18845 * dired.c (file_name_completion): Remove var that is set but not used.
18846
18847 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18848
18849 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18850 (Finsert_file_contents): Remove unnecessary code checking fd.
18851
18852 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18853 Check for integer overflow on size calculations.
18854
18855 * buffer.c (Fprevious_overlay_change): Remove var that is set
18856 but not used.
18857
18858 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18859 Remove vars that are set but not used.
18860 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18861 (timer_check_2): Mark vars as initialized.
18862
18863 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18864
18865 * image.c (lookup_image): Remove var that is set but not used.
18866 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18867
18868 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18869 that are set but not used.
18870
18871 * xfns.c (make_invisible_cursor): Don't return garbage
18872 if XCreateBitmapFromData fails (Bug#8410).
18873
18874 * xselect.c (x_get_local_selection, x_handle_property_notify):
18875 Remove vars that are set but not used.
18876
18877 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18878 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18879
18880 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18881 Remove var that is set but not used.
18882 (scroll_bar_windows_size): Now size_t, not int.
18883 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18884 Check for overflow.
18885
18886 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18887 (map_tty_color) [!defined MSDOS]: Likewise.
18888
18889 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18890
18891 * coding.c: Remove vars that are set but not used.
18892 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18893 All callers changed.
18894 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18895 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18896 (decode_coding_charset): Remove vars that are set but not used.
18897
18898 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18899 that is set but not used.
18900
18901 * print.c (print_object): Remove var that is set but not used.
18902
18903 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18904 The gnulib version avoids calling malloc in the usual case,
18905 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18906 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18907 * filelock.c (current_lock_owner): Likewise.
18908 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18909 * sysdep.c: Include allocator.h, careadlinkat.h.
18910 (emacs_no_realloc_allocator): New static constant.
18911 (emacs_readlink): New function.
18912 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18913 ../lib/careadlinkat.h.
18914
18915 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18916
18917 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18918 first non-nil return value).
18919
18920 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18921
18922 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18923 if not defined (Bug#8403).
18924
18925 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18926
18927 * xdisp.c (display_count_lines): Remove parameter `start',
18928 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18929 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18930 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18931 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18932 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18933 and thereabouts. All callers changed.
18934 (get_per_char_metric): Remove parameter `f', unused since
18935 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18936
18937 2011-04-02 Jim Meyering <meyering@redhat.com>
18938
18939 do not dereference NULL upon failed strdup
18940 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18941 (ns_get_family): Likewise.
18942
18943 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18944
18945 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18946
18947 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18948
18949 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18950 later (Bug#8403).
18951
18952 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18953
18954 Add lexical binding.
18955
18956 * window.c (Ftemp_output_buffer_show): New fun.
18957 (Fsave_window_excursion):
18958 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18959
18960 * lread.c (lisp_file_lexically_bound_p): New function.
18961 (Fload): Bind Qlexical_binding.
18962 (readevalloop): Remove `evalfun' arg.
18963 Bind Qinternal_interpreter_environment.
18964 (Feval_buffer): Bind Qlexical_binding.
18965 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18966 Mark as dynamic.
18967 (syms_of_lread): Declare `lexical-binding'.
18968
18969 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18970
18971 * keyboard.c (eval_dyn): New fun.
18972 (menu_item_eval_property): Use it.
18973
18974 * image.c (parse_image_spec): Use Ffunctionp.
18975
18976 * fns.c (concat, mapcar1): Accept byte-code-functions.
18977
18978 * eval.c (Fsetq): Handle lexical vars.
18979 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18980 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18981 (FletX, Flet): Obey lexical binding.
18982 (Fcommandp): Handle closures.
18983 (Feval): New `lexical' arg.
18984 (eval_sub): New function extracted from Feval. Use it almost
18985 everywhere where Feval was used. Look up vars in lexical env.
18986 Handle closures.
18987 (Ffunctionp): Move from subr.el.
18988 (Ffuncall): Handle closures.
18989 (apply_lambda): Remove `eval_flags'.
18990 (funcall_lambda): Handle closures and new byte-code-functions.
18991 (Fspecial_variable_p): New function.
18992 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18993 but without exporting it to Lisp.
18994
18995 * doc.c (Fdocumentation, store_function_docstring):
18996 * data.c (Finteractive_form): Handle closures.
18997
18998 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18999 interactive spec.
19000
19001 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19002 New byte-codes.
19003 (exec_byte_code): New function extracted from Fbyte_code to handle new
19004 calling convention for byte-code-functions. Add new byte-codes.
19005
19006 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19007
19008 * alloc.c (Fmake_symbol): Init new `declared_special' field.
19009
19010 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19011
19012 * xdisp.c (redisplay_internal): Fix prototype.
19013
19014 2011-03-31 Eli Zaretskii <eliz@gnu.org>
19015
19016 * xdisp.c (SCROLL_LIMIT): New macro.
19017 (try_scrolling): Use it when setting scroll_limit.
19018 Limit scrolling to 100 screen lines.
19019 (redisplay_window): Even when falling back on "recentering",
19020 position point in the window according to scroll-conservatively,
19021 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19022
19023 (try_scrolling): When point is above the window, allow searching
19024 as far as scroll_max, or one screenful, to compute vertical
19025 distance from PT to the scroll margin position. This prevents
19026 try_scrolling from unnecessarily failing when
19027 scroll-conservatively is set to a value slightly larger than the
19028 window height. Clean up the case of PT below the margin at bottom
19029 of window: scroll_max can no longer be INT_MAX. When aggressive
19030 scrolling is in use, don't let point enter the opposite scroll
19031 margin as result of the scroll.
19032 (syms_of_xdisp) <scroll-conservatively>: Document the
19033 threshold of 100 lines for never-recentering scrolling.
19034
19035 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19036
19037 * dispextern.h (move_it_by_lines):
19038 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19039 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19040 (message_log_check_duplicate): Remove parameters `prev_bol' and
19041 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19042 (redisplay_internal): Remove parameter `preserve_echo_area',
19043 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19044
19045 * indent.c (Fvertical_motion):
19046 * window.c (window_scroll_pixel_based, Frecenter):
19047 Don't pass `need_y_p' to `move_it_by_lines'.
19048
19049 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19050
19051 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19052 steal a few bits to be more compact.
19053 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19054 Remove unneeded casts.
19055
19056 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19057
19058 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19059
19060 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19061 binding" message (bug#7967).
19062
19063 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19064
19065 Fix more problems found by GCC 4.6.0's static checks.
19066
19067 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19068 Remove unused local var.
19069
19070 * editfns.c (Fmessage_box): Remove unused local var.
19071
19072 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19073 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19074 Omit unused local vars.
19075 * window.c (shrink_windows): Omit unused local var.
19076 * menu.c (digest_single_submenu): Omit unused local var.
19077 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19078 Omit unused local var.
19079
19080 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19081 Don't assume string length fits in int.
19082 (keyremap_step, read_key_sequence): Use size_t for sizes.
19083 (read_key_sequence): Don't check last_real_key_start redundantly.
19084
19085 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19086 instead of alloca (Bug#8344).
19087
19088 * eval.c (Fbacktrace): Don't assume nargs fits in int.
19089 (Fbacktrace_frame): Don't assume nframes fits in int.
19090
19091 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19092
19093 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19094 concerns.
19095
19096 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19097
19098 * cm.c (calccost): Turn while-do into do-while, for clarity.
19099
19100 * keyboard.c (syms_of_keyboard): Use the same style as later
19101 in this function when indexing through an array. This also
19102 works around GCC bug 48267.
19103
19104 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19105
19106 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19107
19108 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19109 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19110
19111 * keyboard.c, keyboard.h (num_input_events): Now size_t.
19112 This avoids undefined behavior on integer overflow, and is a bit
19113 more convenient anyway since it is compared to a size_t variable.
19114
19115 Variadic C functions now count arguments with size_t, not int.
19116 This avoids an unnecessary limitation on 64-bit machines, which
19117 caused (substring ...) to crash on large vectors (Bug#8344).
19118 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19119 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19120 All variadic functions and their callers changed accordingly.
19121 (struct gcpro.nvars): Now size_t, not int. All uses changed.
19122 * data.c (arith_driver, float_arith_driver): Likewise.
19123 * editfns.c (general_insert_function): Likewise.
19124 * eval.c (struct backtrace.nargs, interactive_p)
19125 (internal_condition_case_n, run_hook_with_args, apply_lambda)
19126 (funcall_lambda, mark_backtrace): Likewise.
19127 * fns.c (concat): Likewise.
19128 * frame.c (x_set_frame_parameters): Likewise.
19129 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19130 0 if not found, not -1. All callers changed.
19131
19132 * alloc.c (garbage_collect): Don't assume stack size fits in int.
19133 (stack_copy_size): Now size_t, not int.
19134 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19135
19136 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19137
19138 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19139 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19140 All callers changed.
19141
19142 * lisp.h (multibyte_char_to_unibyte):
19143 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19144 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19145 * character.h (CHAR_TO_BYTE8):
19146 * cmds.c (internal_self_insert):
19147 * editfns.c (general_insert_function):
19148 * keymap.c (push_key_description):
19149 * search.c (Freplace_match):
19150 * xdisp.c (message_dolog, set_message_1): All callers changed.
19151
19152 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19153
19154 * keyboard.c (safe_run_hook_funcall): New function.
19155 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19156 don't set the hook to nil, but remove the offending function instead.
19157 (Qcommand_hook_internal): Remove, unused.
19158 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19159 Vcommand_hook_internal.
19160
19161 * eval.c (enum run_hooks_condition): Remove.
19162 (funcall_nil, funcall_not): New functions.
19163 (run_hook_with_args): Call each function through a `funcall' argument.
19164 Remove `cond' argument, now redundant.
19165 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19166 (Frun_hook_with_args_until_failure): Adjust accordingly.
19167 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19168
19169 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19170
19171 * dispextern.h (string_buffer_position): Remove declaration.
19172
19173 * print.c (strout): Remove parameter `multibyte', unused since
19174 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19175
19176 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19177 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19178 All callers changed.
19179
19180 * w32.c (_wsa_errlist): Use braces for struct initializers.
19181
19182 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19183 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19184 All callers changed.
19185 (string_buffer_position): Likewise. Also, make static (it's never
19186 used outside xdisp.c).
19187 (cursor_row_p): Remove parameter `w', unused since
19188 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
19189 (decode_mode_spec): Remove parameter `precision', introduced during
19190 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19191 All callers changed.
19192
19193 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19194
19195 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19196
19197 2011-03-27 Anders Lindgren <andlind@gmail.com>
19198
19199 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19200 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19201 (ns_update_auto_hide_menu_bar): New functions.
19202 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19203 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19204 ns_constrain_all_frames.
19205 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19206 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19207
19208 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19209
19210 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19211
19212 2011-03-27 Glenn Morris <rgm@gnu.org>
19213
19214 * syssignal.h: Replace RETSIGTYPE with void.
19215 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19216 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19217 Replace SIGTYPE with void everywhere.
19218 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19219 * s/template.h (SIGTYPE): Remove commented out definition.
19220
19221 2011-03-26 Eli Zaretskii <eliz@gnu.org>
19222
19223 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19224 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19225
19226 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
19227
19228 * w32.c (read_unc_volume): Use parameter `henum', instead of
19229 global variable `wget_enum_handle'.
19230
19231 * keymap.c (describe_vector): Remove parameters `indices' and
19232 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19233 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19234
19235 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19236
19237 * keyboard.c (timer_check): Remove parameter `do_it_now',
19238 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19239 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19240 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19241
19242 * keyboard.c (read_char):
19243 * w32menu.c (w32_menu_display_help):
19244 * xmenu.c (show_help_event, menu_help_callback):
19245 Adjust calls to `show_help_echo'.
19246
19247 * gtkutil.c (xg_maybe_add_timer):
19248 * keyboard.c (readable_events):
19249 * process.c (wait_reading_process_output):
19250 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19251
19252 * insdel.c (adjust_markers_gap_motion):
19253 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19254 (gap_left, gap_right): Don't call it.
19255
19256 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
19257
19258 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19259 incurred during fontification.
19260
19261 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19262
19263 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19264 (DEFVAR_PER_BUFFER): Don't pass it.
19265
19266 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19267 (scrolling_window): Don't pass it.
19268
19269 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19270
19271 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19272
19273 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19274 and `suffix'.
19275 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19276 of variables specific to SELinux and computation of `encoded_absname'.
19277
19278 * image.c (XPutPixel): Remove unused variable `height'.
19279
19280 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19281
19282 * unexw32.c (get_section_info): Remove unused variable `section'.
19283
19284 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19285 (system_process_attributes): Remove unused variable `sess'.
19286 (sys_read): Remove unused variable `err'.
19287
19288 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19289 (w32_wnd_proc): Remove unused variable `isdead'.
19290 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19291 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19292 (x_create_tip_frame): Remove unused variable `tem'.
19293
19294 * w32inevt.c (w32_console_read_socket):
19295 Remove unused variable `no_events'.
19296
19297 * w32term.c (x_draw_composite_glyph_string_foreground):
19298 Remove unused variable `width'.
19299
19300 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
19301
19302 * w32term.c (x_set_glyph_string_clipping):
19303 Don't pass uninitialized region to CombineRgn.
19304
19305 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
19306
19307 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19308 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19309 (Fx_close_connection): Remove unused variable `i'.
19310
19311 * w32font.c (w32font_draw): Return number of glyphs.
19312 (w32font_open_internal): Remove unused variable `i'.
19313 (w32font_driver): Add missing initializer.
19314
19315 * w32menu.c (utf8to16): Remove unused variable `utf16'.
19316 (fill_in_menu): Remove unused variable `items_added'.
19317
19318 * w32term.c (last_mouse_press_frame): Remove static global variable.
19319 (w32_clip_to_row): Remove unused variable `f'.
19320 (x_delete_terminal): Remove unused variable `i'.
19321
19322 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19323 (NOTHING): Remove unused static global variable.
19324 (uniscribe_check_otf): Remove unused variable `table'.
19325 (uniscribe_font_driver): Add missing initializers.
19326
19327 2011-03-23 Julien Danjou <julien@danjou.info>
19328
19329 * term.c (Fsuspend_tty, Fresume_tty):
19330 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19331 * window.c (temp_output_buffer_show):
19332 * insdel.c (signal_before_change):
19333 * frame.c (Fhandle_switch_frame):
19334 * fileio.c (Fdo_auto_save):
19335 * emacs.c (Fkill_emacs):
19336 * editfns.c (save_excursion_restore):
19337 * cmds.c (internal_self_insert):
19338 * callint.c (Fcall_interactively):
19339 * buffer.c (Fkill_all_local_variables):
19340 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19341 Use Frun_hooks.
19342 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
19343 unconditionally since it does the check itself.
19344
19345 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
19346
19347 Fix more problems found by GCC 4.5.2's static checks.
19348
19349 * coding.c (encode_coding_raw_text): Avoid unnecessary test
19350 the first time through the loop, since we know p0 < p1 then.
19351 This also avoids a gcc -Wstrict-overflow warning.
19352
19353 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19354 leading to a memory leak, possible in functions like
19355 load_charset_map_from_file that can allocate an unbounded number
19356 of objects (Bug#8318).
19357
19358 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19359 that could (at least in theory) be that large.
19360
19361 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19362 This is less likely to overflow, and avoids undefined behavior if
19363 overflow does occur. All callers changed. Use strtoul to scan
19364 for the unsigned long integer.
19365 (pint2hrstr): Simplify and tune code slightly.
19366 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19367
19368 * scroll.c (do_scrolling): Work around GCC bug 48228.
19369 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19370
19371 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19372 This also avoids a warning with gcc -Wstrict-overflow.
19373 (validate_x_resource_name): Simplify count usage.
19374 This also avoids a warning with gcc -Wstrict-overflow.
19375
19376 * fileio.c (Fcopy_file): Report error if fchown or fchmod
19377 fail (Bug#8306).
19378
19379 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
19380
19381 * process.c (Fmake_network_process): Use socklen_t, not int,
19382 where POSIX says socklen_t is required in portable programs.
19383 This fixes a porting bug on hosts like 64-bit HP-UX, where
19384 socklen_t is wider than int (Bug#8277).
19385 (Fmake_network_process, server_accept_connection):
19386 (wait_reading_process_output, read_process_output):
19387 Likewise.
19388
19389 * process.c: Rename or move locals to avoid shadowing.
19390 (list_processes_1, Fmake_network_process):
19391 (read_process_output_error_handler, exec_sentinel_error_handler):
19392 Rename or move locals.
19393 (Fmake_network_process): Define label "retry_connect" only if needed.
19394 (Fnetwork_interface_info): Fix pointer signedness.
19395 (process_send_signal): Add cast to avoid pointer signedness problem.
19396 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
19397 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
19398
19399 Make tparam.h and terminfo.c consistent.
19400 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
19401 Include tparam.h instead, since it declares them.
19402 * cm.h (PC): Remove extern decl; tparam.h now does this.
19403 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
19404 * terminfo.c: Include tparam.h, to check interfaces.
19405 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
19406 (tparam): Adjust signature to match interface in tparam.h;
19407 this removes some undefined behavior. Check that outstring and len
19408 are zero, which they always are with Emacs.
19409 * tparam.h (PC, BC, UP): New extern decls.
19410
19411 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
19412 (xftfont_open): Rename locals to avoid shadowing.
19413
19414 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
19415 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
19416 (OTF_TAG_SYM): Omit macro if not needed.
19417 (ftfont_list): Remove unused local.
19418 (get_adstyle_property, ftfont_pattern_entity):
19419 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
19420 Rename locals to avoid shadowing.
19421
19422 * xfont.c (xfont_list_family): Mark var as initialized.
19423
19424 * xml.c (make_dom): Now static.
19425
19426 * composite.c (composition_compute_stop_pos): Rename local to
19427 avoid shadowing.
19428 (composition_reseat_it): Remove unused locals.
19429 (find_automatic_composition, composition_adjust_point): Likewise.
19430 (composition_update_it): Mark var as initialized.
19431 (find_automatic_composition): Mark vars as initialized,
19432 with a FIXME (Bug#8290).
19433
19434 character.h: Rename locals to avoid shadowing.
19435 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
19436 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
19437 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
19438 (BUF_DEC_POS): Be more systematic about renaming local temporaries
19439 to avoid shadowing.
19440
19441 * textprop.c (property_change_between_p): Remove; unused.
19442
19443 * intervals.c (interval_start_pos): Now static.
19444
19445 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
19446
19447 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
19448 Rename locals to avoid shadowing.
19449
19450 * sound.c (wav_play, au_play, Fplay_sound_internal):
19451 Fix pointer signedness.
19452 (alsa_choose_format): Remove unused local var.
19453 (wav_play): Initialize a variable to 0, to prevent undefined
19454 behavior (Bug#8278).
19455
19456 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
19457
19458 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
19459
19460 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
19461 clobbering (Bug#8298).
19462 * sysdep.c (sys_subshell): Likewise.
19463 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
19464
19465 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
19466 This should get cleaned up, so that child_setup has the
19467 same signature on all platforms.
19468
19469 * callproc.c (call_process_cleanup): Now static.
19470 (relocate_fd): Rename locals to avoid shadowing.
19471
19472 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
19473
19474 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
19475 not to be necessary, and produces flickering.
19476
19477 2011-03-20 Glenn Morris <rgm@gnu.org>
19478
19479 * config.in: Remove file.
19480
19481 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
19482
19483 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
19484 are now in src/globals.h.
19485 (syms_of_minibuf): Remove spurious & from previous change.
19486
19487 2011-03-20 Leo Liu <sdl.web@gmail.com>
19488
19489 * minibuf.c (completing-read-function): New variable.
19490 (completing-read-default): Rename from completing-read.
19491 (completing-read): Call completing-read-function.
19492
19493 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19494
19495 * xfaces.c (Fx_load_color_file):
19496 Read color file from absolute filename (bug#8250).
19497
19498 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19499
19500 * makefile.w32-in: Update dependencies.
19501
19502 2011-03-17 Eli Zaretskii <eliz@gnu.org>
19503
19504 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
19505
19506 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
19507
19508 Fix more problems found by GCC 4.5.2's static checks.
19509
19510 * process.c (make_serial_process_unwind, send_process_trap):
19511 (sigchld_handler): Now static.
19512
19513 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
19514 That way, the code declares only the vars that it needs.
19515 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
19516 * s/cygwin.h (PTY_ITERATION): Likewise.
19517 * s/darwin.h (PTY_ITERATION): Likewise.
19518 * s/gnu-linux.h (PTY_ITERATION): Likewise.
19519
19520 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
19521 * process.c (allocate_pty): Don't declare stb unless it's needed.
19522
19523 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19524 (CONSTANTLIM): Remove; unused.
19525 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
19526 Define only if needed.
19527
19528 * unexelf.c (unexec): Name an expression,
19529 to avoid gcc -Wbad-function-cast warning.
19530 Use a different way to cause a compilation error if anyone uses
19531 n rather than nn, a way that does not involve shadowing.
19532 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
19533
19534 * deps.mk (unexalpha.o): Remove; unused.
19535
19536 New file unexec.h, the (simple) interface for unexec (Bug#8267).
19537 * unexec.h: New file.
19538 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19539 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19540 Depend on unexec.h.
19541 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19542 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19543 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19544 Change as necessary to match prototype in unexec.h.
19545
19546 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19547 shadowing.
19548 (back_comment, skip_chars): Mark vars as initialized.
19549
19550 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19551 Rename locals to avoid shadowing.
19552
19553 * lread.c (read1): Rewrite so as not to use empty "else".
19554 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19555
19556 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19557
19558 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19559 warning when compiling print.c.
19560
19561 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19562 instead of using an uninitialized var.
19563 (font_sort_entities): Mark var as initialized.
19564
19565 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19566
19567 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19568 pointers to constants.
19569 (font_parse_fcname): Remove unused vars.
19570 (font_delete_unmatched): Now static.
19571 (font_get_spec): Remove; unused.
19572 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19573 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19574 Rename or move locals to avoid shadowing.
19575
19576 * fns.c (require_nesting_list, require_unwind): Now static.
19577 (Ffillarray): Rename locals to avoid shadowing.
19578
19579 * floatfns.c (domain_error2): Define only if needed.
19580 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19581
19582 * alloc.c (mark_backtrace): Move decl from here ...
19583 * lisp.h: ... to here, so that it can be checked.
19584
19585 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19586 (Fdefvar): Rewrite so as not to use empty "else".
19587 (lisp_indirect_variable): Name an expression,
19588 to avoid gcc -Wbad-function-cast warning.
19589 (Fdefvar): Rename locals to avoid shadowing.
19590
19591 * callint.c (quotify_arg, quotify_args): Now static.
19592 (Fcall_interactively): Rename locals to avoid shadowing.
19593 Use const pointer when appropriate.
19594
19595 * lisp.h (get_system_name, get_operating_system_release):
19596 Move decls here, to check interfaces.
19597 * process.c (get_operating_system_release): Move decl to lisp.h.
19598 * xrdb.c (get_system_name): Likewise.
19599 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19600 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19601 some of which prompt warnings from gcc -Wbad-function-cast.
19602 (Fformat_time_string, Fencode_time, Finsert_char):
19603 (Ftranslate_region_internal, Fformat):
19604 Rename or remove local vars to avoid shadowing.
19605 (Ftranslate_region_internal): Mark var as initialized.
19606
19607 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19608 avoid shadowing.
19609
19610 * lisp.h (eassert): Check that the argument compiles, even if
19611 ENABLE_CHECKING is not defined.
19612
19613 * data.c (Findirect_variable): Name an expression, to avoid
19614 gcc -Wbad-function-cast warning.
19615 (default_value, arithcompare, arith_driver, arith_error): Now static.
19616 (store_symval_forwarding): Rename local to avoid shadowing.
19617 (Fmake_variable_buffer_local, Fmake_local_variable):
19618 Mark variables as initialized.
19619 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
19620
19621 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
19622 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19623 Rename locals to avoid shadowing.
19624 (mark_stack): Move local variables into the #ifdef region where
19625 they're used.
19626 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19627 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19628 needed otherwise.
19629 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19630 (GC_STRING_CHARS): Remove; not used.
19631 (Fmemory_limit): Cast sbrk's returned value to char *.
19632
19633 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19634 avoids undefined behavior in theory.
19635
19636 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19637
19638 Use functions, not macros, for up- and down-casing (Bug#8254).
19639 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19640 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
19641 to use the following functions instead of these macros.
19642 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
19643 EMACS_INT, since callers assume the returned value fits in int.
19644 (upcase1): Likewise, for UPCASE_TABLE.
19645 (uppercasep, lowercasep, upcase): New static inline functions.
19646 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19647 the race-condition problem in the old DOWNCASE.
19648
19649 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19650 Rename locals to avoid shadowing.
19651 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19652 (regex_compile, re_search_2, re_match_2_internal):
19653 Remove unused local vars.
19654 (FREE_VAR): Rewrite so as not to use empty "else",
19655 which gcc can warn about.
19656 (regex_compile, re_match_2_internal): Mark locals as initialized.
19657 (RETALLOC_IF): Define only if needed.
19658 (WORDCHAR_P): Likewise. This one is never needed, but is used
19659 only in a comment talking about a compiler bug, so put inside
19660 the #if 0 of that comment.
19661 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19662 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19663 Remove; unused.
19664
19665 * search.c (boyer_moore): Rename locals to avoid shadowing.
19666 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19667 (PREV_CHAR_BOUNDARY): Likewise.
19668
19669 * search.c (simple_search): Remove unused var.
19670
19671 * dired.c (compile_pattern): Move decl from here ...
19672 * lisp.h: ... to here, so that it can be checked.
19673 (struct re_registers): New forward decl.
19674
19675 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19676
19677 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19678 All uses changed.
19679 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19680 Rename locals to avoid shadowing.
19681 (Fvertical_motion): Mark locals as initialized.
19682
19683 * casefiddle.c (casify_object, casify_region): Now static.
19684 (casify_region): Mark local as initialized.
19685
19686 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19687
19688 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19689 New macros, so that the caller can use some names other than
19690 gcpro1, gcpro2, etc.
19691 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19692 of the new macros.
19693 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19694 argument, for consistency with GCPRO2_VAR, etc: it is now the
19695 prefix of the variable, not the variable itself. All uses
19696 changed.
19697 * dired.c (directory_files_internal, file_name_completion):
19698 Rename locals to avoid shadowing.
19699
19700 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19701 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19702 dired.c's scmp function, had undefined behavior.
19703 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19704 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19705 * buffer.h: ... to here, because these macros use current_buffer,
19706 and the new implementation with inline functions needs to have
19707 current_buffer in scope now, rather than later when the macros
19708 are used.
19709 (downcase, upcase1): New static inline functions.
19710 (DOWNCASE, UPCASE1): Reimplement using these functions.
19711 This avoids undefined behavior in expressions like
19712 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19713 from race conditions in accessing the global variables
19714 case_temp1 and case_temp2.
19715 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19716 * lisp.h (case_temp1, case_temp2): Remove their decls.
19717 * character.h (ASCII_CHAR_P): Move from here ...
19718 * lisp.h: ... to here, so that the inline functions mentioned
19719 above can use them.
19720
19721 * dired.c (directory_files_internal_unwind): Now static.
19722
19723 * fileio.c (file_name_as_directory, directory_file_name):
19724 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19725 Now static.
19726 (file_name_as_directory): Use const pointers when appropriate.
19727 (Fexpand_file_name): Likewise. In particular, newdir might
19728 point at constant storage, so make it a const pointer.
19729 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19730 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19731 signedness issues.
19732 (Fset_file_times, Finsert_file_contents, auto_save_error):
19733 Rename locals to avoid shadowing.
19734
19735 * minibuf.c (choose_minibuf_frame_1): Now static.
19736 (Ftry_completion, Fall_completions): Rename or remove locals
19737 to avoid shadowing.
19738
19739 * marker.c (bytepos_to_charpos): Remove; unused.
19740
19741 * lisp.h (verify_bytepos, count_markers): New decls,
19742 so that gcc does not warn that these functions aren't declared.
19743
19744 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19745 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19746 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19747 (copy_text): Remove unused local var.
19748
19749 * filelock.c (within_one_second): Now static.
19750 (lock_file_1): Rename local to avoid shadowing.
19751
19752 * buffer.c (fix_overlays_before): Mark locals as initialized.
19753 (fix_start_end_in_overlays): Likewise. This function should be
19754 simplified by using pointers-to-pointers, but that's a different
19755 matter.
19756 (switch_to_buffer_1): Now static.
19757 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19758 (report_overlay_modification): Rename locals to avoid shadowing.
19759
19760 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19761 Fix pointer signedness issue.
19762 (sys_subshell): Mark local as volatile if checking for lint,
19763 to suppress a gcc -Wclobbered warning that does not seem to be right.
19764 (MAXPATHLEN): Define only if needed.
19765
19766 * process.c (serial_open, serial_configure): Move decls from here ...
19767 * systty.h: ... to here, so that they can be checked.
19768
19769 * fns.c (get_random, seed_random): Move extern decls from here ...
19770 * lisp.h: ... to here, so that they can be checked.
19771
19772 * sysdep.c (reset_io): Now static.
19773 (wait_for_termination_signal): Remove; unused.
19774
19775 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19776 (copy_keymap_item, append_key, push_text_char_description):
19777 Now static.
19778 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19779 (DENSE_TABLE_SIZE): Remove; unused.
19780 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19781 (describe_map_tree):
19782 Rename locals to avoid shadowing.
19783
19784 * keyboard.c: Declare functions static if they are not used elsewhere.
19785 (echo_char, echo_dash, cmd_error, top_level_2):
19786 (poll_for_input, handle_async_input): Now static.
19787 (read_char, kbd_buffer_get_event, make_lispy_position):
19788 (make_lispy_event, make_lispy_movement, apply_modifiers):
19789 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19790 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19791 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19792 (read_key_sequence, read_char): Mark locals as initialized.
19793 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19794
19795 * keyboard.h (make_ctrl_char): New decl.
19796 (mark_kboards): Move decl here ...
19797 * alloc.c (mark_kboards): ... from here.
19798
19799 * lisp.h (force_auto_save_soon): New decl.
19800
19801 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19802 (DEFINE_DUMMY_FUNCTION): New macro.
19803 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19804 Use it.
19805 (main): Add casts to avoid warnings
19806 if GCC considers string literals to be constants.
19807
19808 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19809
19810 * dbusbind.c: Pointer signedness fixes.
19811 (xd_signature, xd_append_arg, xd_initialize):
19812 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19813 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19814 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19815 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19816
19817 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19818 if GCC considers string literals to be constants.
19819 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19820
19821 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19822
19823 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19824 (print_preprocess, print_object): New macro to fix last change.
19825
19826 * print.c (print_preprocess): Don't forget font objects.
19827
19828 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19829
19830 * emacs.c (USAGE3): Doc fixes.
19831
19832 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19833
19834 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19835 structure.
19836
19837 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19838
19839 * lisp.h (VWindow_system, Qfile_name_history):
19840 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19841 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19842 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19843
19844 * w32select.c: Don't #include "keyboard.h".
19845 (run_protected): Add extern declaration for waiting_for_input.
19846
19847 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19848 * w32console.c (detect_input_pending, read_input_pending)
19849 (encode_terminal_code):
19850 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19851 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19852 (w32_system_caret_y, Qfile_name_history):
19853 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19854 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19855 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19856 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19857 * w32proc.c (Qlocal, report_file_error):
19858 * w32term.c (Vwindow_system, updating_frame):
19859 * w32uniscribe.c (initialized, uniscribe_font_driver):
19860 Remove unneeded extern declarations.
19861
19862 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19863
19864 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19865
19866 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19867
19868 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19869 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19870 These macros can no longer be used for assignment.
19871
19872 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19873 Assign struct members directly, instead of using BUF_BEGV etc.
19874 (record_buffer_markers, fetch_buffer_markers): New functions for
19875 recording and fetching special buffer markers.
19876 (set_buffer_internal_1, set_buffer_temp): Use them.
19877
19878 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19879
19880 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19881
19882 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19883 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19884
19885 * xdisp.c (hscroll_window_tree):
19886 (reconsider_clip_changes): Use PT instead of BUF_PT.
19887
19888 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19889
19890 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19891 $(EMACS_ROOT)/lib/intprops.h.
19892
19893 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19894
19895 Fix more problems found by GCC 4.5.2's static checks.
19896
19897 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19898 to unsigned char * to avoid compiler diagnostic.
19899 (xg_free_frame_widgets): Make it clear that a local variable is
19900 needed only if USE_GTK_TOOLTIP.
19901 (gdk_window_get_screen): Make it clear that this macro is needed
19902 only if USE_GTK_TOOLTIP.
19903 (int_gtk_range_get_value): New function, which avoids a diagnostic
19904 from gcc -Wbad-function-cast.
19905 (xg_set_toolkit_scroll_bar_thumb): Use it.
19906 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19907 diagnostic from gcc -Wbad-function-cast.
19908 (get_utf8_string, xg_get_file_with_chooser):
19909 Rename locals to avoid shadowing.
19910 (create_dialog): Move locals to avoid shadowing.
19911
19912 * xgselect.c (xg_select): Remove unused var.
19913
19914 * image.c (four_corners_best): Mark locals as initialized.
19915 (gif_load): Initialize transparent_p to zero (Bug#8238).
19916 Mark another local as initialized.
19917 (my_png_error, my_error_exit): Mark with NO_RETURN.
19918
19919 * image.c (clear_image_cache): Now static.
19920 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19921 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19922 (x_edge_detection): Remove unnecessary cast that
19923 gcc -Wbad-function-cast diagnoses.
19924 (gif_load): Fix pointer signedness.
19925 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19926 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19927
19928 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19929
19930 Improve quality of tests for time stamp overflow.
19931 For example, without this patch (encode-time 0 0 0 1 1
19932 1152921504606846976) returns the obviously-bogus value (-948597
19933 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19934 reports time overflow. See
19935 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19936 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19937 * editfns.c: Include limits.h and intprops.h.
19938 (TIME_T_MIN, TIME_T_MAX): New macros.
19939 (time_overflow): Move earlier, to before first use.
19940 (hi_time, lo_time): New functions, for an accurate test for
19941 out-of-range times.
19942 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19943 (Fget_internal_run_time): Don't assume time_t fits in int.
19944 (make_time): Use list2 instead of Fcons twice.
19945 (Fdecode_time): More accurate test for out-of-range times.
19946 (check_tm_member): New function.
19947 (Fencode_time): Use it, to test for out-of-range times.
19948 (lisp_time_argument): Don't rely on undefined left-shift and
19949 right-shift behavior when checking for time stamp overflow.
19950
19951 * editfns.c (time_overflow): New function, refactoring common code.
19952 (Fformat_time_string, Fdecode_time, Fencode_time):
19953 (Fcurrent_time_string): Use it.
19954
19955 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19956 * dired.c (make_time): Move to ...
19957 * editfns.c (make_time): ... here.
19958 * systime.h: Note the move.
19959
19960 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19961
19962 * fringe.c (update_window_fringes): Remove unused variables.
19963
19964 * unexmacosx.c (copy_data_segment): Also copy __got section.
19965 (Bug#8223)
19966
19967 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19968
19969 * termcap.c [MSDOS]: Include "msdos.h".
19970 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19971 Constify `char *' arguments and their references according to
19972 prototypes in tparam.h.
19973
19974 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19975
19976 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19977 Adapt all references accordingly.
19978
19979 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19980
19981 2011-03-11 Tom Tromey <tromey@redhat.com>
19982
19983 * buffer.c (syms_of_buffer): Remove obsolete comment.
19984
19985 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19986
19987 * termhooks.h (encode_terminal_code): Declare prototype.
19988
19989 * msdos.c (encode_terminal_code): Don't declare prototype.
19990
19991 * term.c (encode_terminal_code): Now external again, used by
19992 w32console.c and msdos.c.
19993
19994 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19995 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19996
19997 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19998
19999 Fix some minor problems found by GCC 4.5.2's static checks.
20000
20001 * fringe.c (update_window_fringes): Mark locals as initialized
20002 (Bug#8227).
20003 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20004
20005 * alloc.c (mark_fringe_data): Move decl from here ...
20006 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20007 to check its interface.
20008 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20009
20010 * fontset.c (free_realized_fontset): Now static.
20011 (Fset_fontset_font): Rename local to avoid shadowing.
20012 (fontset_font): Mark local as initialized.
20013 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20014
20015 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20016
20017 * xselect.c (x_disown_buffer_selections): Remove; not used.
20018 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20019 (x_own_selection, Fx_disown_selection_internal): Rename locals
20020 to avoid shadowing.
20021 (x_handle_dnd_message): Remove local to avoid shadowing.
20022
20023 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20024 so that the caller can use some name other than gcpro1.
20025 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20026 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20027 (Fx_backspace_delete_keys_p):
20028 Use them to avoid shadowing, and rename vars to avoid shadowing.
20029 (x_decode_color, x_set_name, x_window): Now static.
20030 (Fx_create_frame): Add braces to silence GCC warning.
20031 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20032 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20033 Remove unused locals.
20034 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20035 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20036 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20037 macros.
20038
20039 * xterm.h (x_mouse_leave): New decl.
20040
20041 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20042 Remove unused functions.
20043 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20044 (x_calc_absolute_position): Now static.
20045 (XTread_socket): Don't define label "out" unless it's used.
20046 Don't declare local "event" unless it's used.
20047 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20048 unless they are used.
20049 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20050 (x_fatal_error_signal): Remove; not used.
20051 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20052 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20053 (x_error_catcher, x_connection_closed, x_error_handler):
20054 (x_error_quitter, xembed_send_message, x_iconify_frame):
20055 (my_log_handler): Rename locals to avoid shadowing.
20056 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20057 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20058
20059 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20060 Rename or move locals to avoid shadowing.
20061 (tty_defined_color, merge_face_heights): Now static.
20062 (free_realized_faces_for_fontset): Remove; not used.
20063 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20064 does not deduce is never used uninitialized.
20065 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20066 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20067
20068 * terminal.c (store_terminal_param): Now static.
20069
20070 * xmenu.c (menu_highlight_callback): Now static.
20071 (set_frame_menubar): Remove unused local.
20072 (xmenu_show): Rename parameter to avoid shadowing.
20073 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20074 since they might point to immutable storage.
20075 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20076 since it's unused otherwise.
20077
20078 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20079 Add a FIXME, since the code still doesn't look right. (Bug#8215)
20080 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20081 avoids a gcc -Wuninitialized diagnostic.
20082 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20083 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20084 does not deduce are never used uninitialized.
20085
20086 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20087
20088 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20089 * window.c (window_loop, size_window):
20090 (run_window_configuration_change_hook, enlarge_window): Likewise.
20091
20092 * window.c (display_buffer): Now static.
20093 (size_window): Mark variables that gcc -Wuninitialized
20094 does not deduce are never used uninitialized.
20095 * window.h (check_all_windows): New decl, to forestall
20096 gcc -Wmissing-prototypes diagnostic.
20097 * dispextern.h (bidi_dump_cached_states): Likewise.
20098
20099 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20100 shadowing.
20101 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20102 Include <limits.h>.
20103 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20104 and to avoid gcc -Wuninitialized warning.
20105 (load_charset_map): Mark variables that gcc -Wuninitialized
20106 does not deduce are never used uninitialized.
20107 (load_charset): Abort instead of using uninitialized var (Bug#8229).
20108
20109 * coding.c (coding_set_source, coding_set_destination):
20110 Use "else { /* comment */ }" rather than "else /* comment */;"
20111 for clarity, and to avoid gcc -Wempty-body warning.
20112 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20113 a block, when the outer 'i' will do.
20114 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20115 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20116 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20117 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20118 (Fdecode_sjis_char, Fdefine_coding_system_internal):
20119 Rename locals to avoid shadowing.
20120 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20121 * coding.c (emacs_mule_char, encode_invocation_designation):
20122 Now static, since they're not used elsewhere.
20123 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20124 (decode_coding_object, encode_coding_object, detect_coding_system):
20125 (decode_coding_emacs_mule): Mark variables that gcc
20126 -Wuninitialized does not deduce are never used uninitialized.
20127 (detect_coding_iso_2022): Initialize a local variable that might
20128 be used uninitialized. Leave a FIXME because it's not clear that
20129 this initialization is needed. (Bug#8211)
20130 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20131 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20132 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20133 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20134 Remove unused macros.
20135
20136 * category.c (hash_get_category_set): Remove unused local var.
20137 (copy_category_table): Now static, since it's not used elsewhere.
20138 * character.c (string_count_byte8): Likewise.
20139
20140 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20141 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20142
20143 * chartab.c (copy_sub_char_table): Now static, since it's not used
20144 elsewhere.
20145 (sub_char_table_ref_and_range, char_table_ref_and_range):
20146 Rename locals to avoid shadowing.
20147 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20148
20149 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20150 (BIDI_BOB): Remove unused macro.
20151
20152 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20153 deduce are never used uninitialized.
20154 * term.c (encode_terminal_code): Likewise.
20155
20156 * term.c (encode_terminal_code): Now static. Remove unused local.
20157
20158 * tparam.h: New file.
20159 * term.c, tparam.h: Include it.
20160 * deps.mk (term.o, tparam.o): Depend on tparam.h.
20161 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20162 Move these decls to tparam.h, and make them agree with what
20163 is actually in tparam.c. The previous trick of using incompatible
20164 decls in different modules does not conform to the C standard.
20165 All callers of tparam changed to use tparam's actual API.
20166 * tparam.c (tparam1, tparam, tgoto):
20167 Use const pointers where appropriate.
20168
20169 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20170 * cm.h (struct cm): Likewise.
20171 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20172 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20173 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20174 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20175 (turn_on_face, init_tty): Likewise.
20176 * termchar.h (struct tty_display_info): Likewise.
20177
20178 * term.c (term_mouse_position): Rename local to avoid shadowing.
20179
20180 * alloc.c (mark_ttys): Move decl from here ...
20181 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20182
20183 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
20184
20185 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20186
20187 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
20188
20189 * search.c (compile_pattern_1): Remove argument regp, unused since
20190 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20191 (compile_pattern): Don't pass it.
20192
20193 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
20194
20195 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20196 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20197 for ! HAVE_GTK3.
20198 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20199
20200 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20201
20202 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20203 gdk_window_get_screen, gdk_window_get_geometry,
20204 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20205 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20206 (xg_get_pixbuf_from_pixmap): New function.
20207 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20208 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20209 Call xg_get_pixbuf_from_pixmap instead of
20210 gdk_pixbuf_get_from_drawable.
20211 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20212 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20213 (xg_check_special_colors): Use GtkStyleContext and its functions
20214 for HAVE_GTK3.
20215 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20216 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20217 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20218 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20219 Call gtk_widget_get_preferred_size.
20220 (xg_frame_resized): gdk_window_get_geometry only takes 5
20221 parameters.
20222 (xg_win_to_widget, xg_event_is_for_menubar):
20223 Call gdk_x11_window_lookup_for_display.
20224 (xg_set_widget_bg): New function.
20225 (delete_cb): New function.
20226 (xg_create_frame_widgets): Connect delete-event to delete_cb.
20227 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
20228 (xg_set_background_color): Call xg_set_widget_bg.
20229 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20230 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20231 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20232 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20233 if ! HAVE_GTK3.
20234 (update_frame_tool_bar): Call gtk_widget_hide.
20235 (xg_initialize): Use GDK_KEY_g.
20236
20237 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20238 if ! HAVE_GTK3
20239 (x_session_initialize): Call gdk_x11_set_sm_client_id.
20240
20241 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20242 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20243 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20244
20245 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
20246
20247 * w32xfns.c (select_palette): Check success of RealizePalette against
20248 GDI_ERROR, not zero.
20249
20250 See ChangeLog.11 for earlier changes.
20251
20252 ;; Local Variables:
20253 ;; coding: utf-8
20254 ;; End:
20255
20256 Copyright (C) 2011-2012 Free Software Foundation, Inc.
20257
20258 This file is part of GNU Emacs.
20259
20260 GNU Emacs is free software: you can redistribute it and/or modify
20261 it under the terms of the GNU General Public License as published by
20262 the Free Software Foundation, either version 3 of the License, or
20263 (at your option) any later version.
20264
20265 GNU Emacs is distributed in the hope that it will be useful,
20266 but WITHOUT ANY WARRANTY; without even the implied warranty of
20267 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20268 GNU General Public License for more details.
20269
20270 You should have received a copy of the GNU General Public License
20271 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.