Silence some warnings.
[bpt/emacs.git] / src / ChangeLog
1 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
2
3 * w32proc.c (waitpid): Remove unused label get_result.
4
5 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
6
7 * makefile.w32-in (SYSWAIT_H): New macro.
8 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
9 ($(BLD)/sysdep.$(O)): Update dependencies.
10
11 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
12
13 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
14 * callproc.c (relocate_fd): Assume F_DUPFD.
15 * emacs.c, term.c (O_RDWR): Remove.
16 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
17 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
18 * nsterm.m: Assume <fcntl.h> exists.
19 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
20 (create_pty, Fmake_network_process, server_accept_connection)
21 (wait_reading_process_output, init_process_emacs):
22 Assume O_NONBLOCK.
23 (wait_reading_process_output): Put in a special case for WINDOWSNT
24 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
25 It's not clear this is needed, but it's a more-conservative change.
26 (create_process): Assume FD_CLOEXEC.
27 (create_process, create_pty): Assume O_NOCTTY.
28 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
29 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
30 Omit if not DOS_NT, since F_GETFL is not defined there.
31 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
32 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
33 (O_NOCTTY): Remove.
34 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
35 lack it, since gnulib guarantees this.
36 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
37
38 2012-11-17 Eli Zaretskii <eliz@gnu.org>
39
40 * w32.c (faccessat): Pretend that directories have the execute bit
41 set. Emacs expects that, e.g., in files.el:cd-absolute.
42
43 * w32proc.c (create_child): Don't clip the PID of the child
44 process to fit into an Emacs integer, as this is no longer a
45 restriction.
46 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
47 reaping only the process specified by PID argument, if that is
48 positive. Use PID instead of dead_child to know which process to
49 reap. Wait for the child to die only if WNOHANG is not in
50 OPTIONS.
51 (sys_select): Don't set dead_child.
52
53 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
54 as it is no longer needed.
55
56 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
57 no longer needed.
58 (record_child_status_change): Remove the setting of
59 record_at_most_one_child for the !WNOHANG case.
60
61 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
62
63 Fix problems in ns port found by static checking.
64 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
65 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
66 not to process group.
67 (ns_select): Use emacs_write, not write, as that's more robust
68 in the presence of signals.
69 (fd_handler:): Check for read errors.
70
71 2012-11-16 Glenn Morris <rgm@gnu.org>
72
73 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
74
75 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
76
77 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
78
79 2012-11-16 Eli Zaretskii <eliz@gnu.org>
80
81 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
82 use the same value of thread handle.
83 (start_timer_thread): If the timer thread exited (due to error),
84 clean up by closing the two handles it used. Duplicate the caller
85 thread's handle here, so it gets duplicated only once, when
86 launching the timer thread. Set priority of the timer thread, not
87 the caller thread.
88 (getitimer): Don't duplicate the caller thread's handle here.
89 (Bug#12832)
90
91 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
92
93 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
94 called (Bug#12834).
95
96 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
97
98 Remove no-longer-used pty_max_bytes variable.
99 * process.c (pty_max_bytes): Remove; unused.
100 (send_process): Do not set it.
101
102 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
103
104 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
105 Update dependencies.
106
107 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
108
109 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
110 This follows up on the 2012-09-29 patch that removed indirection
111 for the 'function' field. Reported by Sergey Vinokurov in
112 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
113
114 2012-11-14 Eli Zaretskii <eliz@gnu.org>
115
116 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
117 different name, as the MS runtime does not have such a function,
118 and probably never will.) All callers changed. Ignore DIRFD
119 value if PATH is an absolute file name, to match Posix spec
120 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
121 symlinks.
122
123 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
124
125 * xdisp.c (echo_area_display, redisplay_internal):
126 Omit redundant check whether frame_garbaged is set.
127
128 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
129
130 Use faccessat, not access, when checking file permissions (Bug#12632).
131 This fixes a bug that has been present in Emacs since its creation.
132 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
133 which must set some sort of record. (Torek's bug report was against
134 a predecessor of GNU Emacs, but GNU Emacs happened to have the
135 same common flaw.) See Torek's Usenet posting
136 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
137 Posted: Fri Apr 8 14:18:56 1983.
138 * Makefile.in (LIB_EACCESS): New macro.
139 (LIBES): Use it.
140 * callproc.c (init_callproc):
141 * charset.c (init_charset):
142 * fileio.c (check_existing, check_executable, check_writable)
143 (Ffile_readable_p):
144 * lread.c (openp, load_path_check):
145 * process.c (allocate_pty):
146 * xrdb.c (file_p):
147 Use effective UID when checking permissions, not real UID.
148 * callproc.c (init_callproc):
149 * charset.c (init_charset):
150 * lread.c (load_path_check, init_lread):
151 Test whether directories are accessible, not merely whether they exist.
152 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
153 * fileio.c (check_existing, check_executable, check_writable)
154 (Ffile_readable_p):
155 Use symbolic names instead of integers for the flags, as they're
156 portable now.
157 (check_writable): New arg AMODE. All uses changed.
158 Set errno on failure.
159 (Ffile_readable_p): Use faccessat, not stat + open + close.
160 (Ffile_writable_p): No need to call check_existing + check_writable.
161 Just call check_writable and then look at errno. This saves a syscall.
162 dir should never be nil; replace an unnecessary runtime check
163 with an eassert. When checking the parent directory of a nonexistent
164 file, check that the directory is searchable as well as writable, as
165 we can't create files in unsearchable directories.
166 (file_directory_p): New function, which uses 'stat' on most platforms
167 but faccessat with D_OK (for efficiency) if WINDOWSNT.
168 (Ffile_directory_p, Fset_file_times): Use it.
169 (file_accessible_directory_p): New function, which uses a single
170 syscall for efficiency.
171 (Ffile_accessible_directory_p): Use it.
172 * xrdb.c (file_p): Use file_directory_p.
173 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
174 * lread.c (openp): When opening a file, use fstat rather than
175 stat, as that avoids a permissions race. When not opening a file,
176 use file_directory_p rather than stat.
177 (dir_warning): First arg is now a usage string, not a format.
178 Use errno. All uses changed.
179 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
180 that merely introduced a race.
181 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
182 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
183 and similarly for the other O_* flags.
184 * w32.c (sys_faccessat): Rename from sys_access and switch to
185 faccessat's API. All uses changed.
186 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
187 (magic_db): Rename from magic_file_p.
188 (magic_db, search_magic_path): Return an XrmDatabase rather than a
189 char *, so that we don't have to test for file existence
190 separately from opening the file for reading. This removes a race
191 fixes a permission-checking problem, and simplifies the code.
192 All uses changed.
193 (file_p): Remove; no longer needed.
194
195 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
196
197 Omit glyphs initialization at startup.
198 * dispnew.c (glyphs_initialized_initially_p): Remove.
199 (adjust_frame_glyphs_initially): Likewise. Adjust users.
200 (Fredraw_frame): Move actual code from here...
201 (redraw_frame): ...to here. Add eassert. Adjust comment.
202 (Fredraw_display): Use redraw_frame.
203 * xdisp.c (clear_garbaged_frames): Likewise.
204
205 2012-11-13 Eli Zaretskii <eliz@gnu.org>
206
207 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
208 passed to pint2str and pint2hrstr to be at most the size of the
209 frame's decode_mode_spec_buffer. This avoids crashes with very
210 large values of FIELD_WIDTH argument to decode_mode_spec.
211 (Bug#12867)
212
213 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
214
215 Fix a race with verify-visited-file-modtime (Bug#12863).
216 Since at least 1991 Emacs has ignored an mtime difference of no
217 more than one second, but my guess is that this was to work around
218 file system bugs that were fixed long ago. Since the race is
219 causing problems now, let's remove that code.
220 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
221 whose time stamp is off by no more than a second. Insist that the
222 file time stamps match exactly.
223
224 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
225
226 * frame.h (struct frame): Convert external_tool_bar member to
227 1-bit unsigned bitfield.
228 * termhooks.h (struct terminal): Remove mouse_moved member since
229 all users are long dead. Adjust comment on mouse_position_hook.
230
231 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
232
233 Simplify by using FOR_EACH_FRAME here and there.
234 * frame.c (next_frame, prev_frame, other_visible_frames)
235 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
236 * w32term.c (x_window_to_scroll_bar): Likewise.
237 * window.c (window_list): Likewise.
238 * xdisp.c (x_consider_frame_title): Likewise.
239 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
240 * xfns.c (x_window_to_frame, x_any_window_to_frame)
241 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
242 * xmenu.c (menubar_id_to_frame): Likewise.
243 * xselect.c (frame_for_x_selection): Likewise.
244 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
245 (x_window_to_menu_bar): Likewise.
246 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
247
248 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
249
250 * data.c (Qdefalias_fset_function): Now static.
251
252 Another tweak to vectorlike_header change.
253 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
254 Remove, and replace all uses with ...
255 (next_in_free_list, set_next_in_free_list):
256 New functions, which respect C's aliasing rules better.
257
258 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
259
260 * window.c (list4i): Rename from 'quad'. All uses changed.
261 Needed because <sys/types.h> defines 'quad' on Solaris 10.
262
263 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
264
265 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
266 warning about mixing declarations and code in ISO C90.
267
268 2012-11-10 Martin Rudalics <rudalics@gmx.at>
269
270 * window.c (Fsplit_window_internal): Set combination limit of
271 new parent window to t iff Vwindow_combination_limit is t;
272 fixing a regression introduced with the change from 2012-09-22.
273 (Fset_window_combination_limit): Fix doc-string.
274
275 2012-11-10 Eli Zaretskii <eliz@gnu.org>
276
277 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
278 amount when the scroll margins are too large. When scrolling
279 backwards in the buffer, give up if cannot reach point or the
280 scroll margin within a reasonable number of screen lines. Fixes
281 point position in window under scroll-up/down-aggressively when
282 point is positioned many lines beyond the window top/bottom.
283 (Bug#12811)
284
285 * ralloc.c (relinquish): If real_morecore fails to return memory
286 to the system, don't crash; instead, leave the last heap
287 unchanged and return. (Bug#12774)
288
289 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
290
291 * lisp.h (AUTOLOADP): New macro.
292 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
293 * data.c (Ffset): Remove special ad-advice-info handling.
294 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
295 (Fsubr_arity): CSE.
296 (Finteractive_form): Simplify.
297 (Fquo): Don't insist on having at least 2 arguments.
298 (Qdefalias_fset_function): New var.
299
300 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
301
302 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
303
304 * nsfont.m (Qcondensed, Qexpanded): New variables.
305 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
306 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
307
308 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
309
310 Fix recently introduced crash on MS-Windows (Bug#12839).
311 * w32term.h (struct scroll_bar): Use convenient header.
312 (SCROLL_BAR_VEC_SIZE): Remove.
313 * w32term.c (x_scroll_bar_create): Use VECSIZE.
314
315 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
316
317 Tweak last vectorlike_header change.
318 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
319 vectorlike object on the free list. This is introduced to avoid
320 some (but not all) pointer casting and aliasing problems, see
321 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
322 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
323 objects.
324 (xvectype, xvecsize): Use them to examine Lisp_Object values.
325
326 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
327
328 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
329 been removed, so remove them here also.
330
331 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
332
333 * doc.c (Fdocumentation): Handle new property
334 dynamic-docstring-function to replace the old ad-advice-info.
335
336 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
337
338 * fns.c (Qeql, hashtest_eq): Now static.
339
340 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
341
342 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
343 * fns.c (hashfn_eq, hashfn_eql, sxhash):
344 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
345 * buffer.c (compare_overlays): Use XLI rather than XHASH.
346
347 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
348
349 Use same hash function for hashfn_profiler as for hash_string etc.
350 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
351 * lisp.h (sxhash_combine): New inline function, with the contents
352 of the old SXHASH_COMBINE.
353 * profiler.c (hashfn_profiler): Use it, instead of having a
354 special hash function containing a comparison that always yields 1.
355
356 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
357
358 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
359 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
360 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
361 Remove unused vars.
362
363 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
364
365 * image.c (xpm_make_color_table_h): Fix compiler error because
366 make_hash_table changed.
367
368 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
369
370 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
371
372 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
373
374 Use ad-hoc comparison function for the profiler's hash-tables.
375 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
376 (make_log): Use them.
377 (handle_profiler_signal): Don't inhibit quit any longer since we don't
378 call Fequal any more.
379 (Ffunction_equal): New function.
380 (cmpfn_profiler, hashfn_profiler): New functions.
381 (syms_of_profiler): Initialize them.
382 * lisp.h (struct hash_table_test): New struct.
383 (struct Lisp_Hash_Table): Use it.
384 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
385 * fns.c (make_hash_table): Take a struct to describe the test.
386 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
387 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
388 (hash_lookup, hash_remove_from_table): Move assertion checking of
389 hashfn result here. Check hash-equality before calling cmpfn.
390 (Fmake_hash_table): Adjust call to make_hash_table.
391 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
392 (syms_of_fns): Initialize them.
393 * emacs.c (main): Move syms_of_fns earlier.
394 * xterm.c (syms_of_xterm):
395 * category.c (hash_get_category_set): Adjust call to make_hash_table.
396 * print.c (print_object): Adjust to new hash-table struct.
397 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
398
399 2012-11-08 Eli Zaretskii <eliz@gnu.org>
400
401 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
402 value of w32-scroll-lock-modifier is neither nil nor one of the
403 known key modifiers. (Bug#12806)
404
405 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
406
407 Shrink struct vectorlike_header to the only size field.
408 * lisp.h (enum pvec_type): Avoid explicit enum member values.
409 Adjust comment.
410 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
411 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
412 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
413 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
414 information from the vector header. Adjust comment.
415 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
416 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
417 layout.
418 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
419 (struct vectorlike_header): Remove next member. Adjust comment.
420 (struct Lisp_Subr): Add convenient header. Adjust comment.
421 (allocate_pseudovector): Adjust prototype.
422 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
423 (sweep_string, lisp_malloc): Remove useless prototypes.
424 (enum mem_type): Adjust comment.
425 (NEXT_IN_FREE_LIST): New macro.
426 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
427 (Fmake_bool_vector): Likewise.
428 (struct large_vector): New type to represent allocation unit for
429 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
430 (large_vectors): Change type to struct large_vector.
431 (allocate_vector_from_block): Simplify.
432 (PSEUDOVECTOR_NBYTES): Replace with...
433 (vector_nbytes): ...new function. Adjust users.
434 (sweep_vectors): Adjust processing of large vectors.
435 (allocate_vectorlike): Likewise.
436 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
437 Add easserts. Adjust XSETPVECTYPESIZE usage.
438 (allocate_buffer): Use BUFFER_PVEC_INIT.
439 (live_vector_p): Adjust to match large vector.
440 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
441 * buffer.h (struct buffer): Add next member.
442 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
443 New macros.
444 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
445 * fns.c (internal_equal): Adjust to match enum pvec_type change.
446 (copy_hash_table): Adjust to match vector header change.
447 * lread.c (defsubr): Use XSETPVECTYPE.
448 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
449 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
450 (xvecsize): New command.
451
452 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
453
454 * keyboard.c (event_to_kboard): Do not dereference
455 frame_or_window field of SELECTION_REQUEST_EVENT
456 and SELECTION_CLEAR_EVENT events (Bug#12814).
457 * xterm.h (struct selection_input_event): Adjust comment.
458
459 2012-11-07 Eli Zaretskii <eliz@gnu.org>
460
461 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
462 such as Scroll Lock, if the respective keys are treated as
463 function keys, not as modifiers. This avoids destroying non-ASCII
464 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
465
466 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
467
468 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
469
470 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
471
472 Restore some duplicate definitions (Bug#12814).
473 This undoes part of the 2012-11-03 changes. Some people build
474 with plain -g rather than with -g3, and they need the duplicate
475 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
476 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
477 Define as macros, as well as as enums or as constants.
478
479 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
480
481 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
482 to keypad keys (Bug#12816).
483
484 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
485
486 Minor adjustments of recently-changed frame functions.
487 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
488 known to be a frame (we're in the FRAMEP branch).
489 * lisp.h (Qframep): Remove decl. frame.h declares this.
490 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
491 since they're meant for Lisp fixnum values.
492
493 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
494
495 * window.c (Fwindow_combination_limit): Revert to the only
496 required argument and adjust docstring as suggested in
497 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
498 by Martin Rudalics <rudalics@gmx.at>.
499
500 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
501
502 Widely used frame validity and checking functions.
503 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
504 * frame.c (decode_live_frame, decode_any_frame): New functions.
505 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
506 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
507 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
508 (Fframe_pointer_visible_p): Use decode_any_frame.
509 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
510 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
511 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
512 (Fframe_focus): Likewise. Allow zero number of arguments.
513 Adjust docstring.
514 (frame_buffer_list, frame_buffer_predicate): Remove.
515 * lisp.h (frame_buffer_predicate): Remove prototype.
516 * buffer.c (Fother_buffer): Use decode_any_frame.
517 * xdisp.c (Ftool_bar_lines_needed): Likewise.
518 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
519 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
520 (Fclose_font, Ffont_info): Use decode_live_frame.
521 * fontset.c (check_fontset_name): Likewise.
522 * terminal.c (Fframe_terminal): Likewise.
523 * w32fns.c (check_x_frame): Likewise.
524 * window.c (Fminibuffer_window, Fwindow_at)
525 (Fcurrent_window_configuration): Likewise.
526 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
527 Likewise. Allow zero number of arguments. Adjust docstring.
528 * dispnew.c (Fredraw_frame): Likewise.
529 * xfaces.c (frame_or_selected_frame): Remove.
530 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
531 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
532 (Fframe_face_alist): Use decode_live_frame.
533 * xfns.c (check_x_frame): Likewise.
534
535 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
536
537 * window.c (quad): New function.
538 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
539 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
540 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
541 (Fwindow_line_height): Use it.
542 (Fwindow_fringes): Use list3.
543 (Fwindow_scroll_bars): Use list4.
544 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
545 (Fwindow_combination_limit): Allow zero number of arguments.
546
547 2012-11-05 Eli Zaretskii <eliz@gnu.org>
548
549 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
550
551 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
552 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
553 file descriptor 2 for standard error. (Bug#12805)
554
555 2012-11-05 Chong Yidong <cyd@gnu.org>
556
557 * process.c (wait_reading_process_output): Revert previous change.
558
559 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
560
561 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
562 This removes code that has been obsolete since around 1990.
563 * callproc.c (Fcall_process):
564 * emacs.c (main):
565 * process.c (create_process):
566 * term.c (dissociate_if_controlling_tty):
567 Assume setsid exists.
568 * callproc.c (child_setup): Assume setpgid exists and behaves as
569 per POSIX.1-1988 or later.
570 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
571 * emacs.c (shut_down_emacs):
572 * sysdep.c (sys_suspend, init_foreground_group):
573 Assume getpgrp behaves as per POSIX.1-1998 or later.
574 * msdos.c (setpgrp): Remove.
575 (tcgetpgrp, setpgid, setsid): New functions.
576 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
577 * term.c (no_controlling_tty): Remove; unused.
578 * w32proc.c (setpgrp): Remove.
579 (setsid, tcgetpgrp): New functions.
580
581 Simplify by assuming __fpending.
582 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
583 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
584 Do not assume that __fpending's result fits in int.
585
586 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
587
588 Remove EMACS_OUTQSIZE+sleep hack.
589 * dispnew.c (update_frame_1): Remove hack for terminals slower
590 than 2400 bps, which throttled Emacs by having it sleep.
591 This code hasn't worked since at least 2007, when the multi-tty stuff
592 was added, and anyway those old terminals are long dead.
593 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
594 without the dispnew.c change, as dispnew.c doesn't include systty.h.
595
596 Fix data-loss with --version (Bug#9574).
597 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
598 as we can't assume that emacs_strerror is initialized, and strerror
599 is good enough here.
600 (main): Invoke atexit earlier, to catch earlier instances of
601 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
602
603 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
604
605 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
606 (keyDown): Remap keypad keys to X11 virtual key codes.
607
608 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
609
610 Fix data-loss with --batch (Bug#9574).
611 * emacs.c: Include <close-stream.h>.
612 (close_output_streams): New function.
613 (main): Pass it to atexit, so that Emacs closes stdout and stderr
614 and handles errors appropriately.
615 (Fkill_emacs): Don't worry about flushing, as close_output_stream
616 does that now.
617
618 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
619 The symptom is a diagnostic "GLib-WARNING **: In call to
620 g_spawn_sync(), exit status of a child process was requested but
621 SIGCHLD action was set to SIG_IGN and ECHILD was received by
622 waitpid(), so exit status can't be returned." The diagnostic
623 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
624 The real bug is a race condition between Emacs and glib: Emacs
625 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
626 so that glib can't find it. Work around the bug by invoking
627 waitpid only on subprocesses that Emacs itself creates.
628 * process.c (create_process, record_child_status_change):
629 Don't use special value -1 in pid field, as the caller now must
630 know the pid rather than having the callee infer it.
631 The inference was sometimes incorrect anyway, due to another race.
632 (create_process): Set new 'alive' member if child is created.
633 (process_status_retrieved): New function.
634 (record_child_status_change): Use it.
635 Accept negative 1st argument, which means to wait for the
636 processes that Emacs already knows about. Move special-case code
637 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
638 processes that have already been waited for, by testing and
639 clearing new 'alive' member.
640 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
641 now does this internally.
642 (handle_child_signal): Let record_child_status_change do all
643 the work, since we do not want to reap all exited child processes,
644 only the child processes that Emacs itself created.
645 * process.h (Lisp_Process): New boolean member 'alive'.
646
647 Omit duplicate definitions no longer needed with gcc -g3.
648 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
649 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
650 Define only as macros. There's no longer any need to also define
651 these symbols as enums or as constants, since we now assume
652 gcc -g3 when debugging.
653
654 2012-11-03 Eli Zaretskii <eliz@gnu.org>
655
656 * lisp.mk: Adjust comments to the fact that term/internal is now
657 loaded from loadup.el.
658
659 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
660 (msdos_fatal_signal): New function.
661 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
662 its argument list.
663
664 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
665 for GCC versions before 4.
666 (emacs_raise): Define to call msdos_fatal_signal.
667
668 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
669 iterator when starting in the middle of a display or overlay
670 string. (Bug#12745)
671
672 2012-11-03 Chong Yidong <cyd@gnu.org>
673
674 * process.c (wait_reading_process_output): Clean up the last
675 change.
676
677 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
678
679 * process.c (wait_reading_process_output): Avoid a race condition
680 with SIGIO delivery (Bug#11536).
681
682 2012-11-03 Chong Yidong <cyd@gnu.org>
683
684 * buffer.c (cursor_type): Untabify docstring.
685
686 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
687
688 * frame.h (struct frame): Drop can_have_scroll_bars member
689 which is meaningless for a long time. Adjust comments.
690 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
691 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
692
693 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
694
695 * window.c (decode_next_window_args): Update window arg after
696 calling decode_live_window and so fix crash reported at
697 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
698 by Juanma Barranquero <lekktu@gmail.com>.
699 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
700 * font.c (Ffont_at): Likewise.
701
702 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
703
704 * widget.c (resize_cb): New function.
705 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
706 (EmacsFrameResize): Check if all is up to date before changing frame
707 size.
708
709 2012-11-02 Eli Zaretskii <eliz@gnu.org>
710
711 Implement backtrace output for fatal errors on MS-Windows.
712 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
713 (BACKTRACE_LIMIT_MAX): New macro.
714 (w32_backtrace): New function.
715 (emacs_abort): Use w32_backtrace when the user chooses not to
716 attach a debugger. Update the text of the abort dialog.
717
718 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
719
720 Window-related stuff cleanup here and there.
721 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
722 Use decode_any_window.
723 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
724 * xdisp.c (Fformat_mode_line): Likewise.
725 * font.c (Ffont_at): Use decode_live_window.
726 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
727 * window.c (decode_next_window_args): Likewise.
728 (decode_any_window): Remove static.
729 * window.h (decode_any_window): Add prototype.
730 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
731 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
732 respectively.
733
734 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
735
736 Remove pad from struct input_event.
737 * termhooks.h (struct input_event): Remove padding field.
738 Adjust comment.
739 * keyboard.c (event_to_kboard): Simplify because frame_or_window
740 member is never cons for a long time. Adjust comment.
741 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
742 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
743 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
744 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
745
746 2012-11-01 Eli Zaretskii <eliz@gnu.org>
747
748 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
749
750 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
751
752 Fix crash when using Emacs as commit editor for git (Bug#12697).
753 * callproc.c (setpgrp): Remove macro, as we now use setpgid
754 and it is configured in conf_post.h.
755 (Fcall_process): Don't invoke both setsid and setpgid; the former
756 is enough, if it exists.
757 * callproc.c (Fcall_process, child_setup):
758 * process.c (create_process): Use setpgid.
759 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
760 for the real thing.
761 * dispnew.c (init_display): Initialize the foreground group
762 if we are running a tty display.
763 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
764 * lisp.h (init_foreground_group): New decl.
765 * sysdep.c (inherited_pgroup): New static var.
766 (init_foreground_group, tcsetpgrp_without_stopping)
767 (narrow_foreground_group, widen_foreground_group): New functions.
768 (init_sys_modes): Narrow foreground group.
769 (reset_sys_modes): Widen foreground group.
770
771 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
772
773 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
774
775 2012-10-31 Martin Rudalics <rudalics@gmx.at>
776
777 * minibuf.c (read_minibuf): Restore current buffer since
778 choose_minibuf_frame calling Fset_frame_selected_window may
779 change it (Bug#12766).
780
781 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
782
783 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
784
785 2012-10-30 Kenichi Handa <handa@gnu.org>
786
787 * font.c (Ffont_at): If WINDOW is specified and it is not
788 displaying the current buffer, signal an error.
789
790 2012-10-29 Daniel Colascione <dancol@dancol.org>
791
792 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
793 In preparation for fixing bug#12739, move these functions from
794 here...
795
796 * coding.h, coding.c: ... to here, and compile them only when
797 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
798 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
799
800 2012-10-28 Eli Zaretskii <eliz@gnu.org>
801
802 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
803 (timer_loop, getitimer, setitimer): Use it instead of
804 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
805 'clock'.
806 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
807 literal 10000.
808
809 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
810
811 * nsterm.m (NO_APPDEFINED_DATA): New define.
812 (last_appdefined_event_data): New variable
813 (last_appdefined_event): Remove.
814 (ns_select): Initialize t from last_appdefined_event_data instead
815 of [last_appdefined_event data1].
816 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
817 remove last_appdefined_event (Bug#12698).
818
819 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
820
821 * frame.c (x_set_font): Catch internal error.
822
823 2012-10-27 Eli Zaretskii <eliz@gnu.org>
824
825 Avoid overflow in w32 implementation of interval timers.
826 When possible, for ITIMER_PROF count only times the main thread
827 actually executes.
828 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
829 'volatile ULONGLONG' types. All the other data which was
830 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
831 (GetThreadTimes_Proc): New typedef.
832 (w32_get_timer_time): New function, returns a suitable time value
833 for the timer.
834 (timer_loop): Enter critical section when accessing ULONGLONG
835 values of the itimer_data struct, as these accesses are no longer
836 atomic. Call 'w32_get_timer_time' instead of 'clock'.
837 Remove unused variable.
838 (init_timers): Initialize s_pfn_Get_Thread_Times.
839 (start_timer_thread): Don't assign itimer->caller_thread here.
840 (getitimer): Assign itimer->caller_thread here.
841 (setitimer): Always call getitimer to get the value of ticks_now.
842 (sys_spawnve): Avoid compiler warning about format mismatch.
843
844 2012-10-26 Eli Zaretskii <eliz@gnu.org>
845
846 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
847 mouse movement events if the menu bar is active. This avoids
848 producing a busy "hour-glass" cursor by Windows if the mouse
849 pointer is positioned over a tooltip shown for some menu item.
850
851 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
852
853 Don't assume process IDs fit in int.
854 * emacs.c (shut_down_emacs) [!DOS_NT]:
855 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
856 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
857 Use pid_t, not int, to store process IDs, as 'int'
858 is not wide enough on a few platforms (e.g., AIX and IRIX).
859
860 2012-10-23 Kenichi Handa <handa@gnu.org>
861
862 The following change is to make face-font-rescale-alist work
863 correctly for non-ASCII fonts.
864
865 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
866 (font_open_for_lface): Handle Vface_font_rescale_alist.
867
868 2012-10-23 Chong Yidong <cyd@gnu.org>
869
870 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
871
872 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
873
874 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
875 for screen font.
876 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
877
878 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
879 event (Bug#12681).
880
881 2012-10-21 Glenn Morris <rgm@gnu.org>
882
883 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
884
885 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
886
887 Port to OpenBSD 5.1.
888 * frame.c (Fmouse_position, Fmouse_pixel_position):
889 * xdisp.c (produce_stretch_glyph):
890 Declare local vars only when they're needed.
891 This is clearer and avoids a warning on OpenBSD about unused vars.
892 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
893 This is safer, and avoids OpenBSD warnings about unused vars.
894 * keyboard.c (record_menu_key): Remove unnecessary decl.
895 (poll_timer): Define only if POLL_FOR_INPUT is defined.
896 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
897 as our definition clashes with OpenBSD's.
898 * xfaces.c (load_face_colors, check_lface_attrs)
899 (get_lface_attributes_no_remap, get_lface_attributes)
900 (lface_fully_specified_p, x_supports_face_attributes_p)
901 (tty_supports_face_attributes_p, face_fontset, realize_face)
902 (realize_x_face, realize_tty_face):
903 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
904 merely Lisp_Object *. This is more informative and avoids
905 a warning on OpenBSD about accessing beyond an object's size.
906
907 2012-10-20 Chong Yidong <cyd@gnu.org>
908
909 * lread.c (Fload): Doc fix (Bug#12592).
910
911 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
912
913 * font.c (Ffont_at): Fix previous change.
914
915 2012-10-19 Eli Zaretskii <eliz@gnu.org>
916
917 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
918 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
919 for the reasons.
920
921 * alloc.c (NSTATICS): Decrease to 0x800.
922
923 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
924
925 * fns.c (Fnreverse): Include the problem element when signalling an
926 error (bug#12677).
927
928 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
929
930 * nsterm.m (ns_select): Check writefds before call to
931 FD_ISSET (Bug#12668).
932
933 2012-10-18 Daniel Colascione <dancol@dancol.org>
934
935 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
936 (staticpro): If we run out of staticpro slots, die with an
937 informative error instead of just calling emacs_abort.
938
939 2012-10-18 Martin Rudalics <rudalics@gmx.at>
940
941 Fix two flaws reported by Dmitry Antipov.
942 * window.c (Ftemp_output_buffer_show): Remove.
943 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
944 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
945
946 2012-10-17 Eli Zaretskii <eliz@gnu.org>
947
948 * makefile.w32-in ($(BLD)/w32.$(O)):
949 ($(BLD)/vm-limit.$(O)):
950 ($(BLD)/term.$(O)):
951 ($(BLD)/unexw32.$(O)):
952 ($(BLD)/fileio.$(O)):
953 ($(BLD)/dispnew.$(O)): Update dependencies.
954
955 * w32term.h (w32_initialize_display_info, initialize_w32_display):
956 Add prototypes.
957
958 * w32proc.c: Include ctype.h.
959
960 * w32.h (init_environment, check_windows_init_file)
961 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
962 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
963 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
964 (sys_link): Add prototypes.
965
966 * w32.c: Include w32select.h.
967 (sys_access, e_malloc, sys_select): Add prototypes.
968 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
969
970 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
971
972 * unexw32.c: Include lisp.h and w32.h.
973
974 * term.c [WINDOWSNT]: Include w32term.h.
975
976 * process.c [WINDOWSNT]: Add prototype of sys_select.
977
978 * fileio.c [WINDOWSNT]: Include w32.h.
979
980 * dispnew.c [WINDOWSNT]: Include w32.h.
981
982 * cygw32.c (Fcygwin_convert_path_to_windows)
983 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
984 Lisp_Object values. (Bug#12661)
985
986 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
987 to Lisp_Object. (Bug#12661)
988
989 2012-10-17 Kenichi Handa <handa@gnu.org>
990
991 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
992 invalidate.
993
994 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
995
996 * buffer.c (Fkill_buffer): When unchaining the marker,
997 reset its buffer pointer to NULL (Bug#12652).
998
999 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1000
1001 Do not verify indirection counters of killed buffers (Bug#12579).
1002 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1003 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1004
1005 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1006
1007 * alloc.c (Fmake_byte_code): Fix typo in comment.
1008 * print.c (print_interval): Define as static to match prototype.
1009 * indent.c (disptab_matches_widthtab, recompute_width_table):
1010 Convert to eassert.
1011
1012 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1013
1014 * editfns.c (get_system_name): Remove.
1015 * lisp.h (get_system_name): Remove prototype.
1016 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1017 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1018
1019 2012-10-15 Daniel Colascione <dancol@dancol.org>
1020
1021 * dbusbind.c: Add comment explaining reason for previous change.
1022
1023 2012-10-15 Martin Rudalics <rudalics@gmx.at>
1024
1025 * window.c (Fwindow_end): Rewrite check whether cached position
1026 can be used (Bug#12600).
1027 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1028 Set windows_or_buffers_changed.
1029
1030 2012-10-15 Daniel Colascione <dancol@dancol.org>
1031
1032 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1033 enabled by undefining the symbol "interface", which the platform
1034 headers define to something incompatible.
1035
1036 2012-10-14 Daniel Colascione <dancol@dancol.org>
1037
1038 * image.c (init_tiff_functions, init_imagemagick_functions)
1039 (init_svg_functions): Fix cygw32 build break by using these
1040 functions only when WINDOWSNT _and_ HAVE_NTGUI.
1041
1042 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
1043
1044 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1045
1046 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
1047
1048 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1049
1050 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
1051
1052 * coding.c (detect_coding): Set coding->id before calling
1053 this->detector.
1054
1055 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
1056
1057 * fileio.c: Formatting fixes.
1058
1059 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
1060
1061 Fix some stat-related races.
1062 * fileio.c (Fwrite_region): Avoid race condition if a file is
1063 removed or renamed by some other process immediately after Emacs
1064 writes it but before Emacs stats it. Do not assume that stat (or
1065 fstat) succeeds.
1066 * image.c (slurp_file): Resolve the file name with fopen + fstat
1067 rather than stat + fopen.
1068 (pbm_read_file) [0]: Remove unused code with stat race.
1069 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1070 Remove ineffective code with stat race.
1071
1072 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
1073
1074 * doc.c (get_doc_string): Don't signal an error if the file is missing.
1075
1076 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1077
1078 * nsterm.m (hold_event_q): New static variable.
1079 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1080 ! q_event_ptr.
1081 (hold_event): New function.
1082 (ns_read_socket): If hold_event_q have events, store them and
1083 return (Bug#12384).
1084 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1085 is zero (Bug#12384).
1086
1087 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
1088
1089 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1090
1091 2012-10-12 Eli Zaretskii <eliz@gnu.org>
1092
1093 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1094
1095 * fileio.c (check_existing): New function.
1096 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1097 instead of calling 'stat', when what's needed is to check whether
1098 a file exists. This avoids expensive system calls on MS-Windows.
1099 (Bug#12587)
1100
1101 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
1102
1103 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1104 determine whether a file exists and is not a directory.
1105
1106 * lisp.h (check_existing): Add prototype.
1107
1108 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1109
1110 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1111
1112 2012-10-12 Glenn Morris <rgm@gnu.org>
1113
1114 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
1115
1116 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
1117
1118 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1119
1120 * eval.c (Fautoload): Remember previous autoload status in load-history.
1121
1122 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1123
1124 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1125 * lread.c (load_each_byte, new_backquote_flag, readchar)
1126 (read_filtered_event, lisp_file_lexically_bound_p)
1127 (safe_to_load_version, Fload, complete_filename_p, openp)
1128 (build_load_history, readevalloop, read_escape, read1)
1129 (string_to_number, read_vector, read_list):
1130 * macros.c (Fstart_kbd_macro):
1131 * marker.c (CONSIDER):
1132 * menu.c (parse_single_submenu, digest_single_submenu)
1133 (find_and_return_menu_selection, Fx_popup_menu):
1134 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1135 (Ftry_completion):
1136 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1137 (ns_menu_show):
1138 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1139 (xmenu_show, xdialog_show):
1140 Use bool for booleans.
1141 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1142 as it's not a predicate. All uses changed. Omit unnecessary
1143 buffer termination.
1144
1145 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
1146
1147 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1148 (save_excursion_restore): Do not restore mark if it was not saved.
1149
1150 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1151
1152 * marker.c (cached_modiff): EMACS_INT, not int.
1153
1154 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1155 instead of having a wrong decl.
1156 * nsmenu.m (waiting_for_input): Remove wrong decl.
1157
1158 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1159
1160 keyboard.c, keymap.c: Use bool for booleans.
1161 * dispnew.c (sit_for): Distinguish between 3-way display_option
1162 and boolean do_display.
1163 * keyboard.c (single_kboard, this_command_key_count_reset)
1164 (waiting_for_input, echoing, immediate_quit, input_pending)
1165 (interrupt_input, interrupts_deferred, pop_kboard)
1166 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1167 (command_loop_1, adjust_point_for_property)
1168 (safe_run_hooks_error, input_polling_used, read_char):
1169 (help_char_p, readable_events, kbd_buffer_events_waiting)
1170 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1171 (lucid_event_type_list_p, get_input_pending):
1172 (gobble_input, menu_separator_name_p, menu_bar_item)
1173 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1174 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1175 (keyremap_step, test_undefined, read_key_sequence)
1176 (detect_input_pending, detect_input_pending_ignore_squeezables)
1177 (detect_input_pending_run_timers, requeued_events_pending_p)
1178 (quit_throw_to_read_char, Fset_input_interrupt_mode):
1179 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
1180 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
1181 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
1182 (accessible_keymaps_1, Fkey_description, push_key_description):
1183 (shadow_lookup, struct where_is_internal_data)
1184 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
1185 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
1186 (describe_map, describe_vector):
1187 * menu.c (single_menu_item):
1188 * nsmenu.m (ns_update_menubar):
1189 * process.c (wait_reading_process_output):
1190 * search.c (scan_buffer, scan_newline):
1191 Use bool for boolean.
1192 * keyboard.c (timers_run, swallow_events)
1193 (detect_input_pending_run_timers):
1194 * process.c (wait_reading_process_output):
1195 Use unsigned for counter where wraparound-on-overflow is desired,
1196 since unsigned is guaranteed to have that behavior and signed is not.
1197 (read_char): Use ptrdiff_t for string length.
1198 (get_input_pending): Remove first argument, since it was always
1199 the same pointer-to-int (now pointer-to-boolean) &input_pending,
1200 and behave as if it had that value. Return new value of
1201 input_pending. All callers changed.
1202 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
1203 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
1204 a string length.
1205 * keymap.c (push_key_description): Omit last arg, which was always 1.
1206 All callers changed.
1207
1208 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
1209
1210 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
1211
1212 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
1213 ($(BLD)/term.$(O)): Update dependencies.
1214
1215 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1216
1217 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
1218 * lisp.h (enum pvec_type): Adjust comments and omit explicit
1219 initializer for PVEC_NORMAL_VECTOR.
1220
1221 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1222
1223 Clean out old termopts cruft.
1224 * termopts.h (flow_control, meta_key): Remove unused decls.
1225 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
1226 Don't include termopts.h.
1227
1228 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1229
1230 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
1231
1232 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1233
1234 * commands.h (immediate_quit): Remove duplicate decl.
1235
1236 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
1237
1238 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
1239 caching.
1240 (nsfont_open): Remove setting of Vfonts_in_cache.
1241 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
1242
1243 2012-10-09 Eli Zaretskii <eliz@gnu.org>
1244
1245 * w32fns.c (w32_last_error): Change the return value to DWORD, to
1246 match what GetLastError returns. Explain why the function is
1247 needed.
1248
1249 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
1250 'is_tooltip_frame', to avoid confusion with its global namesake.
1251
1252 2012-10-08 Daniel Colascione <dancol@dancol.org>
1253
1254 * xdisp.c (start_hourglass): Call w32_note_current_window when
1255 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
1256 build that caused Emacs to display the hourglass cursor forever.
1257
1258 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
1259 which is broken under remote desktop, calculate the number of
1260 colors available for a display based on the display's number of
1261 planes and number of bits per pixel per plane. (bug#10397).
1262
1263 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
1264
1265 * nsfont.m (Vfonts_in_cache): New variable.
1266 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
1267 are used. Add cached fonts to Vfonts_in_cache.
1268 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
1269
1270 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
1271
1272 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
1273 in nt/config.nt.
1274 (FONT_H): Define after FRAME_H.
1275 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
1276 Update dependencies.
1277
1278 * w32term.c: Remove leftover declaration of keyboard_codepage.
1279
1280 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1281
1282 * makefile.w32-in (FONT_H): Add $(FRAME_H).
1283 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
1284 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
1285 (GLOBAL_SOURCES): Add cygw32.c.
1286 ($(BLD)/unexw32.$(O)):
1287 ($(BLD)/w32.$(O)):
1288 ($(BLD)/w32console.$(O)):
1289 ($(BLD)/w32fns.$(O)):
1290 ($(BLD)/w32heap.$(O)):
1291 ($(BLD)/w32menu.$(O)):
1292 ($(BLD)/w32proc.$(O)): Add w32common.h.
1293
1294 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
1295 'const char *'.
1296 (x_to_w32_color): Don't modify the argument, modify a copy instead.
1297
1298 2012-10-08 Daniel Colascione <dancol@dancol.org>
1299
1300 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
1301 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
1302 accidental message numbering hole. Change other messages to
1303 match.
1304
1305 * w32select.h (HAVE_W32SELECT): Remove.
1306
1307 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1308 w32common.h instead of w32heap.h.
1309
1310 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
1311 (get_allocation_unit, get_processor_type, get_w32_major_version)
1312 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1313 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1314 (OS_NT, os_subtype, cache_system_info): Move declarations to
1315 w32common.
1316
1317 * w32heap.c: Include w32common.h.
1318 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
1319 (w32_minor_version, w32_build_number, w32_subtype):
1320 Remove duplicate definitions.
1321
1322 * w32fns.c: Include w32common.h; include w32heap.h only in
1323 WINDOWSNT.
1324
1325 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
1326 Use `report_file_error' instead of `error' in order to better
1327 inform users of what went wrong. Increase NTGUI_UNICODE file
1328 dialog box file name length to 32k, the maximum allowed by the NT
1329 kernel.
1330
1331 * w32common.h: New file.
1332 (ROUND_UP, ROUND_DOWN, get_page_size)
1333 (get_allocation_unit, get_processor_type, get_w32_major_version)
1334 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1335 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1336 (OS_NT, os_subtype, cache_system_info): Move here.
1337
1338 * unexw32.c, unexcw.c: Include w32common.h.
1339
1340 * emacs.c (main): Use (defined (WINDOWSNT) || defined
1341 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1342 to call syms_of_w32select.
1343
1344 * cygw32.h: Remove obsolete EXFUN declarations.
1345
1346 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1347
1348 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1349 of w32inevt.o from SOME_MACHINE_OBJECTS.
1350
1351 2012-10-08 Daniel Colascione <dancol@dancol.org>
1352
1353 * image.c: Permanent fix for JPEG compilation issue --- limit
1354 jpeglib `boolean' redefinition to Cygwin builds.
1355
1356 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1357
1358 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1359
1360 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1361 Cygwin.
1362
1363 2012-10-08 Daniel Colascione <dancol@dancol.org>
1364
1365 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1366 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1367 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1368 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1369 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1370 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1371 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1372 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1373 now a supported configuration.
1374
1375 * Makefile.in: consolidate image variables into LIBIMAGE; add
1376 W32_OBJ and W32_LIBS. Compile new files.
1377
1378 * conf_post.h:
1379 (_DebPrint) declare tracing facility for W32 debugging. We need
1380 to unify tracing later.
1381
1382 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1383 unconditional use of W32 Unicode functions. Cygwin runs only on
1384 100% Unicode operating systems.
1385
1386 * cygw32.c: New file. Define Cygwin-specific facilities.
1387 (Fcygwin_convert_path_to_windows)
1388 (Fcygwin_convert_path_from_windows): New user functions for
1389 accessing Cygwin path-munging routines.
1390
1391 * cygw32.h: New file.
1392 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1393 UTF-16LE strings temporarily inside non-Lisp-visible string
1394 objects.
1395
1396 (w32_strerror): Just what it says on the tin.
1397
1398 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1399 also run for Cygwin; both systems have the same problem with using
1400 GUI facilities in a forked child. Also call syms_of_cygw32,
1401 syms_of_w32select in correct places.
1402
1403 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1404 needs fork-then-exec for daemon launching.
1405
1406 * font.h: Include frame.h.
1407
1408 * image.c: Use the image library cache machinery only when we're
1409 compiling for native WINDOWSNT; Cygwin can use shared libraries
1410 like any other Unixlike system.
1411
1412 * keyboard.c: Clarify a comment regarding the input loop.
1413
1414 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1415 functions directly instead of trying to detect at runtime that our
1416 host operating system supports them. We make this change for two
1417 reasons: Cygwin lacks support for the multibyte character
1418 conversion functions used by the legacy menu code, and Cygwin
1419 never needs to rely on non-Unicode APIs.
1420
1421 * unexw32.c (hinst): Declare extern.
1422
1423 * w32.c: Change header order;
1424 (w32_strerror): Move to w32fns.c because we need it for
1425 non-WINDOWSNT builds.
1426
1427 * w32.h: Add #error macro to make sure we don't include w32.h for
1428 Cygwin builds. Remove w32select declarations.
1429
1430 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1431 w32fns.c. w32console.c is WINDOWSNT-only.
1432
1433 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1434 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
1435 POSIXy alternative.
1436 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1437 (w32_major_version, w32_minor_version, w32_build_number)
1438 (os_subtype, sound_type): Define here
1439 (w32_defined_color): Make color parameter const for consistency
1440 with other _defined_color functions.
1441 (w32_createwindow): Unconditionally call w32_init_class instead of
1442 doing so only when hprevinst is non-NULL. Plumbing hprevinst
1443 through the code is complex and unnecessary because class
1444 registration is practically free.
1445 (w32_name_of_message): New EMACSDEBUG-only function.
1446 (Fset_message_beep): Move here
1447 (Fx_open_connection): Require that the display name for Windows be
1448 "w32" for consistency, emacsclient disambiguation, and maybe, one
1449 day, multi-window-system support.
1450 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1451 Cygwin files for W32 GUI facilities, since these clearly don't
1452 expect Cygwin names.
1453 (_DebPrint): Define.
1454 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1455 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1456 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1457 (w32_last_error): Remove.
1458
1459 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1460
1461 * w32heap.c (syspage_mask): Declare here.
1462 (cache_system_info): Remove.
1463
1464 * w32inevt.c (faked_key): Define globally, not statically.
1465 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1466 (w32_console_toggle_lock_key): Move to w32fns.c.
1467
1468 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
1469
1470 * w32proc.c (_DebPrint): Move to w32fns.c.
1471 * w32select.c: Include string.h, stdio.h for Cygwin.
1472 * w32select.h: New File.
1473
1474 * w32term.c: Include io.h for non-CYGWIN builds; needed for
1475 get_osfhandle.
1476 (w32_message_fd): New variable. Under Cygwin, holds the file
1477 descriptor the system used to tell us about pending thread
1478 messages.
1479
1480 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1481 that prevented compilation under non-WINDOWSNT systems.
1482
1483 (w32_initialize): Open /dev/windows and assign it to
1484 w32_message_fd. Provide w32 feature.
1485
1486 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1487 (WM_EMACS_INPUT_READY): add.
1488 (prepend_msg, w32_message_fd): Declare globally.
1489
1490 * w32xfns.c:
1491 (keyboard_handle): Use only when WINDOWSNT.
1492 (notify_msg_ready): New function. Posts a message to the main
1493 thread's message queue under CYGWIN, which wakes up the main
1494 thread from select(2) by making the /dev/windows file descriptor
1495 ready. Under WINDOWSNT, it sets an event the same way the old
1496 code did.
1497
1498 (post, prepend_msg): Actually call notify_msg_ready instead of
1499 setting the input event directly.
1500
1501 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1502
1503 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1504 but it still has blocs in it, don't return it to the system,
1505 instead of aborting. (Bug#12402)
1506
1507 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1508
1509 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1510
1511 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1512 MAC_OS_X_VERSION_10_6.
1513 (syms_of_nsterm): Remove comment about Panther and above for
1514 ns-antialias-text.
1515 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1516 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1517 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1518
1519 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1520 MAC_OS_X_VERSION_10_4.
1521
1522 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1523 MAC_OS_X_VERSION_10_2.
1524
1525 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1526
1527 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1528 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1529
1530 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1531 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1532 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1533 Remove ns_in_resize check.
1534 (ns_clear_frame_area): Remove resize handle code.
1535
1536 * nsfns.m (ns_in_resize): Remove.
1537 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1538 Remove ns_in_resize check.
1539
1540 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1541
1542 Improve sys_siglist detection.
1543 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1544 defined as a macro, as is done in Solaris.
1545 (sys_siglist_entries): New macro.
1546 (save_strsignal): Use it.
1547 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1548 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1549
1550 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1551
1552 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1553 fullscreen/Fullscreen.
1554
1555 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1556 tobar_height is new.
1557
1558 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1559 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1560 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1561 (windowDidResize:): Check for correct window if old style fullscreen.
1562 Capitalize word in comment. Remove incorrect comment.
1563 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1564 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1565 error in drawing background.
1566 (toggleFullScreen:): Remove comment. Rearrange calls.
1567 Set toolbar values to zero, save old height in tobar_height.
1568 Restore tool bar height when leaving fullscreen.
1569 (canBecomeMainWindow): New function.
1570
1571 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1572
1573 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1574
1575 2012-10-05 Eli Zaretskii <eliz@gnu.org>
1576
1577 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1578
1579 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1580 that time stamps of directories could also be changed.
1581 Don't request the too broad GENERIC_WRITE, only the more restrictive
1582 FILE_WRITE_ATTRIBUTES access rights.
1583
1584 * fileio.c (Fset_file_times): Special-case ignoring errors for
1585 directories only on MSDOS, not on MS-Windows.
1586
1587 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
1588
1589 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1590
1591 2012-10-04 Eli Zaretskii <eliz@gnu.org>
1592
1593 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1594 see whether CreateFile failed.
1595
1596 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1597
1598 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1599 to avoid similar races.
1600 * keyboard.c (pending_signals): Now bool, not int.
1601
1602 Port timers to OpenBSD, plus check for timer failures.
1603 OpenBSD problem reported by Han Boetes.
1604 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1605 and/or setitimer.
1606 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1607 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1608 like OpenBSD, which has timer_settime but does not declare it.
1609 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1610 whether to use itimerspec-related primitives. All uses of
1611 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1612
1613 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1614
1615 * profiler.c (handle_profiler_signal): Fix a malloc race
1616 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1617
1618 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1619
1620 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1621
1622 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1623
1624 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1625 consistent with the change in return value of 'safe_strsignal'.
1626
1627 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1628
1629 Prefer plain 'static' to 'static inline' (Bug#12541).
1630 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1631 (bidi_set_sor_type, bidi_push_embedding_level)
1632 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1633 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1634 (bidi_cache_search, bidi_cache_ensure_space)
1635 (bidi_cache_iterator_state, bidi_cache_find)
1636 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1637 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1638 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1639 Now 'static', not 'static inline'.
1640
1641 Count overruns when profiling; change units to ns.
1642 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1643 Give extra weight to samples after overruns, to attempt to count
1644 the time more accurately.
1645 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1646 the underlying primitives nominally do ns.
1647 (Fprofiler_cpu_start): Document the change. Mention that
1648 the sampling intervals are only approximate.
1649
1650 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1651
1652 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1653
1654 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1655 case for the special 0 coding-system.
1656
1657 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1658 (Fmake_overlay): Remove redundant tests.
1659 (fix_start_end_in_overlays): Remove redundant recentering.
1660
1661 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1662
1663 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1664 Update dependencies.
1665
1666 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1667
1668 Fix a malloc race condition involving strsignal.
1669 A signal can arrive in the middle of a malloc, and Emacs's signal
1670 handler can invoke strsignal, which can invoke malloc, which is
1671 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1672 Fix it by altering the signal handler so that it does not invoke
1673 strsignal.
1674 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1675 * process.c (status_message): Use const pointer, in case strsignal
1676 is #defined to safe_strsignal.
1677 * sysdep.c (sys_siglist, init_signals): Always define and
1678 initialize a substitute sys_siglist if the system does not define
1679 one, even if HAVE_STRSIGNAL.
1680 (safe_strsignal): Rename from strsignal. Always define,
1681 using sys_siglist. Return a const pointer.
1682 * syssignal.h (safe_strsignal): New decl.
1683 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1684
1685 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1686
1687 * w32proc.c (timer_loop): Fix code that waits for timer
1688 expiration, to avoid high CPU usage.
1689
1690 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1691
1692 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1693 (sweep_weak_table): Remove redundant prototypes.
1694
1695 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1696
1697 * emacs.c: Move the inclusion of TERM_HEADER after including
1698 windows.h on WINDOWSNT. This avoids compilation problems with
1699 MSVC.
1700
1701 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1702
1703 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1704 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1705 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1706 as the previous version used 'void *'.
1707
1708 * ralloc.c (ROUNDUP): Fix last change.
1709 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1710 'size_t'.
1711
1712 * w32proc.c <disable_itimers>: New static flag.
1713 (init_timers): Initialize it to zero, after creating the critical
1714 sections used by the timer threads.
1715 (term_timers): Set to 1 before deleting the critical sections.
1716 (getitimer, setitimer): If disable_itimers is non-zero, return an
1717 error indication without doing anything. Reported by Fabrice
1718 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1719 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1720 return results.
1721 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1722 support timers.
1723
1724 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1725 term_ntproc after all the other bookkeeping, to get timers working
1726 as long as possible.
1727
1728 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1729
1730 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1731 Suggested by Juri Linkov in
1732 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1733
1734 Prefer plain 'static' to 'static inline' (Bug#12541).
1735 With static functions, modern compilers inline pretty well by
1736 themselves; advice from programmers often hurts as much as it helps.
1737 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1738 this change shrinks the text size of the Emacs executable by 1.1%
1739 without affecting CPU significantly in my benchmark.
1740 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1741 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1742 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1743 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1744 (bset_auto_fill_function, bset_auto_save_file_format)
1745 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1746 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1747 (bset_cache_long_line_scans, bset_case_fold_search)
1748 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1749 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1750 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1751 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1752 (bset_header_line_format, bset_indicate_buffer_boundaries)
1753 (bset_indicate_empty_lines, bset_invisibility_spec)
1754 (bset_left_fringe_width, bset_major_mode, bset_mark)
1755 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1756 (bset_name, bset_overwrite_mode, bset_pt_marker)
1757 (bset_right_fringe_width, bset_save_length)
1758 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1759 (bset_scroll_up_aggressively, bset_selective_display)
1760 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1761 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1762 (set_buffer_overlays_after):
1763 * category.c (bset_category_table):
1764 * charset.c (read_hex):
1765 * coding.c (produce_composition, produce_charset)
1766 (handle_composition_annotation, handle_charset_annotation)
1767 (char_encodable_p):
1768 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1769 (assign_row, set_frame_matrix_frame, make_current)
1770 (add_row_entry):
1771 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1772 * fns.c (maybe_resize_hash_table):
1773 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1774 * gmalloc.c (register_heapinfo):
1775 * image.c (lookup_image_type):
1776 * intervals.c (set_interval_object, set_interval_left)
1777 (set_interval_right, copy_interval_parent, rotate_right)
1778 (rotate_left, balance_possible_root_interval):
1779 * keyboard.c (kset_echo_string, kset_kbd_queue)
1780 (kset_keyboard_translate_table, kset_last_prefix_arg)
1781 (kset_last_repeatable_command, kset_local_function_key_map)
1782 (kset_overriding_terminal_local_map, kset_real_last_command)
1783 (kset_system_key_syms, clear_event, set_prop):
1784 * lread.c (digit_to_number):
1785 * marker.c (attach_marker, live_buffer, set_marker_internal):
1786 * nsterm.m (ns_compute_glyph_string_overhangs):
1787 * process.c (pset_buffer, pset_command)
1788 (pset_decode_coding_system, pset_decoding_buf)
1789 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1790 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1791 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1792 * syntax.c (bset_syntax_table, dec_bytepos):
1793 * terminal.c (tset_param_alist):
1794 * textprop.c (interval_has_some_properties)
1795 (interval_has_some_properties_list):
1796 * window.c (wset_combination_limit, wset_dedicated)
1797 (wset_display_table, wset_hchild, wset_left_fringe_width)
1798 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1799 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1800 (wset_right_fringe_width, wset_right_margin_cols)
1801 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1802 (wset_vertical_scroll_bar_type, wset_window_parameters):
1803 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1804 (wset_column_number_displayed, wset_region_showing)
1805 (window_box_edges, run_window_scroll_functions)
1806 (append_glyph_string_lists, prepend_glyph_string_lists)
1807 (append_glyph_string, set_glyph_string_background_width)
1808 (append_glyph, append_composite_glyph)
1809 (take_vertical_position_into_account):
1810 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1811 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1812 (lface_hash, lface_same_font_attributes_p, lookup_face):
1813 * xml.c (libxml2_loaded_p):
1814 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1815 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1816 Now 'static', not 'static inline'.
1817
1818 * bidi.c: Tune.
1819 (bidi_copy_it): Do the whole copy with a single memcpy.
1820 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1821
1822 Revert the FOLLOW-SYMLINKS change for file-attributes.
1823 Doing it right would require several changes to Tramp, and there's
1824 not enough time to get that tested before the freeze today.
1825 * dired.c (directory_files_internal, Ffile_attributes):
1826 Undo last change.
1827
1828 * frame.c (x_report_frame_params): Port better to wider ints.
1829 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1830 or that pointers can be printed in 15 decimal digits.
1831 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1832
1833 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1834
1835 Support x64 build on MS-Windows.
1836 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1837 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1838 compatibility with x64.
1839 (x_get_focus_frame): Add prototype.
1840
1841 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1842 defining an XRectangle structure.
1843
1844 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1845 arithmetics for compatibility with x64.
1846
1847 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1848 compatibility with x64.
1849
1850 * w32heap.h: Adjust prototypes and declarations.
1851
1852 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1853 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1854 DWORD, long, and unsigned long, for compatibility with x64.
1855 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1856 (sbrk): Argument is now of type ptrdiff_t.
1857
1858 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1859 less than 0x0500.
1860 (w32_msg_pump): Use WPARAM type for 'result'.
1861
1862 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1863 architecture.
1864 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1865 compatibility with x64.
1866
1867 * vm-limit.c (lim_data): Now size_t.
1868 (check_memory_limits): Adjust prototypes of real_morecore and
1869 __morecore to receive argument of type ptrdiff_t. Use size_t for
1870 five_percent and data_size.
1871
1872 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1873 variables, for compatibility with x64.
1874 (rva_to_section, offset_to_section, relocate_offset)
1875 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1876 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1877 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1878 for compatibility with x64.
1879
1880 * sysdep.c (STDERR_FILENO): Define if not already defined.
1881
1882 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1883 (__morecore): Argument type is now ptrdiff_t.
1884 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1885 (relinquish): Use ptrdiff_t type for 'excess'.
1886 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1887
1888 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1889 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1890 instead of a literal number.
1891
1892 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1893 (min): Define only if not already defined.
1894
1895 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1896 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1897 hosts.
1898
1899 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1900 'bitmaps' is a pointer.
1901
1902 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1903
1904 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1905
1906 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1907
1908 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1909 * dired.c (directory_files_internal, Ffile_attributes):
1910 New arg follow_symlinks. All uses changed.
1911
1912 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1913
1914 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1915
1916 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1917
1918 Support atimers and CPU profiler via profile.c on MS-Windows.
1919 * w32proc.c (sig_mask, crit_sig): New static variables.
1920 (sys_signal): Support SIGALRM and SIGPROF.
1921 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1922 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1923 sigfillset, and sigprocmask are no longer no-ops.
1924 (sigismember): New function.
1925 (struct itimer_data): New definition.
1926 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1927 (crit_prof): New static variables.
1928 (MAX_SINGLE_SLEEP): New definition.
1929 (timer_loop, stop_timer_thread, term_timers, init_timers)
1930 (start_timer_thread, getitimer, setitimer): New functions.
1931 (alarm): No longer a no-op, calls setitimer.
1932
1933 * w32.c (term_ntproc): Call term_timers.
1934 (init_ntproc): Make sure all signals are unblocked at startup, to
1935 erase any traces of dumping. Call init_timers.
1936
1937 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1938 Windows-specific code to display the hourglass mouse pointer is no
1939 longer used.
1940 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1941 to hourglass timer expiration.
1942 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1943 Remove, no longer used.
1944 (w32_note_current_window, show_hourglass, hide_hourglass):
1945 New functions, in support of hourglass cursor display similar to other
1946 window systems.
1947 (syms_of_w32fns): Don't initialize hourglass_timer.
1948
1949 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1950 WINDOWSNT as well.
1951 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1952
1953 * w32.h (init_timers, term_timers): Add prototypes.
1954
1955 2012-09-30 Kenichi Handa <handa@gnu.org>
1956
1957 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1958 to the buffer relocation which may be caused by ccl_driver.
1959
1960 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1961
1962 * xfns.c (Fx_file_dialog): Update comment.
1963
1964 * w32fns.c (Fx_file_dialog): Update comment.
1965
1966 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1967 Initialize panel name field if OSX >= 10.6.
1968
1969 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1970
1971 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1972
1973 * nsterm.m (NEW_STYLE_FS): New define.
1974 (ns_fullscreen_hook, windowWillEnterFullScreen)
1975 (windowDidEnterFullScreen, windowWillExitFullScreen)
1976 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1977 (setFSValue): New functions.
1978 (EmacsFSWindow): New implementation.
1979 (canBecomeKeyWindow): New function for EmacsFSWindow.
1980 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1981 (dealloc): Release nonfs_window if in fullscreen.
1982 (updateFrameSize:): Call windowDidMove to update top/left.
1983 (windowWillResize:toSize:): Check if frame is still maximized.
1984 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1985 next_maximized, maximized_width, maximized_height and nonfs_window.
1986 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1987 tbar_height.
1988 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1989 fullscreen. Set maximized_width/height. Act on next_maximized.
1990
1991 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1992 (EmacsView): Add variables for fullscreen.
1993 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1994 (EmacsFSWindow): New interface for fullscreen.
1995
1996 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1997
1998 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1999
2000 2012-09-30 Chong Yidong <cyd@gnu.org>
2001
2002 * fns.c (Frandom): Doc fix.
2003
2004 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2005
2006 * window.c (Vwindow_combination_limit): New default value.
2007 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2008
2009 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2010
2011 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2012 Suggested by Eli Zaretskii in
2013 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2014
2015 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2016
2017 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2018 HAVE_TIMER_SETTIME is defined.
2019
2020 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2021
2022 Profiler improvements: more-accurate timers, overflow checks.
2023 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2024 signal.h, setjmp.h. Include systime.h instead.
2025 (saturated_add): New function.
2026 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2027 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2028 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2029 New static vars.
2030 (enum profiler_cpu_running): New enum.
2031 (profiler_cpu_running): Now of that enum type, not bool.
2032 All uses changed to store the new value.
2033 (handle_profiler_signal): Rename from sigprof_handler_1,
2034 for consistency with other handlers. Do not check whether
2035 cpu_log is a hash-table if garbage collecting, since it
2036 doesn't matter in that case.
2037 (deliver_profiler_signal): Rename from sigprof_handler,
2038 for consistency with other handlers.
2039 (setup_cpu_timer): New function, with much of what used to be in
2040 Fprofiler_cpu_start. Check for out-of-range argument.
2041 Prefer timer_settime if available, and prefer
2042 thread cputime clocks, then process cputime clocks, then
2043 monotonic clocks, to the old realtime clock. Use make_timeval
2044 to round more-correctly when falling back to setitimer.
2045 (Fprofiler_cpu_start): Use it.
2046 (Fprofiler_cpu_stop): Prefer timer_settime if available.
2047 Don't assume that passing NULL as the 2nd argument of setitimer
2048 is the same as passing a pointer to all-zero storage.
2049 Ignore SIGPROF afterwards.
2050 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2051 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2052 non-fatal signal handlers. Ignore SIGPROF on startup.
2053 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2054 in profiler.c, since sysdep.c now uses it.
2055
2056 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2057 Suggested by Eli Zaretskii in
2058 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2059
2060 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
2061
2062 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2063
2064 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2065
2066 * lisp.h (struct backtrace): Remove indirection for `function' field.
2067 * xdisp.c (redisplay_internal):
2068 * profiler.c (record_backtrace, sigprof_handler_1):
2069 * alloc.c (Fgarbage_collect):
2070 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2071 (Fbacktrace_frame): Adjust accordingly.
2072
2073 2012-09-28 Glenn Morris <rgm@gnu.org>
2074
2075 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2076 (Frun_hook_with_args_until_failure): Doc fixes.
2077
2078 2012-09-28 Eli Zaretskii <eliz@gnu.org>
2079
2080 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2081 Qautomatic_redisplay and change the symbol name. All users changed.
2082
2083 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
2084
2085 * profiler.c (sigprof_handler): Fix race condition.
2086
2087 2012-09-28 Glenn Morris <rgm@gnu.org>
2088
2089 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
2090
2091 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
2092
2093 Check more robustly for timer_settime.
2094 * Makefile.in (LIB_TIMER_TIME): New macro.
2095 (LIBES): Add it.
2096 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2097 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2098 call timer_settime.
2099
2100 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2101
2102 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2103
2104 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
2105
2106 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2107
2108 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
2109
2110 * character.h (MAYBE_UNIFY_CHAR): Remove.
2111 * charset.c, charset.h (maybe_unify_char): Now static.
2112 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2113 Since this stuff is now private to charset.c, there's no need for
2114 a public macro and no need to inline by hand.
2115
2116 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2117 Stefan Monnier <monnier@iro.umontreal.ca>
2118 Juanma Barranquero <lekktu@gmail.com>
2119
2120 * profiler.c: New file.
2121 * Makefile.in (base_obj): Add profiler.o.
2122 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2123 ($(BLD)/profiler.$(O)): New target.
2124 * emacs.c (main): Call syms_of_profiler.
2125 * alloc.c (Qautomatic_gc): New constant.
2126 (MALLOC_PROBE): New macro.
2127 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2128 (total_bytes_of_live_objects): New function.
2129 (Fgarbage_collect): Use it. Record itself in backtrace_list.
2130 Call malloc_probe for the memory profiler.
2131 (syms_of_alloc): Define Qautomatic_gc.
2132 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2133 race condition.
2134 (struct backtrace): Move definition...
2135 * lisp.h (struct backtrace): ..here.
2136 (Qautomatic_gc, profiler_memory_running): Declare vars.
2137 (malloc_probe, syms_of_profiler): Declare functions.
2138 * xdisp.c (Qautomatic_redisplay): New constant.
2139 (redisplay_internal): Record itself in backtrace_list.
2140 (syms_of_xdisp): Define Qautomatic_redisplay.
2141
2142 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2143 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2144
2145 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2146
2147 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
2148
2149 Prefer POSIX timers if available.
2150 They avoid a race if the timer is too close to the current time.
2151 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2152 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
2153 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
2154
2155 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2156
2157 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2158 CHAR_STRING_ADVANCE.
2159 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2160 STRING_CHAR_ADVANCE.
2161
2162 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2163
2164 Move Vlibrary_cache to emacs.c and reset before dumping.
2165
2166 * lisp.h (reset_image_types): Declare.
2167 [WINDOWSNT] (Vlibrary_cache): Declare.
2168
2169 * image.c (reset_image_types): New function.
2170
2171 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2172 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2173 (Fdump_emacs): Reset Vlibrary_cache and image_types.
2174
2175 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2176 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
2177
2178 * w32.h (Vlibrary_cache): Do not declare.
2179
2180 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2181
2182 * w32proc.c (sys_signal): Handle all signals defined by the
2183 MS-Windows runtime, not just SIGCHLD. Actually install the signal
2184 handlers for signals supported by Windows. Don't override
2185 term_ntproc as the handler for SIGABRT.
2186 (sigaction): Rewrite to call sys_signal instead of duplicating its
2187 code.
2188 (sys_kill): Improve commentary.
2189
2190 * w32.c (term_ntproc): Accept (and ignore) one argument, for
2191 consistency with a signature of a signal handler. All callers
2192 changed.
2193 (init_ntproc): Accept an argument DUMPING. If dumping, don't
2194 install term_ntproc as a signal handler for SIGABRT, as that
2195 should be done by the dumped Emacs.
2196
2197 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
2198
2199 * w32select.c (term_w32select): Protect against repeated
2200 invocation by setting clipboard_owner to NULL after calling
2201 DestroyWindow.
2202
2203 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
2204 and term_ntproc to their modified signatures.
2205
2206 * character.c (char_string, string_char): Remove calls to
2207 MAYBE_UNIFY_CHAR. See the discussion starting at
2208 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
2209 for the details.
2210
2211 2012-09-25 Chong Yidong <cyd@gnu.org>
2212
2213 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
2214
2215 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
2216
2217 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
2218 when encountering an unknown bytecode.
2219
2220 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
2221
2222 image.c, indent.c: Use bool for booleans.
2223 * dispextern.h (struct image_type): Members valid_p, load, init
2224 now return bool, not int. All uses changed.
2225 * image.c: Omit unnecessary static decls.
2226 (x_create_bitmap_mask, x_build_heuristic_mask):
2227 Return void, not int, since callers don't care about the return value.
2228 (x_create_bitmap_mask, define_image_type, valid_image_p)
2229 (struct image_keyword, parse_image_spec, image_spec_value)
2230 (check_image_size, image_background)
2231 (image_background_transparent, x_clear_image_1)
2232 (postprocess_image, lookup_image, x_check_image_size)
2233 (x_create_x_image_and_pixmap, xbm_image_p)
2234 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
2235 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
2236 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
2237 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
2238 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
2239 (png_image_p, init_png_functions, png_load_body, png_load)
2240 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
2241 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
2242 (init_gif_functions, gif_load, imagemagick_image_p)
2243 (imagemagick_load_image, imagemagick_load, svg_image_p)
2244 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
2245 (gs_load):
2246 * nsimage.m (ns_load_image):
2247 * nsterm.m (ns_defined_color):
2248 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
2249 * xfns.c (x_defined_color):
2250 * xterm.c (x_alloc_lighter_color_for_widget)
2251 (x_alloc_nearest_color_1, x_alloc_nearest_color)
2252 (x_alloc_lighter_color):
2253 * indent.c (disptab_matches_widthtab, current_column)
2254 (scan_for_column, string_display_width, indented_beyond_p)
2255 (compute_motion, vmotion, Fvertical_motion):
2256 Use bool for booleans.
2257
2258 2012-09-24 Chong Yidong <cyd@gnu.org>
2259
2260 * chartab.c (Fset_char_table_default): Obsolete function removed.
2261
2262 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2263
2264 Move pid_t related decls out of lisp.h.
2265 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
2266 (interruptible_wait_for_termination):
2267 Move these decls from lisp.h to syswait.h, since they use pid_t.
2268 Needed on FreeBSD; see Herbert J. Skuhra in
2269 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
2270 * callproc.c: Include syswait.h.
2271
2272 gnutls.c, gtkutil.c: Use bool for boolean.
2273 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
2274 (emacs_gnutls_handle_error):
2275 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
2276 (xg_hide_tooltip, xg_create_frame_widgets)
2277 (create_dialog, xg_uses_old_file_dialog)
2278 (xg_get_file_with_chooser, xg_get_file_with_selection)
2279 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
2280 (xg_item_label_same_p, xg_update_menubar)
2281 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
2282 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
2283 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
2284 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
2285 (update_frame_tool_bar, free_frame_tool_bar):
2286 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
2287 * nsmenu.m (ns_update_menubar):
2288 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
2289 * xfns.c (Fx_show_tip) [USE_GTK]:
2290 Use bool for boolean.
2291 * gtkutil.c (xg_update_frame_menubar):
2292 * xmenu.c (update_frame_menubar):
2293 Return void, not int, since caller ignores return value.
2294 * gtkutil.c (xg_change_toolbar_position):
2295 Return void, not 1.
2296
2297 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2298
2299 * makefile.w32-in (BLOCKINPUT_H): Remove.
2300 (SYSSIGNAL_H): New macro.
2301 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
2302 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
2303 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
2304 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
2305 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
2306 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
2307 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
2308 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
2309 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
2310 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
2311 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
2312 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
2313 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
2314 ($(BLD)/w32xfns.$(O)): Update dependencies.
2315
2316 2012-09-23 Eli Zaretskii <eliz@gnu.org>
2317
2318 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
2319 fatal_error_backtrace.
2320
2321 * w32proc.c (sys_kill): Undo last change: don't do anything when
2322 invoked to deliver SIGABRT to our own process. This is now
2323 handled by emacs_raise.
2324
2325 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2326
2327 * w32term.c (w32_read_socket): Remove leftover reference to
2328 interrupt_input_pending.
2329
2330 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2331
2332 Do not use SA_NODEFER.
2333 Problem reported by Dani Moncayo in
2334 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2335 * alloc.c (die):
2336 * sysdep.c (emacs_abort): Do not reset signal handler.
2337 * emacs.c (terminate_due_to_signal): Reset signal handler here.
2338 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
2339 wanted even on POSIXish hosts, and it doesn't work on Windows.
2340
2341 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2342
2343 * xterm.c (x_term_init): Call fixup_locale before and after calling
2344 gtk_init (Bug#12392).
2345
2346 2012-09-23 Chong Yidong <cyd@gnu.org>
2347
2348 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2349 Vdynamic_library_alist.
2350
2351 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2352 (Fgnutls_available_p): Caller changed.
2353
2354 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2355 (Flibxml_parse_xml_region): Likewise.
2356
2357 * dispextern.h (struct image_type): Remove arg from init function.
2358
2359 * image.c (Finit_image_library, lookup_image_type)
2360 (define_image_type): Remove now-unneeded second arg.
2361 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2362 (init_tiff_functions, init_gif_functions, init_svg_functions):
2363 Arglist and w32_delayed_load calling convention changed.
2364 (gs_type): Remove init_gs_functions; there is no such function.
2365 (valid_image_p, make_image): Fix caller to lookup_image_type.
2366
2367 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2368
2369 Simplify and avoid signal-handling races (Bug#12471).
2370 * alloc.c (die):
2371 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2372 Avoid recursive loop if there's a fatal error in the function itself.
2373 * atimer.c (pending_atimers):
2374 * blockinput.h: Don't include "atimer.h"; no longer needed.
2375 (interrupt_input_pending): Remove. All uses removed.
2376 pending_signals now counts both atimers and ordinary interrupts.
2377 This is less racy than having three separate pending-signal flags.
2378 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2379 (input_blocked_p):
2380 Rename from their upper-case counterparts BLOCK_INPUT,
2381 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2382 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2383 This makes it easier to access volatile variables more accurately.
2384 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2385 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2386 that's more reliable if the code is buggy and sets
2387 interrupt_input_blocked to a negative value. All uses changed.
2388 * atimer.c (deliver_alarm_signal):
2389 Remove. No need to deliver this to the parent; any thread can
2390 handle this signal now. All uses replaced by underlying handler.
2391 * atimer.c (turn_on_atimers):
2392 * dispnew.c (handle_window_change_signal):
2393 * emacs.c (handle_danger_signal):
2394 * keyboard.c (kbd_buffer_get_event):
2395 Don't reestablish signal handler; not needed with sigaction.
2396 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2397 (UNBLOCK_INPUT_TO):
2398 Rework to avoid unnecessary accesses to volatile variables.
2399 (UNBLOCK_INPUT_TO): Now a function.
2400 (totally_unblock_input, unblock_input): New decls.
2401 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2402 (init_data): Remove. Necessary stuff now done in init_signal.
2403 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2404 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2405 (fatal_error_code): Remove; no longer needed.
2406 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2407 it doesn't always backtrace. All uses changed. No need to reset
2408 signal to default, since sigaction and/or die does that for us now.
2409 Use emacs_raise (FOO), not kill (getpid (), FOO).
2410 (main): Check more-accurately whether we're dumping.
2411 Move fatal-error setup to sysdep.c
2412 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2413 * gtkutil.c (xg_get_file_name, xg_get_font):
2414 Remove no-longer-needed signal-mask manipulation.
2415 * keyboard.c, process.c (POLL_FOR_INPUT):
2416 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2417 * keyboard.c (read_avail_input): Remove.
2418 All uses replaced by gobble_input.
2419 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2420 (kbd_buffer_store_event_hold, gobble_input):
2421 (record_asynch_buffer_change) [USABLE_SIGIO]:
2422 (store_user_signal_events):
2423 No need to mess with signal mask.
2424 (gobble_input): If blocking input and there are terminals, simply
2425 set pending_signals to 1 and return. All hooks changed to not
2426 worry about whether input is blocked.
2427 (process_pending_signals): Clear pending_signals before processing
2428 them, in case a signal comes in while we're processing.
2429 By convention callers now test pending_signals before calling us.
2430 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2431 New functions, to support changes to blockinput.h.
2432 (handle_input_available_signal): Now extern.
2433 (reinvoke_input_signal): Remove. All uses replaced by
2434 handle_async_input.
2435 (quit_count): Now volatile, since a signal handler uses it.
2436 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2437 All callers changed. Block SIGINT only if not already blocked.
2438 Clear sigmask reliably, even if Fsignal returns, which it can.
2439 Omit unnecessary accesses to volatile var.
2440 (quit_throw_to_read_char): No need to restore sigmask.
2441 * keyboard.c (gobble_input, handle_user_signal):
2442 * process.c (wait_reading_process_output):
2443 Call signal-handling code rather than killing ourselves.
2444 * lisp.h: Include <float.h>, for...
2445 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2446 (pending_signals): Now volatile.
2447 (syms_of_data): Now const if IEEE floating point.
2448 (handle_input_available_signal) [USABLE_SIGIO]:
2449 (terminate_due_to_signal, record_child_status_change): New decls.
2450 * process.c (create_process): Avoid disaster if memory is exhausted
2451 while we're processing a vfork, by tightening the critical section
2452 around the vfork.
2453 (send_process_frame, process_sent_to, handle_pipe_signal)
2454 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
2455 ignores SIGPIPE.
2456 (send_process): No need for setjmp/longjmp any more, since the
2457 SIGPIPE stuff is now gone. Instead, report an error if errno
2458 is EPIPE.
2459 (record_child_status_change): Now extern. PID and W are now args.
2460 Return void, not bool. All callers changed.
2461 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2462 Remove. All uses removed. This bug should be fixed now in a
2463 different way.
2464 (wait_for_termination_1): Use waitpid rather than sigsuspend,
2465 and record the child status change directly. This avoids the
2466 need to futz with the signal mask.
2467 (process_fatal_action): Move here from emacs.c.
2468 (emacs_sigaction_flags): New function, containing
2469 much of what used to be in emacs_sigaction_init.
2470 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
2471 caught by emacs, to make races less likely.
2472 (deliver_process_signal): Rename from handle_on_main_thread.
2473 All uses changed.
2474 (BACKTRACE_LIMIT_MAX): Now at top level.
2475 (thread_backtrace_buffer, threadback_backtrace_pointers):
2476 New static vars.
2477 (deliver_thread_signal, deliver_fatal_thread_signal):
2478 New functions, for more-accurate delivery of thread-specific signals.
2479 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2480 (deliver_arith_signal): Handle in this thread, not
2481 in the main thread, since it's triggered by this thread.
2482 (maybe_fatal_sig): New function.
2483 (init_signals): New arg DUMPING so that we can be more accurate
2484 about whether we're dumping. Caller changed.
2485 Treat thread-specific signals differently from process-general signals.
2486 Block all signals while handling fatal error; that's safer.
2487 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2488 on IEEE hosts.
2489 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2490 Ignore SIGPIPE unless batch.
2491 (emacs_backtrace): Output backtrace for the appropriate thread,
2492 which is not necessarily the main thread.
2493 * syssignal.h: Include <stdbool.h>.
2494 (emacs_raise): New macro.
2495 * xterm.c (x_connection_signal): Remove; no longer needed
2496 now that we use sigaction.
2497 (x_connection_closed): No need to mess with sigmask now.
2498 (x_initialize): No need to reset SIGPIPE handler here, since
2499 init_signals does this for us now.
2500
2501 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2502
2503 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2504 background rect may be larger (Bug#12245).
2505
2506 2012-09-23 Chong Yidong <cyd@gnu.org>
2507
2508 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2509
2510 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2511
2512 * .gdbinit: Just stop at fatal_error_backtrace.
2513 See Stefan Monnier's request in
2514 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2515 Remove no-longer-used query of system type.
2516
2517 2012-09-22 Chong Yidong <cyd@gnu.org>
2518
2519 * search.c (Freplace_match): Doc fix (Bug#12325).
2520
2521 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2522
2523 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2524 (Fline_end_position): Doc fix.
2525
2526 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2527
2528 2012-09-22 Chong Yidong <cyd@gnu.org>
2529
2530 * dispextern.h (struct image_type): Add new slot, storing a type
2531 initialization function.
2532
2533 * image.c (define_image_type): Call the image initializer function
2534 if it is defined. Arguments and return value changed.
2535 (valid_image_p, make_image): Callers changed.
2536 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2537 (gif_type, imagemagick_type, svg_type, gs_type):
2538 Add initialization functions.
2539 (Finit_image_library): Call lookup_image_type.
2540 (CHECK_LIB_AVAILABLE): Macro deleted.
2541 (lookup_image_type): Call define_image_type here, rather than via
2542 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2543 (syms_of_image): Move define_image_type calls for xbm_type and
2544 pbm_type to lookup_image_type.
2545
2546 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2547
2548 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2549 'idle_timers' from here ...
2550 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2551 lists, to avoid infloops when the timer does something stupid,
2552 like reinvoke itself with the same or smaller time-out.
2553 (Bug#12447)
2554
2555 2012-09-22 Martin Rudalics <rudalics@gmx.at>
2556
2557 * window.c (Fsplit_window_internal): Handle only Qt value of
2558 Vwindow_combination_limit separately.
2559 (Qtemp_buffer_resize): New symbol.
2560 (Vwindow_combination_limit): New default value.
2561 Rewrite doc-string.
2562
2563 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2564
2565 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2566 the new overlay string. (Bug#10159)
2567
2568 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2569
2570 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2571 or that fprintf is async-signal-safe. POSIX doesn't require
2572 either assumption.
2573
2574 2012-09-22 Chong Yidong <cyd@gnu.org>
2575
2576 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2577 (Bug#8207).
2578
2579 2012-09-22 Kenichi Handa <handa@gnu.org>
2580
2581 * composite.c (composition_reseat_it): Handle the case that a
2582 grapheme cluster is not covered by a single font (Bug#12352).
2583
2584 2012-09-21 Chong Yidong <cyd@gnu.org>
2585
2586 * image.c (define_image_type): Avoid adding duplicate types to
2587 image_types (Bug#12463). Suggested by Jörg Walter.
2588
2589 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2590
2591 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2592 (print_load_command_name): Add case LC_DATA_IN_CODE.
2593 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2594
2595 2012-09-21 Glenn Morris <rgm@gnu.org>
2596
2597 * eval.c (Frun_hook_with_args_until_success)
2598 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2599
2600 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
2601
2602 * fileio.c (Ffile_selinux_context): Only call freecon when
2603 lgetfilecon succeeded.
2604 (Fset_file_selinux_context): Likewise. (Bug#12444)
2605
2606 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2607
2608 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2609 reordering, locate the cursor by calling set_cursor_from_row; if
2610 that fails, clear the desired glyph matrix before returning a
2611 failure indication to the caller. Fixes leaving garbled display
2612 when fast scrolling with a down-key. (Bug#12403)
2613 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2614 scrolling through multibyte text.
2615
2616 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2617
2618 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2619 calling mark_vectorlike since that's the one that marks the window.
2620 (mark_discard_killed_buffers): Mark the final cdr.
2621 * window.h (struct window): Move prev/next_buffers to the
2622 non-standard fields.
2623 * window.c (make_window): Initialize prev/next_buffers manually.
2624
2625 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2626
2627 Omit unused arg EXPECTED from socket hooks.
2628 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2629 * nsterm.m (ns_term_init):
2630 * termhooks.h (struct terminal.read_socket_hook):
2631 * w32inevt.c (w32_console_read_socket):
2632 * w32term.c (w32_read_socket):
2633 * xterm.c (XTread_socket):
2634 Omit unused arg EXPECTED. All callers changed.
2635 (store_user_signal_events): Return void, not int, since callers no
2636 longer care about the return value. All uses changed.
2637
2638 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2639
2640 * w32gui.h (XParseGeometry): Do not declare.
2641
2642 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2643
2644 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2645 Ignore 'expected'. See Eli Zaretskii in
2646 <http://bugs.gnu.org/12471#8> (last line).
2647
2648 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2649 (XParseGeometry): Now static. Substitute extremal values for
2650 values that are out of range.
2651
2652 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2653
2654 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2655
2656 * nsfns.m (XParseGeometry): Remove.
2657 (Fx_create_frame): Call x_set_offset to correctly interpret
2658 top_pos in geometry.
2659
2660 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2661 (Fx_parse_geometry): If there is a space in string, call
2662 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2663
2664 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2665
2666 * search.c (scan_buffer): Use character positions in calls to
2667 region_cache_forward and region_cache_backward, not byte
2668 positions. (Bug#12196)
2669
2670 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2671 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2672
2673 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2674 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2675 emacs_blocked_malloc, now deleted.
2676
2677 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2678
2679 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2680 The workaround was for improving performance on Solaris 2.4, but
2681 is getting in the way now. Emacs will still work if someone is
2682 still running Solaris 2.4 in a museum somewhere; Sun dropped
2683 support for Solaris 2.4 in 2003.
2684 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2685 * process.c (create_process) [HAVE_WORKING_VFORK]:
2686 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2687 since Emacs no longer uses vfork on that platform.
2688
2689 2012-09-17 Glenn Morris <rgm@gnu.org>
2690
2691 * emacs.c: Use COPYRIGHT.
2692
2693 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2694
2695 Remove configure's --without-sync-input option (Bug#12450).
2696 When auditing signal-handling in preparation for cleaning it up,
2697 I found that SYNC_INPUT has race conditions and would be a real
2698 pain to fix. Since it's an undocumented and deprecated
2699 configure-time option, now seems like a good time to remove it.
2700 Also see <http://bugs.gnu.org/11080#16>.
2701 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2702 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2703 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2704 (malloc_hysteresis):
2705 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2706 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2707 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2708 (dont_register_blocks, bytes_used_when_reconsidered)
2709 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2710 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2711 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2712 Remove. All uses removed.
2713 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2714 implementation, one that depends on whether the new macro
2715 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2716 is defined.
2717 * atimer.c (run_timers, handle_alarm_signal):
2718 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2719 (handle_async_input, process_pending_signals)
2720 (handle_input_available_signal, init_keyboard):
2721 * nsterm.m (ns_read_socket):
2722 * process.c (wait_reading_process_output):
2723 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2724 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2725 (emacs_write):
2726 * xterm.c (XTread_socket):
2727 Assume SYNC_INPUT.
2728 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2729 * eval.c (handling_signal): Remove. All uses removed.
2730 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2731 All uses replaced with the SYNC_INPUT version.
2732 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2733 Remove decls.
2734 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2735 Now static.
2736
2737 * font.c (Ffont_shape_gstring): Remove unused local.
2738
2739 2012-09-16 Glenn Morris <rgm@gnu.org>
2740
2741 * Makefile.in (clean): No longer run nextstep's clean.
2742
2743 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2744 (ns_frag): Remove.
2745 (ns-app): Move here from ns.mk, and simplify.
2746 (clean): Simplify nextstep entry.
2747 * ns.mk: Remove file.
2748
2749 2012-09-17 Kenichi Handa <handa@gnu.org>
2750
2751 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2752 not covert the last few charactes.
2753
2754 2012-09-16 Kenichi Handa <handa@gnu.org>
2755
2756 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2757 here, but just check the validity of glyphs in the glyph-string.
2758
2759 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2760
2761 * window.c (Fwindow_parameter, Fset_window_parameter):
2762 Accept any window as argument (Bug#12452).
2763
2764 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2765
2766 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2767 to ns_term_init to avoid memory leak.
2768
2769 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2770 explicit retain/release.
2771 (ns_term_init): Only allow one display. Initialize outerpool and
2772 ns_*_types.
2773
2774 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2775
2776 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2777 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2778 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2779 the Microsoft problem in a different way, by altering ../nt/config.nt.
2780
2781 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2782
2783 * w32xfns.c:
2784 * w32uniscribe.c:
2785 * w32term.c:
2786 * w32select.c:
2787 * w32reg.c:
2788 * w32proc.c:
2789 * w32menu.c:
2790 * w32inevt.c:
2791 * w32heap.c:
2792 * w32font.c:
2793 * w32fns.c:
2794 * w32console.c:
2795 * w32.c:
2796 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2797 by lisp.h. This completes removal of setjmp.h inclusion
2798 erroneously announced in the previous commit. (Bug#12446)
2799
2800 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2801 more accurate.
2802
2803 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2804 not defined as a macro. The latter happens on MS-Windows.
2805 (Bug#12446)
2806
2807 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2808
2809 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2810 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2811 Some instances of '#include <setjmp.h>' removed, if the
2812 only reason for the instance was because "lisp.h" was included.
2813 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2814 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2815 and _longjmp with the new symbols. Emacs already uses _setjmp if
2816 available, so this change affects only POSIXish hosts that have
2817 sigsetjmp but not _setjmp, such as some versions of Solaris and
2818 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2819 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2820 (png_load_body) [HAVE_PNG]:
2821 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2822 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2823 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2824 since PNG requires jmp_buf. This is the only exception to the
2825 general rule that we now use sys_setjmp and sys_longjmp.
2826 This exception is OK since this code does not change the signal
2827 mask or longjmp out of a signal handler.
2828
2829 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2830
2831 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2832 Include "syssignal.h", for 'main_thread'.
2833
2834 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2835
2836 Avoid out-of-range marker position (Bug#12426).
2837 * insdel.c (replace_range, replace_range_2):
2838 Adjust markers before overlays, as suggested by comments.
2839 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2840 Remove redundant check before calling offset_intervals.
2841
2842 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2843
2844 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2845 current buffer (Bug#12387).
2846
2847 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2848
2849 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2850
2851 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2852
2853 Use a more backwards-compatible timer format (Bug#12430).
2854 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2855 vector element, not from the 4th, since PSECS is now at the end.
2856 (Fcurrent_idle_time): Doc fix.
2857
2858 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2859
2860 Function to mark objects and remove killed buffers at once.
2861 * alloc.c (discard_killed_buffers): Rename to ...
2862 (mark_discard_killed buffers) ... new name. Add marking
2863 of remaining objects. Fix comment. Adjust users.
2864 (mark_object): Do not touch frame buffer lists here.
2865 * frame.c (delete_frame): Reset frame buffer lists here.
2866
2867 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2868
2869 Better workaround for GNOME bug when --enable-gcc-warnings.
2870 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2871 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2872 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2873
2874 Simplify SIGIO usage (Bug#12408).
2875 The code that dealt with SIGIO was crufty and confusing, e.g., it
2876 played tricks like "#undef SIGIO" but these tricks were not used
2877 consistently. Simplify mostly by not #undeffing standard symbols,
2878 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2879 or not as we please) rather than "defined SIGIO" (standard symbol
2880 that we probably shouldn't #undef).
2881 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2882 Modules that need it can include it.
2883 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2884 * dispextern.h (ignore_sigio): New decl.
2885 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2886 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2887 * emacs.c (shut_down_emacs):
2888 * keyboard.c (kbd_buffer_store_event_hold):
2889 Use ignore_sigio rather than invoking 'signal' directly.
2890 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2891 for FIONREAD.
2892 (FIONREAD, SIGIO): Do not #undef.
2893 (tty_read_avail_input): Use #error rather than a syntax error.
2894 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2895 for I_PIPE, used by SETUP_SLAVE_PTY.
2896 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2897 * sysdep.c (croak): Remove; no longer needed. This bit of
2898 temporary code, with Fred N. Fish's comment that it's temporary,
2899 has been in Emacs since at least 1992!
2900 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2901 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2902 * syssignal.h (croak): Remove decl.
2903 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2904 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2905 now that we're termios-only.
2906 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2907 * term.c (dissociate_if_controlling_tty): Use #error rather than
2908 a run-time error.
2909
2910 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2911 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2912 to work around GNOME bug 683906.
2913 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2914 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2915 This works around GCC bug 54561.
2916
2917 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2918
2919 More fixes for 'volatile' and setjmp/longjmp.
2920 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2921 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2922 (png_load_body) [HAVE_PNG]:
2923 (jpeg_load_body) [HAVE_JPEG]:
2924 New function, with most of the old parent function's body.
2925 (png_load) [HAVE_PNG]:
2926 (jpeg_load) [HAVE_JPEG]:
2927 Invoke the new function, to avoid longjmp munging our locals.
2928 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2929 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2930 longjmp is passed 2, as the C standard doesn't guarantee this.
2931 Instead, store the failure code into mgr->failure_code.
2932
2933 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2934
2935 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2936 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2937 (syms_of_keyboard): Remove support for unread-command-char.
2938
2939 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2940
2941 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2942 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2943 violation. (Bug#12426)
2944
2945 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2946
2947 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2948
2949 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2950
2951 * eval.c: Add `inhibit-debugger'.
2952 (Qinhibit_debugger): New symbol.
2953 (call_debugger): Bind it instead of Qdebug_on_error.
2954 (maybe_call_debugger): Test Vinhibit_debugger.
2955 (syms_of_eval): Define inhibit-debugger.
2956 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2957 (syms_of_xdisp): Remove inhibit-debug-on-message.
2958
2959 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2960
2961 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2962 If a nonvolatile local variable is written before a _longjmp to
2963 the frame containing the variable, and is read after the _longjmp,
2964 the value read is indeterminate. Some local variables of type
2965 'struct handler' and 'struct catchtag' are used in this way, so
2966 mark each of their slots as volatile if the slot can be set before
2967 _longjmp and read afterwards.
2968 * lisp.h (struct handler): var and chosen_clause are now volatile.
2969 (struct catchtag): val, next, and pdlcount are now volatile.
2970
2971 * bidi.c (bidi_push_it, bidi_pop_it):
2972 * fns.c (copy_hash_table):
2973 * image.c (define_image_type):
2974 * keyboard.c (kbd_buffer_store_event_hold):
2975 * process.c (Fprocess_send_eof):
2976 * xfaces.c (x_create_gc) [HAVE_NS]:
2977 * xgselect.c (xg_select):
2978 Prefer assignment to memcpy when either will do.
2979
2980 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2981 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2982 time an item is removed. No need to mark this function 'inline';
2983 the compiler knows better than we do.
2984
2985 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2986
2987 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2988 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2989 to change_frame_size (Bug#12388).
2990 (windowDidResize:): Pass YES to updateFrameSize.
2991
2992 * nsterm.h: Add delay parameter to updateFrameSize.
2993
2994 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2995
2996 Discard killed buffers from deleted window and frame objects.
2997 This reduces an amount of references to killed buffers and
2998 helps GC to reclaim them faster.
2999 * alloc.c (discard_killed_buffers): New function.
3000 (mark_object): Use it for deleted windows and frames.
3001 (mark_object): If symbol's value is set up for a killed buffer
3002 or deleted frame, restore its global binding.
3003 * data.c (swap_in_global_binding): Add GC notice.
3004 (swap_in_symval_forwarding): Use convenient set_blv_where.
3005 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3006 * window.h: ... to here.
3007
3008 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3009
3010 Convenient macro to check whether the buffer is live.
3011 * buffer.h (BUFFER_LIVE_P): New macro.
3012 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3013 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3014
3015 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3016
3017 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3018 composition cases (Bug#12364).
3019
3020 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3021 overhang of succeeding glyphs overlapping box cursor.
3022
3023 * w32term.c (x_draw_glyph_string): Likewise.
3024
3025 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3026
3027 Simplify, document, and port floating-point (Bug#12381).
3028 The porting part of this patch fixes bugs on non-IEEE platforms
3029 with frexp, ldexp, logb.
3030 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3031 Now static.
3032 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3033 support, by removing commented-out code and briefly listing the
3034 C89 functions excluded. The commented-out stuff was confusing
3035 maintenance, e.g., we thought we needed cbrt but it was commented out.
3036 (logb): Remove decl; no longer needed.
3037 (isfinite): New macro, if not already supplied.
3038 (isnan): Don't replace any existing macro.
3039 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3040 are present on all C89 platforms.
3041 (Ffrexp): Do not special-case zero, as frexp does the right thing
3042 for that case.
3043 (Flogb): Do not use logb, as it doesn't have the desired meaning
3044 on hosts that use non-base-2 floating point. Instead, stick with
3045 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
3046 frexp, to avoid getting an unspecified result.
3047
3048 * xdisp.c (Qinhibit_debug_on_message): Now static.
3049
3050 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
3051
3052 * nsterm.m (ns_update_begin): Set clip path to whole view by using
3053 NSBezierPath (Bug#12131).
3054
3055 2012-09-10 Chong Yidong <cyd@gnu.org>
3056
3057 * fns.c (Fdelq, Fdelete): Doc fix.
3058
3059 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
3060
3061 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3062 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3063
3064 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
3065
3066 * lisp.h (make_lisp_ptr): New macro to replace XSET.
3067 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3068 Use it.
3069
3070 2012-09-09 Eli Zaretskii <eliz@gnu.org>
3071
3072 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3073 left fringe if the window has a left margin. This avoids leaving
3074 traces of the cursor because its leftmost pixel is not drawn over.
3075
3076 * dispnew.c (update_window_line): When the left margin area of a
3077 screen line is updated, set the redraw_fringe_bitmaps_p flag of
3078 that screen line. (Bug#12277)
3079
3080 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
3081
3082 Assume C89 or later for math functions (Bug#12381).
3083 This simplifies the code, and makes it a bit smaller and faster,
3084 and (most important) makes it easier to clean up signal handling
3085 since we can stop worring about floating-point exceptions in
3086 library code. That was a problem before C89, but the problem
3087 went away many years ago on all practical Emacs targets.
3088 * data.c, image.c, lread.c, print.c:
3089 Don't include <math.h>; no longer needed.
3090 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3091 might be autoconfigured, as that never happens.
3092 * data.c (fmod):
3093 * doprnt.c (DBL_MAX_10_EXP):
3094 * print.c (DBL_DIG):
3095 Remove. C89 or later always defines these.
3096 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3097 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3098 (arith_error, domain_error, domain_error2):
3099 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
3100 no longer needed -- we simply return what C returns. All uses removed.
3101 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
3102 the wrapped code.
3103 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3104 Remove. All uses expanded, as these macros are no longer used
3105 more than once and are now more trouble than they're worth.
3106 (Ftan): Use tan, not sin / cos.
3107 (Flogb): Assume C89 frexp.
3108 (fmod_float): Assume C89 fmod.
3109 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3110 (init_floatfns): Remove. All uses removed.
3111
3112 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3113
3114 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3115 compositeToPoint for OSX < 10.6 (Bug#12390).
3116
3117 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
3118
3119 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3120 This produces more-accurate results.
3121
3122 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3123
3124 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3125 changes (Bug#12088).
3126
3127 2012-09-08 Chong Yidong <cyd@gnu.org>
3128
3129 * syntax.c (Fstring_to_syntax): Doc fix.
3130
3131 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3132
3133 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3134 in the internal border.
3135 (x_set_window_size): Remove static variables and their usage.
3136 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3137 (ns_after_update_window_line, ns_draw_fringe_bitmap):
3138 Remove fringe/internal border adjustment (Bug#11052).
3139 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3140 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3141 (ns_fix_rect_ibw): Remove.
3142 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3143 (ns_dumpglyphs_box_or_relief): Ditto.
3144 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3145 adjustment.
3146 (ns_dumpglyphs_image): Ditto.
3147 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
3148 border adjustment.
3149 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3150 their usage. Add fringe_extended_p and its use as in other terms.
3151 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
3152 scroll bar was removed.
3153 (updateFrameSize): New function.
3154 (windowDidResize): Move code to updateFrameSize and call it.
3155
3156 * nsterm.h (EmacsView): Add updateFrameSize.
3157
3158 2012-09-07 Chong Yidong <cyd@gnu.org>
3159
3160 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3161
3162 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3163
3164 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3165
3166 More signal-handler cleanup (Bug#12327).
3167 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3168 Problem introduced when merging patches. Noted by Eli Zaretskii in
3169 <http://bugs.gnu.org/12327#67>.
3170 * floatfns.c: Comment fix.
3171 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3172 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3173 and anyway the declaration is harmless even if SIGDANGER is not defined.
3174 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3175 defined BROKEN_FIONREAD). systty.h formerly did this, but other
3176 source files not surprisingly expected syssignal.h to define, or
3177 not define, SIGIO, and it's cleaner to do it that way, for consistency.
3178 Include <sys/ioctl.h>, for FIONREAD.
3179 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
3180 This eliminates a problem whereby other files mysteriously had
3181 to include "syssignal.h" before including "systty.h" if they
3182 wanted to use "#ifdef SIGIO".
3183
3184 2012-09-07 Eli Zaretskii <eliz@gnu.org>
3185
3186 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
3187
3188 * w32.c (sigemptyset): Empty the set.
3189 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
3190
3191 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
3192
3193 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
3194
3195 * alloc.c (mark_buffer): Revert unsafe marking optimization.
3196 (mark_object): Likewise for frame objects.
3197
3198 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3199
3200 * syssignal.h (handle_on_main_thread): Always declare,
3201 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
3202 This ports to platforms without HAVE_PTHREAD.
3203
3204 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3205
3206 Signal-handler cleanup (Bug#12327).
3207 Emacs's signal handlers were written in the old 4.2BSD style with
3208 sigblock and sigmask and so forth, and this led to some
3209 inefficiencies and confusion. Rewrite these to use
3210 pthread_sigmask etc. without copying signal sets around. Also,
3211 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
3212 'signal', and instead use functions that do not attempt to take
3213 over the system name space. This patch causes Emacs's text
3214 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
3215 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
3216 Do not include <signal.h> or "syssignal.h", as these
3217 modules do not use signals.
3218 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
3219 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
3220 Do not include <signal.h>, as "syssignal.h" does that for us now.
3221 * atimer.c (sigmask_atimers): New function.
3222 (block_atimers, unblock_atimers): New functions,
3223 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
3224 All uses replaced.
3225 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
3226 no longer needed here.
3227 * emacs.c (main): Inspect existing signal handler with sigaction,
3228 so that there's no need to block and unblock SIGHUP.
3229 * sysdep.c (struct save_signal): New member 'action', replacing
3230 old member 'handler'.
3231 (save_signal_handlers, restore_signal_handlers):
3232 Use sigaction instead of 'signal' to save and restore.
3233 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
3234 New function. All users of 'signal' modified to use set_sighandler
3235 if they're writeonly, and to use sys_signal if they're read+write.
3236 (emacs_sigaction_init, forwarded_signal): New functions.
3237 (sys_signal): Remove. All uses replaced by calls to sigaction
3238 and emacs_sigaction_init, or by direct calls to 'signal'.
3239 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
3240 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
3241 all uses replaced by pthread_sigmask etc. calls.
3242 * syssignal.h: Include <signal.h>.
3243 (emacs_sigaction_init, forwarded_signal): New decls.
3244 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
3245 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
3246 (sigmask, sys_sigmask): Remove; no longer needed.
3247 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
3248 (sigblock, sigunblock, sigfree):
3249 (sigsetmask) [!defined sigsetmask]:
3250 Remove. All uses replaced by pthread_sigmask.
3251 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
3252 no longer need to be replaced, and its typical old uses
3253 are now done via emacs_sigaction_init and sigaction.
3254 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
3255 (sys_sigdel): Remove; unused.
3256 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
3257
3258 2012-09-06 Eli Zaretskii <eliz@gnu.org>
3259
3260 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
3261 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
3262
3263 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3264
3265 Explicitly mark buffer_defaults and buffer_local_symbols.
3266 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
3267 mark_local_symbols here.
3268 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
3269 since special buffers aren't marked here any more.
3270 (allocate_buffer): Chain new buffer with all_buffers here...
3271 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
3272 not here.
3273 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
3274 (syms_of_buffer): Remove staticpro of the above.
3275 (init_buffer_once): Set names for buffer_defaults and
3276 buffer_local_symbols.
3277
3278 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3279
3280 Use bool for booleans in font-related modules.
3281 * font.c (font_intern_prop, font_style_to_value)
3282 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
3283 (generate_otf_features, font_check_otf_features, font_check_otf)
3284 (font_match_p, font_list_entities, font_at):
3285 * fontset.c (fontset_id_valid_p, reorder_font_vector
3286 (fontset_find_font, Fset_fontset_font)
3287 (face_suitable_for_char_p) [0]:
3288 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
3289 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
3290 (m17n_flt_initialized, ftfont_shape_by_flt):
3291 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
3292 * nsfont.m (nsfont_draw):
3293 * w32font.c (w32font_draw):
3294 * w32term.c (x_draw_glyphless_glyph_string_foreground):
3295 Use bool for booleans.
3296 * font.h: Adjust to above API changes.
3297 (struct font, struct font_driver, struct font_driver_list):
3298 Use bool for booleans.
3299 (struct font): Remove useless member encoding_type.
3300 All users removed.
3301 * fontset.c, xftfont.c: Omit unnecessary static decls.
3302
3303 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3304
3305 * alloc.c (mark_object): Revert window marking code
3306 since it's unsafe for the Fset_window_configuration.
3307
3308 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3309
3310 Fix race conditions with signal handlers and errno (Bug#12327).
3311 Be more systematic about preserving errno whenever a signal
3312 handler returns, even if it's not in the main thread. Do this by
3313 renaming signal handlers to distinguish between signal delivery
3314 and signal handling. All uses changed.
3315 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
3316 * data.c (deliver_arith_signal): Rename from arith_error.
3317 * dispnew.c (deliver_window_change_signal): Rename from
3318 window_change_signal.
3319 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
3320 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
3321 * keyboard.c (deliver_input_available_signal): Rename from
3322 input_available_signal.
3323 (deliver_user_signal): Rename from handle_user_signal.
3324 (deliver_interrupt_signal): Rename from interrupt_signal.
3325 * process.c (deliver_pipe_signal): Rename from send_process_trap.
3326 (deliver_child_signal): Rename from sigchld_handler.
3327 * atimer.c (handle_alarm_signal):
3328 * data.c (handle_arith_signal):
3329 * dispnew.c (handle_window_change_signal):
3330 * emacs.c (handle_fatal_signal, handle_danger_signal):
3331 * keyboard.c (handle_input_available_signal):
3332 * keyboard.c (handle_user_signal, handle_interrupt_signal):
3333 * process.c (handle_pipe_signal, handle_child_signal):
3334 New functions, with the actual signal-handling code taken from the
3335 original respective signal handlers, sans the sporadic attempts to
3336 preserve errno, since that's now done by handle_on_main_thread.
3337 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3338 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3339 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3340 Move to sysdep.c.
3341 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3342 Move initialization of main_thread to sysdep.c's init_signals.
3343 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3344 our usage, and simplifies the mainline code.
3345 (record_child_status_change): New static function, as a helper
3346 for handle_child_signal, and with most of the old child handler's
3347 contents.
3348 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3349 (handle_child_signal): Use the above.
3350 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3351 Moved here from emacs.c.
3352 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3353 code moved here from emacs.c's main function.
3354 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3355 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
3356 This lets callers save and restore errno properly.
3357
3358 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3359
3360 Remove redundant or unused things here and there.
3361 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3362 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3363 * editfns.c (Fcompare_buffer_substrings): Likewise.
3364 * frame.h (struct terminal, struct font_driver_list):
3365 Remove redundant declarations.
3366 * window.h (Qleft, Qright): Likewise.
3367
3368 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3369
3370 Do not mark objects from deleted buffers, windows and frames.
3371 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3372 (mark_object): Likewise for windows and frames.
3373
3374 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3375
3376 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3377 buffer_defaults and buffer_local_symbols as valid objects.
3378 Return special value to denote them.
3379
3380 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3381
3382 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3383 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3384 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3385 (file_name_absolute_p, Fsubstitute_in_file_name):
3386 (check_executable, check_writable, Ffile_accessible_directory_p)
3387 (Fset_file_selinux_context, Fdefault_file_modes)
3388 (Finsert_file_contents, choose_write_coding_system)
3389 (Fwrite_region, build_annotations, a_write, e_write)
3390 (Fdo_auto_save):
3391 * filelock.c (boot_time_initialized, get_boot_time)
3392 (get_boot_time_1, lock_file_1, within_one_second):
3393 * floatfns.c (in_float):
3394 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3395 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3396 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3397 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3398 * window.c (compare_window_configurations):
3399 Use bool for booleans.
3400 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3401 (Fdefault_file_modes): Now mode_t, not int, for modes.
3402 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3403 (internal_delete_file): Now returns void, not a (boolean) int,
3404 since nobody was looking at the return value.
3405 * lisp.h, window.h: Adjust to above API changes.
3406
3407 * xdisp.c (set_message): Simplify and reindent last change.
3408
3409 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
3410
3411 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3412
3413 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3414
3415 * eval.c (call_debugger): Make the function non-static so that we
3416 can call it from set_message.
3417
3418 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3419 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3420
3421 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3422
3423 Give more-useful info on a fatal error (Bug#12328).
3424 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3425 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3426 of doing the work ourselves.
3427 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3428 do most of the work.
3429 (fatal_error_backtrace): New function, taken from the guts
3430 of the old fatal_error_signal, but with a new option to output
3431 a backtrace.
3432 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3433 info about the signal than just its number.
3434 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3435 * sysdep.c: Include <execinfo.h>
3436 (emacs_backtrace): New function, taken partly from the previous
3437 code of the 'die' function.
3438 (emacs_abort): Call fatal_error_backtrace rather than abort.
3439
3440 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
3441
3442 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3443 eager (load-time) macro-expansion.
3444 * lisp.mk (lisp): Add macroexp.
3445
3446 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3447
3448 Simplify redefinition of 'abort' (Bug#12316).
3449 Do not try to redefine the 'abort' function. Instead, redo
3450 the code so that it calls 'emacs_abort' rather than 'abort'.
3451 This removes the need for the NO_ABORT configure-time macro
3452 and makes it easier to change the abort code to do a backtrace.
3453 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3454 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3455 Remove; sysdep.c's emacs_abort now takes its place.
3456 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
3457 'abort' changed to use 'emacs_abort'.
3458 * msdos.c (dos_abort) [defined abort]: Remove; not used.
3459 (abort) [!defined abort]: Rename to ...
3460 (emacs_abort): ... new name.
3461 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3462 the place of the old 'abort' in emacs.c.
3463 * w32.c, w32fns.c (abort): Do not #undef.
3464 * w32.c (emacs_abort): Rename from w32_abort.
3465
3466 2012-09-04 Eli Zaretskii <eliz@gnu.org>
3467
3468 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3469 offsets[j].dv, since the y axis of the screen coordinates points
3470 down, while the y axis of the font definition coordinates points
3471 up. This fixes display of Arabic diacritics such as KASRA and
3472 KASRATAN. (Bug#11860)
3473
3474 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3475
3476 Be more systematic about _setjmp vs setjmp.
3477 * alloc.c (test_setjmp, mark_stack):
3478 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3479 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3480 (png_load, my_error_exit, jpeg_load):
3481 * process.c (send_process_trap, send_process):
3482 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3483 The underscored versions are up to 30x faster on some hosts.
3484 Formerly, the code used setjmp+longjmp sometimes and
3485 _setjmp+_longjmp at other times, with no particular reason to
3486 prefer setjmp+longjmp.
3487
3488 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3489
3490 Fix minor problem found by static checking.
3491 * buffer.c (Fdelete_all_overlays): Return nil.
3492
3493 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3494
3495 * buffer.c (Fdelete_all_overlays): New function.
3496
3497 2012-09-03 Chong Yidong <cyd@gnu.org>
3498
3499 * gtkutil.c: Add extern decl for Qxft.
3500
3501 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3502
3503 * emacs.c, eval.c: Use bool for boolean.
3504 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3505 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3506 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3507 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3508 (main, decode_env_path, Fdaemon_initialized):
3509 * eval.c (call_debugger, Finteractive_p, interactive_p):
3510 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3511 (maybe_call_debugger, Fbacktrace):
3512 * process.c (read_process_output, exec_sentinel):
3513 Use bool for booleans.
3514 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3515 All callers changed.
3516 * eval.c (interactive_p): Omit always-true boolean argument
3517 EXCLUDE_SUBRS_P. All callers changed.
3518 * dispextern.h, lisp.h: Reflect above API changes.
3519 * firstfile.c (dummy): Use the address of 'main', whose signature
3520 won't change, instead of the address of 'initialize', whose
3521 signature just changed from int to bool.
3522 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3523 * msdos.c (fatal_error_in_progress): ... from here.
3524 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3525 of incrementing it.
3526 (redisplay_internal, unwind_redisplay): Simply clear
3527 REDISPLAYING_P when unwinding, instead of saving its previous,
3528 always-false value and then restoring it.
3529
3530 Clean up some extern decls.
3531 Mostly, this hoists extern decls out of .c files and into .h files.
3532 That way, we're more likely to catch errors if the interfaces change.
3533 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3534 declare xg_mark_data.
3535 * dispextern.h (x_frame_parm_handlers):
3536 * font.h (Qxft):
3537 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3538 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3539 (Qultra_bold, Qoblique, Qitalic):
3540 Move extern decl here from .c file.
3541 * alloc.c (xg_mark_data) [USE_GTK]:
3542 * doc.c (Qclosure):
3543 * eval.c (Qlexical_binding):
3544 * fns.c (time) [!HAVE_UNISTD_H]:
3545 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3546 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3547 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3548 * lread.c (Qinternal_interpreter_environment):
3549 * minibuf.c (Qbuffer):
3550 * process.c (QCfamily, QCfilter):
3551 * widget.c (free_frame_faces):
3552 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3553 * xfont.c (x_clear_errors):
3554 * xterm.c (x_frame_parm_handlers):
3555 Remove now-redundant extern decls.
3556 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3557 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3558 Now static.
3559 * xfaces.c: Remove unnecessary static decls.
3560 * xterm.c (updating_frame): Remove decl of nonexistent object.
3561
3562 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3563 when building globals.h, as the objects that are not built on
3564 this host are not needed to compile C files on this host.
3565
3566 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3567
3568 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3569
3570 * frame.h: Add missing prototype for x_wm_set_size_hint.
3571
3572 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3573
3574 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3575 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3576 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3577 (Fsubstitute_command_keys):
3578 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3579 (save_excursion_save, save_excursion_restore)
3580 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3581 (format_time_string, general_insert_function)
3582 (make_buffer_string, make_buffer_string_both)
3583 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3584 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3585 (copy_text, insert_1, insert_1_both, insert_from_string)
3586 (insert_from_string_before_markers, insert_from_string_1)
3587 (insert_from_buffer, insert_from_buffer_1, replace_range)
3588 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3589 (del_range_2, modify_region):
3590 * intervals.c (intervals_equal, balance_possible_root_interval)
3591 (adjust_intervals_for_insertion, merge_properties_sticky)
3592 (graft_intervals_into_buffer, lookup_char_property)
3593 (adjust_for_invis_intang, set_point_both)
3594 (get_property_and_range, compare_string_intervals)
3595 (set_intervals_multibyte_1, set_intervals_multibyte):
3596 * keyboard.c (decode_timer):
3597 Use bool for boolean.
3598 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3599 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3600
3601 2012-09-02 Chong Yidong <cyd@gnu.org>
3602
3603 * keymap.c (push_key_description): Print M-TAB as C-M-i
3604 (Bug#11758).
3605
3606 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3607
3608 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3609 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3610 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3611 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3612 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3613 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3614 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3615
3616 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3617
3618 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3619 more than one grapheme cluster passed to the shaper: compute the
3620 offset adjustment values separately for each cluster. (Bug#11860)
3621
3622 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3623 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3624 about implicit conversions from integer to pointer.
3625
3626 2012-09-01 Daniel Colascione <dancol@dancol.org>
3627
3628 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3629 system used too early.
3630
3631 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3632
3633 Better seed support for (random).
3634 * emacs.c (main): Call init_random.
3635 * fns.c (Frandom): Set the seed from a string argument, if given.
3636 Remove long-obsolete Gentzel cruft.
3637 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3638 (init_random): New function.
3639
3640 2012-09-01 Daniel Colascione <dancol@dancol.org>
3641
3642 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3643 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3644 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3645 x_wm_set_size_hint, x_query_colors, x_real_positions,
3646 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3647 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3648 all of which have been moved to common code.
3649
3650 * xfaces.c: Include TERM_HEADER instead of listing all possible
3651 window-system headers.
3652
3653 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3654 to match header.
3655
3656 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3657 directly accessing frame internals.
3658
3659 * w32font.h: Include font.h. Define syms_of_w32font and
3660 globals_of_w32font.
3661
3662 * process.c: Include TERM_HEADER instead of listing all possible
3663 window-system headers.
3664
3665 * nsterm.h: Remove declarations now in frame.h.
3666 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3667
3668 * menu.c: Include TERM_HEADER instead of listing all possible
3669 window-system headers.
3670
3671 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3672 window system.
3673
3674 * keyboard.c: Include TERM_HEADER instead of listing all possible
3675 window-system headers.
3676
3677 * image.c: Include TERM_HEADER instead of listing all possible
3678 window-system headers. Declare Vlibrary_cache when compiling for
3679 Windows.
3680
3681 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3682 window system declarations.
3683
3684 * frame.h: Move common functions here: set_frame_menubar,
3685 x_set_window_size, x_sync, x_get_focus_frame,
3686 x_set_mouse_position, x_set_mouse_pixel_position,
3687 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3688 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3689 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3690 x_activate_menubar, x_real_positions, x_bitmap_icon,
3691 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3692 and x_query_colors.
3693
3694 * frame.c: Include TERM_HEADER instead of listing all possible
3695 window-system headers.
3696
3697 * font.c: Include TERM_HEADER instead of listing all possible
3698 window-system headers.
3699
3700 * emacs.c: Include TERM_HEADER.
3701
3702 * dispnew.c: Include TERM_HEADER instead of listing all possible
3703 window-system headers.
3704
3705 * ccl.h: Include character.h.
3706
3707 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3708 the current window system; include in list of objects to link into
3709 Emacs.
3710
3711 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3712
3713 Remove mark_ttys function and fix tty_display_info initialization.
3714 * lisp.h (mark_ttys): Remove prototype.
3715 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3716 to mark_ttys because all possible values of 'top_frame' slot are
3717 the frames which are reachable from Vframe_list.
3718 * term.c (mark_ttys): Remove.
3719 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3720
3721 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3722
3723 Change struct frame bitfields from unsigned char to unsigned.
3724 * frame.h (struct frame): Change type of 'display_preempted',
3725 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3726 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3727 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3728 bitfields from unsigned char to unsigned.
3729
3730 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3731
3732 Remove unused member of struct x_output and struct w32_output.
3733 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3734 * w32term.h (struct w32_output): Likewise.
3735
3736 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3737
3738 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3739 does not become zero (Bug#12234).
3740
3741 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3742
3743 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3744 for GCC 4.7.1 x86-64.
3745
3746 2012-08-30 Glenn Morris <rgm@gnu.org>
3747
3748 * lread.c (init_lread): For out-of-tree builds, only add the
3749 source directory's site-lisp dir to the load-path if it exists,
3750 consistent with in-tree builds. (Bug#12302)
3751
3752 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3753
3754 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3755 button_values to NULL. Call setStykeMask so dialogs get a close button.
3756 (windowShouldClose:): Set window_closed.
3757 (dealloc): New member, free button_values.
3758 (process_dialog:): Make member function. Remove window argument,
3759 replace window with self. Count buttons and allocate and store values
3760 in button_values.
3761 (addButton:value:row:): value is int with the name tag. Call setTag
3762 with tag. Remove return self, declare return value as void.
3763 (addString:row:): Remove return self, declare return value as void.
3764 (addSplit): Remove return self, declare return value as void.
3765 (clicked:): Remove return self, declare return value as void.
3766 Set dialog_return to button_values[seltag]. Code formatting change.
3767 (initFromContents:isQuestion:): Adjust call to process_dialog.
3768 Code formatting change.
3769 (timeout_handler:): Set timer_fired to YES.
3770 (runDialogAt:): Set timer_fired to NO.
3771 Handle click on close button as quit.
3772
3773 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3774 Add window_closed and button_values. Add void as return value for
3775 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3776 Add process_dialog as new member.
3777
3778 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3779
3780 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3781 is not one of the heaps we manage. (Bug#12242)
3782
3783 2012-08-28 Glenn Morris <rgm@gnu.org>
3784
3785 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3786
3787 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3788
3789 * window.c (Fset_window_configuration): Remove handling of
3790 auto-buffer-name window parameter. Install revision of reverted
3791 fix.
3792
3793 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3794
3795 Do not allow to set major mode for a dead buffer.
3796 * buffer.c (Fset_buffer_major_mode): Signal an error
3797 if the buffer is dead.
3798 (Fother_buffer, other_buffer_safely): Remove redundant
3799 nested declaration.
3800
3801 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3802
3803 Always use set_buffer_if_live to restore original buffer at unwind.
3804 * buffer.h (record_unwind_current_buffer): New function.
3805 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3806 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3807 * undo.c, window.c: Adjust users.
3808 * buffer.c (set_buffer_if_live): Fix comment.
3809
3810 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3811
3812 Fix usage of set_buffer_internal.
3813 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3814 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3815 * coding.c (decode_coding): Omit redundant test.
3816 * fileio.c (decide_coding_unwind): Likewise.
3817 * fns.c (secure_hash): Likewise.
3818 * insdel.c (modify_region): Likewise.
3819 * keyboard.c (command_loop_1): Likewise.
3820 * print.c (PRINTFINISH): Likewise.
3821 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3822
3823 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3824
3825 * dispnew.c: Use bool for boolean.
3826 (frame_garbaged, display_completed, delayed_size_change)
3827 (fonts_changed_p, add_window_display_history)
3828 (add_frame_display_history, verify_row_hash)
3829 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3830 (row_equal_p, realloc_glyph_pool)
3831 (allocate_matrices_for_frame_redisplay)
3832 (showing_window_margins_p)
3833 (adjust_frame_glyphs_for_frame_redisplay)
3834 (build_frame_matrix_from_leaf_window, make_current)
3835 (mirrored_line_dance, mirror_line_dance, update_frame)
3836 (update_window_tree, update_single_window)
3837 (check_current_matrix_flags, update_window, update_text_area)
3838 (update_window_line, set_window_update_flags, scrolling_window)
3839 (update_frame_1, scrolling, buffer_posn_from_coords)
3840 (do_pending_window_change, change_frame_size)
3841 (change_frame_size_1, sit_for):
3842 Use bool for boolean.
3843 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3844 and remove last int (actually boolean) argument, which was always 0.
3845 All callers changed.
3846 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3847 * dispextern.h (struct composition_it): Use bool for boolean.
3848 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3849 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3850 * dired.c (file_name_completion):
3851 Use bool for boolean. (This was missed in an earlier change.)
3852
3853 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3854
3855 * window.c (Fset_window_configuration): Revert first part of
3856 last change.
3857
3858 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3859
3860 * nsterm.h (NSPanel): New class variable dialog_return.
3861
3862 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3863 Initialize dialog_return.
3864 (windowShouldClose:): Use stop instead of stopModalWithCode.
3865 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3866 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3867 event.
3868 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3869 modal loop returns.
3870
3871 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3872
3873 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3874 * composite.c (find_composition, composition_gstring_p)
3875 (composition_reseat_it, find_automatic_composition):
3876 * data.c (let_shadows_buffer_binding_p)
3877 (let_shadows_global_binding_p, set_internal, make_blv)
3878 (Fmake_variable_buffer_local, Fmake_local_variable)
3879 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3880 (cons_to_signed, arith_driver):
3881 * dbusbind.c (xd_in_read_queued_messages):
3882 * dired.c (directory_files_internal, file_name_completion):
3883 Use bool for booleans.
3884 * dired.c (file_name_completion):
3885 * process.h (fd_callback):
3886 Omit int (actually boolean) argument. It wasn't being used.
3887 All uses changed.
3888 * composite.h, lisp.h: Reflect above API changes.
3889
3890 * cmds.c, coding.c: Use bool for booleans.
3891 * cmds.c (move_point, Fself_insert_command):
3892 * coding.h (struct composition status, struct coding_system):
3893 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3894 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3895 (emacs_mule_char, decode_coding_emacs_mule)
3896 (encode_coding_emacs_mule, detect_coding_iso_2022)
3897 (decode_coding_iso_2022, encode_invocation_designation)
3898 (encode_designation_at_bol, encode_coding_iso_2022)
3899 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3900 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3901 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3902 (encode_coding_raw_text, detect_coding_charset)
3903 (decode_coding_charset, encode_coding_charset, detect_eol)
3904 (detect_coding, get_translation_table, produce_chars)
3905 (consume_chars, reused_workbuf_in_use)
3906 (make_conversion_work_buffer, code_conversion_save)
3907 (decode_coding_object, encode_coding_object)
3908 (detect_coding_system, char_encodable_p)
3909 (Funencodable_char_position, code_convert_region)
3910 (code_convert_string, code_convert_string_norecord)
3911 (Fset_coding_system_priority):
3912 * fileio.c (Finsert_file_contents):
3913 Use bool for booleans.
3914 * coding.h, lisp.h: Reflect above API changes.
3915 * coding.c: Remove unnecessary static function decls.
3916 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3917 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3918 not a boolean 'int', since callers never look at the return value.
3919 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3920 * coding.h (decoding_buffer_size, encoding_buffer_size)
3921 (emacs_mule_string_char): Remove unused extern decls.
3922 (struct iso_2022_spec, struct coding_system):
3923 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3924 (struct emacs_mule_spec): Remove unused field 'full_support'.
3925 All initializations removed.
3926 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3927
3928 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3929
3930 Fix spare memory change (Bug#12286).
3931 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3932 (valid_lisp_object_p): Likewise.
3933
3934 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3935
3936 * window.c (Fset_window_configuration): Record any window's old
3937 buffer if it's replaced (see Bug#8789). If the new current
3938 buffer doesn't appear in the selected window, go to its old
3939 point (Bug#12208).
3940
3941 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3942
3943 Special MEM_TYPE_SPARE to denote reserved memory.
3944 * alloc.c (enum mem_type): New memory type.
3945 (refill_memory_reserve): Use new type for spare memory.
3946 This prevents live_cons_p and live_string_p from incorrect
3947 detection of uninitialized objects from spare memory as live.
3948
3949 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3950
3951 Spelling fixes.
3952 * Makefile.in (.PHONY): versioclean -> versionclean.
3953
3954 Remove unused external symbols.
3955 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3956 * window.c (Qwindow_valid_p, decode_valid_window):
3957 Now static, not extern.
3958 * data.c (Qinterval): Remove; unused.
3959 (syms_of_data): Do not define 'interval'.
3960 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3961 * window.h (decode_valid_window):
3962 Remove decls.
3963
3964 * character.c, charset.c, chartab.c: Use bool for booleans.
3965 * character.c (lisp_string_width, string_count_byte8)
3966 (string_escape_byte8):
3967 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3968 (load_charset_map_from_file, map_charset_chars)
3969 (Fdefine_charset_internal, define_charset_internal)
3970 (Fdeclare_equiv_charset, find_charsets_in_text)
3971 (Ffind_charset_region, char_charset, Fiso_charset):
3972 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3973 (sub_char_table_set, sub_char_table_set_range)
3974 (char_table_set_range, optimize_sub_char_table)
3975 (map_sub_char_table):
3976 Use bool for boolean.
3977 * character.c (str_to_unibyte): Omit last boolean argument; it was
3978 always 0. All callers changed.
3979 * character.h, charset.h: Adjust to match previous changes.
3980 * character.h (char_printable_p): Remove decl of nonexistent function.
3981 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3982 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3983 are all boolean, so make them single-bit bitfields.
3984
3985 * lisp.h (ASET): Remove attempt to detect side effects.
3986 It was meant to be temporary and it often doesn't work,
3987 because when IDX has side effects the behavior of IDX==IDX
3988 is undefined. See Stefan Monnier in
3989 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3990
3991 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3992
3993 * lisp.h (functionp): New function (extracted from Ffunctionp).
3994 (FUNCTIONP): Use it.
3995 * eval.c (Ffunctionp): Use it.
3996
3997 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3998
3999 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4000 as that's faster and simpler than static storage. Don't bother
4001 with the g_main_context_query overhead if g_main_context_pending
4002 says no events are pending.
4003 (gfds, gfds_size): Remove these static vars.
4004 (xgselect_initialize): Remove; no longer needed.
4005 All uses and decls removed.
4006
4007 * emacs.c (fatal_error_signal_hook): Remove.
4008 All uses removed. This leftover from old code was always 0.
4009
4010 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4011 * casefiddle.c (casify_object, casify_region):
4012 * casetab.c (set_case_table):
4013 * category.c, category.h (word_boundary_p):
4014 * category.h (CHAR_HAS_CATEGORY):
4015 Use bool for booleans, instead of int.
4016
4017 2012-08-25 Eli Zaretskii <eliz@gnu.org>
4018
4019 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4020
4021 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4022
4023 On assertion failure, print backtrace if available.
4024 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4025 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4026 * Makefile.in (LIB_EXECINFO): New macro.
4027 (LIBES): Use it.
4028
4029 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4030 * bytecode.c (exec_byte_code):
4031 * callint.c (check_mark, Fcall_interactively):
4032 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4033 (getenv_internal, sync_process_alive, call_process_exited):
4034 * lisp.h (USE_SAFE_ALLOCA):
4035 Use bool for booleans, instead of int.
4036 * lisp.h, process.h: Adjust prototypes to match above changes.
4037 * callint.c (Fcall_interactively): Don't assume the mark's
4038 offset fits in 'int'.
4039
4040 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
4041
4042 * buffer.c, buffer.h: Use bool for boolean.
4043 * buffer.c (reset_buffer_local_variables)
4044 (buffer_lisp_local_variables, Fset_buffer_modified_p)
4045 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4046 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4047 (overlay_touches_p, overlay_strings, Foverlay_put)
4048 (report_overlay_modification, call_overlay_mod_hooks):
4049 (mmap_enlarge, mmap_set_vars):
4050 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4051 Use bool for booleans, instead of int.
4052 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4053 since the 1-or-0 return value is always ignored anyway.
4054 (mmap_initialized_p):
4055 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4056 * buffer.h, lisp.h: Adjust prototypes to match above changes.
4057
4058 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4059
4060 * bidi.c: Use bool for boolean.
4061 This is a bit more readable, and makes the text segment of bidi.o
4062 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4063 Presumably it's faster too.
4064 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4065 Now bool.
4066 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4067 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4068 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4069 (bidi_explicit_dir_char, bidi_level_of_next_char)
4070 (bidi_find_other_level_edge, bidi_move_to_visually_next):
4071 Use bool for booleans, instead of int.
4072 * dispextern.h (bidi_init_it, bidi_paragraph_init)
4073 (bidi_unshelve_cache): Adjust decls to match code.
4074
4075 2012-08-23 Martin Rudalics <rudalics@gmx.at>
4076
4077 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4078 argument.
4079
4080 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4081
4082 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4083 * atimer.h: Include <stdbool.h>.
4084
4085 2012-08-22 Dan Nicolaescu <dann@gnu.org>
4086
4087 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4088 compile time tests instead of run time tests on systems that do
4089 not use them.
4090 (FRAME_MAC_P): Remove leftover from deleted code.
4091 * frame.c (syms_of_frame): Remove leftover from deleted code.
4092
4093 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
4094
4095 * nsterm.m (insertText:): Don't clear modifiers if code is space.
4096
4097 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
4098
4099 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4100 Otherwise, the compiler complains about (A?B:C) where B is void
4101 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
4102 (fontset_add): Return void, for FONTSET_ADD.
4103
4104 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4105
4106 * alloc.c: Use bool for booleans.
4107 (gc_in_progress, abort_on_gc)
4108 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4109 (dont_register_blocks) [GC_MALLOC_CHECK]:
4110 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4111 (check_string_bytes, make_specified_string, memory_full)
4112 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4113 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4114 (mark_stack, valid_pointer_p, make_pure_string)
4115 (Fgarbage_collect, survives_gc_p, gc_sweep):
4116 Use bool for booleans, instead of int.
4117 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4118 Remove unused local.
4119 * alloc.c (PURE_POINTER_P):
4120 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4121 * editfns.c (Fformat):
4122 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4123 (Fdo_auto_save):
4124 * fns.c (sweep_weak_table):
4125 * lisp.h (suppress_checking, push_message, survives_gc_p)
4126 (make_pure_string, gc_in_progress, abort_on_gc):
4127 * lread.c (readchar, read1):
4128 * print.c (Fprin1_to_string):
4129 * xdisp.c (push_message):
4130 Use bool for booleans affected directly or indirectly by
4131 alloc.c's changes.
4132
4133 Make recently-introduced setters macros.
4134 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4135 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4136 (set_fontset_default, set_fontset_fallback): Rename from their
4137 upper-case counterparts, and make them functions rather than macros.
4138 This is more consistent with the other recently-introduced setters.
4139 These don't need to be inline, since they're local.
4140
4141 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
4142
4143 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4144 the loop (Bug#12247).
4145
4146 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4147
4148 * lisp.h (vcopy): Use memcpy rather than our own loop.
4149 This fixes a performance regression introduced by the recent
4150 addition of vcopy. This means 'vcopy' will need to be modified
4151 for a copying collector, but that's OK. Also, tighten the
4152 checking in the assertion.
4153
4154 2012-08-21 Eli Zaretskii <eliz@gnu.org>
4155
4156 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4157 components for RTL text (Bug#11860). Adjust X-OFFSET of each
4158 non-base glyph for the width of the base character, according to
4159 what x_draw_composite_glyph_string_foreground expects.
4160 Generate WADJUST value according to composition_gstring_width's
4161 expectations, to produce correct width of the composed character.
4162 Reverse the sign of the DU offset produced by ScriptPlace.
4163
4164 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4165
4166 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4167
4168 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4169
4170 Avoid direct writes to contents member of struct Lisp_Vector.
4171 * lisp.h (vcopy): New function to copy data into vector.
4172 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4173 * fns.c (Ffillarray): Use ASET.
4174 * keyboard.c (timer_check_2): Use AREF and ASET.
4175 (append_tool_bar_item, Frecent_keys): Use vcopy.
4176 * lread.c (read_vector): Use ASET.
4177 * msdos.c (Frecent_doskeys): Use vcopy.
4178 * xface.c (Finternal_copy_lisp_face): Use vcopy.
4179 (Finternal_merge_in_global_face): Use ASET and vcopy.
4180 * xfont.c (xfont_list_pattern): Likewise.
4181
4182 2012-08-21 Martin Rudalics <rudalics@gmx.at>
4183
4184 * window.c (Fwindow_point): For the selected window always return
4185 the position of its buffer's point.
4186 (Fset_window_point): For the selected window always go in its
4187 buffer to the specified position.
4188
4189 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4190
4191 Setter macros for fontsets.
4192 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
4193 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
4194 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
4195 Adjust users.
4196
4197 2012-08-20 Glenn Morris <rgm@gnu.org>
4198
4199 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4200 Don't assume that `ln -f' works.
4201
4202 2012-08-20 Eli Zaretskii <eliz@gnu.org>
4203
4204 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
4205 and later about non-assignments with no effect. See discussion at
4206 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
4207 details.
4208
4209 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4210
4211 Inline setter functions for Lisp_Objects slots of struct specbinding.
4212 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
4213 Adjust users.
4214
4215 2012-08-20 Martin Rudalics <rudalics@gmx.at>
4216
4217 * window.c (select_window): Always make selected window's buffer
4218 current.
4219
4220 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4221
4222 Use AREF and ASET for docstrings of category tables.
4223 * category.h (CATEGORY_DOCSTRING): Use AREF.
4224 (SET_CATEGORY_DOCSTRING): Use ASET.
4225 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
4226
4227 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4228
4229 Inline setter functions for hash table members.
4230 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
4231 (set_hash_hash, set_hash_index): Rename with _slot suffix.
4232 (set_hash_key_and_value, set_hash_index, set_hash_next)
4233 (set_hash_hash): New functions.
4234 * charset.c, fns.c: Adjust users.
4235
4236 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4237
4238 Inline getter and setter functions for per-buffer values.
4239 * buffer.h (per_buffer_default, set_per_buffer_default)
4240 (per_buffer_value, set_per_buffer_value): New functions.
4241 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
4242 * buffer.c, data.c: Adjust users.
4243
4244 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
4245
4246 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
4247
4248 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
4249
4250 Rely on <config.h> + <unistd.h> to declare 'environ',
4251 as gnulib does this if the system doesn't.
4252 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
4253 Remove declaration. MS-Windows declares it on stdlib.h which is
4254 included by conf_post.h.
4255 * emacs.c (environ) [DOUG_LEA_MALLOC]:
4256 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
4257 * vm-limit.c: Include <unistd.h>, for 'environ'.
4258
4259 * unexaix.c, unexcoff.c: Include "mem-limits.h".
4260 (start_of_data): Remove decl; mem-limits.h provides it.
4261
4262 * xdisp.c (handle_invisible_prop): Make it a bit faster
4263 and avoid a gcc -Wmaybe-uninitialized diagnostic.
4264
4265 2012-08-19 Chong Yidong <cyd@gnu.org>
4266
4267 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
4268 ends (Bug#3874).
4269
4270 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
4271
4272 * .gdbinit: Use call instead of set when calling a function in the
4273 inferior.
4274
4275 * data.c (set_internal): Don't use set_blv_found.
4276 (Fkill_local_variable): Likewise.
4277
4278 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
4279
4280 * nsfont.m (ns_ascii_average_width): Ensure the string
4281 ascii_printable is initialized with a null-terminated character
4282 array. Otherwise, it can contain undesired extra characters.
4283
4284 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4285
4286 port new setting code to Sun C 5.8 2005/10/13
4287 * chartab.c, lisp.h (char_table_set, char_table_set_range):
4288 Return void, not Lisp_Object. Otherwise, the compiler
4289 complains about (A?B:C) where B is void and C is Lisp_Object
4290 when compiling CHAR_TABLE_SET, due to the recent change to
4291 the API of sub_char_table_set_contents.
4292
4293 2012-08-18 Chong Yidong <cyd@gnu.org>
4294
4295 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
4296 for the string case (Bug#3874).
4297
4298 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4299
4300 * buffer.h (BSET): Remove (Bug#12215).
4301 Replace all uses with calls to new setter functions.
4302 (bset_bidi_paragraph_direction, bset_case_canon_table)
4303 (bset_case_eqv_table, bset_directory, bset_display_count)
4304 (bset_display_time, bset_downcase_table)
4305 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
4306 (bset_last_selected_window, bset_local_var_alist)
4307 (bset_mark_active, bset_point_before_scroll, bset_read_only)
4308 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
4309 (bset_width_table):
4310 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4311 (bset_auto_fill_function, bset_auto_save_file_format)
4312 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4313 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4314 (bset_cache_long_line_scans, bset_case_fold_search)
4315 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4316 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4317 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4318 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4319 (bset_header_line_format, bset_indicate_buffer_boundaries)
4320 (bset_indicate_empty_lines, bset_invisibility_spec)
4321 (bset_left_fringe_width, bset_major_mode, bset_mark)
4322 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4323 (bset_name, bset_overwrite_mode, bset_pt_marker)
4324 (bset_right_fringe_width, bset_save_length)
4325 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4326 (bset_scroll_up_aggressively, bset_selective_display)
4327 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4328 (bset_word_wrap, bset_zv_marker):
4329 * category.c (bset_category_table):
4330 * syntax.c (bset_syntax_table):
4331 New setter functions.
4332
4333 * process.h (PSET): Remove (Bug#12215).
4334 Replace all uses with calls to new setter functions.
4335 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4336 (PROCESS_INLINE): New macro.
4337 (pset_childp): New setter function.
4338 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4339 * process.c (PROCESS_INLINE):
4340 Define to EXTERN_INLINE, so that the corresponding functions
4341 are compiled into code.
4342 (pset_buffer, pset_command, pset_decode_coding_system)
4343 (pset_decoding_buf, pset_encode_coding_system)
4344 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4345 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4346 (pset_type, pset_write_queue): New setter functions.
4347
4348 * window.h (WSET): Remove (Bug#12215).
4349 Replace all uses with calls to new setter functions.
4350 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4351 (WINDOW_INLINE): New macro.
4352 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4353 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4354 (wset_total_lines, wset_vertical_scroll_bar)
4355 (wset_window_end_pos, wset_window_end_valid)
4356 (wset_window_end_vpos): New setter functions.
4357 * window.c (WINDOW_INLINE):
4358 Define to EXTERN_INLINE, so that the corresponding functions
4359 are compiled into code.
4360 (wset_combination_limit, wset_dedicated, wset_display_table)
4361 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4362 (wset_new_normal, wset_new_total, wset_next_buffers)
4363 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4364 (wset_prev_buffers, wset_right_fringe_width)
4365 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4366 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4367 (wset_window_parameters):
4368 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4369 (wset_column_number_displayed, wset_region_showing):
4370 New setter functions.
4371
4372 * termhooks.h (TSET): Remove (Bug#12215).
4373 Replace all uses with calls to new setter functions.
4374 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4375 (TERMHOOKS_INLINE): New macro.
4376 (tset_charset_list, tset_selection_alist): New setter functions.
4377 * terminal.c (TERMHOOKS_INLINE):
4378 Define to EXTERN_INLINE, so that the corresponding functions
4379 are compiled into code.
4380 (tset_param_alist): New setter function.
4381
4382 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4383
4384 * keyboard.h (KSET): Remove (Bug#12215).
4385 Replace all uses with calls to new setter functions.
4386 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4387 (KEYBOARD_INLINE): New macro.
4388 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4389 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4390 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4391 New setter functions.
4392 * keyboard.c (KEYBOARD_INLINE):
4393 Define to EXTERN_INLINE, so that the corresponding functions
4394 are compiled into code.
4395 (kset_echo_string, kset_kbd_queue)
4396 (kset_keyboard_translate_table, kset_last_prefix_arg)
4397 (kset_last_repeatable_command, kset_local_function_key_map)
4398 (kset_overriding_terminal_local_map, kset_real_last_command)
4399 (kset_system_key_syms): New setter functions.
4400
4401 * frame.h (FSET): Remove (Bug#12215).
4402 Replace all uses with calls to new setter functions.
4403 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4404 (FRAME_INLINE): New macro.
4405 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4406 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4407 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4408 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4409 (fset_param_alist, fset_root_window, fset_scroll_bars)
4410 (fset_selected_window, fset_title, fset_tool_bar_items)
4411 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4412 * frame.c (FRAME_INLINE):
4413 Define to EXTERN_INLINE, so that the corresponding functions
4414 are compiled into code.
4415 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4416
4417 A few more naming-convention fixes for getters and setters.
4418 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4419 and rename from buffer_overlays_set_before.
4420 (set_buffer_overlays_after): Move here from buffer.h, and rename
4421 from buffer_overlays_set_after.
4422 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4423 All uses changed.
4424 (set_buffer_intervals): Rename from buffer_set_intervals.
4425 * intervals.c (set_interval_object): Move here from intervals.h,
4426 and rename from interval_set_object.
4427 (set_interval_left): Move here from intervals.h, and rename from
4428 interval_set_left.
4429 (set_interval_right): Move here from intervals.h, and rename from
4430 interval_set_right.
4431 (copy_interval_parent): Move here from intervals.h, and rename from
4432 interval_copy_parent.
4433 * intervals.h (set_interval_parent): Rename from interval_set_parent.
4434 (set_interval_plist): Rename from interval_set_plist.
4435 Return void, not Lisp_Object, since no caller uses the result.
4436 * lisp.h (string_intervals): Rename from string_get_intervals.
4437 (set_string_intervals): Rename from string_set_intervals.
4438
4439 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4440 (set_char_table_contents): Rename from char_table_set_contents.
4441 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4442 All uses changed. See the end of
4443 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4444
4445 * lisp.h (CSET): Remove (Bug#12215).
4446 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4447 (set_char_table_purpose): New functions,
4448 replacing CSET. All uses changed. For example, replace
4449 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4450 "set_char_table_parent (char_table, parent);".
4451 The old version was confusing because it used the same name
4452 'parent' for two different things.
4453
4454 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4455
4456 Functions to get and set Lisp_Object fields of buffer-local variables.
4457 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4458 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4459 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4460 * data.c, eval.c, frame.c: Adjust users.
4461
4462 2012-08-17 Chong Yidong <cyd@gnu.org>
4463
4464 * xfaces.c (merge_face_vectors): If the target font specfies a
4465 font spec, make the font's attributes take precedence over
4466 directly-specified attributes.
4467 (merge_face_ref): Recognize :font.
4468
4469 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4470
4471 Do not use memcpy for copying intervals.
4472 * intervals.c (reproduce_interval): New function.
4473 (reproduce_tree, reproduce_tree_obj): Use it.
4474 (reproduce_tree_obj): Remove prototype.
4475
4476 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4477
4478 * lisp.h (duration_to_sec_usec): Remove unused decl.
4479
4480 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
4481
4482 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4483 to an allocated instance of NSString, not to the class itself.
4484
4485 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
4486
4487 * makefile.w32-in (C_CTYPE_H): New macro.
4488 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4489 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4490 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4491
4492 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4493
4494 Use ASCII tests for character types.
4495 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4496 * xfns.c, xterm.c:
4497 Don't include <ctype.h>; was not needed.
4498 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4499 * sysdep.c, xfaces.c:
4500 Include <c-ctype.h> instead of <ctype.h>.
4501 * nsterm.m: Include <c-ctype.h>.
4502 * charset.c (read_hex):
4503 * doc.c (Fsnarf_documentation):
4504 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4505 (DRIVE_LETTER) [DOS_NT]:
4506 (Ffile_name_directory, Fexpand_file_name)
4507 (Fsubstitute_in_file_name):
4508 * font.c (font_parse_xlfd, font_parse_fcname):
4509 * frame.c (x_set_font_backend):
4510 * gtkutil.c (xg_get_font):
4511 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4512 * nsimage.m (hexchar):
4513 * nsterm.m (ns_xlfd_to_fontname):
4514 * sysdep.c (system_process_attributes):
4515 * xfaces.c (hash_string_case_insensitive):
4516 Use C-locale tests instead of locale-specific tests for character
4517 types, since we want the ASCII interpretation here, not the
4518 interpretation suitable for whatever happens to be the current locale.
4519
4520 2012-08-16 Martin Rudalics <rudalics@gmx.at>
4521
4522 Consistently check windows for validity/liveness
4523 (Bug#11984, Bug#12025, Bug#12026).
4524 * lisp.h (CHECK_VALID_WINDOW): New macro.
4525 * window.c (decode_window): Rename to decode_live_window.
4526 (decode_valid_window, Fwindow_valid_p): New functions.
4527 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4528 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4529 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4530 (Fwindow_prev_sibling, Fwindow_combination_limit)
4531 (Fset_window_combination_limit, Fwindow_use_time)
4532 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4533 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4534 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4535 (Fwindow_hscroll, Fset_window_hscroll)
4536 (Fwindow_redisplay_end_trigger)
4537 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4538 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4539 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4540 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4541 (Fwindow_end, Fset_window_point, Fset_window_start)
4542 (Fpos_visible_in_window_p, Fwindow_line_height)
4543 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4544 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4545 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4546 (Fset_window_parameter, Fwindow_display_table)
4547 (Fset_window_display_table, Fdelete_other_windows_internal)
4548 (Fset_window_buffer, Fset_window_new_total)
4549 (Fset_window_new_normal, Fdelete_window_internal)
4550 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4551 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4552 (Fwindow_scroll_bars): Check whether argument window is a valid or
4553 live window. Update doc-strings.
4554 (syms_of_window): New symbol Qwindow_valid_p.
4555 * keyboard.c (Fposn_at_x_y): Check whether argument
4556 frame_or_window denotes a valid window.
4557
4558 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4559
4560 Fix previous char table change.
4561 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4562 * chartab.c (optimize_sub_char_table): Likewise.
4563
4564 2012-08-16 Chong Yidong <cyd@gnu.org>
4565
4566 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4567
4568 * xfont.c (xfont_open):
4569 * xftfont.c (xftfont_open): Set the font's max_width field.
4570
4571 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4572 min_width to space_width and average_width to the average over
4573 printable ASCII characters.
4574 (ns_char_width): Code cleanup.
4575 (ns_ascii_average_width): New utility function.
4576
4577 * font.h (struct font): Update comments.
4578
4579 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4580
4581 Simple interface to set Lisp_Object fields of character tables.
4582 * lisp.h (CSET): New macro.
4583 (char_table_set_extras, char_table_set_contents)
4584 (sub_char_table_set_contents): New function.
4585 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4586 * syntax.c: Adjust users.
4587
4588 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4589
4590 * eval.c (eval_sub): Bind lexical-binding.
4591 * lread.c (Qlexical_binding): Make non-static.
4592
4593 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4594
4595 * nsmenu.m (popupSession): Remove.
4596 (pop_down_menu): Remove endModalSession.
4597 (timeout_handler:): New method.
4598 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4599 Call runModalForWindow. Check timer_fired when it returns.
4600 If not set, cancel timer and break out of loop.
4601 Otherwise loop again, with a new timeout.
4602
4603 * nsterm.m: Include fcntl.h if present.
4604 (fd_entry, t_readfds, inNsSelect): Remove.
4605 (select_writefds, select_valid, select_timeout, selfds)
4606 (select_mutex, apploopnr): Add.
4607 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4608 Otherwise call kbd_buffer_store_event.
4609 (ns_send_appdefined): Remove release of fd_entry.
4610 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4611 Increment and decrement apploopnr.
4612 (ns_select): If no file descriptors, just do a NSTimer.
4613 Otherwise copy read/write masks and start select thread (fd_handler).
4614 Start main loop and wait for application defined event.
4615 Inform select thread to stop selecting after main loop is exited.
4616 (ns_term_init): Create selfds pipe and set non-blocking.
4617 Initialize select_mutex. Start the select thread (fd_handler).
4618 (fd_handler:): Loop forever, wait for info from the main thread
4619 to either start or stop selecting. When select returns, send
4620 and appdefined event.
4621 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4622 If not call kbd_buffer_store_event.
4623
4624 * nsterm.h (EmacsApp): fd_handler takes id argument.
4625 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4626
4627 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4628
4629 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4630
4631 * region-cache.c (move_cache_gap): Update gap_len using the actual
4632 growth of the boundaries array. Do not change cache_len.
4633 (Bug#12196)
4634
4635 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4636
4637 Generalize and cleanup font subsystem checks.
4638 * font.h (FONT_DEBUG, font_assert): Remove.
4639 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4640 Change font_assert to eassert. Use eassert where appropriate.
4641
4642 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4643
4644 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4645
4646 2012-08-15 Chong Yidong <cyd@gnu.org>
4647
4648 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4649 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4650 extract the font descriptor instead of just the font name.
4651 In that case, return a font spec instead of a string.
4652 (x_last_font_name): Move to this file from xfns.c.
4653
4654 * xfns.c (Fx_select_font): The return value can also be a font
4655 spec. Move x_last_font_name management to gtkutil.c.
4656
4657 * xfaces.c: Make font weight and style symbols non-static.
4658
4659 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4660
4661 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4662 (bug#12117).
4663
4664 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4665
4666 * alloc.c (Fgarbage_collect): Use plural form consistently.
4667
4668 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4669
4670 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4671 iteration through the command loop. Fixes a problem whereby mouse
4672 movements are ignored until the first mouse click.
4673
4674 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4675
4676 Use bool, not int, for Lisp booleans.
4677 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4678 makes Emacs a bit smaller and presumably a bit faster.
4679 * lisp.h: Include <stdbool.h>.
4680 (struct Lisp_Boolfwd, defvar_bool):
4681 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4682 * regex.c [!emacs]: Include <stdbool.h>.
4683 (false, true): Remove; <stdbool.h> does this for us now.
4684
4685 2012-08-14 Chong Yidong <cyd@gnu.org>
4686
4687 * character.c (Fcharacterp): Doc fix (Bug#12076).
4688
4689 * data.c (Findirect_variable): Doc fix (Bug#11040).
4690
4691 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4692
4693 * editfns.c (Fformat): Doc fix (Bug#12059).
4694 (Fsave_current_buffer): Doc fix (Bug#11542).
4695
4696 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4697
4698 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4699 (bug#12022).
4700
4701 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4702
4703 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4704 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4705 * minibuf.c (choose_minibuf_frame, read_minibuf):
4706 * w32fns.c (x_create_tip_frame):
4707 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4708 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4709
4710 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4711
4712 * intervals.c (offset_intervals): Remove obsolete comment.
4713
4714 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4715
4716 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4717
4718 2012-08-14 Gergely Risko <gergely@risko.hu>
4719
4720 * coding.c (decode_coding): Record buffer modification before
4721 disabling undo_list (Bug#11773).
4722
4723 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4724
4725 Revert and cleanup some recent overlay changes.
4726 * buffer.h (enum overlay_type): Remove.
4727 (buffer_get_overlays, buffer_set_overlays): Likewise.
4728 (buffer_set_overlays_before, buffer_set_overlays_after):
4729 New function. Adjust users.
4730 (unchain_both): Add eassert.
4731
4732 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4733
4734 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4735
4736 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4737
4738 * gtkutil.c (xg_mark_data): Don't assume C99.
4739
4740 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4741
4742 * gtkutil.c (xg_frame_tb_info): New struct.
4743 (TB_INFO_KEY): New define.
4744 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4745 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4746 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4747 if not present.
4748 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4749 is up to date. Otherwise store new data.
4750 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4751
4752 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4753
4754 Use KSET for write access to Lisp_Object members of struct kboard.
4755 * keyboard.h (KSET): New macro.
4756 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4757 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4758 * xterm.c: Adjust users.
4759
4760 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4761
4762 Use BSET for write access to Lisp_Object members of struct buffer.
4763 * buffer.h (BSET): New macro.
4764 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4765 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4766 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4767 * window.c, xdisp.c, xfns.c: Adjust users.
4768
4769 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4770
4771 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4772
4773 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4774
4775 * nsterm.m (not_in_argv): New function.
4776 (application:openFile, application:openTempFile:):
4777 (application:openFileWithoutUI:, application:openFiles:): Open file
4778 if not_in_argv returns non-zero (bug#12171).
4779
4780 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4781 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4782 Define for Gtk+ versions less than 3.2.
4783 (xg_get_font_name): Use those functions/macros here.
4784 Reported by Frans Oilinki <moilinki@gmail.com>.
4785
4786 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4787
4788 * unexmacosx.c (copy_data_segment): Copy initialized data in
4789 statically linked libraries from input file rather than memory.
4790
4791 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4792 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4793 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4794
4795 2012-08-10 Glenn Morris <rgm@gnu.org>
4796
4797 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4798 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4799
4800 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4801
4802 Fix last change to allow compilation with low optimization levels.
4803 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4804 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4805
4806 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4807
4808 Use common inline syntax in intervals.h.
4809 * intervals.h (INTERVALS_INLINE): New macro.
4810 Change all users from LISP_INLINE.
4811
4812 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4813
4814 Define Qnone once for all platforms.
4815 * frame.c (Qnone): Define here.
4816 (syms_of_frame): DEFSYM it.
4817 * lisp.h (Qnone): New declaration.
4818 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4819 * xfns.c: Remove duplication. Adjust users.
4820
4821 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4822
4823 Remove unused macros from intervals.h.
4824 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4825 * intervals.c: Adjust comment.
4826
4827 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4828
4829 * w32fns.c <w32_unicode_gui>: New static variable.
4830 (globals_of_w32fns): Initialize it according to os_subtype.
4831 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4832 testing os_subtype.
4833
4834 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4835 Eli Zaretskii <eliz@gnu.org>
4836
4837 Fix bug #10299 with Unicode characters sent by customized
4838 keyboards created by MSKLC.
4839 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4840 (w32_init_class): Use it to initialize the Emacs class with either
4841 ANSI or Unicode API calls.
4842 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4843 later.
4844 (w32_wnd_proc): If the character code sent by WM_CHAR or
4845 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4846 original message. Call DefWindowProcW on NT and later.
4847
4848 2012-08-10 Glenn Morris <rgm@gnu.org>
4849
4850 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4851
4852 * lisp.h (DIRECTORY_SEP): Let configure set it.
4853
4854 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4855
4856 Use TSET for write access to Lisp_Object slots of struct terminal.
4857 * termhooks.h (TSET): New macro.
4858 * coding.c, terminal.c, xselect.c: Adjust users.
4859
4860 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4861
4862 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4863 the failing expression, include them in the error message.
4864 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4865 * lisp.h (internal_condition_case_n): Update declaration.
4866
4867 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4868
4869 Inline functions to examine and change buffer overlays.
4870 * buffer.c (unchain_both): New function.
4871 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4872 (buffer_has_overlays): New function.
4873 (enum overlay_type): New enum.
4874 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4875 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4876
4877 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4878
4879 Inline functions to examine and change buffer intervals.
4880 * alloc.c (mark_interval_tree): Remove.
4881 (MARK_INTERVAL_TREE): Simplify.
4882 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4883 * intervals.c (buffer_balance_intervals): New function.
4884 (graft_intervals_into_buffer): Adjust indentation.
4885 (set_intervals_multibyte): Simplify.
4886 * buffer.h (BUF_INTERVALS): Remove.
4887 (buffer_get_intervals, buffer_set_intervals): New function.
4888 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4889 * intervals.c, textprop.c: Adjust users.
4890
4891 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4892
4893 Inline functions to examine and change string intervals.
4894 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4895 (string_get_intervals, string_set_intervals): New function.
4896 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4897 * lread.c, print.c, textprop.c: Adjust users.
4898
4899 2012-08-08 Glenn Morris <rgm@gnu.org>
4900
4901 * lisp.mk (lisp): Remove language/persian.elc.
4902
4903 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4904
4905 Cleanup intervals.
4906 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4907 (NULL_INTERVAL_P): Likewise. Adjust users.
4908 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4909 Adjust comment. Move under #if 0.
4910 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4911 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4912
4913 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4914
4915 Check total length of intervals with eassert.
4916 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4917 * intervals.c: Change all users to eassert.
4918
4919 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4920
4921 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4922 Rename fields to match removal of FGET and WGET and disuse of
4923 INTERNAL_FIELD in Lisp_Cons.
4924
4925 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4926
4927 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4928 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4929 name since all xname users are fixed long time ago. Do not
4930 use INTERNAL_FIELD.
4931 (set_symbol_name, set_symbol_function, set_symbol_plist):
4932 (set_symbol_next, set_overlay_plist): New function.
4933 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4934 (struct Lisp_Overlay): Likewise.
4935 (CVAR, MVAR, SVAR): Remove.
4936 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4937 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4938 * xterm.c: Adjust users.
4939 * .gdbinit: Change to use name field of struct Lisp_Symbol
4940 where appropriate.
4941
4942 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4943
4944 Basic functions to set Lisp_Object and pointer slots of intervals.
4945 * intervals.h (interval_set_parent, interval_set_object):
4946 (interval_set_left, interval_set_right, interval_set_plist):
4947 (interval_copy_parent): New function.
4948 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4949 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4950 Adjust indentation.
4951 (INTERVAL_SIZE): Remove. Adjust users.
4952 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4953
4954 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4955
4956 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4957 * process.h (PGET): Remove.
4958 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4959 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4960
4961 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4962
4963 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4964 * window.h (WGET): Remove.
4965 (struct window): Do not use INTERNAL_FIELD.
4966 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4967 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4968 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4969 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4970 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4971 Adjust users.
4972
4973 2012-08-07 Chong Yidong <cyd@gnu.org>
4974
4975 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4976 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4977 (Fdelete_window_internal): Signal an error if the window is not on
4978 a live frame (Bug#12025).
4979
4980 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4981
4982 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4983 * frame.h (FGET): Remove.
4984 (struct frame): Do not use INTERNAL_FIELD.
4985 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4986 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4987 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4988 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4989
4990 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4991
4992 * w32.c: Silence compiler warnings.
4993 (map_w32_filename): Remove unused variable `is_fat'.
4994 (chase_symlinks): Add parentheses around expression.
4995
4996 2012-08-06 Glenn Morris <rgm@gnu.org>
4997
4998 * sysdep.c: Respect BROKEN_GETWD.
4999
5000 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5001 Let configure handle it.
5002 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5003
5004 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5005
5006 Use GCALIGNMENT where appropriate.
5007 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5008 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5009 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5010
5011 2012-08-06 Eli Zaretskii <eliz@gnu.org>
5012
5013 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5014 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5015
5016 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5017
5018 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5019 that should be sufficient for everyone.
5020
5021 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5022
5023 * keyboard.c (timer_check_2): Add break so timer_check returns next
5024 timeout.
5025
5026 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5027
5028 Fix Windows build errors introduced after converting to WGET and WSET.
5029 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5030 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5031
5032 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5033
5034 * nsterm.m (ns_frame_rehighlight): Use FSET.
5035
5036 * nsmenu.m (ns_update_menubar): Use FSET.
5037
5038 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5039
5040 Separate read and write access to Lisp_Object slots of Lisp_Process.
5041 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5042 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5043
5044 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5045
5046 Separate read and write access to Lisp_Object slots of struct window.
5047 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5048 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5049 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5050 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5051 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5052 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5053 Adjust users.
5054
5055 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5056
5057 Fix Windows build errors introduced after converting to FGET and FSET.
5058 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5059 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5060 (w32_judge_scroll_bars): Change to use FSET.
5061 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5062
5063 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5064
5065 Fix replacement typo.
5066 * window.c (replace_window): Set root_window instead of
5067 selected_window. This fixes a total window subsystem
5068 malfunction reported by Bastien Guerry <bzg@gnu.org>.
5069
5070 2012-08-06 Glenn Morris <rgm@gnu.org>
5071
5072 * lisp.mk (lisp): Add language/persian.elc.
5073
5074 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5075
5076 Separate read and write access to Lisp_Object slots of struct frame.
5077 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5078 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5079 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5080 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5081 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5082
5083 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
5084
5085 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5086
5087 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
5088
5089 Generalize common compile-time constants.
5090 * lisp.h (header_size, bool_header_size, word_size): Now here.
5091 (struct Lisp_Vector): Add comment.
5092 (struct Lisp_Bool_Vector): Move up to define handy constants.
5093 (VECSIZE, PSEUDOVECSIZE): Simplify.
5094 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
5095 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5096 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5097 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5098 * xfont.c, xmenu.c: Use word_size where appropriate.
5099
5100 2012-08-05 Lawrence Mitchell <wence@gmx.li>
5101
5102 * search.c (Freplace_match): Treat \? in the replacement text
5103 literally (Bug#8161).
5104
5105 2012-08-05 Chong Yidong <cyd@gnu.org>
5106
5107 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5108 * frame.c (Vdelete_frame_functions):
5109 * emacs.c (Vkill_emacs_hook): Doc fix.
5110
5111 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5112
5113 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5114 --with-x-toolkit=no builds.
5115 Reported by Carsten Mattner <carstenmattner@gmail.com>.
5116
5117 2012-08-04 Chong Yidong <cyd@gnu.org>
5118
5119 * syntax.c (Fmodify_syntax_entry): Doc fix.
5120
5121 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5122
5123 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
5124 * w32.c (init_environment): Change the default values of many
5125 environment variables in dflt_envvars[] to NULL, to avoid pushing
5126 them into environment when they were not already defined.
5127 Remove the code that deletes site-lisp subdirectories from the default
5128 value of EMACSLOADPATH, as it is no longer needed.
5129 (check_windows_init_file): Now external, not static.
5130 Use Vload_path as is, without adding anything, as this function is now
5131 called when Vload_path is already set up.
5132
5133 * w32.h (check_windows_init_file): Add prototype.
5134
5135 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5136 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5137 compatibility with Posix platforms.
5138 (main): Move the call to check_windows_init_file to here from
5139 w32.c.
5140 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5141 any, in the DEFALT argument into the root of the Emacs build or
5142 installation tree, as appropriate.
5143
5144 * callproc.c (init_callproc_1): Call decode_env_path instead of
5145 doing its equivalent by hand.
5146 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5147 the code that sets Vexec_path run on MS-Windows.
5148
5149 * lread.c (init_lread): Add comments to #ifdef's.
5150
5151 * msdos.c (dos_set_window_size, IT_update_begin)
5152 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5153 instead of direct references.
5154
5155 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
5156
5157 Export DEFAULT_REHASH_* to GDB.
5158 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5159 Now constants, not macros.
5160
5161 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
5162
5163 Remove unnecessary casts involving pointers.
5164 These casts are no longer needed now that we assume C89 or later,
5165 since they involve casting to or from void *.
5166 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5167 (make_pure_float, make_pure_vector):
5168 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5169 * macros.c (Fstart_kbd_macro):
5170 * menu.c (find_and_return_menu_selection):
5171 * minibuf.c (read_minibuf_noninteractive):
5172 * sysdep.c (closedir):
5173 * xdisp.c (x_produce_glyphs):
5174 * xfaces.c (compare_fonts_by_sort_order):
5175 * xfns.c (x_real_positions, select_visual):
5176 * xselect.c (x_stop_queuing_selection_requests)
5177 (x_get_window_property, x_get_window_property_as_lisp_data):
5178 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
5179 Remove unnecessary pointer casts.
5180 * alloc.c (record_xmalloc): New function.
5181 * lisp.h (record_xmalloc): New decl.
5182 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
5183 more like a function. This is because the pointer cast is not
5184 needed. All uses changed.
5185 * print.c (print_string, print_error_message): Avoid length recalc.
5186
5187 Improve fix for macroexp crash with debugging (Bug#12118).
5188 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
5189 ARRAY_MARK_FLAG when checking subscripts, because ASET is
5190 not supposed to be invoked from the garbage collector.
5191 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
5192 (gc_aset): New function, which is like ASET but can be
5193 used in the garbage collector.
5194 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5195 (set_hash_index): Use it instead of ASET.
5196
5197 2012-08-03 Eli Zaretskii <eliz@gnu.org>
5198
5199 Support symlinks on latest versions of MS-Windows.
5200 * w32.c: Include winioctl.h and aclapi.h.
5201 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
5202 (revert_to_self): Forward declarations of static functions.
5203 <static BOOL g_b_init_get_security_info>:
5204 <g_b_init_create_symbolic_link>: New static flags.
5205 (globals_of_w32): Initialize them to zero.
5206 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
5207 (map_w32_filename): Improve commentary. Simplify switch.
5208 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
5209 headers (most versions of MinGW w32api don't).
5210 (get_security_info, create_symbolic_link)
5211 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
5212 New functions.
5213 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
5214 in the argument file name.
5215 (sys_access): Call unc_volume_file_attributes only if
5216 GetFileAttributes fails with network-related error codes.
5217 (sys_rename): Diagnose renaming of a symlink when the user doesn't
5218 have the required privileges.
5219 (get_file_security_desc_by_name): Rename from
5220 get_file_security_desc.
5221 (stat_worker): New function, with most of the guts of 'stat', and
5222 with addition of handling of symlinks and support for 'lstat'.
5223 If possible, get file's attributes and security information by
5224 handle, not by name. Produce S_IFLNK bit for symlinks, when
5225 called from 'lstat'.
5226 (stat, lstat): New functions, call 'stat_worker'.
5227 (symlink, readlink, careadlinkat): Rewritten to create and resolve
5228 symlinks when the underlying filesystem supports them.
5229
5230 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5231
5232 Fix macroexp crash on Windows with debugging (Bug#12118).
5233 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
5234 checking subscripts; problem introduced with the recent
5235 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
5236 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
5237 since it's used in non-static inline functions now.
5238
5239 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
5240 Don't assume buffer size fits in 'int'. Remove unused local.
5241
5242 Use C99-style 'extern inline' if available.
5243 * buffer.h (BUFFER_INLINE):
5244 * category.h (CATEGORY_INLINE):
5245 * character.h (CHARACTER_INLINE):
5246 * charset.h (CHARSET_INLINE):
5247 * composite.h (COMPOSITE_INLINE):
5248 * dispextern.h (DISPEXTERN_INLINE):
5249 * lisp.h (LISP_INLINE):
5250 * systime.h (SYSTIME_INLINE):
5251 New macro, replacing 'static inline' in this header.
5252 * buffer.h, category.h, character.h, charset.h, composite.h:
5253 * dispextern.h, lisp.h, systime.h:
5254 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5255 * alloc.c (LISP_INLINE):
5256 * buffer.c (BUFFER_INLINE):
5257 * category.c (CATEGORY_INLINE):
5258 * character.c (CHARACTER_INLINE):
5259 * charset.c (CHARSET_INLINE):
5260 * composite.c (COMPOSITE_INLINE):
5261 * dispnew.c (DISPEXTERN_INLINE):
5262 * sysdep.c (SYSTIME_INLINE):
5263 Define to EXTERN_INLINE, so that the corresponding functions
5264 are compiled into code.
5265 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
5266 (INLINE_HEADER_END): New macros.
5267 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
5268 since it's used in non-static inline functions now.
5269 (VALMASK) [!USE_LSB_TAG]: Likewise.
5270
5271 2012-08-02 Glenn Morris <rgm@gnu.org>
5272
5273 * s/: Remove empty directory.
5274
5275 * s/ms-w32.h: Move to ../nt/inc.
5276 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
5277 Update for new ms-w32.h location.
5278
5279 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5280
5281 Port to Solaris 8.
5282 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
5283
5284 2012-08-02 Glenn Morris <rgm@gnu.org>
5285
5286 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
5287 hard-coding the path separator.
5288
5289 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5290
5291 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
5292 This how ASET and AREF are supposed to work, and makes
5293 it easier to think about future improvements. See
5294 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
5295 * charset.h (set_charset_attr): New function.
5296 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
5297 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
5298 (aref_addr): New function. All uses of &AREF(...) changed.
5299 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5300 (set_hash_index): New functions. All lvalue-style uses of
5301 HASH_KEY etc. changed.
5302 * keyboard.c (set_prop): New function. All lvalue-style uses
5303 of PROP changed.
5304
5305 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
5306
5307 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
5308 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
5309 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
5310 * nsfns.m (ns_set_name_as_filename): Likewise.
5311 * nsmenu.m (ns_update_menubar): Likewise.
5312 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
5313
5314 2012-08-01 Eli Zaretskii <eliz@gnu.org>
5315
5316 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
5317 Adapt to latest changes in field names of the corresponding Lisp
5318 objects.
5319
5320 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
5321
5322 2012-08-01 Glenn Morris <rgm@gnu.org>
5323
5324 * s/msdos.h: Remove file.
5325 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
5326 * Makefile.in (S_FILE): Remove.
5327 (config_h): Remove S_FILE.
5328
5329 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5330
5331 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5332 Remove; moved to nt/config.nt.
5333
5334 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5335
5336 Use INTERNAL_FIELD for conses and overlays.
5337 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5338 Remove obsolete comment.
5339 (MVAR): New macro.
5340 (struct Lisp_Overlay): Use INTERNAL_FIELD.
5341 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5342
5343 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5344
5345 Use INTERNAL_FIELD for symbols.
5346 * lisp.h (SVAR): New macro. Adjust users.
5347 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5348 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5349
5350 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5351
5352 Use INTERNAL_FIELD for processes.
5353 * process.h (PVAR): New macro. Adjust style.
5354 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5355 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5356
5357 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5358
5359 Use INTERNAL_FIELD for windows.
5360 * window.h (WVAR): New macro.
5361 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5362 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5363 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5364 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5365 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5366 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5367
5368 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5369
5370 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5371
5372 2012-08-01 Glenn Morris <rgm@gnu.org>
5373
5374 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5375 Move to configure.ac.
5376
5377 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5378
5379 * makefile.w32-in (CONFIG_H): Update dependencies.
5380 (CONF_POST_H): New macro.
5381
5382 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5383
5384 2012-07-31 Glenn Morris <rgm@gnu.org>
5385
5386 * Makefile.in (S_FILE): No longer set by configure.
5387
5388 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5389 is available.
5390 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5391
5392 * process.h (NULL_DEVICE):
5393 * emacs.c (SEPCHAR):
5394 * editfns.c (USER_FULL_NAME): Let configure set them.
5395
5396 * s/README, s/template.h: Remove files.
5397
5398 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5399
5400 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5401 Move to configure.ac.
5402
5403 2012-07-31 Eli Zaretskii <eliz@gnu.org>
5404
5405 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5406 resulting renaming of 'struct frame' members.
5407
5408 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5409
5410 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5411 after introduction of FVAR.
5412
5413 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5414
5415 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5416
5417 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5418 instead of compositeToPoint.
5419 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5420
5421 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5422
5423 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5424
5425 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5426 * lisp.h (INTERNAL_FIELD): New macro.
5427 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5428 (BVAR): Change to use INTERNAL_FIELD.
5429 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5430 (KVAR): Change to use INTERNAL_FIELD.
5431 * frame.h (FVAR): New macro.
5432 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5433 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5434 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5435 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5436 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5437
5438 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5439
5440 Miscellaneous fixes for non-default X toolkits.
5441 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5442 * xterm.c (x_frame_of_widget): Remove redundant prototype.
5443 Move under #ifdef USE_LUCID.
5444 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5445 definition and usage to avoid warnings.
5446
5447 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5448
5449 * nsterm.m (openFiles): Fix previous checkin.
5450
5451 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
5452
5453 * indent.c (compute_motion): Remove unused local.
5454
5455 2012-07-31 Glenn Morris <rgm@gnu.org>
5456
5457 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5458
5459 * conf_post.h [USG5_4]:
5460 Move remaining contents of s/usg5-4-common.h here.
5461 * s/usg5-4-common.h: Remove file.
5462
5463 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5464 * s/irix6-5.h: Remove file.
5465
5466 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5467 * s/darwin.h: Remove file.
5468
5469 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5470 * s/hpux10-20.h: Remove file, which is now empty.
5471
5472 2012-07-30 Glenn Morris <rgm@gnu.org>
5473
5474 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5475 * Makefile.in (config_h): Add conf_post.h.
5476 * makefile.w32-in (CONFIG_H): Add conf_post.h.
5477
5478 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
5479
5480 * nsterm.m (ns_do_open_file): New variable.
5481 (ns_term_init): Set ns_do_open_file to YES after run returns.
5482 (openFile, openTempFile, openFileWithoutUI, openFiles):
5483 Open files only if ns_do_open_file.
5484
5485 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5486
5487 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5488 This no-op macro hasn't been needed for many years.
5489 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5490
5491 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5492 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5493 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5494 gdb_make_enums_visible.
5495 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5496 (DIRECTORY_SEP): Now a constant, not a macro.
5497
5498 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5499
5500 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5501 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5502
5503 * w32term.c <w32_keyboard_codepage>: Renamed from
5504 keyboard_codepage and now external. All users changed.
5505
5506 * w32term.h: Add declaration of w32_keyboard_codepage.
5507
5508 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5509 the codepage to translate keys to Unicode. If this argument is
5510 -1, use the value returned by GetConsoleCP. All callers changed.
5511
5512 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5513
5514 Update .PHONY listings in makefiles.
5515 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5516 bootstrap-clean, distclean, maintainer-clean, versioclean,
5517 extraclean, frc.
5518
5519 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5520 This is a bit clearer. Fix some commentary typos.
5521
5522 2012-07-30 Glenn Morris <rgm@gnu.org>
5523
5524 * s/netbsd.h: Let configure include signal.h if needed.
5525 Remove file, which is now empty.
5526
5527 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5528 Let configure set them.
5529 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5530 No more need to undefine.
5531
5532 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5533
5534 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5535 non-single-byte char when adding meta modifier. (Bug#12090)
5536
5537 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5538
5539 Convert safe_call to use variable number of arguments.
5540 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5541 (safe_call2): Fix comment.
5542 * lisp.h (safe_call): Adjust prototype.
5543 * coding.c (encode_coding_object): Change to use safe_call2.
5544 * xfaces.c (merge_face_heights): Change to use safe_call1.
5545
5546 2012-07-30 Glenn Morris <rgm@gnu.org>
5547
5548 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5549 does that unconditionally. Remove file, which is now empty.
5550
5551 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5552 Remove empty files.
5553
5554 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5555
5556 Export to GDB most of lisp.h's remaining object-like macros.
5557 * lisp.h (min, max): Move earlier, because they're used earlier now.
5558 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5559 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5560 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5561 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5562 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5563 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5564 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5565 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5566 Now constants, for GDB. They need not be macros.
5567 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5568 Now constants, for GDB, as well as macros, for static initializers.
5569 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5570 Move to after the definition of struct Lisp_Char_Table,
5571 since the former now needs that type defined.
5572 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5573 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5574 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5575 New enums, for gdb_make_enums_visible.
5576 (GLYPH_MODE_LINE_FACE): Remove; unused.
5577 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5578 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5579 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5580 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5581 enum maxargs, enum MAX_ALLOCA.
5582 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5583 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5584 no longer needed, now that they are done in lisp.h.
5585
5586 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5587
5588 Cleanup string bytes checking.
5589 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5590 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5591 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5592 (check_sblock, compact_small_strings): Simplify.
5593
5594 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5595
5596 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5597 These macros are confusing and no longer need to be defined, as
5598 the enum values now suffice. All uses replaced with definiens.
5599 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5600
5601 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5602
5603 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5604 ($(BLD)/w32console.$(O)): Update dependencies.
5605
5606 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5607
5608 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5609 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5610 time. Adjust users.
5611 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5612
5613 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5614
5615 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5616 setting sitelisp (Bug#12010).
5617
5618 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5619
5620 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5621
5622 * w32heap.c (cache_system_info):
5623 * w32.c (sys_rename):
5624 * w32proc.c (find_child_console, sys_kill): All users changed.
5625
5626 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5627
5628 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5629
5630 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5631
5632 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5633
5634 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5635
5636 Cleanup statistics calculation in Fgarbage_collect.
5637 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5638 Fix zombies percentage calculation. Simplify elapsed time calculation.
5639
5640 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5641
5642 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5643 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5644 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5645 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5646 (replace_range, replace_range_2, del_range_2): Change to eassert.
5647 * marker.c (byte_char_debug_check): Adjust style.
5648
5649 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5650
5651 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5652 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5653 long-ago-commented-out code that talks about "WIN32".
5654 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5655 All uses changed.
5656
5657 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5658
5659 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5660 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5661 Simplify by using alignof.
5662 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5663 * lisp.h: Include <stdalign.h>.
5664 (GCALIGNMENT): New macro and constant.
5665 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5666 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5667 (stdalign): New macro, if not already defined.
5668
5669 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5670
5671 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5672 * w32inevt.c: Include w32inevt.h.
5673 (w32_read_console_input): New inline function, calls either
5674 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5675 w32_console_unicode_input.
5676 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5677 (w32_kbd_patch_key, key_event): Use the codepage returned by
5678 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5679 (key_event): use uChar.UnicodeChar only if
5680 w32_console_unicode_input is non-zero.
5681
5682 * w32console.c: Include w32heap.h.
5683 <w32_console_unicode_input>: New global variable.
5684 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5685 family of Windows, zero otherwise.
5686
5687 * w32inevt.h: Declare w32_console_unicode_input.
5688
5689 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5690 --without-x. (Bug#11742)
5691
5692 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5693
5694 Adjust GDB to reflect pvec_type changes (Bug#12036).
5695 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5696 2012-07-04 changes to pseudovector representation.
5697 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5698
5699 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5700
5701 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5702 bus address.
5703 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5704
5705 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5706
5707 * alloc.c (listn): Fix the order the arguments are consed onto the
5708 list.
5709
5710 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5711 enumeration constants, as PURE and HEAP are too general, and clash
5712 with other headers and sources, such as gmalloc.c and the
5713 MS-Windows system headers. All users changed.
5714
5715 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5716
5717 Revert last save_excursion_save and save_excursion_restore changes.
5718 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5719 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5720
5721 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5722
5723 Fix recently-introduced typos in Windows port.
5724 Reported by Martin Rudalics <rudalics@gmx.at>.
5725 * w32.c (init_environment): Replace comma with semicolon.
5726 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5727
5728 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5729
5730 Improve GDB symbol export (Bug#12036).
5731 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5732 arms of an 'if', not using conditional expressions; otherwise GDB
5733 complains about the types in the unevaluated arm when the argument
5734 is an integer literal.
5735 (xgetint): Simplify expression.
5736 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5737 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5738 Zaretskii in <http://bugs.gnu.org/12036#13>.
5739 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5740 needed now that we have gdb_make_enums_visible.
5741 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5742 (enum enum_USE_LSB_TAG):
5743 New enum types, packaging up enums that need to be exported to GDB.
5744
5745 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5746
5747 Utility function to make a list from specified amount of objects.
5748 * lisp.h (enum constype): New datatype.
5749 (listn): New prototype.
5750 * alloc.c (listn): New function.
5751 (Fmemory_use_count, syms_of_alloc): Use it.
5752 * buffer.c (syms_of_buffer): Likewise.
5753 * callint.c (syms_of_callint): Likewise.
5754 * charset.c (define_charset_internal): Likewise.
5755 * coding.c (syms_of_coding): Likewise.
5756 * keymap.c (syms_of_keymap): Likewise.
5757 * search.c (syms_of_search): Likewise.
5758 * syntax.c (syms_of_syntax): Likewise.
5759 * w32.c (init_environment): Likewise.
5760 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5761 * xdisp.c (syms_of_xdisp): Likewise.
5762 * xfns.c (syms_of_xfns): Likewise.
5763
5764 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5765
5766 Fast save_excursion_save and save_excursion_restore.
5767 * lisp.h (struct Lisp_Excursion): New data type.
5768 (PVEC_EXCURSION): New pseudovector type.
5769 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5770 to deal with it. Adjust comments.
5771 (init_marker, attach_marker): New prototype.
5772 (unchain_marker): Adjust prototype.
5773 * marker.c (attach_marker): Change to global.
5774 (init_marker): New function.
5775 * alloc.c (Fmake_marker, build_marker): Use it.
5776 (build_marker): More easserts.
5777 (mark_object): Handle struct Lisp_Excursion.
5778 * editfns.c (save_excursion_save, save_excursion_restore):
5779 Reimplement to use struct Lisp_Excursion. Add comments.
5780
5781 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5782
5783 Fix export of symbols to GDB (Bug#12036).
5784 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5785 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5786 emacs.c, as this is a more-suitable home. Had this been done earlier
5787 the fix for 12036 would have avoided some of the problems noted in
5788 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5789 would have been more obvious.
5790 * emacs.c: Do not include <verify.h>; no longer needed.
5791 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5792 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5793 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5794 Remove; now done in lisp.h.
5795 * lisp.h (PUBLISH_TO_GDB): New macro.
5796 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5797 (DATA_SEG_BITS): Use it.
5798 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5799 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5800 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5801 not be usable in #if. This simplifies things.
5802
5803 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5804
5805 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5806
5807 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5808
5809 Simplify export of symbols to GDB (Bug#12036).
5810 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5811 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5812 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5813 Adjust to changes in lisp.h and emacs.c, by using
5814 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5815 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5816 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5817 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5818 instead of gdb_valbits.
5819 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5820 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5821 instead of gdb_array_mark_flag.
5822 (xboolvector): Get size from $->size, not $->header.size.
5823 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5824 (xreload, hook-run, hookpost-run): Remove.
5825 * emacs.c: Include <verify.h>.
5826 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5827 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5828 Remove.
5829 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5830 (gdb_USE_LSB_TAG): New enum constants.
5831 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5832 Also define these as enum constants, so they're visible to GDB.
5833 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5834 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5835 as constants, so they're visible to GDB.
5836 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5837 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5838 Now enum constants, not macros, so they're visible to GDB.
5839 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5840 more convenient now. All uses changed.
5841 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5842 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5843
5844 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5845
5846 Explicitly free restriction data that are not needed anymore.
5847 * editfns.c (save_restriction_restore): Free restriction data.
5848
5849 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5850
5851 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5852 add argument, tune behavior, and adjust all callers.
5853
5854 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5855
5856 Use typedef for EMACS_INT, EMACS_UINT.
5857 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5858 than macros. This simplifies debugging in the usual case, since
5859 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5860 and it allows expressions involving EMACS_INT casts.
5861 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5862
5863 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5864
5865 * nsterm.m (ns_read_socket): Return early if there is a modal
5866 window (Bug#12043).
5867
5868 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5869
5870 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5871 that FOCUS-FRAME can be omitted.
5872
5873 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5874
5875 Adjust buffer text indirection counters at the end of Fkill_buffer.
5876 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5877 buffer is definitely dead. This should really fix an issue reported
5878 by Christoph Scholtes again. (Bug#12007).
5879 (init_buffer_once): Initialize indirection counters of
5880 buffer_defaults and buffer_local_symbols (for sanity and safety).
5881
5882 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5883
5884 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5885 and continuation glyphs on tooltip frames, leave them at zero.
5886 Avoids continued lines in tooltips. (Bug#11832)
5887
5888 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5889
5890 Simplify copy_overlay.
5891 * buffer.c (copy_overlay): Simplify. Use build_marker.
5892 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5893
5894 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5895
5896 * print.c (print_object): Don't crash when a frame's name is nil
5897 or invalid. (Bug#12025)
5898
5899 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5900 it signals an error when a tooltip frame is being created.
5901
5902 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5903
5904 Cleanup miscellaneous objects allocation and initialization.
5905 * alloc.c (allocate_misc): Change to static. Add argument to
5906 specify the subtype. Adjust comment and users.
5907 (build_overlay): New function.
5908 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5909 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5910 (allocate_misc): Remove prototype.
5911 (build_overlay): Add prototype.
5912
5913 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5914
5915 Swap buffer text indirection counters in Fbuffer_swap_text.
5916 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5917 This avoids crash reported by Christoph Scholtes at
5918 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5919
5920 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5921
5922 * nsmenu.m (Popdown_data): New struct.
5923 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5924 free Popdown_data.
5925 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5926 (initWithContentRect): Make imgView and contentView non-static
5927 and autorelease them. Also autorelease img and matrix (Bug#12005).
5928 (dealloc): Remove (Bug#12005).
5929
5930 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5931
5932 Adjust consing_since_gc when objects are explicitly freed.
5933 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5934 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5935 (free_cons, free_misc): Subtract object size from consing_since_gc.
5936
5937 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5938
5939 Simplify and cleanup markers positioning code.
5940 * marker.c (attach_marker): More useful eassert.
5941 (live_buffer, set_marker_internal): New function.
5942 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5943 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5944
5945 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5946
5947 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5948 as it's limited by the amount of memory, not by INT_MAX.
5949
5950 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5951
5952 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5953 in special-event-map. See the discussion at
5954 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5955 for the reasons.
5956
5957 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5958 info.dwItemData. Fixes crashes on 64-bit Windows.
5959 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5960
5961 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5962
5963 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5964 (conversationIdentifier): Return value is NSInteger.
5965 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5966
5967 2012-07-21 Chong Yidong <cyd@gnu.org>
5968
5969 * window.c (decode_any_window): Signal an error if the window is
5970 on a dead frame (Bug#11984).
5971
5972 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5973
5974 Add indirection counting to speed up Fkill_buffer.
5975 * buffer.h (struct buffer): New member.
5976 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5977 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5978 base buffer indirection counter.
5979 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5980 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5981 through buffer list if indirection counter is 0.
5982
5983 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5984
5985 Extend the value returned by Fgarbage_collect with heap statistics.
5986 * alloc.c (Qheap): New symbol.
5987 (syms_of_alloc): DEFSYM it.
5988 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5989 (Fmemory_free): Remove.
5990 (syms_of_alloc): Don't defsubr it.
5991 * buffer.c (Fcompact_buffer): Remove.
5992 (syms_of_buffer): Don't defsubr it.
5993
5994 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5995
5996 Make maybe_gc inline.
5997 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5998 * lisp.h (consing_since_gc, gc_relative_threshold)
5999 (memory_full_cons_threshold): Revert declaration.
6000 (maybe_gc): Remove prototype, define as inline.
6001 * alloc.c: Remove old commented-out code.
6002 (consing_since_gc, gc_relative_threshold)
6003 (memory_full_cons_threshold): Revert to global.
6004 (maybe_gc): Remove.
6005
6006 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6007
6008 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6009 * lisp.h (build_unibyte_string): New function.
6010 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6011 * sysdep.c, w32fns.c, xfns.c: Use it.
6012 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6013 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6014 Adjust users accordingly.
6015 * font.h (font_open_by_name): Adjust prototype.
6016
6017 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6018
6019 Cleanup calls to Fgarbage_collect.
6020 * lisp.h (maybe_gc): New prototype.
6021 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6022 Remove declarations.
6023 * alloc.c (maybe_gc): New function.
6024 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6025 Make them static.
6026 * bytecode.c (MAYBE_GC): Use maybe_gc.
6027 * eval.c (eval_sub, Ffuncall): Likewise.
6028 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6029 to avoid dependency from auto-save feature.
6030
6031 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6032
6033 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6034 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6035 'for_each_per_buffer_object_at'.
6036 All uses changed. It's better to use upper-case for macros that
6037 cannot be implemented as functions, to give the reader a clue
6038 that they're special.
6039
6040 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
6041
6042 * alloc.c (Fgarbage_collect): Tweak docstring.
6043
6044 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6045
6046 Tweak the value returned from Fgarbage_collect again.
6047 * alloc.c (Fgarbage_collect): New return value, as confirmed in
6048 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6049 Adjust documentation.
6050 (total_vector_bytes): Rename to total_vector_slots, adjust
6051 accounting.
6052 (total_free_vector_bytes): Rename to total_free_vector_slots,
6053 adjust accounting.
6054 (Qstring_bytes, Qvector_slots): New symbols.
6055 (syms_of_alloc): DEFSYM them.
6056
6057 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6058
6059 Buffer compaction primitive which may be used from Lisp.
6060 * buffer.c (compact_buffer, Fcompact_buffer): New function.
6061 (syms_of_buffer): Register Fcompact_buffer.
6062 * alloc.c (Fgarbage_collect): Use compact_buffer.
6063 * buffer.h (compact_buffer): New prototype.
6064 (struct buffer_text): New member.
6065
6066 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6067
6068 New macro to iterate over all buffers, miscellaneous cleanups.
6069 * lisp.h (all_buffers): Remove declaration.
6070 * buffer.h (all_buffers): Add declaration, with comment.
6071 (for_each_buffer): New macro.
6072 * alloc.c (Fgarbage_collect, mark_object): Use it.
6073 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6074 (init_buffer): Likewise.
6075 * data.c (Fset_default): Likewise.
6076 * coding.c (code_conversion_restore): Remove redundant check
6077 for dead buffer.
6078 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
6079
6080 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6081
6082 Fix bug that created negative-length intervals.
6083 * intervals.c (merge_interval_right, merge_interval_left):
6084 Do not zero out this interval if it is absorbed by its children,
6085 as this interval's total length doesn't change in that case. See
6086 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6087
6088 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
6089
6090 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6091 when invoking (make-bool-vector N t) and N is a positive
6092 multiple of 8 -- the last 8 bits were mistakenly cleared.
6093
6094 Remove some struct layout assumptions in bool vectors.
6095 * alloc.c (bool_header_size): New constant.
6096 (header_size, word_size): Move earlier, as they're now used earlier.
6097 Use 'word_size' in a few more places, where it's appropriate.
6098 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6099 padding before the data member of a bool vector.
6100 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6101 than doing the check by hand with an abort ().
6102
6103 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6104
6105 * eval.c (Fdefvar): Don't check constants since we only set the var if
6106 it's not yet defined anyway (bug#11904).
6107
6108 * lisp.h (last_undo_boundary): Declare new var.
6109 * keyboard.c (command_loop_1): Set it.
6110 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6111 were auto-added by the command loop (bug#11774).
6112
6113 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6114
6115 * w32font.c (Qsymbol): Remove local definition.
6116 (syms_of_w32font): Don't DEFSYM it.
6117
6118 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6119
6120 Fix sweep_vectors to handle large bool vectors correctly.
6121 * alloc.c (sweep_vectors): Account total_vector_bytes for
6122 bool vectors larger than VBLOCK_BYTES_MAX.
6123
6124 2012-07-18 Chong Yidong <cyd@gnu.org>
6125
6126 * frame.c (x_set_frame_parameters): Revert bogus change introduced
6127 in 2012-05-25 commit by Paul Eggert (Bug#11738).
6128
6129 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6130
6131 Return more descriptive data from Fgarbage_collect.
6132 Suggested by Stefan Monnier in
6133 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6134 * alloc.c (bounded_number): New function.
6135 (total_buffers, total_vectors): New variable.
6136 (total_string_size): Rename to total_string_bytes, adjust users.
6137 (total_vector_size): Rename to total_vector_bytes, adjust users.
6138 (sweep_vectors): Account total_vectors and total_vector_bytes.
6139 (Fgarbage_collect): New return value. Adjust documentation.
6140 (gc_sweep): Account total_buffers.
6141 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6142 (VECTOR_SIZE): Remove.
6143 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6144 (Qinterval, Qmisc): New symbols.
6145 (syms_of_data): Initialize them.
6146 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6147 (Qcons, Qbuffer): New declarations.
6148
6149 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6150
6151 * alloc.c (Fmemory_free): Account for memory-free's own storage.
6152 Round up, not down. Improve doc.
6153
6154 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6155
6156 Restore old code in allocate_string_data to avoid Faset breakage.
6157 Reported by Julien Danjou <julien@danjou.info> in
6158 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6159 * alloc.c (allocate_string_data): Restore old code with minor
6160 adjustments, fix comment to explain this subtle issue.
6161
6162 2012-07-17 Eli Zaretskii <eliz@gnu.org>
6163
6164 Remove FILE_SYSTEM_CASE.
6165 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6166
6167 * fileio.c (FILE_SYSTEM_CASE): Don't define.
6168 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6169 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6170 call-process-region passes it through expand-file-name.
6171
6172 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6173
6174 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6175
6176 Fix crash when creating indirect buffer (Bug#11917)
6177 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
6178 Don't handle unbound variables specially if non-zero.
6179 (Fbuffer_local_variables): Pass zero.
6180 (clone_per_buffer_values): Pass non-zero.
6181
6182 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6183
6184 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
6185 to make the loop interruptible.
6186
6187 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6188
6189 * gnutls.c (emacs_gnutls_handshake): Only retry if
6190 GNUTLS_E_INTERRUPTED.
6191
6192 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6193
6194 Cleanup and convert miscellaneous checks to eassert.
6195 * alloc.c (mark_interval): Fix comment, partially rephrase
6196 old comment from intervals.h (see below).
6197 * intervals.c (find_interval, adjust_intervals_for_insertion)
6198 (delete_interval, adjust_intervals_for_deletion)
6199 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
6200 Convert to eassert.
6201 (adjust_intervals_for_insertion, make_new_interval):
6202 Remove obsolete and unused code.
6203 * intervals.h (struct interval): Remove obsolete comment.
6204 * textprotp.c (erase_properties): Remove unused code.
6205 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
6206 (Fremove_list_of_text_properties): Convert to eassert.
6207
6208 2012-07-17 Chong Yidong <cyd@gnu.org>
6209
6210 * editfns.c (Finsert_char): Doc fix.
6211
6212 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6213
6214 Fix previous change to make Fmemory_free always accurate.
6215 * alloc.c (make_interval): Update total_free_intervals.
6216 (make_float): Likewise for total_free_floats.
6217 (free_cons, Fcons): Likewise for total_free_conses.
6218 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
6219 Likewise for total_free_vector_bytes.
6220 (Fmake_symbol): Likewise for total_free_symbols.
6221 (bytes_free): Remove.
6222
6223 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6224
6225 Simple free memory accounting feature.
6226 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
6227 (sweep_vectors): Accumulate size of free vectors.
6228 (Fgarbage_collect): Setup bytes_free.
6229 (Fmemory_free): New function.
6230 (syms_of_alloc): Register it.
6231
6232 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6233
6234 Cleanup overlays checking.
6235 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
6236 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
6237 eassert and OVERLAYP.
6238 (sort_overlays): Change to use OVERLAYP.
6239
6240 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
6241
6242 * editfns.c (Finsert_char): Make it interactive, and make the
6243 second arg optional. Copy interactive spec and docstring from
6244 ucs-insert.
6245
6246 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6247
6248 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
6249 Unlike the other wrapped functions, fabs has an unspecified
6250 effect on errno.
6251
6252 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
6253
6254 * nsterm.m (keyDown): Interpret flags without left/right bits
6255 as the left key (Bug#11670).
6256
6257 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6258
6259 Remove empty and useless init functions.
6260 * lisp.h (init_character_once, init_fns, init_image)
6261 (init_filelock, init_sound): Remove prototype.
6262 * character.c (init_character_once): Remove.
6263 * filelock.c (init_filelock): Likewise.
6264 * fns.c (init_fns): Likewise.
6265 * image.c (init_image): Likewise.
6266 * sound.c (init_sound): Likewise.
6267 * emacs.c (main): Adjust accordingly.
6268
6269 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6270
6271 * gtkutil.h: Tiny cleanups.
6272 (use_old_gtk_file_dialog): Remove useless declaration.
6273 (xg_uses_old_file_dialog): Add suggested const attribute.
6274
6275 2012-07-15 Eli Zaretskii <eliz@gnu.org>
6276
6277 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
6278 (bidi_paragraph_init): Use it to limit search forward for a strong
6279 directional character in abnormally large paragraphs full of
6280 neutral or weak characters. (Bug#11943)
6281
6282 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
6283
6284 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
6285 the toolbar (Bug#9451).
6286 (xg_make_tool_item): Give the widget event box a transparent
6287 background.
6288
6289 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6290
6291 Cleanup basic allocation variables and functions.
6292 * alloc.c (ignore_warnings, init_intervals, init_float)
6293 (init_cons, init_symbol, init_marker): Remove.
6294 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
6295 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
6296 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
6297 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
6298 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
6299 (staticidx, init_alloc_once, init_strings, free_ablock):
6300 Remove redundant initialization.
6301 * fns.c (init_weak_hash_tables): Remove.
6302 * lisp.h (init_weak_hash_tables): Remove prototype.
6303
6304 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6305
6306 Use zero_vector where appropriate.
6307 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
6308 accordingly.
6309 * lisp.h (zero_vector): New declaration.
6310 * font.c (null_vector): Remove.
6311 (syms_of_font): Remove initialization and staticpro.
6312 (font_list_entities, font_find_for_lface): Change to use zero_vector.
6313 * keymap.c (Faccessible_keymaps): Likewise.
6314
6315 2012-07-15 Leo Liu <sdl.web@gmail.com>
6316
6317 * fringe.c: Fix typo in comments.
6318
6319 2012-07-14 Leo Liu <sdl.web@gmail.com>
6320
6321 * fringe.c: Add a new bitmap exclamation-mark.
6322
6323 2012-07-14 Eli Zaretskii <eliz@gnu.org>
6324
6325 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
6326
6327 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
6328 (HAVE_MENUS): Don't define, defined by editing config.in with
6329 msdos/sed2v2.inp.
6330 (GMALLOC_INHIBIT_VALLOC): Don't define.
6331 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6332
6333 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
6334
6335 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6336
6337 2012-07-14 Glenn Morris <rgm@gnu.org>
6338
6339 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6340 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6341 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6342
6343 2012-07-13 Glenn Morris <rgm@gnu.org>
6344
6345 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6346
6347 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6348 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6349
6350 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
6351
6352 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6353 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6354 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6355 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6356 where appropriate.
6357 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6358 as boolean expression.
6359 (x_set_window_size): Remove unused variable toolbar.
6360 (ns_get_color_default, ns_mod_to_lisp): Remove.
6361 (ns_mouse_position): Remove unused variables xchar and ychar.
6362 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6363 (ns_set_vertical_scroll_bar): Remove unused variable count.
6364 (ns_delete_terminal): Remove unused variable i.
6365 (ns_term_init): Remove unused variables r, g and b.
6366 (mouseDown): Remove unused variable window.
6367 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6368 (initFrameFromEmacs): Remove unused variable vbextra.
6369 (mouseEntered): Remove unused variables p and dpyinfo.
6370 (mouseExited): Remove unused variables p and r.
6371 (ns_define_frame_cursor, ns_clear_frame_area)
6372 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6373 (menuDown): Assign [sender tag] to variable and cast the variable.
6374
6375 * nsterm.h (menuDown): Add id as type to argument sender.
6376 (ns_display_info_for_name): Add Lisp_Object argument.
6377 (ns_term_init): Add Lisp_Object argument.
6378 (ns_map_event_to_object): Add void argument.
6379 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6380 prototype with arguments and only declare if __OBJC__.
6381 (nxatoms_of_nsselect): Add void argument.
6382 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6383 (ns_alloc_autorelease_pool): Add void argument.
6384 (ns_release_autorelease_pool): Add void* argument.
6385 (ns_get_defaults_value): Add const char* argument.
6386
6387 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6388 (initFromContents): Use SSDATA where appropriate.
6389 (ns_update_menubar): Add braces to ambigous if-else.
6390 (initWithTitle): Put () around assignment in if statement.
6391 (ns_menu_show): Remove unused variables window and keymap.
6392 (update_frame_tool_bar): Remove unused variable selected_p.
6393 (initWithContentRect): Remove unused variable this_cmd_name.
6394
6395 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6396 appropriate.
6397 (setXBMColor): Remove unused variable len.
6398 (setPixmapData): Put () around assignment in loop statement.
6399
6400 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6401 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6402 where appropriate.
6403 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6404 around assignment in loop statement.
6405 (nsfont_open): Remove unused variable i.
6406 (nsfont_open): Remove unused variable len.
6407 (nsfont_draw): Remove unused variable cs.
6408
6409 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6410 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6411 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6412 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6413 (Fns_font_name, Fns_perform_service)
6414 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6415 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6416 (ns_set_name): Remove unused variable view.
6417 (x_set_menu_bar_lines): Remove unused variable olines.
6418 (x_set_tool_bar_lines): Remove unused variable root_window.
6419 (Fns_list_colors): Put () around assignment in while statement.
6420 (Fns_perform_service): Remove unused variable len.
6421 (Fns_display_usable_bounds): Remove unused variable top.
6422 (syms_of_nsfns): Remove unused variable i.
6423
6424 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6425 memcpy (Bug#11907).
6426
6427 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
6428
6429 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6430 and free it with DestroyExceptionInfo (Bug#11558).
6431
6432 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
6433
6434 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6435 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6436 Set here, not in nt/config.nt.
6437
6438 2012-07-13 Eli Zaretskii <eliz@gnu.org>
6439
6440 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6441 cursor overflow into the last glyph on display line when the right
6442 fringe is off. (Bug#11832)
6443
6444 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
6445
6446 * xdisp.c (produce_special_glyphs): Now static.
6447 * dispextern.h (produce_special_glyphs): Remove decl.
6448
6449 2012-07-13 Glenn Morris <rgm@gnu.org>
6450
6451 * s/bsd-common.h, s/cygwin.h: Remove empty files.
6452 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6453
6454 * s/usg5-4-common.h (USG, USG5):
6455 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6456 * s/sol2-6.h (SOLARIS2):
6457 * s/irix6-5.h (IRIX6_5):
6458 * s/hpux10-20.h (USG, USG5, HPUX):
6459 * s/gnu-linux.h (USG, GNU_LINUX):
6460 * s/freebsd.h (BSD_SYSTEM):
6461 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6462 * s/cygwin.h (CYGWIN):
6463 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6464 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6465
6466 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
6467
6468 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6469
6470 2012-07-13 Glenn Morris <rgm@gnu.org>
6471
6472 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6473
6474 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6475
6476 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6477 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6478
6479 2012-07-12 Glenn Morris <rgm@gnu.org>
6480
6481 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6482
6483 * process.c (init_process_emacs): Rename from init_process.
6484 The old name is also the name of a Mach system call.
6485 * lisp.h, emacs.c: Update for this name change.
6486 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6487 longer needed.
6488
6489 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6490
6491 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6492 memmove call that removes glyphs covered by the left truncation
6493 glyph. Improve commentary.
6494 (display_line): Fix display of continuation glyphs on GUI frames
6495 when the right fringe is turned off and variable-size fonts are
6496 used in the window. Move the code that appends a stretch glyph to
6497 produce_special_glyphs, so that it could be used for truncation
6498 and continuation glyphs alike.
6499 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6500 glyph of a suitably computed width, to align the special glyphs at
6501 the window margin. Code moved from display_line. (Bug#11832)
6502
6503 2012-07-12 Glenn Morris <rgm@gnu.org>
6504
6505 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6506
6507 * s/gnu-linux.h, s/hpux10-20.h:
6508 Do not unconditionally define HAVE_XRMSETDATABASE.
6509
6510 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6511
6512 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6513
6514 Fix typos that broke OS X build.
6515 Reported by Randal L. Schwartz in
6516 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6517 * nsterm.m (ns_timeout): Add missing local decl.
6518 (ns_get_color): snprintf -> sprintf, to fix typo.
6519
6520 2012-07-12 Glenn Morris <rgm@gnu.org>
6521
6522 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6523 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6524 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6525 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6526
6527 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6528 Move PTY_OPEN to configure.
6529
6530 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6531 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6532 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6533
6534 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6535
6536 Use empty_unibyte_string where applicable.
6537 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6538 * lread.c (read1): Likewise.
6539 * xsettings.c (syms_of_xsettings): Likewise.
6540
6541 2012-07-12 Glenn Morris <rgm@gnu.org>
6542
6543 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6544 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6545 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6546 * s/hpux10-20.h (RUN_TIME_REMAP):
6547 * s/bsd-common.h (TABDLY): Move to configure.
6548
6549 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6550
6551 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6552
6553 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6554 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6555
6556 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6557
6558 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6559 * s/template.h: Move NARROWPROTO to configure.
6560
6561 2012-07-11 Glenn Morris <rgm@gnu.org>
6562
6563 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6564 unused since 2011-01-17 change to systty.h.
6565
6566 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6567 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6568 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6569
6570 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6571
6572 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6573
6574 2012-07-11 Glenn Morris <rgm@gnu.org>
6575
6576 * s/darwin.h, s/gnu-linux.h, s/template.h:
6577 Move INTERRUPT_INPUT to configure.
6578
6579 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6580
6581 Minor adjustments to interning code.
6582 * lisp.h (intern, intern_c_string): Redefine as static inline
6583 wrappers for intern_1 and intern_c_string_1, respectively.
6584 (intern_1, intern_c_string_1): Rename prototypes.
6585 * lread.c (intern_1, intern_c_string_1, oblookup):
6586 Simplify Vobarray checking.
6587 * font.c (font_intern_prop): Likewise. Adjust comment.
6588 * w32font.c (intern_font_name): Likewise.
6589
6590 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6591
6592 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6593
6594 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6595 of Fcar/Fcdr if possible.
6596 * font.c (check_otf_features): Likewise.
6597 * fontset.c (Fnew_fontset): Likewise.
6598 * gnutls.c (Fgnutls_boot): Likewise.
6599 * minibuf.c (read_minibuf): Likewise.
6600 * msdos.c (IT_set_frame_parameters): Likewise.
6601 * xmenu.c (Fx_popup_dialog): Likewise.
6602 * w32menu.c (Fx_popup_dialog): Likewise.
6603
6604 2012-07-11 Glenn Morris <rgm@gnu.org>
6605
6606 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6607 since nothing has defined it on these platforms.
6608
6609 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6610 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6611
6612 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6613 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6614 Move CLASH_DETECTION to configure.
6615
6616 * s/gnu.h: Remove file, which is now empty.
6617
6618 * s/gnu.h, s/gnu-linux.h:
6619 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6620
6621 2012-07-11 John Wiegley <johnw@newartisans.com>
6622
6623 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6624 function attribute, so we only use it if it exists in the
6625 compiler.
6626
6627 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6628
6629 Avoid call to strlen in fast_c_string_match_ignore_case.
6630 * search.c (fast_c_string_match_ignore_case): Change to use
6631 length argument. Adjust users accordingly.
6632 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6633
6634 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6635
6636 Assume mkdir, rmdir.
6637 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6638 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6639
6640 Assume rename.
6641 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6642
6643 Assume perror.
6644 * s/hpux10-20.h (HAVE_PERROR): Remove.
6645 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6646 Remove dummy definition, as this problem was obsolete long ago.
6647
6648 Assume strerror.
6649 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6650
6651 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6652
6653 Avoid calls to strlen in font processing functions.
6654 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6655 (font_open_by_name): Change to use length argument.
6656 Adjust users accordingly.
6657 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6658 Adjust prototypes.
6659 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6660 Change to return ptrdiff_t.
6661 (xfont_list_pattern, xfont_match): Use length returned by
6662 xfont_decode_coding_xlfd.
6663 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6664
6665 2012-07-11 Glenn Morris <rgm@gnu.org>
6666
6667 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6668 Move DONT_REOPEN_PTY to configure.
6669
6670 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6671 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6672
6673 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6674
6675 Remove "#define unix" that is no longer needed (Bug#11905).
6676 * s/aix4-2.h (unix): Remove; no longer needed.
6677
6678 EMACS_TIME simplification (Bug#11875).
6679 This replaces macros (which typically do not work in GDB)
6680 with functions, typedefs and enums, making the code easier to debug.
6681 The functional style also makes code easier to read and maintain.
6682 * systime.h: Include <sys/time.h> on all hosts, not just if
6683 WINDOWSNT, since 'struct timeval' is needed in general.
6684 (EMACS_TIME): Now a typedef, not a macro.
6685 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6686 not macros.
6687 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6688 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6689 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6690 (EMACS_TIME_LE): Now functions, not macros.
6691 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6692 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6693 which are not functions. All uses rewritten to use:
6694 (make_emacs_time): New function.
6695 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6696 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6697 not functions. All uses rewritten to use the following, respectively:
6698 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6699 (add_emacs_time, sub_emacs_time): New functions.
6700 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6701 * fileio.c (Fcopy_file):
6702 * xterm.c (XTflash): Get the current time closer to when it's used.
6703 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6704
6705 * bytecode.c (targets): Suppress -Woverride-init warnings.
6706
6707 Simplify by avoiding confusing use of strncpy etc.
6708 * doc.c (Fsnarf_documentation):
6709 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6710 * frame.c (Fmake_terminal_frame):
6711 * gtkutil.c (get_utf8_string):
6712 * lread.c (openp):
6713 * nsmenu.m (ns_update_menubar):
6714 * regex.c (regerror):
6715 Prefer memcpy to strncpy and strncat when either will do.
6716 * fileio.c (Fsubstitute_in_file_name):
6717 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6718 (menu_separator_name_p):
6719 * nsmenu.m (ns_update_menubar):
6720 Prefer memcmp to strncmp when either will do.
6721 * nsterm.m: Include <ftoastr.h>.
6722 (ns_get_color):
6723 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6724 Prefer snprintf to strncpy.
6725 * nsterm.m (ns_term_init):
6726 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6727 * nsterm.m (ns_term_init):
6728 Avoid the need for strncpy, by using build_string or
6729 make_unibyte_string directly. Use dtoastr, not snprintf.
6730 * process.c (Fmake_network_process): Diagnose service names that
6731 are too long, rather than silently truncating them or creating
6732 non-null-terminated names.
6733 (Fnetwork_interface_info): Likewise, for interface names.
6734 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6735 Prefer sprintf to strncat.
6736 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6737 Prefer vsnprintf to vsprintf + strncpy.
6738
6739 2012-07-10 Glenn Morris <rgm@gnu.org>
6740
6741 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6742 Clarify fallback case.
6743
6744 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6745
6746 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6747 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6748 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6749 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6750 where argument type is known to be a Lisp_Cons.
6751
6752 2012-07-10 Tom Tromey <tromey@redhat.com>
6753
6754 * bytecode.c (BYTE_CODE_THREADED): New macro.
6755 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6756 (enum byte_code_op): New type.
6757 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6758 (exec_byte_code): Use them. Use token threading when applicable.
6759
6760 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6761
6762 Optimize pure C strings initialization.
6763 * lisp.h (make_pure_string): Fix prototype.
6764 (build_pure_c_string): New function, defined as static inline. This
6765 provides a better opportunity to optimize away calls to strlen when
6766 the function is called with compile-time constant argument.
6767 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6768 argument, adjust users accordingly. Use build_pure_c_string where
6769 appropriate.
6770 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6771 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6772 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6773
6774 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6775
6776 Avoid calls to strlen in miscellaneous functions.
6777 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6778 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6779 * lread.c (openp): Likewise.
6780
6781 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6782
6783 Avoid calls to strlen in path processing functions.
6784 * fileio.c (file_name_as_directory): Add comment. Change to add
6785 srclen argument and return the length of result. Adjust users
6786 accordingly.
6787 (directory_file_name): Fix comment. Change to add srclen argument,
6788 swap 1st and 2nd arguments to obey the common convention.
6789 Adjust users accordingly.
6790 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6791
6792 2012-07-10 Glenn Morris <rgm@gnu.org>
6793
6794 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6795 Move PENDING_OUTPUT_COUNT definition to configure.
6796
6797 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6798 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6799 * s/gnu.h (DATA_START): Move definitions to configure.
6800
6801 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6802 We include usg5-4-common.h, which defines them both.
6803
6804 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6805 O_RDONLY already includes it).
6806
6807 Stop ns builds setting the EMACSLOADPATH environment variable.
6808 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6809 Now it does not set EMACSLOADPATH, just returns the load-path string.
6810 * nsterm.h: Update accordingly.
6811 * lread.c [HAVE_NS]: Include nsterm.h.
6812 (init_lread) [HAVE_NS]: Use ns_load_path.
6813 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6814
6815 2012-07-09 Glenn Morris <rgm@gnu.org>
6816
6817 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6818 since the included bsd-common.h does so.
6819
6820 Stop ns builds setting the EMACSPATH environment variable.
6821 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6822 (ns_init_paths): Do not set EMACSPATH.
6823 * nsterm.h (ns_exec_path): Add it.
6824 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6825 Use ns_exec_path.
6826
6827 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6828
6829 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6830
6831 * process.c (wait_reading_process_output): 'waitchannels' was unset
6832 when read_kbd || !NILP (wait_for_cell); fix this.
6833
6834 Add GCC-style 'const' attribute to functions that can use it.
6835 * character.h (char_resolve_modifier_mask):
6836 * keyboard.h (make_ctrl_char):
6837 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6838 (init_character_once, next_almost_prime, init_fns, init_image)
6839 (flush_pending_output, init_sound):
6840 * mem-limits.h (start_of_data):
6841 * menu.h (finish_menu_items):
6842 Add ATTRIBUTE_CONST.
6843 * emacs.c (DEFINE_DUMMY_FUNCTION):
6844 Declare the dummy function with ATTRIBUTE_CONST.
6845 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6846 Add decls with ATTRIBUTE_CONST.
6847
6848 Minor improvements to make_formatted_string.
6849 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6850 where int is good enough, as vsprintf returns an int.
6851 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6852
6853 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6854
6855 Use make_formatted_string to avoid double length calculation.
6856 * lisp.h (make_formatted_string): New prototype.
6857 * alloc.c (make_formatted_string): New function.
6858 * buffer.c (Fgenerate_new_buffer_name): Use it.
6859 * dbusbind.c (syms_of_dbusbind): Likewise.
6860 * editfns.c (Fcurrent_time_zone): Likewise.
6861 * filelock.c (get_boot_time): Likewise.
6862 * frame.c (make_terminal_frame, set_term_frame_name)
6863 (x_report_frame_params): Likewise.
6864 * image.c (gs_load): Likewise.
6865 * minibuf.c (get_minibuffer): Likewise.
6866 * msdos.c (dos_set_window_size): Likewise.
6867 * process.c (make_process): Likewise.
6868 * xdisp.c (ensure_echo_area_buffers): Likewise.
6869 * xsettings.c (apply_xft_settings): Likewise.
6870
6871 2012-07-09 Glenn Morris <rgm@gnu.org>
6872
6873 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6874 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6875 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6876 * nsterm.h (ns_etc_directory): Add it.
6877 * callproc.c [HAVE_NS]: Include nsterm.h.
6878 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6879
6880 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6881
6882 Move marker debugging code under MARKER_DEBUG.
6883 * marker.c (MARKER_DEBUG): Move marker debugging code under
6884 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6885 for bootstrap with --enable-checking (~3x slowdown reported
6886 by Juanma Barranquero <lekktu@gmail.com>).
6887 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6888
6889 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6890
6891 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6892 See <http://bugs.gnu.org/11825#29>.
6893
6894 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6895
6896 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6897 has no font, use the frame's font. (Bug#11813)
6898 (display_line): Add commentary about displaying truncation glyphs
6899 on GUI frames.
6900 (produce_special_glyphs): Move here from term.c.
6901
6902 * term.c (produce_special_glyphs): Move to xdisp.c.
6903
6904 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6905 section.
6906
6907 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6908
6909 * xdisp.c (display_line): Avoid warning about implicit declaration
6910 of FRAME_FONT.
6911
6912 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6913
6914 * lisp.h: Remove empty conditional.
6915
6916 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6917
6918 * lread.c (load_path_check): Now static.
6919
6920 Fix some minor --with-ns problems found by static checking.
6921 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6922 (x_set_font) [!HAVE_X_WINDOWS]:
6923 * image.c (xpm_load_image) [HAVE_NS]:
6924 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6925 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6926 Remove unused local.
6927 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6928 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6929 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6930 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6931 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6932 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6933 Fix pointer signedness problem.
6934 * xfaces.c (FRAME_X_FONT_TABLE):
6935 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6936
6937 2012-07-07 Glenn Morris <rgm@gnu.org>
6938
6939 * lread.c (load_path_check): New function, split from init_lread.
6940 (init_lread): Reorganize. Motivation:
6941 If EMACSLOADPATH is set, check/warn about that rather than the
6942 defaults, which we are not going to use. Hence we can remove
6943 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6944 Don't warn if site-lisp directories are missing.
6945 If not installed, start from a blank load-path, since
6946 PATH_LOADSEARCH refers to the eventual installation directories.
6947
6948 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6949
6950 Support truncation and continuation glyphs on GUI frames, when
6951 fringes are disabled. (Bug#11832)
6952 * xdisp.c (init_iterator): Get dimensions of truncation and
6953 continuation glyphs even if on GUI frames.
6954 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6955 or both, are absent.
6956 (start_display, move_it_in_display_line_to): Handle the case of a
6957 GUI frame without a fringe to display continuation or truncation
6958 glyphs.
6959 (insert_left_trunc_glyphs): Support GUI frames: make sure
6960 truncation glyphs overwrite enough glyphs from the current line to
6961 have sufficient space in pixels.
6962 (display_line): Support truncation and continuation glyphs on GUI
6963 frames. If some spare pixels are left on the line after inserting
6964 the truncation glyphs, fill that space with a stretch glyph of a
6965 suitably computed width.
6966
6967 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6968 produce_glyphs, to support GUI sessions.
6969
6970 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6971
6972 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6973
6974 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6975
6976 Do not require float-time's arg to fit in time_t (Bug#11825).
6977 This works better on hosts where time_t is unsigned, and where
6978 float-time is applied to the (negative) difference between two times.
6979 * editfns.c (decode_time_components): Last arg is now double *,
6980 not int *, and means to store all the result as a double, without
6981 worrying about whether the seconds part fits in time_t.
6982 All callers changed.
6983 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6984 All callers changed.
6985 (Ffloat_time): Do not fail merely because the specified time falls
6986 outside of time_t range.
6987
6988 2012-07-07 Glenn Morris <rgm@gnu.org>
6989
6990 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6991 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6992 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6993
6994 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6995
6996 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6997 Update dependencies.
6998
6999 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7000
7001 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7002
7003 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7004 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7005 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7006 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7007 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7008 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7009
7010 * xfont.c (compare_font_names): Redo to omit the need for casts.
7011
7012 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7013
7014 * xfns.c (Fx_change_window_property): Doc fix.
7015 * w32fns.c (Fx_change_window_property): Doc fix.
7016
7017 * w32fns.c (Fx_window_property): Accept the same arguments as the
7018 X Windows version. Doc fix.
7019 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7020
7021 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
7022 Eli Zaretskii <eliz@gnu.org>
7023
7024 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7025 Windows-specific code from nt/config.nt moved here.
7026 Obsolete settings removed.
7027
7028 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7029
7030 * process.c: Avoid unnecessary calls to gettime.
7031 (wait_reading_process_output): Don't get the time of day
7032 when gobbling data immediately and not waiting, as there's no need
7033 for it in that case. This removes a FIXME.
7034
7035 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
7036
7037 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7038 is defined (Bug#11768).
7039
7040 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7041
7042 Fix marker debugging code.
7043 * marker.c (byte_char_debug_check): Do not perform the check
7044 if buffer is not multibyte.
7045 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7046 Call byte_char_debug_check with correct arguments.
7047
7048 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7049
7050 Compile marker debugging code only if ENABLE_CHECKING is defined.
7051 * marker.c (byte_char_debug_check, count_markers):
7052 Use only if ENABLE_CHECKING is defined.
7053 (byte_debug_flag): Remove.
7054 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7055 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7056
7057 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7058
7059 Avoid code repetition in marker-related functions.
7060 * marker.c (attach_marker): New function.
7061 (Fset_marker, set_marker_restricted, set_marker_both)
7062 (set_marker_restricted_both): Use it.
7063 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7064 Consistently rename charno to charpos.
7065 (marker_position): Add eassert.
7066 (marker_byte_position): Convert to eassert.
7067
7068 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7069
7070 Simplify list operations in unchain_overlay and unchain_marker.
7071 * buffer.c (unchain_overlay): Simplify. Add comment.
7072 * marker.c (unchain_marker): Simplify. Fix comments.
7073
7074 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7075
7076 Introduce fast path for the widely used marker operation.
7077 * alloc.c (build_marker): New function.
7078 * lisp.h (build_marker): New prototype.
7079 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7080 * composite.c (autocmp_chars): Likewise.
7081 * editfns.c (buildmark): Remove.
7082 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7083 (save_restriction_save): Use build_marker.
7084 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7085 * window.c (save_window_save): Likewise.
7086
7087 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7088
7089 Do not use Fdelete_overlay in delete_all_overlays
7090 to avoid redundant calls to unchain_overlay.
7091 * buffer.c (drop_overlay): New function.
7092 (delete_all_overlays, Fdelete_overlay): Use it.
7093 * minibuf.c (get_minibuffer): Fix comment.
7094
7095 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7096
7097 Port to OpenBSD 5.1 amd64.
7098 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7099 This is needed for OpenBSD, and should be harmless on all BSD systems.
7100 Also, include <sys/sysctl.h>, as it should be available on all
7101 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7102 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7103 use p_pid member, not kp_proc.pid.
7104
7105 2012-07-06 Glenn Morris <rgm@gnu.org>
7106
7107 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7108
7109 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7110
7111 More xmalloc and related cleanup.
7112 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7113 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7114 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7115 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7116 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7117 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7118 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7119 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7120 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7121 * xterm.c:
7122 Omit needless casts involving void * pointers and allocation.
7123 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7124 as the former is more robust if P's type is changed.
7125 Prefer xzalloc to xmalloc + memset 0.
7126 Simplify malloc-or-realloc to realloc.
7127 Don't worry about xmalloc returning a null pointer.
7128 Prefer xstrdup to xmalloc + strcpy.
7129 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7130 growing it.
7131 * keyboard.c (apply_modifiers_uncached): Prefer local array to
7132 alloca of a constant.
7133
7134 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7135
7136 * xdisp.c (display_line): Fix horizontal pixel coordinates when
7137 hscroll is larger than the line width. Fixes long and futile
7138 looping inside extend_face_to_end_of_line (on a TTY) producing
7139 glyphs that are not needed and thrown away.
7140
7141 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7142
7143 * marker.c (set_marker_restricted_both): Simplify by using
7144 clip_to_bounds.
7145
7146 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7147
7148 * editfns.c (region_limit): Simplify by using clip_to_bounds.
7149
7150 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
7151
7152 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7153 not defined (Bug#11768).
7154 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7155 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7156 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7157 followed by gtk_box_set_homogeneous (Bug#11768).
7158 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
7159 (update_theme_scrollbar_width, xg_create_scroll_bar):
7160 Use gtk_scrollbar_new (Bug#11768).
7161 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7162 (is_box_type): New function (Bug#11768).
7163 (xg_tool_item_stale_p): Call is_box_type.
7164 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
7165 with default display (Bug#11768).
7166
7167 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7168
7169 * xdisp.c (window_hscroll_limited): New function.
7170 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7171 coordinates when window's hscroll is set to insanely large
7172 values. (Bug#11857)
7173
7174 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
7175
7176 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
7177 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
7178
7179 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7180
7181 Cleanup xmalloc.
7182 * lisp.h (xzalloc): New prototype. Omit needless casts.
7183 * alloc.c (xzalloc): New function. Omit needless casts.
7184 * charset.c: Omit needless casts. Convert all calls to
7185 xmalloc with following memset to xzalloc.
7186 * dispnew.c: Likewise.
7187 * fringe.c: Likewise.
7188 * image.c: Likewise.
7189 * sound.c: Likewise.
7190 * term.c: Likewise.
7191 * w32fns.c: Likewise.
7192 * w32font.c: Likewise.
7193 * w32term.c: Likewise.
7194 * xfaces.c: Likewise.
7195 * xfns.c: Likewise.
7196 * xterm.c: Likewise.
7197 * atimer.c: Omit needless casts.
7198 * buffer.c: Likewise.
7199 * callproc.c: Likewise.
7200 * ccl.c: Likewise.
7201 * coding.c: Likewise.
7202 * composite.c: Likewise.
7203 * doc.c: Likewise.
7204 * doprnt.c: Likewise.
7205 * editfns.c: Likewise.
7206 * emacs.c: Likewise.
7207 * eval.c: Likewise.
7208 * filelock.c: Likewise.
7209 * fns.c: Likewise.
7210 * gtkutil.c: Likewise.
7211 * keyboard.c: Likewise.
7212 * lisp.h: Likewise.
7213 * lread.c: Likewise.
7214 * minibuf.c: Likewise.
7215 * msdos.c: Likewise.
7216 * print.c: Likewise.
7217 * process.c: Likewise.
7218 * region-cache.c: Likewise.
7219 * search.c: Likewise.
7220 * sysdep.c: Likewise.
7221 * termcap.c: Likewise.
7222 * terminal.c: Likewise.
7223 * tparam.c: Likewise.
7224 * w16select.c: Likewise.
7225 * w32.c: Likewise.
7226 * w32reg.c: Likewise.
7227 * w32select.c: Likewise.
7228 * w32uniscribe.c: Likewise.
7229 * widget.c: Likewise.
7230 * xdisp.c: Likewise.
7231 * xmenu.c: Likewise.
7232 * xrdb.c: Likewise.
7233 * xselect.c: Likewise.
7234
7235 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7236
7237 * fileio.c (time_error_value): Check the right error number.
7238 Problem reported by Troels Nielsen in
7239 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
7240
7241 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7242
7243 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
7244 This should be fixed in a better way; see Eli Zaretskii in
7245 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
7246 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
7247
7248 * fileio.c (time_error_value): Rename from special_mtime.
7249 The old name's problems were noted by Eli Zaretskii in
7250 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
7251
7252 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
7253 This variable's comment says Emacs needs at least one GDB-visible
7254 symbol of type enum pvec_type, to work around GDB problems.
7255 The symbol's value doesn't matter.
7256
7257 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
7258 that causes compilation to fail on pre-C99 compilers.
7259
7260 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
7261
7262 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
7263 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
7264
7265 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7266
7267 * buffer.c (init_buffer_once): Fix initialization of
7268 headers for buffer_defaults and buffer_local_symbols.
7269 Reported by Juanma Barranquero <lekktu@gmail.com>.
7270
7271 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7272
7273 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
7274 * lisp.h (enum pvec_type): Use fewer bits.
7275 (PSEUDOVECTOR_SIZE_BITS): New constant.
7276 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
7277 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
7278 change in pvec_type.
7279 (PSEUDOVECTOR_TYPEP): New macro.
7280 (TYPED_PSEUDOVECTORP): Use it.
7281 * fns.c (internal_equal): Adapt code to extract pvectype.
7282 * emacs.c (gdb_pvec_type): Update type.
7283 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
7284 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
7285 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
7286 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
7287 (sweep_vectors): Use it. Use local var `total_bytes' instead of
7288 abusing vector->header.next.nbytes.
7289 (live_vector_p): Use PVEC_TYPE.
7290 (mark_object): Adapt code to extract pvectype. Use switch.
7291
7292 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7293
7294 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
7295 Tighten new eassert a bit.
7296
7297 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7298
7299 Fix compilation with --enable-gcc-warnings and -O1
7300 optimization level.
7301 * doprnt.c (doprnt): Change type of tem to int, initialize
7302 to avoid compiler warning. Add eassert.
7303 * search.c (simple_search): Initialize match_byte to avoid
7304 compiler warning. Add eassert.
7305
7306 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7307
7308 Avoid weird behavior with large horizontal scrolls.
7309 Without this change, for example, large hscroll values would
7310 mess up Emacs's display on Fedora 15 x86, presumably due to
7311 overflows in int calculations in the display code.
7312 Also, if buffers had long lines, Emacs would freeze.
7313 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
7314 (set_window_hscroll): New function, containing the old guts of
7315 Fset_window_hscroll. Return the clipped value.
7316 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
7317 This avoids the need to check against PTRDIFF_MAX.
7318
7319 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
7320
7321 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7322
7323 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
7324
7325 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7326
7327 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
7328 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
7329 since GCC 4.4.6 issues a bogus warning for them.
7330
7331 Fix bugs in file timestamp newness comparisons.
7332 * fileio.c (Ffile_newer_than_file_p):
7333 * lread.c (Fload): Use full timestamp resolution of files,
7334 not just the 1-second resolution, so that files that are only
7335 slightly newer still count as newer.
7336 * fileio.c (Ffile_newer_than_file_p): Don't assume file
7337 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7338
7339 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
7340
7341 * fileio.c: Improve handling of file time marker. (Bug#11852)
7342 (special_mtime): New function.
7343 (Finsert_file_contents, Fverify_visited_file_modtime):
7344 Use it to set special mtime values consistently.
7345
7346 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
7347
7348 * fileio.c (Finsert_file_contents): Properly handle st_mtime
7349 marker for non-existing file. (Bug#11852)
7350
7351 2012-07-03 Glenn Morris <rgm@gnu.org>
7352
7353 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7354 and did not make it into globals.h).
7355
7356 2012-07-03 Tom Tromey <tromey@redhat.com>
7357
7358 * window.c (Fset_window_margins, Fset_window_fringes)
7359 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7360 * textprop.c (Fprevious_property_change): No longer static.
7361 * syntax.c (Fsyntax_table_p): No longer static.
7362 * process.c (Fget_process, Fprocess_datagram_address): No longer
7363 static.
7364 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7365 * keyboard.c (Fcommand_execute): No longer static.
7366 Remove EXFUN.
7367 * insdel.c (Fcombine_after_change_execute): No longer static.
7368 * image.c (Finit_image_library): No longer static.
7369 * fileio.c (Fmake_symbolic_link): No longer static.
7370 * eval.c (Ffetch_bytecode): No longer static.
7371 * editfns.c (Fuser_full_name): No longer static.
7372 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7373 No longer static.
7374 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7375 static.
7376 * dired.c (Ffile_attributes): No longer static.
7377 * composite.c (Fcomposition_get_gstring): No longer static.
7378 * callproc.c (Fgetenv_internal): No longer static.
7379
7380 * ccl.h: Remove EXFUNs.
7381 * buffer.h: Remove EXFUNs.
7382 * dispextern.h: Remove EXFUNs.
7383 * intervals.h: Remove EXFUNs.
7384 * fontset.h: Remove EXFUN.
7385 * font.h: Remove EXFUNs.
7386 * dosfns.c (system_process_attributes): Remove EXFUN.
7387 * keymap.h: Remove EXFUNs.
7388 * lisp.h: Remove EXFUNs.
7389 * w32term.h: Remove EXFUNs.
7390 * window.h: Remove EXFUNs.
7391 * xsettings.h: Remove EXFUN.
7392 * xterm.h: Remove EXFUN.
7393
7394 2012-07-03 Glenn Morris <rgm@gnu.org>
7395
7396 * lisp.h (Frandom): Make it visible to C.
7397 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7398 buffer for invisible buffers. (Bug#1229)
7399
7400 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7401
7402 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7403 values which aren't power of 2.
7404 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7405 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
7406 accordingly.
7407
7408 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7409
7410 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7411
7412 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7413
7414 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7415
7416 * alloc.c (allocate_vector_block): Remove redundant
7417 calls to mallopt if DOUG_LEA_MALLOC is defined.
7418 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7419 avoid calls to mallopt if zero_vector is returned.
7420
7421 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7422
7423 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7424 is enabled, avoid dereferencing NULL current_sblock if
7425 running undumped.
7426
7427 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7428
7429 Cleanup basic buffer management.
7430 * buffer.h (struct buffer): Change layout to use generic vector
7431 marking code. Fix some comments. Change type of 'clip_changed'
7432 to bitfield. Remove unused #ifndef old.
7433 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7434 (GET_OVERLAYS_AT): Fix indentation.
7435 (for_each_per_buffer_object_at): New macro.
7436 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7437 (Fbuffer_local_variables): Use it.
7438 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7439 * alloc.c (allocate_buffer): Adjust to match new layout of
7440 struct buffer. Fix comment.
7441 (mark_overlay): New function.
7442 (mark_buffer): Use it. Use mark_vectorlike to mark normal
7443 Lisp area of struct buffer.
7444 (mark_object): Use it. Adjust marking of misc objects
7445 and related comments.
7446
7447 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
7448
7449 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7450 wrapper that is not needed because the wrapped code is a no-op (zero
7451 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7452 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7453
7454 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
7455
7456 * alloc.c (mark_buffer): Simplify. Remove prototype.
7457 (mark_object): Add comment. Reorganize marking of vector-like
7458 objects. Use CHECK_LIVE for all vector-like objects except buffers
7459 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7460 Avoid redundant calls to mark_vectorlike for bool vectors.
7461
7462 2012-06-30 Glenn Morris <rgm@gnu.org>
7463
7464 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7465
7466 * epaths.in (PATH_SITELOADSEARCH): New.
7467 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7468 This is rather than relying on --enable-locallisppath elements
7469 having "site-lisp" in their names. (Bug#10208#25, 11658)
7470
7471 2012-06-30 Eli Zaretskii <eliz@gnu.org>
7472
7473 * w32proc.c (sys_select): Accept and ignore one more argument.
7474
7475 * w32.c (emacs_gnutls_pull): Call select with one more argument.
7476
7477 * sysselect.h [DOS_NT]: Don't include sys/select.h.
7478 (pselect) [!MS_DOS]: Redirect to sys_select.
7479
7480 * sysdep.c: Don't include dos.h and dosfns.h.
7481
7482 * process.c (sys_select):
7483 * msdos.c (sys_select): Accept one more argument and ignore it.
7484
7485 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7486 adapt data types and code to that.
7487
7488 * dosfns.c:
7489 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7490 which clashes with the gnulib function of the same name.
7491
7492 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7493
7494 * font.c (font_style_to_value, font_style_symbolic)
7495 (font_prop_validate_style): Add type checks for values in
7496 font_style_table.
7497
7498 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7499 argument.
7500 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7501 uses.
7502
7503 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7504
7505 * xdisp.c (try_window_id): Undo last change.
7506
7507 * w32.c (getwd): Adjust commentary about startup_dir.
7508 (init_environment): Always call sys_access, even in non-MSVC
7509 builds. Don't chdir to the directory of the Emacs executable.
7510 This undoes code from 1997 which was justified by the need to
7511 "avoid conflicts when removing and renaming directories". But its
7512 downside was that every relative file name was being interpreted
7513 relative to the directory of the Emacs executable, which can never
7514 be TRT. In particular, it broke sys_access when called with
7515 relative file names.
7516 (sys_access): Map GetLastError to errno.
7517
7518 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7519
7520 * window.h (struct window): Change type of 'fringes_outside_margins'
7521 to bitfield. Fix comment. Adjust users accordingly.
7522 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7523 Adjust comment.
7524 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7525 to ptrdiff_t.
7526
7527 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
7528
7529 * gnutls.c (emacs_gnutls_handshake):
7530 Add QUIT to make the loop interruptible.
7531
7532 2012-06-29 Glenn Morris <rgm@gnu.org>
7533
7534 * charset.c (init_charset): Make lack of etc/charsets fatal.
7535
7536 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7537
7538 * editfns.c (region_limit): Fix type mismatch.
7539
7540 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7541
7542 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7543 undefined. Convert from xassert to eassert.
7544 * nsmenu.m: Convert from xassert to eassert.
7545 * nsterm.m: Likewise.
7546
7547 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7548
7549 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7550
7551 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7552
7553 Avoid integer overflow on scroll-left and scroll-right.
7554 * window.c (HSCROLL_MAX): New macro.
7555 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7556 overflow when requested scroll falls outside ptrdiff_t range.
7557
7558 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7559
7560 * window.h (struct window): Change type of 'hscroll',
7561 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7562 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7563 Adjust users accordingly.
7564 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7565 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7566 from EMACS_INT to ptrdiff_t.
7567 (make_window): Omit redundant initialization.
7568
7569 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
7570
7571 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7572
7573 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7574
7575 * window.h (struct window): Change type of 'use_time' and
7576 'sequence_number' from Lisp_Object to int.
7577 * frame.c (make_frame): Adjust users accordingly.
7578 * print.c (print_object): Likewise.
7579 * window.c (select_window, Fwindow_use_time, make_parent_window)
7580 (make_window): Likewise.
7581
7582 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7583
7584 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7585 enabled with --enable-checking=[all,glyphs] configure option.
7586 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7587 adjust comments accordingly.
7588 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7589 undefined, adjust comments accordingly.
7590 * image.c: Likewise.
7591 * scroll.c: Likewise.
7592 * w32fns.c: Likewise.
7593 * w32term.c: Likewise.
7594 * xdisp.c: Likewise.
7595 * xfaces.c: Likewise.
7596 * xfns.c: Likewise.
7597 * xterm.c: Likewise.
7598
7599 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7600
7601 Generalize run-time debugging checks.
7602 * dispextern.h (XASSERTS): Remove.
7603 * fontset.c (xassert): Remove.
7604 Convert from xassert to eassert.
7605 * alloc.c: Convert from xassert to eassert.
7606 * bidi.c: Likewise.
7607 * dispnew.c: Likewise.
7608 * fns.c: Likewise.
7609 * fringe.c: Likewise.
7610 * ftfont.c: Likewise.
7611 * gtkutil.c: Likewise.
7612 * image.c: Likewise.
7613 * keyboard.c: Likewise.
7614 * menu.c: Likewise.
7615 * process.c: Likewise.
7616 * scroll.c: Likewise.
7617 * sound.c: Likewise.
7618 * term.c: Likewise.
7619 * w32console.c: Likewise.
7620 * w32fns.c: Likewise.
7621 * w32term.c: Likewise.
7622 * window.c: Likewise.
7623 * xdisp.c: Likewise.
7624 * xfaces.c: Likewise.
7625 * xfns.c: Likewise.
7626 * xselect.c: Likewise.
7627 * xterm.c: Likewise.
7628
7629 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7630
7631 * fns.c (maybe_resize_hash_table): Output message when growing the
7632 purify-hashtable.
7633
7634 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7635
7636 * alloc.c (allocate_string_data): Remove dead code.
7637 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7638 avoid GCC warning about unused macro.
7639
7640 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7641
7642 * alloc.c (allocate_string): Omit intervals initialization.
7643 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7644 as in make_pure_string and make_pure_c_string.
7645
7646 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7647
7648 * alloc.c (allocate_string): Fix last change.
7649
7650 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7651
7652 * alloc.c (allocate_string): Remove two redundant calls
7653 to memset, add explicit initialization where appropriate.
7654
7655 2012-06-27 Glenn Morris <rgm@gnu.org>
7656
7657 * lisp.mk (lisp): Remove paths.elc.
7658
7659 2012-06-27 Chong Yidong <cyd@gnu.org>
7660
7661 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7662
7663 2012-06-26 John Wiegley <johnw@newartisans.com>
7664
7665 * unexmacosx.c (copy_data_segment): Add two section names used
7666 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7667
7668 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7669 when building with Clang.
7670
7671 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7672
7673 * eval.c (Fapply): Allow calling it with a single argument.
7674
7675 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7676
7677 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7678 _stricmp and _strnicmp.
7679 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7680
7681 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7682
7683 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7684 allocated window.
7685 (allocate_process): Likewise for new process.
7686 (allocate_terminal): Change to use offsetof.
7687 (allocate_frame): Likewise.
7688 * frame.c (make_frame): Omit redundant initialization.
7689 * window.c (make_parent_window): Use memset.
7690 (make_window): Omit redundant initialization.
7691 * process.c (make_process): Omit redundant initialization.
7692 * terminal.c (create_terminal): Likewise.
7693
7694 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7695
7696 * term.c (delete_tty): Remove redundant call to memset.
7697
7698 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7699
7700 * alloc.c: Remove build_string.
7701 * lisp.h: Define build_string as static inline. This provides
7702 a better opportunity to optimize away calls to strlen when the
7703 function is called with compile-time constant argument.
7704 * image.c (imagemagick_error): Convert to build_string.
7705 * w32proc.c (sys_spawnve): Likewise.
7706 * xterm.c (x_term_init): Likewise.
7707
7708 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7709
7710 Use sprintf return value instead of invoking strlen on result.
7711 In the old days this wasn't portable, since some sprintf
7712 implementations returned char *. But they died out years ago and
7713 Emacs already assumes sprintf returns int.
7714 Similarly for float_to_string.
7715 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7716 * ccl.c (ccl_driver):
7717 * character.c (string_escape_byte8):
7718 * data.c (Fnumber_to_string):
7719 * doprnt.c (doprnt):
7720 * print.c (print_object):
7721 * xdisp.c (message_dolog):
7722 * xfns.c (syms_of_xfns):
7723 Use sprintf or float_to_string result to avoid need to call strlen.
7724 * data.c (Fnumber_to_string):
7725 Use make_unibyte_string, since the string must be ASCII.
7726 * lisp.h, print.c (float_to_string): Now returns int length.
7727 * term.c (produce_glyphless_glyph):
7728 Use sprintf result rather than recomputing it.
7729
7730 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7731 * Makefile.in (ALL_CFLAGS):
7732 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7733 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7734
7735 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7736
7737 * dispextern.h (xstrcasecmp): Define to library function
7738 strcasecmp if available.
7739 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7740
7741 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7742
7743 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7744 Avoid comma operator.
7745 * menu.c (push_submenu_start, push_submenu_end)
7746 (push_left_right_boundary, push_menu_pane): Likewise.
7747 * msdos.c (dos_rawgetc): Likewise.
7748
7749 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7750
7751 * xfns.c (xic_create_fontsetname): Remove redundant calls
7752 to memset.
7753
7754 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7755
7756 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7757 sprintf already null-terminates its output.
7758
7759 * xfns.c (x_window): Remove redundant cast.
7760
7761 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7762
7763 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7764 `const char *' to `char *' to avoid compiler warning.
7765
7766 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7767
7768 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7769 instead of truncating it to 63 (admittedly a generous limit).
7770
7771 * process.c: Fix spelling and caps in comments.
7772
7773 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7774
7775 * emacs.c (setpgrp): Remove definition, unused.
7776 * sysdep.c (setpgrp): Remove definition, not used in this file.
7777
7778 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7779
7780 * makefile.w32-in: Update dependencies.
7781
7782 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7783
7784 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7785 (SYSTIME_H): Add nt/inc/sys/time.h.
7786
7787 * systime.h [WINDOWSNT]: Include sys/time.h.
7788
7789 * s/ms-w32.h (struct timespec): Definition moved from
7790 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7791
7792 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7793
7794 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7795 * buffer.h (buffer_slot_type_mismatch):
7796 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7797 * eval.c (unwind_to_catch):
7798 * image.c (my_png_error, my_error_exit):
7799 * keyboard.c (quit_throw_to_read_char, user_error)
7800 (Fexit_recursive_edit, Fabort_recursive_edit):
7801 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7802 (wrong_type_argument, buffer_overflow, __executable_start)
7803 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7804 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7805 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7806 (fatal):
7807 (child_setup) [!DOS_NT]:
7808 * lread.c (end_of_file_error, invalid_syntax):
7809 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7810 * puresize.h (pure_write_error):
7811 * search.c (matcher_overflow):
7812 * sound.c (sound_perror, alsa_sound_perror):
7813 * sysdep.c, syssignal.h (croak):
7814 * term.c (maybe_fatal, vfatal):
7815 * textprop.c (text_read_only):
7816 * undo.c (user_error):
7817 * unexmacosx.c (unexec_error):
7818 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7819 Use _Noreturn rather than NO_RETURN.
7820 No need for separate decl merely because of _Noreturn.
7821 * sound.c (sound_warning, parse_sound):
7822 Remove unnecessary forward decls.
7823
7824 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7825
7826 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7827 * lisp.h (WAIT_READING_MAX): New macro.
7828 * dispnew.c (Fsleep_for, sit_for):
7829 * keyboard.c (kbd_buffer_get_event):
7830 * process.c (Faccept_process_output):
7831 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7832 This improves on the previous patch, which introduced a bug
7833 when time_t is unsigned and as wide as intmax_t.
7834 See <http://bugs.gnu.org/9000#51>.
7835
7836 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7837
7838 * dispnew.c (sit_for, Fsleep_for):
7839 * keyboard.c (kbd_buffer_get_event):
7840 * process.c (Faccept_process_output): Avoid compiler warnings when
7841 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7842
7843 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7844
7845 * makefile.w32-in: Update dependencies.
7846
7847 * w32.c (ltime): Add return type and declare static.
7848 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7849
7850 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7851
7852 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7853 Privately reported by Herbert J. Skuhra.
7854 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7855 All uses changed.
7856 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7857 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7858
7859 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7860
7861 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7862 last argument of make_unibyte_string.
7863
7864 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7865 language ID in the event parameters.
7866
7867 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7868 event.code, not the obscure "character set ID".
7869
7870 2012-06-23 Chong Yidong <cyd@gnu.org>
7871
7872 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7873
7874 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7875
7876 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7877 * w32.c (fdutimens): New function.
7878
7879 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7880
7881 * s/ms-w32.h (pselect): Redirect to sys_select.
7882
7883 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7884
7885 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7886 in the logic of incrementing and decrementing the value of
7887 use_relocatable_buffers.
7888
7889 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7890
7891 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7892 Privately reported by Herbert J. Skuhra.
7893 [__FreeBSD__]: Remove "*/" typo after "#include".
7894 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7895 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7896 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7897 Don't assume EMACS_TIME and struct timeval are the same type.
7898
7899 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7900
7901 Support higher-resolution time stamps (Bug#9000).
7902 The time stamps are only nanosecond-resolution at the C level,
7903 since that's the best that any real-world system supports now.
7904 But they are picosecond-resolution at the Lisp level, as that's
7905 easy, and leaves room for future OS improvements.
7906
7907 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7908 (LIBES): Use it.
7909
7910 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7911 Don't get current time unless it's needed.
7912
7913 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7914 now provides it if it's absent.
7915 (start_atimer): Port to higher-res time stamps.
7916 Check for time stamp overflow. Don't get current time more
7917 often than is needed.
7918
7919 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7920 Include systime.h, not time.h.
7921 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7922
7923 * dired.c: Include stat-time.h.
7924 (Ffile-attributes): File times now have higher resolution.
7925
7926 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7927 (struct image): Timestamp now has higher resolution.
7928
7929 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7930 has at least microseconds now. All uses removed.
7931 (update_frame, update_single_window, update_window, update_frame_1)
7932 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7933 (duration_to_sec_usec): Remove; no longer needed.
7934
7935 * editfns.c (time_overflow): Now extern.
7936 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7937 (float-time, Fformat_time_string, Fcurrent_time_string)
7938 (Fcurrent_time_zone): Accept and generate higher-resolution
7939 time stamps.
7940 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7941 (decode_time_components, lisp_seconds_argument): New functions.
7942 (make_time): Now static.
7943 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7944 Report an error if the time is invalid, rather than having the caller
7945 do that.
7946
7947 * fileio.c: Include <stat-time.h>
7948 (Fcopy_file): Copy higher-resolution time stamps.
7949 Prefer to set the time stamp via a file descriptor if that works.
7950 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7951 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7952 (Fvisited_file_modtime, Fset_visited_file_modtime):
7953 Support higher-resolution time stamps.
7954
7955 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7956
7957 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7958
7959 * image.c (prepare_image_for_display, clear_image_cache)
7960 (lookup_image): Port to higer-resolution time stamps.
7961
7962 * keyboard.c (start_polling, bind_polling_period):
7963 Check for time stamp overflow.
7964 (read_char, kbd_buffer_get_event, timer_start_idle)
7965 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7966 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7967 Port to higher-resolution time stamps. Do not assume time_t is signed.
7968 (decode_timer): New function. Timers are now vectors of length 9,
7969 not 8, to accommodate the picosecond component.
7970 (timer_check_2): Use it.
7971
7972 * nsterm.m (select_timeout, timeval_subtract): Remove.
7973 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7974 as they're a bit more accurate and handle overflow better.
7975 (ns_select): Change prototype to be compatible with pselect.
7976 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7977 * nsterm.h (ns_select): Adjust prototype.
7978
7979 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7980 us-resolution time stamps.
7981 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7982
7983 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7984
7985 * lisp.h (time_overflow): New decl.
7986 (wait_reading_process_output): First arg is now intmax_t, not int,
7987 to accommodate larger waits.
7988
7989 * process.h (struct Lisp_Process.read_output_delay):
7990 Now counts nanoseconds, not microseconds.
7991 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7992 EMACS_HAS_USECS.
7993 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7994 (wait_reading_process_output):
7995 Port to ns-resolution time stamps.
7996 (Faccept_process_output, wait_reading_process_output):
7997 Check for time stamp overflow. Do not assume time_t is signed.
7998 (select_wrapper): Remove; we now use pselect.
7999 (Fprocess_attributes): Now generates ns-resolution time stamps.
8000
8001 * sysdep.c: Include utimens.h. Don't include utime.h
8002 or worry about struct utimbuf; gnulib does that for us now.
8003 (gettimeofday): Remove; gnulib provides a substitute.
8004 (make_timeval): New function.
8005 (set_file_times): Now sets ns-resolution time stamps.
8006 New arg FD; all uses changed.
8007 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8008 (system_process_attributes):
8009 Now returns ns-resolution time stamp. All uses changed.
8010 Check for time stamp overflow.
8011
8012 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8013 provides a substitute now.
8014
8015 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8016 since it guarantees struct timespec.
8017 (EMACS_TIME): Now struct timespec, so that we can support
8018 ns-resolution time stamps.
8019 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8020 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8021 (EMACS_USECS): Remove.
8022 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8023 so multiply the arg by 1000 before storing it.
8024 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8025 New macros.
8026 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8027 Port to ns-resolution time stamps.
8028 (EMACS_TIME_NEG_P): Remove; replaced by....
8029 (EMACS_TIME_SIGN): New macro.
8030 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8031 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8032 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8033 (make_timeval, make_lisp_time, decode_time_components): New decls.
8034 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
8035 that it mishandled time_t overflow. You can't compare by subtracting!
8036 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8037 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8038
8039 * term.c: Include <sys/time.h>.
8040 (timeval_to_Time): New function, for proper overflow wraparound.
8041 (term_mouse_position, term_mouse_click): Use it.
8042
8043 * undo.c (record_first_change): Support higher-resolution time stamps
8044 in the undo buffer.
8045 (Fprimitive_undo): Use them when restoring time stamps.
8046
8047 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8048 (w32_get_internal_run_time):
8049 Port to higher-resolution Emacs time stamps.
8050 (ltime): Now accepts single 64-bit integer, as that's more convenient
8051 for callers.
8052
8053 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8054
8055 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8056 for compatibility with pselect. Support ns-resolution time stamps.
8057
8058 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8059
8060 * xselect.c (wait_for_property_change, x_get_foreign_selection):
8061 Check for time stamp overflow, and support ns-resolution time stamps.
8062
8063 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8064 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8065 (timeval_subtract): Remove; no longer needed.
8066 (XTflash, XTring_bell, x_wait_for_event):
8067 Port to ns-resolution time stamps. Don't assume time_t is signed.
8068
8069 2012-06-22 Chong Yidong <cyd@gnu.org>
8070
8071 * xdisp.c (x_consider_frame_title): Revert last change.
8072
8073 2012-06-22 Eli Zaretskii <eliz@gnu.org>
8074
8075 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
8076 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8077 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
8078 staticidx goes up to 1597 out of 1600 = 0x640.)
8079
8080 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
8081
8082 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8083 Otherwise, the umask might be mistakenly 0 while handling input signals.
8084
8085 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
8086
8087 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8088
8089 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
8090
8091 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8092 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8093 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8094 access to `contents' member of Lisp_Vector objects with AREF and ASET
8095 where appropriate.
8096
8097 2012-06-19 Chong Yidong <cyd@gnu.org>
8098
8099 * frame.c (delete_frame): When selecting a frame on a different
8100 text terminal, do not alter the terminal's top-frame.
8101
8102 * xdisp.c (format_mode_line_unwind_data): Record the target
8103 frame's selected window and its terminal's top-frame.
8104 (unwind_format_mode_line): Restore them.
8105 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8106 Callers changed.
8107 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8108 since tty frames can be explicitly named.
8109 (prepare_menu_bars): Likewise.
8110
8111 * term.c (Ftty_top_frame): New function.
8112
8113 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8114
8115 Port byte-code-meter to modern targets.
8116 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8117 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8118 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
8119 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8120 (METER_1, METER_2): Simplify.
8121
8122 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
8123
8124 * data.c (Fdefalias): Return `symbol' (bug#11686).
8125
8126 2012-06-18 Martin Rudalics <rudalics@gmx.at>
8127
8128 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
8129 gets killed during executing of this function (Bug#11665).
8130 Try to always return Qt when the buffer has been actually killed.
8131 (Vkill_buffer_query_functions): In doc-string say that functions
8132 run by this hook should not change the current buffer.
8133
8134 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8135
8136 Fix recently-introduced process.c problems found by static checking.
8137 * process.c (write_queue_push, write_queue_pop, send_process):
8138 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8139 (write_queue_pop): Fix pointer signedness problem.
8140 (send_process): Remove unused local.
8141
8142 2012-06-17 Chong Yidong <cyd@gnu.org>
8143
8144 * xdisp.c (redisplay_internal): No need to redisplay terminal
8145 frames that are not on top.
8146
8147 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
8148
8149 * process.c (make_process): Initialize write_queue.
8150 (write_queue_push, write_queue_pop): New functions.
8151 (send_process): Use them to maintain correct ordering of process
8152 writes (Bug#10815).
8153
8154 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
8155
8156 * lisp.h (eassert): Assume C89 or later.
8157 This removes the need for CHECK.
8158 (CHECK): Remove. Its comments about always evaluating its
8159 argument were confusing, as 'eassert' typically does not evaluate
8160 its argument.
8161
8162 * coding.c (produce_chars): Use ptrdiff_t, not int.
8163
8164 * xterm.c (x_draw_underwave): Check for integer overflow.
8165 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8166
8167 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
8168
8169 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8170 referenced (Bug#11583).
8171
8172 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
8173
8174 Implement wave-style variant of underlining.
8175 * dispextern.h (face_underline_type): New enum.
8176 (face): Add field for underline type.
8177 * nsterm.m (ns_draw_underwave): New function.
8178 (ns_draw_text_decoration): Use it.
8179 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
8180 New functions.
8181 (x_draw_glyph_string): Use them.
8182 * xfaces.c (Qline, Qwave): New Lisp objects.
8183 (check_lface_attrs, merge_face_ref)
8184 (Finternal_set_lisp_face_attribute, realize_x_face):
8185 Handle wave-style underline face attributes.
8186 * xterm.c (x_draw_underwave): New function.
8187 (x_draw_glyph_string): Use it.
8188
8189 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
8190
8191 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
8192 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
8193 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
8194 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
8195 ($(BLD)/w32select.$(O)): Update dependencies.
8196
8197 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8198
8199 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
8200 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
8201 * character.c (_fetch_multibyte_char_p): Remove.
8202 * alloc.c: Include "character.h" before "buffer.h".
8203 * bidi.c: Likewise.
8204 * buffer.c: Likewise.
8205 * bytecode.c: Likewise.
8206 * callint.c: Likewise.
8207 * callproc.c: Likewise.
8208 * casefiddle.c: Likewise.
8209 * casetab.c: Likewise.
8210 * category.c: Likewise.
8211 * cmds.c: Likewise.
8212 * coding.c: Likewise.
8213 * composite.c: Likewise.
8214 * dired.c: Likewise.
8215 * dispnew.c: Likewise.
8216 * doc.c: Likewise.
8217 * dosfns.c: Likewise.
8218 * editfns.c: Likewise.
8219 * emacs.c: Likewise.
8220 * fileio.c: Likewise.
8221 * filelock.c: Likewise.
8222 * font.c: Likewise.
8223 * fontset.c: Likewise.
8224 * fringe.c: Likewise.
8225 * indent.c: Likewise.
8226 * insdel.c: Likewise.
8227 * intervals.c: Likewise.
8228 * keyboard.c: Likewise.
8229 * keymap.c: Likewise.
8230 * lread.c: Likewise.
8231 * macros.c: Likewise.
8232 * marker.c: Likewise.
8233 * minibuf.c: Likewise.
8234 * nsfns.m: Likewise.
8235 * nsmenu.m: Likewise.
8236 * print.c: Likewise.
8237 * process.c: Likewise.
8238 * regex.c: Likewise.
8239 * region-cache.c: Likewise.
8240 * search.c: Likewise.
8241 * syntax.c: Likewise.
8242 * term.c: Likewise.
8243 * textprop.c: Likewise.
8244 * undo.c: Likewise.
8245 * unexsol.c: Likewise.
8246 * w16select.c: Likewise.
8247 * w32fns.c: Likewise.
8248 * w32menu.c: Likewise.
8249 * window.c: Likewise.
8250 * xdisp.c: Likewise.
8251 * xfns.c: Likewise.
8252 * xmenu.c: Likewise.
8253 * xml.c: Likewise.
8254 * xselect.c: Likewise.
8255
8256 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8257
8258 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
8259 If all the glyphs of the glyph row came from strings, and we have no
8260 cursor positioning clues, put the cursor on the first glyph of the
8261 row.
8262 (handle_face_prop): Use chunk-relative overlay string index when
8263 indexing into it->string_overlays array. (Bug#11653)
8264 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
8265 the rightmost. (Bug#11720)
8266
8267 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8268
8269 * category.h (CHAR_HAS_CATEGORY): Define as inline.
8270 (CATEGORY_MEMBER): Enforce 1/0 value.
8271 * category.c (_temp_category_set): Remove.
8272
8273 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8274
8275 * window.c (Fdelete_other_windows_internal)
8276 (Fdelete_window_internal): Don't access frame's mouse highlight
8277 info of the initial frame. (Bug#11677)
8278
8279 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
8280
8281 * .gdbinit (xgetint): Fix recently-introduced paren typo.
8282 Assume USE_2_TAGS_FOR_INTS.
8283 (xreload): Adjust $tagmask width to match recent lisp.h change.
8284
8285 Simplify lisp.h in minor ways that should not affect code.
8286 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
8287 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
8288 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
8289 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
8290 (INTTYPEBITS): New macro, for clarity.
8291 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
8292 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
8293 Simplify now that USE_LSB_TAG is always defined.
8294 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
8295 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
8296
8297 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
8298
8299 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
8300
8301 2012-06-13 Glenn Morris <rgm@gnu.org>
8302
8303 * s/bsd-common.h (BSD4_3):
8304 * s/usg5-4-common.h (USG5_4): No longer define; unused.
8305
8306 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
8307
8308 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
8309 instead of union.
8310 (XLI, XIL): Define.
8311 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
8312 Use them.
8313 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
8314 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
8315 * alloc.c (widen_to_Lisp_Object): Remove.
8316 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
8317 * frame.c (delete_frame): Remove outdated comment.
8318 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
8319 USE_LISP_UNION_TYPE.
8320 (Fw32_unregister_hot_key): Likewise.
8321 (Fw32_toggle_lock_key): Likewise.
8322 * w32menu.c (add_menu_item): Likewise.
8323 (w32_menu_display_help): Use XIL instead of checking
8324 USE_LISP_UNION_TYPE.
8325 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
8326 (init_heap): Likewise.
8327 * w32term.c (w32_read_socket): Update comment.
8328
8329 2012-06-13 Glenn Morris <rgm@gnu.org>
8330
8331 * s/usg5-4-common.h, src/s/unixware.h:
8332 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8333
8334 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8335
8336 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
8337
8338 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8339 * alloc.c (make_number) [!defined make_number]:
8340 Remove, as lisp.h always defines this now.
8341 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8342 (roundup_size): Verify that it is a power of 2.
8343 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8344 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8345 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8346 -DUSE_LSB_TAG=0, to override the automatically-selected default.
8347 USE_LSB_TAG now is always defined to be either 0 or 1.
8348 All uses changed.
8349 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8350 code works fine either way, and efficiency is not a concern here,
8351 as the union type is for debugging, not for production.
8352 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8353 Use an inline function on all platforms when using the union type,
8354 since this is simpler and 'static inline' can be used portably
8355 within Emacs now.
8356 (LISP_INITIALLY_ZERO): New macro.
8357 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8358 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8359
8360 2012-06-12 Glenn Morris <rgm@gnu.org>
8361
8362 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8363
8364 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8365
8366 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8367 Move BROKEN_SIGIO to configure.
8368
8369 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8370 Move NO_TERMIO to configure.
8371
8372 2012-06-12 Chong Yidong <cyd@gnu.org>
8373
8374 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8375 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8376 MagickExportImagePixels is undefined.
8377
8378 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8379
8380 * image.c (imagemagick_load_image): Remove unused label.
8381
8382 2012-06-11 Glenn Morris <rgm@gnu.org>
8383
8384 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8385 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8386 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8387 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8388
8389 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8390
8391 * alloc.c (make_byte_code): New function.
8392 (Fmake_byte_code): Use it. Don't purify here.
8393 * lread.c (read1): Use it as well to avoid extra allocation.
8394
8395 2012-06-11 Chong Yidong <cyd@gnu.org>
8396
8397 * image.c (imagemagick_load_image): Implement transparency.
8398
8399 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8400
8401 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8402 account for preceding backslashes. (Bug#11663)
8403
8404 2012-06-09 Chong Yidong <cyd@gnu.org>
8405
8406 * term.c: Support italics in capable terminals (Bug#9652).
8407 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8408 (turn_on_face): Output using TS_enter_italic_mode if available.
8409 Don't handle unused blinking and alt-charset cases.
8410 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8411 and tty_alt_charset_p cases.
8412 (tty_capable_p, init_tty): Support italics.
8413
8414 * termchar.h (struct tty_display_info): Add field for italics.
8415 Remove unused blink field.
8416
8417 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8418 Handle slant.
8419
8420 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8421 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8422 tty_alt_charset_p. Add tty_italic_p.
8423
8424 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
8425
8426 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8427 dbus_type_is_basic if available.
8428 (xd_extract_signed, xd_extract_unsigned): Rename from
8429 extract_signed and extract_unsigned, respectively. Adapt callers.
8430
8431 2012-06-09 Chong Yidong <cyd@gnu.org>
8432
8433 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8434
8435 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8436 case (Bug#9752).
8437
8438 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
8439
8440 * xdisp.c (vmessage): Treat frame message as multibyte.
8441 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8442 would generate the diagnostic "Making \302\247 buffer-local while
8443 let-bound!".
8444
8445 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8446
8447 * dispnew.c (showing_window_margins_p): Undo last change, which
8448 was done due to an inadvertent commit.
8449 (adjust_frame_glyphs_for_frame_redisplay): Do call
8450 showing_window_margins_p.
8451
8452 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8453
8454 * eval.c (Fmake_var_non_special): New primitive.
8455 (syms_of_eval): Defsubr it.
8456 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8457
8458 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
8459
8460 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8461 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8462
8463 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8464
8465 * alloc.c (allocate_vectorlike): Fix last change.
8466
8467 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
8468
8469 Block-based vector allocation of small vectors.
8470 * lisp.h (struct vectorlike_header): New field `nbytes',
8471 adjust comment accordingly.
8472 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8473 to denote vector blocks. Adjust users (live_vector_p,
8474 mark_maybe_pointer, valid_lisp_object_p) accordingly.
8475 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8476 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8477 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8478 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8479 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8480 (roundup_size): New constant.
8481 (struct vector_block): New data type.
8482 (vector_blocks, vector_free_lists, zero_vector): New variables.
8483 (all_vectors): Rename to `large_vectors'.
8484 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8485 (sweep_vectors): New functions.
8486 (allocate_vectorlike): Return `zero_vector' as the only vector of
8487 0 items. Allocate new vector from block if vector size is less than
8488 or equal to VBLOCK_BYTES_MAX.
8489 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8490 (init_alloc_once): Add call to init_vectors.
8491
8492 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8493
8494 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8495
8496 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8497
8498 * doprnt.c (doprnt): Truncate multibyte char correctly.
8499 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8500 would mishandle a string argument "Xc" if X was a multibyte
8501 character of length 2: it would truncate after X's first byte
8502 rather than including all of X.
8503
8504 2012-06-06 Chong Yidong <cyd@gnu.org>
8505
8506 * buffer.c (word_wrap): Doc fix.
8507
8508 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8509
8510 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8511
8512 2012-06-03 Glenn Morris <rgm@gnu.org>
8513
8514 * xdisp.c (tool-bar-style): Doc fix.
8515
8516 2012-06-03 Ulrich Müller <ulm@gentoo.org>
8517
8518 * Makefile.in (PAXCTL): Define.
8519 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8520 binary via PaX flags if the paxctl utility is available.
8521 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8522 Restore PaX flags to their default. (Bug#11398)
8523
8524 2012-06-03 Chong Yidong <cyd@gnu.org>
8525
8526 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8527 buffer (Bug#11226).
8528
8529 2012-06-03 Chong Yidong <cyd@gnu.org>
8530
8531 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8532 (note_mode_line_or_margin_highlight): If there is no help echo,
8533 use mode-line-default-help-echo. Handle the case where the mouse
8534 position is past the end of the mode line string.
8535
8536 * buffer.c (buffer_local_value_1): New function, split from
8537 Fbuffer_local_value; can return Qunbound.
8538 (Fbuffer_local_value): Use it.
8539 (Vmode_line_format): Docstring tweaks.
8540
8541 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8542
8543 * sysdep.c (system_process_attributes): Improve comment.
8544
8545 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8546
8547 * keyboard.c: Export real-this-command to Elisp.
8548 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8549 and DEFVAR it. Update all users.
8550
8551 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8552
8553 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8554
8555 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8556 Convert pctcpu and pctmem to Lisp float properly.
8557 Let the compiler fold better, as 100.0/0x8000 is exact.
8558
8559 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8560
8561 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8562 cons_block.
8563
8564 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8565
8566 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8567
8568 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8569
8570 For a 'struct window', replace some Lisp_Object fields to
8571 bitfields where appropriate, remove unused fields.
8572 * window.h (struct window): Remove unused 'last_mark_x' and
8573 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
8574 change its type from Lisp_Object to bitfield.
8575 Change type of 'force_start', 'optional_new_start',
8576 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8577 fields from Lisp_Object to bitfield. Adjust users accordingly.
8578
8579 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8580
8581 Pacify gcc -Wdouble-precision when using Xaw.
8582 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8583 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8584 Use 'float' consistently, rather than 'float' in most places
8585 and 'double' in a couple of places.
8586
8587 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8588
8589 * xdisp.c (handle_stop): Detect whether we have overlay strings
8590 loaded by testing it->current.overlay_string_index to be
8591 non-negative, instead of checking whether n_overlay_strings is
8592 positive. (Bug#11587)
8593
8594 2012-05-31 Chong Yidong <cyd@gnu.org>
8595
8596 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8597
8598 * doc.c (Fsubstitute_command_keys): Doc fix.
8599
8600 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8601
8602 * search.c (search_buffer): Remove calls to
8603 r_alloc_inhibit_buffer_relocation, as it is now called by
8604 maybe_unify_char, which was the cause of relocation of buffer text
8605 in bug#11519.
8606
8607 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8608
8609 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8610 for the duration of call to load_charset, to avoid problems with
8611 callers of maybe_unify_char that access buffer text through C
8612 pointers.
8613
8614 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8615 decrement the inhibition flag, instead of just setting or
8616 resetting it.
8617
8618 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8619
8620 Remove obsolete '#define static' cruft.
8621 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8622 This #undef was "temporary" in 2000; it is no longer needed
8623 now that '#define static' has gone away.
8624 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8625 (gray_bitmap_bits): Remove; no longer needed.
8626 All uses replaced with definiens.
8627 * xterm.c: Include "bitmaps/gray.xbm".
8628
8629 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8630
8631 Clean up __executable_start, monstartup when --enable-profiling.
8632 The following changes affect the code only when profiling.
8633 * dispnew.c (__executable_start): Rename from safe_bcopy.
8634 Define only on platforms that need it.
8635 * emacs.c: Include <sys/gmon.h> when profiling.
8636 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8637 (__executable_start): Remove decl, since lisp.h does it now.
8638 (safe_bcopy): Remove decl; no longer has that name.
8639 (main): Coalesce #if into single bit of code, for simplicity.
8640 Cast pointers to uintptr_t, since standard libraries want integers
8641 and not pointers.
8642 * lisp.h (__executable_start): New decl.
8643
8644 2012-05-31 Glenn Morris <rgm@gnu.org>
8645
8646 * image.c (Fimagemagick_types): Doc fix.
8647
8648 2012-05-30 Jim Meyering <meyering@redhat.com>
8649
8650 * callproc.c (Fcall_process_region): Include directory component
8651 in mkstemp error message (Bug#11586).
8652
8653 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8654
8655 * alloc.c, lisp.h (make_pure_vector): Now static.
8656
8657 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8658
8659 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8660 Move to byte-run.el.
8661 (Fautoload): Do the hash-doc more carefully.
8662 * data.c (Fdefalias): Purify definition, except for keymaps.
8663 (Qdefun): Move from eval.c.
8664 * lisp.h (Qdefun): Remove.
8665 * lread.c (read1): Tiny simplification.
8666
8667 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8668
8669 Do not create empty overlays with the evaporate property (Bug#9642).
8670 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8671 Bug#9642, but explicitly check that the buffer the overlay would
8672 be moved to is live and rearrange lines to make sure that errors
8673 will not put the overlay in an inconsistent state.
8674 (Fdelete_overlay): Cosmetics.
8675
8676 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8677
8678 * w32term.c (my_bring_window_to_top): New function.
8679 (x_raise_frame): Use handle returned by DeferWindowPos, which
8680 could be different from the original one.
8681 Call my_bring_window_to_top instead of my_set_foreground_window.
8682 (Bug#11513)
8683
8684 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8685 by calling BringWindowToTop.
8686
8687 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8688 (WM_EMACS_END): Increase by one.
8689
8690 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8691
8692 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8693 This avoids undefined behavior that might cause the eassert
8694 to not catch an out-of-range value.
8695
8696 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8697
8698 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8699 Update dependencies.
8700
8701 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8702
8703 * bidi.c (bidi_mirror_char): Fix last change.
8704
8705 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8706
8707 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8708 when referring to sectname field in printf format.
8709
8710 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8711
8712 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8713 Only r_alloc_inhibit_buffer_relocation needed to be added;
8714 the others were already declared.
8715
8716 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8717 before checking whether it's out of range. Put the check inside
8718 eassert. See
8719 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8720
8721 2012-05-27 Ken Brown <kbrown@cornell.edu>
8722
8723 * callproc.c (Fcall_process): Restore a line that was accidentally
8724 commented out in the 2011-02-13 change (bug#11547).
8725
8726 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8727
8728 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8729 defined on ralloc.c.
8730
8731 * buffer.c [REL_ALLOC]: Remove prototypes of
8732 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8733 they are now on lisp.h.
8734
8735 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8736
8737 * search.c (search_buffer): Use it to inhibit relocation of buffer
8738 text while re_search_2 is doing its job, because re_search_2 is
8739 passed C pointers to buffer text. (Bug#11519)
8740
8741 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8742 Update value to 24.
8743
8744 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8745 state after an additional call to move_it_in_display_line_to, keep
8746 the values of it->max_ascent and it->max_descent found for the
8747 entire line.
8748 (pos_visible_p): Revert the comparison against bottom_y to what it
8749 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8750 (Bug#11464)
8751
8752 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8753
8754 Fix coding-related core dumps with gcc -ftrapv.
8755 The code was computing A - B, where A and B are pointers, and B is
8756 random garbage. This can lead to core dumps on platforms that
8757 have special pointer registers, and it also leads to core dumps on
8758 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8759 A - B only when B is initialized properly.
8760 * coding.c (coding_set_source, coding_set_destination): Return void.
8761 (coding_change_source, coding_change_destinations): New functions,
8762 with the old behaviors of coding_set_source and coding_set_destination.
8763 All callers that need an offset changed to use these new functions.
8764
8765 2012-05-26 Glenn Morris <rgm@gnu.org>
8766
8767 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8768
8769 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8770
8771 Extend mouse support on W32 text-mode console.
8772 * xdisp.c (draw_row_with_mouse_face):
8773 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8774
8775 * w32console.c: Include window.h.
8776 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8777 New functions.
8778 (initialize_w32_display): Initialize mouse-highlight data.
8779
8780 * w32inevt.c: Include termchar.h and window.h.
8781 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8782 moves, call note_mouse_highlight. If help_echo changed, call
8783 gen_help_event to produce help-echo message in the echo area.
8784 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8785 highlight info.
8786
8787 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8788
8789 * lread.c (read1): Simplify slightly to avoid an overflow warning
8790 with GCC 4.7.0 on x86-64.
8791
8792 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8793
8794 * bidi.c (bidi_mirror_char): Revert last change: an int is
8795 definitely wide enough here.
8796
8797 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8798
8799 Fix integer width and related bugs (Bug#9874).
8800 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8801 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8802 (string_bytes, check_sblock, allocate_string_data):
8803 (compact_small_strings, Fmake_bool_vector, make_string)
8804 (make_unibyte_string, make_multibyte_string)
8805 (make_string_from_bytes, make_specified_string)
8806 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8807 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8808 (mark_vectorlike):
8809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8810 (allocate_pseudovector):
8811 Use int, not EMACS_INT, where int is wide enough.
8812 (inhibit_garbage_collection, Fgarbage_collect):
8813 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8814 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8815 int might not be wide enough.
8816 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8817 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8818 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8819 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8820 (bidi_level_of_next_char, bidi_move_to_visually_next):
8821 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8822 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8823 (Fkill_buffer, Fset_buffer_major_mode)
8824 (advance_to_char_boundary, Fbuffer_swap_text)
8825 (Fset_buffer_multibyte, overlays_at, overlays_in)
8826 (overlay_touches_p, struct sortvec, record_overlay_string)
8827 (overlay_strings, recenter_overlay_lists)
8828 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8829 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8830 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8831 (Foverlay_recenter, last_overlay_modification_hooks_used)
8832 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8833 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8834 (validate_region): Omit unnecessary test for b <= e,
8835 since that's guaranteed by the previous test.
8836 (adjust_overlays_for_delete): Avoid pos + length overflow.
8837 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8838 (report_overlay_modification):
8839 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8840 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8841 Omit pointer cast, which isn't needed anyway, and doesn't work
8842 after the EMACS_INT -> ptrdiff_t change.
8843 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8844 * buffer.h: Adjust decls to match defn changes elsewhere.
8845 (struct buffer_text, struct buffer):
8846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8847 Use EMACS_INT, not int, where int might not be wide enough.
8848 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8849 not int, to avoid needless 32-bit limit on 64-bit hosts.
8850 (exec_byte_code): Use tighter memory-full test, one that checks
8851 for alloca overflow. Don't compute the address of the object just
8852 before an array, as that's not portable. Use EMACS_INT, not
8853 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8854 * callint.c (Fcall_interactively):
8855 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8856 * callproc.c (call_process_kill, Fcall_process):
8857 Don't assume pid_t fits into an Emacs fixnum.
8858 (call_process_cleanup, Fcall_process, child_setup):
8859 Don't assume pid_t fits into int.
8860 (call_process_cleanup, Fcall_process, delete_temp_file)
8861 (Fcall_process_region):
8862 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8863 (Fcall_process): Simplify handling of volatile integers.
8864 Use int, not EMACS_INT, where int will do.
8865 * casefiddle.c (casify_object, casify_region, operate_on_word)
8866 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8867 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8868 (casify_object): Avoid integer overflow when overallocating buffer.
8869 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8870 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8871 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8872 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8873 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8874 integers are now checked earlier. All uses replaced with XINT.
8875 (ccl_driver):
8876 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8877 For CCL_MapSingle, check that content and value are in int range.
8878 (ccl_driver, Fregister_code_conversion_map):
8879 Check that Vcode_version_map_vector is a vector.
8880 (resolve_symbol_ccl_program): Check that vector header is in range.
8881 Always copy the vector, so that we can check its contents reliably
8882 now rather than having to recheck each instruction as it's being
8883 executed. Check that vector words fit in 'int'.
8884 (ccl_get_compiled_code, Fregister_ccl_program)
8885 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8886 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8887 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8888 contents are in range.
8889 (Fccl_execute_on_string): Check that status is in range.
8890 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8891 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8892 Accept and return EMACS_INT, not int, because callers can pass values
8893 out of 'int' range.
8894 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8895 (multibyte_chars_in_text, parse_str_as_multibyte)
8896 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8897 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8898 (string_escape_byte8, Fget_byte):
8899 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8900 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8901 avoid mishandling large integers.
8902 * character.h: Adjust decls to match defn changes elsewhere.
8903 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8904 (Ffind_charset_region):
8905 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8906 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8907 (load_charset_map_from_vector, Fdefine_charset_internal):
8908 Don't assume fixnum fits in int.
8909 (load_charset_map_from_vector, Fmap_charset_chars):
8910 Remove now-unnecessary CHECK_NATNUMs.
8911 (Fdefine_charset_internal): Check ranges here, more carefully.
8912 Don't rely on undefined behavior with signed left shift overflow.
8913 Don't assume unsigned int fits into fixnum, or that fixnum fits
8914 into unsigned int. Don't require max_code to be a valid fixnum;
8915 that's not true for gb10830 4-byte on a 32-bit host. Allow
8916 invalid_code to be a cons, for the same reason. Require code_offset
8917 to be a character. Avoid int overflow if max_char is close
8918 to INT_MAX.
8919 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8920 this is intended anyway and avoids some undefined behavior.
8921 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8922 INDEX_TO_CODE_POINT, as that's what it expects.
8923 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8924 * charset.h (DECODE_CHAR): Return int, not unsigned;
8925 this is what was intended anyway, and it avoids undefined behavior.
8926 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8927 integer-overflow issues.
8928 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8929 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8930 where the argument is EMACS_INT, and this behavior is not intended.
8931 * chartab.c (Fmake_char_table, Fset_char_table_range)
8932 (uniprop_get_decoder, uniprop_get_encoder):
8933 Don't assume fixnum fits in int.
8934 * cmds.c (move_point): New function, that does the gist of
8935 Fforward_char and Fbackward_char, but does so while checking
8936 for integer overflow more accurately.
8937 (Fforward_char, Fbackward_char): Use it.
8938 (Fforward_line, Fend_of_line, internal_self_insert)
8939 (internal_self_insert):
8940 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8941 Fix a FIXME, by checking for integer overflow when calculating
8942 target_clm and actual_clm.
8943 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8944 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8945 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8946 (coding_alloc_by_making_gap, alloc_destination)
8947 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8948 (encode_coding_utf_16, detect_coding_emacs_mule)
8949 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8950 (detect_coding_iso_2022, decode_coding_iso_2022)
8951 (encode_invocation_designation, encode_designation_at_bol)
8952 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8953 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8954 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8955 (encode_coding_ccl, encode_coding_raw_text)
8956 (detect_coding_charset, decode_coding_charset)
8957 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8958 (produce_composition, produce_charset, produce_annotation)
8959 (decode_coding, handle_composition_annotation)
8960 (handle_charset_annotation, consume_chars, decode_coding_gap)
8961 (decode_coding_object, encode_coding_object, detect_coding_system)
8962 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8963 (code_convert_region, code_convert_string)
8964 (Fdefine_coding_system_internal)
8965 (coding_set_source, coding_set_destination):
8966 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8967 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8968 (Fdefine_coding_system_internal):
8969 Don't assume fixnums fit in int.
8970 (decode_coding_gap, decode_coding_object, encode_coding_object)
8971 (Fread_coding_system, Fdetect_coding_region)
8972 (Funencodable_char_position, Fcheck_coding_systems_region)
8973 (get_translation, handle_composition_annotation, consume_chars):
8974 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8975 (consume_chars): Rewrite to not calculate an address outside buffer.
8976 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8977 Don't access memory outside of the args array.
8978 (Fdefine_coding_system_internal): Check for charset-id overflow.
8979 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8980 result of ENCODE_CHAR.
8981 * coding.h: Adjust decls to match defn changes elsewhere.
8982 (struct coding_system):
8983 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8984 * composite.c (get_composition_id, find_composition)
8985 (run_composition_function, update_compositions)
8986 (compose_text, composition_gstring_put_cache)
8987 (composition_gstring_p, composition_gstring_width)
8988 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8989 (composition_compute_stop_pos, composition_reseat_it)
8990 (composition_update_it, struct position_record)
8991 (find_automatic_composition, composition_adjust_point)
8992 (Fcomposition_get_gstring, Ffind_composition_internal):
8993 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8994 (update_compositions):
8995 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8996 * composite.h: Adjust decls to match defn changes elsewhere.
8997 (struct composition):
8998 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8999 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9000 Do not attempt to compute the address of the object just before a
9001 buffer; this is not portable.
9002 (Faref, Faset):
9003 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9004 (Faset): Use int, not EMACS_INT, where int is wide enough.
9005 (Fstring_to_number): Don't assume fixnums fit in int.
9006 (Frem): Don't assume arg is nonnegative.
9007 * dbusbind.c (xd_append_arg): Check for integers out of range.
9008 (Fdbus_call_method): Don't overflow the timeout int.
9009 (extract_signed, extract_unsigned): New functions.
9010 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9011 (xd_get_connection_references): Return ptrdiff_t, not int.
9012 All uses changed.
9013 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9014 (xd_read_message_1):
9015 Use int, not unsigned, where the dbus API uses int.
9016 (Fdbus_message_internal): Don't overflow mtype.
9017 (syms_of_dbusbind): Allocate right-sized buffer for integers.
9018 * dired.c (directory_files_internal, file_name_completion, scmp)
9019 (file_name_completion_stat):
9020 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9021 (file_name_completion): Don't overflow matchcount.
9022 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9023 * dispextern.h: Adjust decls to match defn changes elsewhere.
9024 (struct text_pos, struct glyph, struct bidi_saved_info)
9025 (struct bidi_string_data, struct bidi_it, struct composition_it)
9026 (struct it):
9027 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9028 (struct display_pos, struct composition_it, struct it):
9029 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9030 * dispnew.c (increment_matrix_positions)
9031 (increment_row_positions, mode_line_string)
9032 (marginal_area_string):
9033 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9034 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9035 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9036 (duration_to_sec_usec): New function, to check for overflow better.
9037 (Fsleep_for, sit_for): Use it.
9038 * doc.c (get_doc_string, store_function_docstring):
9039 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9040 (get_doc_string, Fsnarf_documentation):
9041 Use int, not EMACS_INT, where int is wide enough.
9042 (get_doc_string):
9043 Use SAFE_ALLOCA, not alloca.
9044 Check for overflow when converting EMACS_INT to off_t.
9045 * doprnt.c (doprnt):
9046 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9047 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9048 Don't assume uid_t fits into fixnum.
9049 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9050 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9051 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9052 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9053 (general_insert_function)
9054 (Finsert_char, make_buffer_string, make_buffer_string_both)
9055 (update_buffer_properties, Fbuffer_substring)
9056 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9057 (Fsubst_char_in_region, check_translation)
9058 (Ftranslate_region_internal, save_restriction_restore, Fformat)
9059 (transpose_markers, Ftranspose_regions):
9060 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9061 (clip_to_bounds): Move to lisp.h as an inline function).
9062 (Fconstrain_to_field): Don't assume integers are nonnegative.
9063 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9064 (Fsubst_char_in_region, Fsave_restriction):
9065 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9066 (Femacs_pid): Don't assume pid_t fits into fixnum.
9067 (lo_time): Use int, not EMACS_INT, when int suffices.
9068 (lisp_time_argument): Check for usec out of range.
9069 (Fencode_time): Don't assume fixnum fits in int.
9070 (Fuser_login_name, Fuser_full_name): Signal an error
9071 if a uid argument is out of range, rather than relying on
9072 undefined behavior.
9073 (Fformat_time_string): Remove now-unnecessary check.
9074 lisp_time_argument checks for out-of-range usec now.
9075 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9076 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9077 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9078 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9079 (init_cmdargs, Fdump_emacs):
9080 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9081 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9082 the bottom (typically) 32 bits of the fixnum.
9083 * eval.c (specpdl_size, call_debugger):
9084 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9085 (when_entered_debugger, Fbacktrace_debug):
9086 Don't assume fixnum can fit in int.
9087 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9088 the object just before a buffer; this is not portable.
9089 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9090 (grow_specpdl, unbind_to):
9091 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9092 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9093 (grow_specpdl): Simplify allocation by using xpalloc.
9094 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
9095 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9096 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9097 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9098 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9099 (a_write, e_write):
9100 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9101 (Fcopy_file, non_regular_nbytes, read_non_regular)
9102 (Finsert_file_contents):
9103 Use int, not EMACS_INT, where int is wide enough.
9104 (READ_BUF_SIZE): Verify that it fits in int.
9105 (Finsert_file_contents): Check that counts are in proper range,
9106 rather than assuming fixnums fit into ptrdiff_t etc.
9107 Don't assume fixnums fit into int.
9108 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
9109 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9110 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
9111 (string_char_to_byte, string_byte_to_char)
9112 (string_make_multibyte, string_to_multibyte)
9113 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9114 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9115 (substring_both, Fdelete, internal_equal, Ffillarray)
9116 (Fclear_string, mapcar1)
9117 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9118 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9119 (larger_vector, make_hash_table, maybe_resize_hash_table)
9120 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9121 (Fmaphash, secure_hash):
9122 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9123 (concat): Check for string index and length overflow.
9124 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9125 (Frequire):
9126 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9127 (larger_vector): New API (vec, incr_min, size_max) replaces old
9128 one (vec, new_size, init). This catches size overflow.
9129 INIT was removed because it was always Qnil.
9130 All callers changed.
9131 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9132 the upper bound on a hash table index size.
9133 (make_hash_table, maybe_resize_hash_table): Use it.
9134 (secure_hash): Computer start_byte and end_byte only after
9135 they're known to be in ptrdiff_t range.
9136 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9137 (Ffont_get_glyphs, Ffont_at):
9138 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9139 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9140 (Flist_fonts, Fopen_font):
9141 Don't assume fixnum can fit in int.
9142 (check_gstring): Don't assume index can fit in int.
9143 (font_match_p): Check that fixnum is a character, not a nonnegative
9144 fixnum, since the later code needs to stuff it into an int.
9145 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9146 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9147 conversion overflow issues.
9148 (Fopen_font): Check for integer out of range.
9149 (Ffont_get_glyphs): Don't assume index can fit in int.
9150 * font.h: Adjust decls to match defn changes elsewhere.
9151 * fontset.c (reorder_font_vector): Redo score calculation to avoid
9152 integer overflow.
9153 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9154 printmax_t, where ptrdiff_t is wide enough.
9155 (Finternal_char_font):
9156 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9157 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9158 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9159 (Fset_frame_position, x_set_frame_parameters)
9160 (x_set_line_spacing, x_set_border_width)
9161 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9162 Check that fixnums are in proper range for system types.
9163 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9164 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9165 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9166 Use SAFE_ALLOCA_LISP, not alloca.
9167 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9168 intptr_t is wide enough.
9169 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9170 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9171 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9172 Check for fixnum out of range.
9173 * ftfont.c (ftfont_list): Don't assume index fits in int.
9174 Check that fixnums are in proper range for system types.
9175 (ftfont_shape_by_flt):
9176 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9177 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9178 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9179 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
9180 Check that fixnums are in proper range for system types.
9181 * gnutls.h: Adjust decls to match defn changes elsewhere.
9182 * gtkutil.c (xg_dialog_run):
9183 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9184 (update_frame_tool_bar):
9185 Check that fixnums are in proper range for system types.
9186 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
9187 (lookup_image): Check that fixnums are in range for system types.
9188 * indent.c (last_known_column, last_known_column_point):
9189 (current_column_bol_cache):
9190 (skip_invisible, current_column, check_display_width):
9191 (check_display_width, scan_for_column, current_column_1)
9192 (Findent_to, Fcurrent_indentation, position_indentation)
9193 (indented_beyond_p, Fmove_to_column, compute_motion):
9194 (Fcompute_motion, Fvertical_motion):
9195 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9196 (last_known_column_modified): Use EMACS_INT, not int.
9197 (check_display_width):
9198 (Fcompute_motion):
9199 Check that fixnums and floats are in proper range for system types.
9200 (compute_motion): Don't assume index or fixnum fits in int.
9201 (compute_motion, Fcompute_motion):
9202 Use int, not EMACS_INT, when it is wide enough.
9203 (vmotion): Omit local var start_hpos that is always 0; that way
9204 we don't need to worry about overflow in expressions involving it.
9205 * indent.h: Adjust decls to match defn changes elsewhere.
9206 (struct position):
9207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9208 Use int, not EMACS_INT, where int is wide enough.
9209 Remove unused members ovstring_chars_done and tab_offset;
9210 all uses removed.
9211 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
9212 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
9213 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
9214 (make_gap, copy_text, insert, insert_and_inherit)
9215 (insert_before_markers, insert_before_markers_and_inherit)
9216 (insert_1, count_combining_before, count_combining_after)
9217 (insert_1_both, insert_from_string)
9218 (insert_from_string_before_markers, insert_from_string_1)
9219 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
9220 (adjust_after_replace, adjust_after_insert, replace_range)
9221 (replace_range_2, del_range, del_range_1, del_range_byte)
9222 (del_range_both, del_range_2, modify_region)
9223 (prepare_to_modify_buffer, signal_before_change)
9224 (signal_after_change, Fcombine_after_change_execute):
9225 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9226 * intervals.c (traverse_intervals, rotate_right, rotate_left)
9227 (balance_an_interval, split_interval_right, split_interval_left)
9228 (find_interval, next_interval, update_interval)
9229 (adjust_intervals_for_insertion, delete_node, delete_interval)
9230 (interval_deletion_adjustment, adjust_intervals_for_deletion)
9231 (static_offset_intervals, offset_intervals)
9232 (merge_interval_right, merge_interval_left, make_new_interval)
9233 (graft_intervals_into_buffer, temp_set_point_both)
9234 (temp_set_point, set_point, adjust_for_invis_intang)
9235 (set_point_both, move_if_not_intangible, get_property_and_range)
9236 (get_local_map, copy_intervals, copy_intervals_to_string)
9237 (compare_string_intervals, set_intervals_multibyte_1):
9238 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9239 * intervals.h: Adjust decls to match defn changes elsewhere.
9240 (struct interval):
9241 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9242 * keyboard.c (this_command_key_count, this_single_command_key_start)
9243 (before_command_key_count, before_command_echo_length, echo_now)
9244 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
9245 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
9246 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
9247 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
9248 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9249 (last_non_minibuf_size, last_point_position, echo_truncate)
9250 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
9251 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
9252 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
9253 (stuff_buffered_input):
9254 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9255 (last_auto_save, command_loop_1, read_char):
9256 Use EMACS_INT, not int, to avoid integer overflow.
9257 (record_char): Avoid overflow in total_keys computation.
9258 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
9259 * keyboard.h: Adjust decls to match defn changes elsewhere.
9260 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
9261 (Fkey_description, Fdescribe_vector, Flookup_key):
9262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9263 (click_position): New function, to check that positions are in range.
9264 (Fcurrent_active_maps):
9265 (describe_command):
9266 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9267 (Faccessible_keymaps, Fkey_description):
9268 (preferred_sequence_p):
9269 Don't assume fixnum can fit into int.
9270 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
9271 Check for integer overflow in size calculations.
9272 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
9273 avoid mishandling large integers.
9274 * lisp.h: Adjust decls to match defn changes elsewhere.
9275 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
9276 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
9277 (struct Lisp_Marker):
9278 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9279 (clip_to_bounds): Now an inline function, moved here from editfns.c.
9280 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
9281 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
9282 All callers changed.
9283 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
9284 Assume the arg has valid form, since it always does.
9285 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
9286 unsigned integer system type.
9287 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
9288 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
9289 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9290 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
9291 (duration_to_sec_usec): New decl.
9292 * lread.c (read_from_string_index, read_from_string_index_byte)
9293 (read_from_string_limit, readchar, unreadchar, openp)
9294 (read_internal_start, read1, oblookup):
9295 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9296 (Fload, readevalloop, Feval_buffer, Feval_region):
9297 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9298 (openp): Check for out-of-range argument to 'access'.
9299 (read1): Use int, not EMACS_INT, where int is wide enough.
9300 Don't assume fixnum fits into int.
9301 Fix off-by-one error that can read outside a buffer.
9302 (read_filtered_event): Use duration_to_sec_usec
9303 to do proper overflow checking on durations.
9304 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
9305 in size calculation.
9306 (Fexecute_kbd_macro):
9307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9308 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
9309 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
9310 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
9311 (set_marker_both, set_marker_restricted_both, marker_position)
9312 (marker_byte_position, Fbuffer_has_markers_at):
9313 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9314 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
9315 * menu.c (ensure_menu_items): Rename from grow_menu_items.
9316 It now merely ensures that the menu is large enough, without
9317 necessarily growing it, as this avoids some integer overflow issues.
9318 All callers changed.
9319 (keymap_panes, parse_single_submenu, Fx_popup_menu):
9320 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9321 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
9322 Use SAFE_ALLOCA_LISP, not alloca.
9323 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
9324 to EMACS_INT. Check that fixnums are in proper range for system types.
9325 * minibuf.c (minibuf_prompt_width, string_to_object)
9326 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
9327 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
9328 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9329 (get_minibuffer, read_minibuf_unwind):
9330 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9331 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9332 this simplifies overflow checking. All callers changed.
9333 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9334 (Ftest_completion):
9335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9336 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9337 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9338 Check that fixnums are in proper range for system types.
9339 (Fx_create_frame, Fx_show_tip):
9340 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9341 * nsfont.m (ns_findfonts, nsfont_list_family):
9342 Don't assume fixnum fits in long.
9343 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9344 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9345 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9346 wide enough.
9347 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9348 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9349 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9350 (PRINTDECLARE, PRINTPREPARE):
9351 (strout, print_string):
9352 (print, print_preprocess, print_check_string_charset_prop)
9353 (print_object):
9354 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9355 (PRINTDECLARE):
9356 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9357 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9358 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9359 (printchar, strout): Use xpalloc to catch size calculation overflow.
9360 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9361 (print_error_message): Use SAFE_ALLOCA, not alloca.
9362 (print_object): Use int, not EMACS_INT, where int is wide enough.
9363 (print_depth, new_backquote_output, print_number_index):
9364 Use ptrdiff_t, not int, where int might not be wide enough.
9365 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9366 (Fset_process_window_size, Fformat_network_address)
9367 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9368 (sigchld_handler):
9369 Check that fixnums are in proper range for system types.
9370 (Fsignal_process): Simplify by avoiding a goto.
9371 Check for process-ids out of pid_t range rather than relying on
9372 undefined behavior.
9373 (process_tick, update_tick): Use EMACS_INT, not int.
9374 (Fformat_network_address, read_process_output, send_process)
9375 (Fprocess_send_region, status_notify):
9376 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9377 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9378 (wait_reading_process_output, read_process_output, exec_sentinel):
9379 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9380 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9381 (Faccept_process_output): Use duration_to_sec_usec to do proper
9382 overflow checking on durations.
9383 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9384 Don't assume pid_t fits in int.
9385 * process.h (struct Lisp_Process): Members tick and update_tick
9386 are now of type EMACS_INT, not int.
9387 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9388 configured --with-wide-int.
9389 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9390 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9391 * search.c (looking_at_1, string_match_1):
9392 (fast_string_match, fast_c_string_match_ignore_case)
9393 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9394 (scan_newline, find_before_next_newline, search_command)
9395 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9396 (set_search_regs, wordify):
9397 (Freplace_match):
9398 (Fmatch_data):
9399 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9400 (string_match_1, search_buffer, set_search_regs):
9401 (Fmatch_data):
9402 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9403 (wordify): Check for overflow in size calculation.
9404 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9405 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9406 Check that fixnums are in proper range for system types.
9407 * sound.c (struct sound_device)
9408 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9410 (Fplay_sound_internal):
9411 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9412 * syntax.c (struct lisp_parse_state, find_start_modiff)
9413 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9414 (Fparse_partial_sexp):
9415 Don't assume fixnums can fit in int.
9416 (struct lisp_parse_state, find_start_pos, find_start_value)
9417 (find_start_value_byte, find_start_begv)
9418 (update_syntax_table, char_quoted, dec_bytepos)
9419 (find_defun_start, prev_char_comend_first, back_comment):
9420 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9421 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9422 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9423 (Finternal_describe_syntax_value): Check that match_lisp is a
9424 character, not an integer, since the code stuffs it into int.
9425 (scan_words, scan_sexps_forward):
9426 Check that fixnums are in proper range for system types.
9427 (Fforward_word):
9428 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9429 (scan_sexps_forward):
9430 Use CHARACTERP, not INTEGERP, since the value must fit into int.
9431 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9432 * syntax.h: Adjust decls to match defn changes elsewhere.
9433 (struct gl_state_s):
9434 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9435 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9436 MOST_POSITIVE_FIXNUM.
9437 * sysdep.c (wait_for_termination_1, wait_for_termination)
9438 (interruptible_wait_for_termination, mkdir):
9439 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9440 (emacs_read, emacs_write):
9441 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9442 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9443 and double all fit in int.
9444 * term.c (set_tty_color_mode):
9445 Check that fixnums are in proper range for system types.
9446 * termhooks.h (struct input_event):
9447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9448 * textprop.c (validate_interval_range, interval_of)
9449 (Fadd_text_properties, set_text_properties_1)
9450 (Fremove_text_properties, Fremove_list_of_text_properties)
9451 (Ftext_property_any, Ftext_property_not_all)
9452 (copy_text_properties, text_property_list, extend_property_ranges)
9453 (verify_interval_modification):
9454 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9455 (Fnext_single_char_property_change)
9456 (Fprevious_single_char_property_change):
9457 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9458 (copy_text_properties):
9459 Check for integer overflow in index calculation.
9460 * undo.c (last_boundary_position, record_point, record_insert)
9461 (record_delete, record_marker_adjustment, record_change)
9462 (record_property_change):
9463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9464 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9465 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9466 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9467 (Fx_hide_tip, Fx_file_dialog):
9468 * w32menu.c (set_frame_menubar):
9469 Use ptrdiff_t, not int, for consistency with rest of code.
9470 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9471 (select_window, Fdelete_other_windows_internal)
9472 (window_scroll_pixel_based, window_scroll_line_based)
9473 (Frecenter, Fset_window_configuration):
9474 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9475 (Fset_window_hscroll, run_window_configuration_change_hook)
9476 (set_window_buffer, temp_output_buffer_show, scroll_command)
9477 (Fscroll_other_window, Frecenter):
9478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9479 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9480 Don't assume fixnum fits in int.
9481 (Fset_window_scroll_bars):
9482 Check that fixnums are in proper range for system types.
9483 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9484 (string_pos, c_string_pos, number_of_chars, init_iterator)
9485 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9486 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9487 (compute_display_string_end, handle_face_prop)
9488 (face_before_or_after_it_pos, handle_invisible_prop)
9489 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9490 (display_prop_intangible_p, string_buffer_position_lim)
9491 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9492 (get_overlay_strings_1, get_overlay_strings)
9493 (iterate_out_of_display_property, forward_to_next_line_start)
9494 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9495 (get_next_display_element, set_iterator_to_next)
9496 (get_visually_first_element, compute_stop_pos_backwards)
9497 (handle_stop_backwards, next_element_from_buffer)
9498 (move_it_in_display_line_to, move_it_in_display_line)
9499 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9500 (add_to_log, message_dolog, message_log_check_duplicate)
9501 (message2, message2_nolog, message3, message3_nolog
9502 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9503 (current_message_1, truncate_echo_area, truncate_message_1)
9504 (set_message, set_message_1, store_mode_line_noprop)
9505 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9506 (text_outside_line_unchanged_p, check_point_in_composition)
9507 (reconsider_clip_changes)
9508 (redisplay_internal, set_cursor_from_row, try_scrolling)
9509 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9510 (redisplay_window, find_last_unchanged_at_beg_row)
9511 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9512 (trailing_whitespace_p, find_row_edges, display_line)
9513 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9514 (display_mode_element, store_mode_line_string)
9515 (pint2str, pint2hrstr, decode_mode_spec)
9516 (display_count_lines, display_string, draw_glyphs)
9517 (x_produce_glyphs, x_insert_glyphs)
9518 (rows_from_pos_range, mouse_face_from_buffer_pos)
9519 (fast_find_string_pos, mouse_face_from_string_pos)
9520 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9521 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9522 (safe_call, init_from_display_pos, handle_fontified_prop)
9523 (handle_single_display_spec, load_overlay_strings)
9524 (with_echo_area_buffer, setup_echo_area_for_printing)
9525 (display_echo_area, echo_area_display)
9526 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9527 (update_tool_bar, hscroll_window_tree, redisplay_internal)
9528 (redisplay_window, dump_glyph_row, display_mode_line)
9529 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9530 (handle_display_spec, display_prop_string_p):
9531 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9532 (handle_single_display_spec, build_desired_tool_bar_string)
9533 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9534 (get_specified_cursor_type):
9535 Check that fixnums are in proper range for system types.
9536 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9537 (Flookup_image_map):
9538 Don't assume fixnums fit in int.
9539 (compare_overlay_entries):
9540 Avoid mishandling comparisons due to subtraction overflow.
9541 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9542 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9543 (handle_tool_bar_click):
9544 Use int, not unsigned, since we prefer signed and the signedness
9545 doesn't matter here.
9546 (get_next_display_element, next_element_from_display_vector):
9547 Use int, not EMACS_INT, when int is wide enough.
9548 (start_hourglass): Use duration_to_sec_usec to do proper
9549 overflow checking on durations.
9550 * xfaces.c (Fbitmap_spec_p):
9551 Check that fixnums are in proper range for system types.
9552 (compare_fonts_by_sort_order):
9553 Avoid mishandling comparisons due to subtraction overflow.
9554 (Fx_family_fonts, realize_basic_faces):
9555 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9556 (Fx_family_fonts):
9557 Don't assume fixnum fits in int.
9558 Use SAFE_ALLOCA_LISP, not alloca.
9559 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9560 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9561 (face_at_buffer_position, face_for_overlay_string)
9562 (face_at_string_position):
9563 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9564 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9565 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9566 (Fx_show_tip):
9567 Check that fixnums are in proper range for system types.
9568 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9569 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9570 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9571 (Fx_change_window_property): Don't assume fixnums fit in int.
9572 * xfont.c (xfont_chars_supported):
9573 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9574 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9575 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9576 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9577 * xml.c (parse_region):
9578 * xrdb.c (magic_file_p):
9579 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9580 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9581 (x_get_local_selection, x_reply_selection_request)
9582 (x_handle_selection_request, wait_for_property_change):
9583 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9584 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9585 short is wide enough.
9586 (x_send_client_event): Don't assume fixnum fits in int.
9587 * xterm.c (x_x_to_emacs_modifiers):
9588 Don't assume EMACS_INT overflows nicely into int.
9589 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9590 may come from Lisp.
9591 (handle_one_xevent): NATNUMP can eval its arg twice.
9592 (x_connection_closed):
9593 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9594 * xterm.h: Adjust decls to match defn changes elsewhere.
9595 (struct scroll_bar): Use struct vectorlike_header
9596 rather than rolling our own approximation.
9597 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9598
9599 2012-05-25 Glenn Morris <rgm@gnu.org>
9600
9601 * lisp.mk (lisp): Update for more files being compiled now.
9602
9603 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9604
9605 * lread.c: Remove `read_pure' which makes no difference.
9606 (read_pure): Remove var.
9607 (unreadpure): Remove function.
9608 (readevalloop): Don't call read_list with -1 flag.
9609 (read1, read_vector): Don't test read_pure any more.
9610 (read_list): Simplify.
9611
9612 * fileio.c, character.h: Minor style tweaks.
9613
9614 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9615
9616 * window.h (clip_changed): Remove useless declaration.
9617
9618 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9619
9620 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9621 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9622
9623 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9624
9625 Remove src/m/*.
9626 This directory predates autoconf and is no longer needed nowadays.
9627 Move its few remaining bits of functionality to where they're needed.
9628 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9629 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9630 * m/template.h: Remove.
9631 * Makefile.in (M_FILE): Remove. All uses removed.
9632 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9633 * lisp.h (USE_LSB_TAG):
9634 * mem-limits.h (EXCEEDS_LISP_PTR):
9635 Use VAL_MAX, not VALBITS, in #if.
9636 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9637 (EMACS_UINT): Define unconditionally now.
9638 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9639 (BITS_PER_EMACS_INT): New constants, replacing
9640 what used to be in config.h, but not useful in #if.
9641 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9642 define them any more.
9643 (VAL_MAX): New macro.
9644 (VALMASK): Use it.
9645 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9646 BITS_PER_EMACS_INT, in #if.
9647 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9648 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9649 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9650 * s/ms-w32.h (DATA_START):
9651 Move here from removed file m/intel386.h.
9652 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9653 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9654
9655 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9656
9657 Assume C89 or later.
9658 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9659 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9660 (xrealloc):
9661 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9662 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9663 * textprop.c, tparam.c (NULL): Remove.
9664 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9665 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9666 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9667 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9668 * xterm.c (input_signal_count): Assume volatile works.
9669
9670 2012-05-21 Ken Brown <kbrown@cornell.edu>
9671
9672 * xgselect.c (xg_select): Fix first argument in call to 'select'
9673 (bug#11508).
9674
9675 2012-05-20 Ken Brown <kbrown@cornell.edu>
9676
9677 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9678 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9679
9680 2012-05-19 Ken Brown <kbrown@cornell.edu>
9681
9682 * xfns.c (x_in_use): Remove `static' qualifier.
9683 * xterm.h (x_in_use): Declare.
9684 * xgselect.c: Include xterm.h.
9685 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9686 and `display_arg' (bug#9754).
9687
9688 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9689
9690 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9691
9692 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9693 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9694
9695 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9696
9697 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9698
9699 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9700 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9701
9702 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9703 reference to image_cache->refcount.
9704 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9705
9706 2012-05-17 Juri Linkov <juri@jurta.org>
9707
9708 * search.c (Fword_search_regexp, Fword_search_backward)
9709 (Fword_search_forward, Fword_search_backward_lax)
9710 (Fword_search_forward_lax): Move functions to isearch.el
9711 (bug#10145, bug#11381).
9712
9713 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9714
9715 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9716
9717 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9718
9719 * lread.c (init_obarray): Declare Qt and Qnil as special.
9720
9721 2012-05-14 Glenn Morris <rgm@gnu.org>
9722
9723 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9724 Put "libexec" before "bin", for the sake of init_callproc_1.
9725
9726 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9727
9728 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9729
9730 * unexaix.c: Port to more-recent AIX compilers.
9731 (report_error, report_error_1, make_hdr, copy_sym)
9732 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9733 Make arguments const char *, not char *, to avoid violations of C
9734 standard and to fix some AIX warnings reported by Gilles Pion.
9735
9736 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9737
9738 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9739 already have overlays loaded.
9740 (handle_single_display_spec): Before returning without displaying
9741 fringe bitmap, synchronize the bidi iterator with the main display
9742 iterator, by calling iterate_out_of_display_property.
9743 (iterate_out_of_display_property): Detect buffer iteration by
9744 testing that it->string is a Lisp string.
9745 (get_next_display_element): When the current object is exhausted,
9746 and there's something on it->stack, call set_iterator_to_next to
9747 proceed with what's on the stack, instead of returning zero.
9748 (set_iterator_to_next): If called at the end of a Lisp string,
9749 proceed to consider_string_end without incrementing string
9750 position. Don't increment display vector index past the end of
9751 the display vector. (Bug#11417)
9752 (pos_visible_p): Don't report a position visible when move_it_to
9753 stopped at the last line of window, which happens to be scanned
9754 backwards by the bidi iteration. (Bug#11464)
9755
9756 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9757
9758 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9759 and right-margin display specs even if the spec is invalid or we
9760 are on a TTY, and thus unable to display on the fringes.
9761 That's because the text with the property will not be displayed anyway,
9762 so we need to signal to the caller that this is a "replacing"
9763 display spec. This fixes display when the spec is invalid or we
9764 are on a TTY.
9765
9766 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9767
9768 * unexaix.c (make_hdr): Fix typo in prototype.
9769 This bug broke the build on AIX. Problem reported by Gilles Pion.
9770
9771 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9772
9773 * keyboard.c (kbd_buffer_get_event): Read special events also in
9774 batch mode. (Bug#11415)
9775
9776 2012-05-12 Glenn Morris <rgm@gnu.org>
9777
9778 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9779
9780 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9781
9782 * lisp.mk (lisp): Add newcomment.elc.
9783
9784 2012-05-12 Glenn Morris <rgm@gnu.org>
9785
9786 * Makefile.in (MKDIR_P): New, set by configure.
9787 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9788
9789 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9790
9791 Remove unused function hourglass_started.
9792 * dispextern.h (hourglass_started):
9793 * w32fns.c (hourglass_started):
9794 * xdisp.c (hourglass_started): Remove.
9795
9796 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9797
9798 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9799 Update dependencies.
9800
9801 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9802
9803 * xgselect.c (xg_select): Put maxfds+1 into a var.
9804 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9805
9806 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9807
9808 2012-05-10 Dave Abrahams <dave@boostpro.com>
9809
9810 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9811 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9812
9813 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9814
9815 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9816 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9817 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9818 Initialize xd_registered_buses.
9819
9820 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9821
9822 Untag more efficiently if USE_LSB_TAG.
9823 This is based on a proposal by YAMAMOTO Mitsuharu in
9824 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9825 For an admittedly artificial (nth 8000 longlist) benchmark on
9826 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9827 Emacs's overall text size by 1%.
9828 * lisp.h (XUNTAG): New macro.
9829 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9830 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9831 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9832 * eval.c (Fautoload):
9833 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9834 * frame.h (XFRAME): Use XUNTAG.
9835
9836 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9837 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9838 Remove unportable assumptions about print widths of types like
9839 dbus_uint32_t.
9840 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9841 intptr_t when converting between pointer and integer, to avoid GCC
9842 warnings about wrong width.
9843
9844 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9845
9846 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9847 stack for each reader_thread, instead of defaulting to 8MB
9848 determined by the linker. This avoids failures in creating
9849 subprocesses on Windows 7, see the discussion in this thread:
9850 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9851
9852 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9853
9854 Fix up display of the *Minibuf-0* buffer in the mini window.
9855 * keyboard.c (read_char): Don't clear the echo area if there's no
9856 message to clear.
9857 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9858 contents of *Minibuf-0*) if there's no message displayed in its stead.
9859
9860 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9861
9862 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9863 batch mode.
9864
9865 2012-05-06 Chong Yidong <cyd@gnu.org>
9866
9867 * lisp.mk (lisp): Update.
9868
9869 2012-05-05 Jim Meyering <meyering@redhat.com>
9870
9871 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9872
9873 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9874
9875 * data.c (PUT_ERROR): New macro.
9876 (syms_of_data): Use it. Add new error type `user-error'.
9877 * undo.c (user_error): New function.
9878 (Fprimitive_undo): Use it.
9879 * print.c (print_error_message): Adjust print style for `user-error'.
9880 * keyboard.c (user_error): New function.
9881 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9882
9883 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9884
9885 Do not limit current-time-string to years 1000..9999.
9886 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9887 (Fcurrent_time_string): Support any year that is supported by the
9888 underlying localtime representation. Don't use asctime, as it
9889 has undefined behavior for years outside the range -999..9999.
9890
9891 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9892
9893 Fix race conditions involving setenv, gmtime, localtime, asctime.
9894 Without this fix, interrupts could mess up code that uses these
9895 nonreentrant functions, since setting TZ invalidates existing
9896 tm_zone or tzname values, and since most of these functions return
9897 pointers to static storage.
9898 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9899 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9900 Grow the critical sections to include not just invoking
9901 localtime/gmtime, but also accessing these functions' results
9902 including their tm_zone values if any, and any related TZ setting.
9903 (format_time_string): Last arg is now struct tm *, not struct tm **,
9904 so that the struct tm is saved in the critical section.
9905 All callers changed. Simplify allocation of initial buffer, partly
9906 motivated by the fact that memory allocation needs to be outside
9907 the critical section.
9908
9909 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9910
9911 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9912 with RESET_INTERVAL.
9913
9914 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9915 Remove duplicated buffer name initialization.
9916
9917 2012-05-02 Jim Meyering <jim@meyering.net>
9918
9919 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9920
9921 * xfns.c (x_window): Use xstrdup (Bug#11375).
9922
9923 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9924
9925 * xdisp.c (pos_visible_p): If already at a newline from the
9926 display string before the 'while' loop, don't walk back the glyphs
9927 from it3.glyph_row. Solves assertion violation when the display
9928 string begins with a newline (egg.el). (Bug#11367)
9929
9930 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9931
9932 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9933 Move to simple.el.
9934
9935 2012-05-01 Glenn Morris <rgm@gnu.org>
9936
9937 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9938 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9939 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9940 All were removed before 23.1.
9941
9942 * dispnew.c: Remove HAVE_LIBNCURSES test;
9943 it is always true on relevant platforms.
9944
9945 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9946 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9947
9948 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9949
9950 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9951
9952 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9953 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9954 Remove.
9955
9956 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9957
9958 Do not avoid creating empty evaporating overlays (Bug#9642).
9959 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9960 That is, do not delete an evaporating overlay if it becomes
9961 empty after its bounds are adjusted to fit within its buffer.
9962 This fix caused other problems, and I'm reverting it until we get
9963 to the bottom of them.
9964
9965 2012-04-27 Chong Yidong <cyd@gnu.org>
9966
9967 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9968
9969 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9970
9971 * xdisp.c (pos_visible_p): If the window start position is beyond
9972 ZV, start the display from buffer beginning. Prevents assertion
9973 violation in init_iterator when the minibuffer window is scrolled
9974 via the scroll bar.
9975
9976 * window.c (window_scroll_pixel_based): Likewise.
9977
9978 2012-04-27 Chong Yidong <cyd@gnu.org>
9979
9980 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9981
9982 2012-04-27 Glenn Morris <rgm@gnu.org>
9983
9984 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9985 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9986
9987 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9988
9989 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9990 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9991
9992 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9993
9994 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9995 display element, check also the underlying string or buffer
9996 character. (Bug#11341)
9997
9998 * w32menu.c: Include w32heap.h.
9999 (add_menu_item): If the call to AppendMenuW (via
10000 unicode_append_menu) fails, disable Unicode menus only if we are
10001 running on Windows 9X/Me.
10002
10003 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10004
10005 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10006 (xgetint): Add missing shift for LSB tags.
10007
10008 2012-04-24 Martin Rudalics <rudalics@gmx.at>
10009
10010 * keyboard.c (read_char): Don't wipe echo area for select window
10011 events: These might get delayed via `mouse-autoselect-window'
10012 (Bug#11304).
10013
10014 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
10015
10016 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10017 manipulation of :loaded-from data.
10018
10019 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
10020
10021 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10022 now a cons (bug#11311).
10023
10024 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10025
10026 Do not create empty overlays with the evaporate property (Bug#9642).
10027 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10028 if it becomes empty after its bounds are adjusted to fit within
10029 its buffer. Without this fix, in a nonempty buffer (let ((o
10030 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10031 yields an empty overlay that has the evaporate property, which is
10032 not supposed to happen.
10033
10034 Fix minor GTK3 problems found by static checking.
10035 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10036 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10037 (struct _EmacsFixedClass, emacs_fixed_get_type):
10038 Move decls here from emacsgtkfixed.h, since they needn't be public.
10039 (emacs_fixed_get_type): Now static.
10040 (emacs_fixed_class_init): Omit unused local.
10041 (emacs_fixed_child_type): Remove; unused.
10042 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10043 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10044 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10045 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10046 (EMACS_FIXED_GET_CLASS): Remove; unused.
10047 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10048
10049 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10050 Problem reported by Juanma Barranquero for Windows -Wunused-function.
10051
10052 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10053
10054 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10055 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10056 (__malloc_size_t, __malloc_ptrdiff_t):
10057 Remove. All uses removed, replaced by the definiens if needed,
10058 since we can assume C89 or better now.
10059 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10060 (protect_malloc_state, align, get_contiguous_space)
10061 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10062 (malloc_atfork_handler_child, malloc_enable_thread)
10063 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10064 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10065 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10066 (special_realloc, _realloc_internal_nolock, _realloc_internal)
10067 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10068 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10069 Define using prototypes, not old style.
10070 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10071 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10072 (align): Don't assume that signed integer overflow wraps around.
10073 Omit unused local var.
10074 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10075 (_free_internal_nolock, memalign, mallochook, reallochook):
10076 Omit no-longer-needed casts.
10077 (valloc): Use getpagesize, not __getpagesize.
10078 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10079 (struct hdr): The 'magic' member is now size_t, not unsigned long.
10080
10081 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10082
10083 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
10084
10085 Move functions from C to Lisp. Make non-blocking method calls
10086 the default. Implement further D-Bus standard interfaces.
10087
10088 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10089 (QCdbus_request_name_allow_replacement)
10090 (QCdbus_request_name_replace_existing)
10091 (QCdbus_request_name_do_not_queue)
10092 (QCdbus_request_name_reply_primary_owner)
10093 (QCdbus_request_name_reply_in_queue)
10094 (QCdbus_request_name_reply_exists)
10095 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10096 (QCdbus_registered_serial, QCdbus_registered_method)
10097 (QCdbus_registered_signal): New Lisp objects.
10098 (XD_DEBUG_MESSAGE): Use sizeof.
10099 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10100 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10101 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10102 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10103 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10104 (xd_signature, xd_append_arg): Allow float for integer types.
10105 (xd_get_connection_references): New function.
10106 (xd_get_connection_address): Rename from xd_initialize.
10107 Return cached address.
10108 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10109 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
10110 level.
10111 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
10112 Return number of refcounts.
10113 (Fdbus_get_unique_name): Make stronger parameter check.
10114 (Fdbus_message_internal): New defun.
10115 (Fdbus_call_method, Fdbus_call_method_asynchronously)
10116 (Fdbus_method_return_internal, Fdbus_method_error_internal)
10117 (Fdbus_send_signal, Fdbus_register_service)
10118 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10119 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10120 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10121 (Vdbus_compiled_version, Vdbus_runtime_version)
10122 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10123 (Vdbus_message_type_method_return, Vdbus_message_type_error)
10124 (Vdbus_message_type_signal): New defvars.
10125 (Vdbus_registered_buses, Vdbus_registered_objects_table):
10126 Adapt docstring.
10127
10128 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10129
10130 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10131 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10132 Do not assume ptrdiff_t is the same width as 'int'.
10133
10134 * alloc.c: Handle unusual debugging option combinations.
10135 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10136 since the two debugging options are incompatible.
10137 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10138 is defined.
10139 (mem_init, mem_insert, mem_insert_fixup):
10140 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10141 (NEED_MEM_INSERT): Remove; no longer needed.
10142
10143 2012-04-22 Leo Liu <sdl.web@gmail.com>
10144
10145 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10146
10147 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10148
10149 * sysdep.c [__FreeBSD__]: Minor cleanups.
10150 (list_system_processes, system_process_attributes) [__FreeBSD__]:
10151 Use Emacs indenting style more consistently. Avoid some casts.
10152 Use 'double' consistently rather than mixing 'float' and 'double'.
10153
10154 2012-04-21 Eduard Wiebe <usenet@pusto.de>
10155
10156 * sysdep.c (list_system_processes, system_process_attributes):
10157 Add implementation for FreeBSD (Bug#5243).
10158
10159 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
10160
10161 * lisp.mk (lisp): Update.
10162
10163 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
10164
10165 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10166 It is never used otherwise.
10167
10168 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
10169
10170 * print.c (print_preprocess): Only check print_depth if print-circle
10171 is nil.
10172 (print_object): Check for cycles even when print-circle is nil and
10173 print-gensym is t, but only check print_depth if print-circle is nil.
10174
10175 2012-04-20 Chong Yidong <cyd@gnu.org>
10176
10177 * process.c (wait_reading_process_output): If EIO occurs on a pty,
10178 set the status to "failed" and ensure that sentinel is run.
10179
10180 2012-04-20 Glenn Morris <rgm@gnu.org>
10181
10182 * process.c (Fset_process_inherit_coding_system_flag)
10183 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
10184 (Fmake_network_process, Fmake_serial_process): Doc fix.
10185
10186 2012-04-20 Eli Zaretskii <eliz@gnu.org>
10187
10188 * xdisp.c (string_buffer_position_lim): Limit starting position to
10189 BEGV.
10190 (set_cursor_from_row): If called for a mode-line or header-line
10191 row, return zero immediately.
10192 (try_cursor_movement): If inside continuation line, don't back up
10193 farther than the first row after the header line, if any.
10194 Don't consider the header-line row as "partially visible", even if
10195 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
10196
10197 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10198
10199 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
10200 (bug#11238).
10201
10202 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
10203 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
10204
10205 configure: new option --enable-gcc-warnings (Bug#11207)
10206 * Makefile.in (C_WARNINGS_SWITCH): Remove.
10207 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
10208 (ALL_CFLAGS): Use new macros rather than old.
10209 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
10210 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
10211 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
10212 -Wunused-result, -Wunused-variable. This should go away once
10213 the Emacs and Gnulib regex code is merged.
10214 (xmalloc, xrealloc): Now static.
10215
10216 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
10217
10218 * dired.c (Fsystem_groups): Remove unused local.
10219
10220 2012-04-17 Glenn Morris <rgm@gnu.org>
10221
10222 * dired.c (Fsystem_users): Doc fix.
10223
10224 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
10225
10226 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
10227 (syms_of_dired): Add them.
10228
10229 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
10230
10231 Fix minor alloc.c problems found by static checking.
10232 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
10233 New extern decls, to avoid calling undeclared functions.
10234 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
10235 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
10236 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
10237 (NEED_MEM_INSERT): New macro.
10238 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
10239 Remove one incorrect comment and fix another.
10240
10241 Fix minor ralloc.c problems found by static checking.
10242 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10243 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
10244 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
10245 (r_alloc_sbrk): Now static.
10246
10247 Improve ralloc.c interface checking.
10248 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10249 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
10250 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
10251 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
10252 [REL_ALLOC]: ... to here, to check interface.
10253 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
10254 Remove decls. This fixes an "It stinks!".
10255
10256 * alloc.c (which_symbols): Fix alignment issue / type clash.
10257
10258 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
10259
10260 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
10261 (struct Lisp_Misc_Any): Likewise.
10262 (struct Lisp_Free): Likewise.
10263 * alloc.c (union aligned_Lisp_Symbol): Define.
10264 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
10265 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
10266 (union aligned_Lisp_Misc): Define.
10267 (MARKER_BLOCK_SIZE, struct marker_block): Use union
10268 aligned_Lisp_Misc instead of union Lisp_Misc.
10269 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
10270
10271 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
10272
10273 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
10274 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
10275 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
10276 * s/netbsd.h, s/sol2-6.h:
10277 Remove definition of GC_MARK_STACK, since the default now works.
10278 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
10279 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
10280 no longer the default.
10281 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
10282
10283 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10284
10285 * lread.c (lisp_file_lexically_bound_p):
10286 Fix hang at ";-*-\n" (bug#11238).
10287
10288 2012-04-14 Eli Zaretskii <eliz@gnu.org>
10289
10290 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
10291 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
10292
10293 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
10294
10295 * nsterm.m (constrainFrameRect): Always constrain when there is only
10296 one screen (Bug#10962).
10297
10298 2012-04-13 Ken Brown <kbrown@cornell.edu>
10299
10300 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
10301
10302 2012-04-13 Reuben Thomas <rrt@sc3d.org>
10303
10304 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
10305
10306 2012-04-11 Daniel Colascione <dancol@dancol.org>
10307
10308 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
10309 against is gone. It's better to use vfork now so that when Cygwin
10310 gains a new, working vfork, we use it automatically (bug#10398).
10311
10312 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10313
10314 * window.c (save_window_save): Obey window-point-insertion-type.
10315
10316 2012-04-11 Glenn Morris <rgm@gnu.org>
10317
10318 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
10319
10320 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10321
10322 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
10323
10324 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
10325
10326 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
10327 (force_quit_count): New var.
10328 (handle_interrupt): Use it.
10329
10330 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
10331
10332 * w32.c (w32_delayed_load): Record the full path of the library
10333 being loaded (bug#10424).
10334
10335 2012-04-09 Glenn Morris <rgm@gnu.org>
10336
10337 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10338 not just in the obarray, before snarfing them. (Bug#11036)
10339
10340 * Makefile.in ($(leimdir)/leim-list.el):
10341 Pass EMACS rather than BUILT_EMACS.
10342
10343 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
10344
10345 * process.c (make_process):
10346 * process.h: Add integer `gnutls_handshakes_tried' member to
10347 process struct.
10348
10349 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10350 Add convenience `GNUTLS_LOG2i' macro.
10351
10352 * gnutls.c (gnutls_log_function2i): Convenience log function.
10353 (emacs_gnutls_read): Use new log functions,
10354 `gnutls_handshakes_tried' process member, and
10355 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10356 attempts per process (connection).
10357
10358 2012-04-09 Chong Yidong <cyd@gnu.org>
10359
10360 * eval.c (Fuser_variable_p, user_variable_p_eh)
10361 (lisp_indirect_variable): Functions deleted.
10362 (Fdefvar): Caller changed.
10363
10364 * callint.c (Finteractive, Fcall_interactively):
10365 * minibuf.c (Fread_variable): Callers changed.
10366
10367 2012-04-09 Eli Zaretskii <eliz@gnu.org>
10368
10369 * xdisp.c (set_cursor_from_row): If the display string appears in
10370 the buffer at position that is closer to point than the position
10371 after the display string, display the cursor on the first glyph of
10372 the display string. Fixes cursor display when a 'display' text
10373 property immediately follows invisible text. (Bug#11094)
10374
10375 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10376
10377 composite.c: use 'double' consistently
10378 * composite.c (get_composition_id): Use 'double' consistently
10379 instead of converting 'float' to 'double' and vice versa; this is
10380 easier to understand and avoids a GCC warning.
10381
10382 2012-04-09 Glenn Morris <rgm@gnu.org>
10383
10384 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10385 preparation for dumping it with emacs. (Bug#4789)
10386 (leimdir): New variable.
10387 ($(leimdir)/leim-list.el): New rule.
10388 (emacs$(EXEEXT)): Depend on leim-list.el.
10389
10390 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10391 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10392 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10393
10394 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10395
10396 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10397 proper alignment.
10398
10399 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
10400
10401 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10402 Remove unused local variable.
10403
10404 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10405
10406 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10407 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10408 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10409 objects, as mark_maybe_pointer will catch them otherwise.
10410 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10411 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10412
10413 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10414
10415 Fix typo that broke non-Windows builds.
10416 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10417
10418 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10419
10420 Support building on MS-Windows with libxml2.
10421
10422 * makefile.w32-in (OBJ2): Add xml.$(O).
10423 (GLOBAL_SOURCES): Add xml.c.
10424 ($(BLD)/xml.$(O)): New dependency list.
10425
10426 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10427 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10428 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10429 [!WINDOWSNT]: New macros.
10430 (init_libxml2_functions, libxml2_loaded_p): New functions.
10431 (parse_region): Call fn_xmlCheckVersion instead of using the macro
10432 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
10433 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10434 Calls xmlCleanupParser only if libxml2 was loaded (or statically
10435 linked in).
10436 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10437 Call init_libxml2_functions before calling libxml2 functions.
10438 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10439
10440 * emacs.c: Don't include libxml/parser.h.
10441 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10442 xmlCleanupParser directly.
10443
10444 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10445
10446 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10447
10448 * indent.c (Fvertical_motion): If there is a display string at
10449 point, use it.vpos to compute how many lines to backtrack after
10450 move_it_to point. (Bug#11133)
10451
10452 2012-04-06 Eli Zaretskii <eliz@gnu.org>
10453
10454 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10455 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10456 about subtle differences between FETCH_CHAR* and STRING_CHAR*
10457 macros related to unification of CJK characters. For the details,
10458 see the discussion following the message here:
10459 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10460
10461 2012-04-04 Chong Yidong <cyd@gnu.org>
10462
10463 * keyboard.c (Vdelayed_warnings_list): Doc fix.
10464
10465 2012-04-01 Eli Zaretskii <eliz@gnu.org>
10466
10467 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10468 instead of alloca. (Bug#11138)
10469
10470 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
10471
10472 * w32menu.c (is_simple_dialog): Properly check lisp types.
10473 (Bug#11141)
10474
10475 2012-03-31 Eli Zaretskii <eliz@gnu.org>
10476
10477 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10478 position we get to after a call to move_it_to fails the
10479 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10480 only if we wind up in a string from display property. (Bug#11063)
10481
10482 * window.c (Fdelete_other_windows_internal): Invalidate the row
10483 and column information about mouse highlight, so that redisplay
10484 restores it after reallocating the glyph matrices. (Bug#7464)
10485
10486 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10487 string comes from a `display' text property, use the buffer
10488 position of that property as if we actually saw that position in
10489 the row's glyphs.
10490 (move_it_by_lines): Remove the assertion that
10491 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10492 violated when there's a before-string at the beginning of a line.
10493 (Bug#11063)
10494
10495 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10496
10497 * xdisp.c (append_space_for_newline): If the default face was
10498 remapped, use the remapped face for the appended newline.
10499 (extend_face_to_end_of_line): Use the remapped default face for
10500 extending the face to the end of the line.
10501 (display_line): Call extend_face_to_end_of_line when the default
10502 face was remapped. (Bug#11068)
10503
10504 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10505
10506 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10507
10508 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10509
10510 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10511
10512 2012-03-27 Glenn Morris <rgm@gnu.org>
10513
10514 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10515 Doc fixes.
10516
10517 2012-03-26 Kenichi Handa <handa@m17n.org>
10518
10519 * dispextern.h (struct glyph): Fix previous change. Change the
10520 bit length of glyphless.ch to 25 (Bug#11082).
10521
10522 2012-03-26 Chong Yidong <cyd@gnu.org>
10523
10524 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10525 (command_loop_1): Use it; inhibit selection update for
10526 handle-select-window too (Bug#8996).
10527
10528 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10529
10530 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10531
10532 2012-03-25 Kenichi Handa <handa@m17n.org>
10533
10534 * dispextern.h (struct glyph): Change the bit length of
10535 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10536
10537 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10538
10539 * s/ms-w32.h (tzname): Include time.h before redirecting to
10540 _tzname. Fixes the MSVC build. (Bug#9960)
10541
10542 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10543
10544 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10545 characters.
10546
10547 * xterm.c (XTread_socket): Only modify handling_signal if
10548 !SYNC_INPUT. (Bug#11080)
10549
10550 2012-03-23 Eli Zaretskii <eliz@gnu.org>
10551
10552 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10553 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10554 when fetching a multibyte character consumes more bytes than
10555 CHAR_BYTES returns, due to unification of CJK characters in
10556 string_char. (Bug#11073)
10557
10558 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10559
10560 * process.c (wait_reading_process_output): Handle pty disconnect
10561 by refraining from sending oneself a SIGCHLD (bug#10933).
10562
10563 2012-03-22 Chong Yidong <cyd@gnu.org>
10564
10565 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10566
10567 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10568 Mark string as coming from a prefix property.
10569 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10570 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10571
10572 2012-03-21 Chong Yidong <cyd@gnu.org>
10573
10574 * xfaces.c (Vface_remapping_alist): Doc fix.
10575
10576 2012-03-20 Eli Zaretskii <eliz@gnu.org>
10577
10578 * w32proc.c (Fw32_set_console_codepage)
10579 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10580 Doc fixes.
10581
10582 2012-03-20 Chong Yidong <cyd@gnu.org>
10583
10584 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10585 to reflect default non-nil value of redisplay-dont-pause.
10586
10587 2012-03-19 Kenichi Handa <handa@m17n.org>
10588
10589 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10590 it fit in a valid range (Bug#11003).
10591
10592 2012-03-18 Eli Zaretskii <eliz@gnu.org>
10593
10594 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10595 that is not from display property, accept the row as a "cursor
10596 row" if one of the string's character has a non-nil `cursor'
10597 property. Fixes cursor positioning when there are newlines in
10598 overlay strings, e.g. in icomplete.el. (Bug#11035)
10599
10600 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10601
10602 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10603
10604 2012-03-12 Chong Yidong <cyd@gnu.org>
10605
10606 * eval.c (inhibit_lisp_code): Rename from
10607 inhibit_window_configuration_change_hook; move from window.c.
10608
10609 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10610 * window.c (run_window_configuration_change_hook)
10611 (syms_of_window): Callers changed.
10612
10613 2012-03-11 Chong Yidong <cyd@gnu.org>
10614
10615 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10616
10617 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10618
10619 2012-03-10 Chong Yidong <cyd@gnu.org>
10620
10621 * frame.c (other_visible_frames): Don't assume the selected frame
10622 is visible (Bug#10955).
10623
10624 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10625
10626 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10627
10628 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10629
10630 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10631 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10632 zero (Bug#10954).
10633
10634 2012-03-03 Glenn Morris <rgm@gnu.org>
10635
10636 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10637
10638 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10639
10640 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10641 position past the first glyph_row that ends at ZV. (Bug#10902)
10642 (redisplay_window, next_element_from_string): Fix typos in
10643 comments.
10644 (redisplay_window): Pass to move_it_vertically the margin in
10645 pixels, not in screen lines.
10646
10647 2012-03-02 Glenn Morris <rgm@gnu.org>
10648
10649 * buffer.c (buffer-list-update-hook): Doc fix.
10650
10651 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10652
10653 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10654 push_it before setting up the iterator for the first overlay
10655 string, even if we have an empty string loaded.
10656 (next_overlay_string): If there's an empty string on the iterator
10657 stack, pop the stack. (Bug#10903)
10658
10659 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10660
10661 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10662 Suggested by Stefan Monnier in
10663 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10664 * alloc.c (widen_to_Lisp_Object): New static function.
10665 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10666 and widening them to Lisp_Objects. This would work even if
10667 USE_LSB_TAG is defined and wide integers are used, which might
10668 happen in a future version of Emacs.
10669
10670 2012-02-25 Chong Yidong <cyd@gnu.org>
10671
10672 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10673 Doc fix.
10674
10675 * xselect.c (Fx_selection_exists_p): Doc fix.
10676 (x_clipboard_manager_save_all): Print an informative message
10677 before saving to clipboard manager.
10678
10679 2012-02-24 Chong Yidong <cyd@gnu.org>
10680
10681 * keyboard.c (process_special_events): Handle all X selection
10682 requests in kbd_buffer, not just the next one (Bug#8869).
10683
10684 2012-02-23 Chong Yidong <cyd@gnu.org>
10685
10686 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10687 call when setting menu-bar-lines and tool-bar-lines parameters.
10688 (unwind_create_frame_1): New helper function.
10689
10690 * window.c (inhibit_window_configuration_change_hook): New var.
10691 (run_window_configuration_change_hook): Obey it.
10692 (syms_of_window): Initialize it.
10693
10694 2012-02-22 Chong Yidong <cyd@gnu.org>
10695
10696 * xterm.c (x_draw_image_relief): Add missing type check for
10697 Vtool_bar_button_margin (Bug#10743).
10698
10699 2012-02-21 Chong Yidong <cyd@gnu.org>
10700
10701 * fileio.c (Vfile_name_handler_alist): Doc fix.
10702
10703 * buffer.c (Fget_file_buffer): Protect against invalid file
10704 handler return value.
10705
10706 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10707
10708 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10709 when computing $valmask.
10710
10711 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10712 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10713 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10714 It's useless in that case, and it can cause problems on hosts
10715 that allocate halves of EMACS_INT values separately.
10716 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10717 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10718 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10719 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10720 it avoids undefined behavior on hosts where shifting right by more
10721 than the word width has undefined behavior.
10722
10723 2012-02-19 Chong Yidong <cyd@gnu.org>
10724
10725 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10726 (Funhandled_file_name_directory, Ffile_name_as_directory)
10727 (Fdirectory_file_name, Fexpand_file_name)
10728 (Fsubstitute_in_file_name): Protect against invalid file handler
10729 return values (Bug#10845).
10730
10731 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10732
10733 * .gdbinit (pitx): Fix incorrect references to fields of the
10734 iterator stack.
10735
10736 2012-02-17 Chong Yidong <cyd@gnu.org>
10737
10738 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10739
10740 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10741
10742 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10743 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10744
10745 2012-02-15 Chong Yidong <cyd@gnu.org>
10746
10747 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10748 marked as special. Also, starting docstrings with * is obsolete.
10749
10750 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10751
10752 * gnutls.c (emacs_gnutls_write): Fix last change.
10753
10754 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10755
10756 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10757 send_process.
10758
10759 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10760
10761 * keymap.c (Fsingle_key_description): Handle char ranges.
10762
10763 2012-02-12 Chong Yidong <cyd@gnu.org>
10764
10765 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10766 as that creates a dangerous corner case.
10767
10768 * window.c (Fdelete_window_internal): Invalidate the mouse
10769 highlight (Bug#9904).
10770
10771 2012-02-12 Glenn Morris <rgm@gnu.org>
10772
10773 * xselect.c (Fx_own_selection_internal)
10774 (Fx_get_selection_internal, Fx_disown_selection_internal)
10775 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10776 * nsselect.m (Fx_own_selection_internal)
10777 (Fx_disown_selection_internal, Fx_selection_exists_p)
10778 (Fx_selection_owner_p, Fx_get_selection_internal):
10779 Sync docs and argument specs with the xselect.c versions.
10780
10781 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10782
10783 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10784
10785 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10786
10787 * w32select.c (Fx_selection_exists_p): Sync doc string and
10788 argument list with xselect.c. (Bug#10783)
10789
10790 * w16select.c (Fx_selection_exists_p): Sync doc string and
10791 argument list with xselect.c. (Bug#10783)
10792
10793 2012-02-10 Glenn Morris <rgm@gnu.org>
10794
10795 * fns.c (Fsecure_hash): Doc fix.
10796
10797 2012-02-09 Kenichi Handa <handa@m17n.org>
10798
10799 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10800
10801 2012-02-07 Chong Yidong <cyd@gnu.org>
10802
10803 * buffer.c (Fbuffer_local_variables)
10804 (buffer_lisp_local_variables): Handle unbound vars correctly;
10805 don't let Qunbound leak into Lisp.
10806
10807 2012-02-07 Glenn Morris <rgm@gnu.org>
10808
10809 * image.c (Fimagemagick_types): Doc fix.
10810
10811 * image.c (imagemagick-render-type): Change it from a lisp object
10812 to an integer. Move the doc here from the lisp manual.
10813 Treat all values not equal to 0 the same.
10814
10815 2012-02-06 Chong Yidong <cyd@gnu.org>
10816
10817 * doc.c (store_function_docstring): Avoid applying docstring of
10818 alias to base function (Bug#2603).
10819
10820 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10821
10822 * .gdbinit (pp1, pv1): Remove redundant defines.
10823 (pr): Use pp.
10824
10825 2012-02-04 Chong Yidong <cyd@gnu.org>
10826
10827 * nsterm.m: Declare a global (Bug#10694).
10828
10829 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10830
10831 * w32.c (get_emacs_configuration_options):
10832 Include --enable-checking, if specified, in the return value.
10833
10834 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10835
10836 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10837 after rounding frame sizes. (Bug#9723)
10838
10839 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10840
10841 * keyboard.c (adjust_point_for_property): Don't position point
10842 before BEGV. (Bug#10696)
10843
10844 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10845
10846 Handle overflow when computing char display width (Bug#9496).
10847 * character.c (char_width): Return EMACS_INT, not int.
10848 (char_width, c_string_width): Check for overflow when
10849 computing the width; this is possible now that individual
10850 characters can have unbounded width. Problem introduced
10851 by merge from Emacs 23 on 2012-01-19.
10852
10853 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10854
10855 * dbusbind.c (Fdbus_register_method): Mention the return value
10856 :ignore in the docstring.
10857
10858 2012-02-02 Glenn Morris <rgm@gnu.org>
10859
10860 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10861
10862 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10863 Unconditionally set to t. (Bug#10673)
10864 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10865 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10866 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10867
10868 2012-02-02 Kenichi Handa <handa@m17n.org>
10869
10870 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10871 0, do not call append_composite_glyph.
10872
10873 2012-02-02 Kenichi Handa <handa@m17n.org>
10874
10875 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10876 NULL (Bug#6988).
10877 (x_produce_glyphs): If the component of a composition is a null
10878 string, set it->pixel_width to 1 to avoid zero-width glyph.
10879
10880 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10881
10882 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10883 first 2 arguments are identical. This makes inserting large
10884 output from a subprocess an order of magnitude faster on
10885 MS-Windows, where all sbrk'ed memory is always contiguous.
10886
10887 2012-01-31 Glenn Morris <rgm@gnu.org>
10888
10889 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10890 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10891 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10892
10893 2012-01-29 Glenn Morris <rgm@gnu.org>
10894
10895 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10896
10897 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10898
10899 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10900
10901 2012-01-28 Chong Yidong <cyd@gnu.org>
10902
10903 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10904
10905 2012-01-26 Chong Yidong <cyd@gnu.org>
10906
10907 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10908
10909 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10910 repeat counts (Bug#10507).
10911
10912 2012-01-26 Glenn Morris <rgm@gnu.org>
10913
10914 * lread.c (syms_of_lread): Doc fix.
10915
10916 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10917
10918 * coding.c (encode_designation_at_bol): Change return value to
10919 EMACS_INT.
10920
10921 2012-01-25 Chong Yidong <cyd@gnu.org>
10922
10923 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10924
10925 2012-01-21 Chong Yidong <cyd@gnu.org>
10926
10927 * floatfns.c (Fcopysign): Make the second argument non-optional,
10928 since nil is not allowed anyway.
10929
10930 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10931
10932 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10933 (send_process): Likewise.
10934
10935 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10936
10937 * window.c (save_window_save, Fcurrent_window_configuration)
10938 (Vwindow_persistent_parameters): Do not use Qstate.
10939 Rewrite doc-strings.
10940
10941 2012-01-19 Kenichi Handa <handa@m17n.org>
10942
10943 * character.c (char_width): New function.
10944 (Fchar_width, c_string_width, lisp_string_width):
10945 Use char_width (Bug#9496).
10946
10947 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10948
10949 * window.c (Vwindow_persistent_parameters): New variable.
10950 (Fset_window_configuration, save_window_save): Handle persistent
10951 window parameters.
10952
10953 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10954
10955 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10956 thrashing the stack of the thread. (Bug#9087)
10957
10958 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10959
10960 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10961
10962 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10963
10964 * xdisp.c (rows_from_pos_range): Handle the case where the
10965 highlight ends on a newline. (Bug#10464)
10966 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10967 he end column for display of highlight that ends on a newline
10968 before a R2L line.
10969
10970 2012-01-11 Glenn Morris <rgm@gnu.org>
10971
10972 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10973 from load-path also when installation-directory is nil. (Bug#10208)
10974
10975 2012-01-10 Glenn Morris <rgm@gnu.org>
10976
10977 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10978
10979 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10980 Update template values to be closer to their typical values these days.
10981
10982 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10983
10984 * xdisp.c (rows_from_pos_range): Accept additional argument
10985 DISP_STRING, and accept any glyph in a row whose object is that
10986 string as eligible for mouse highlight. Fixes mouse highlight of
10987 display strings from overlays. (Bug#10464)
10988
10989 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10990
10991 emacs: fix an auto-save permissions race condition (Bug#10400)
10992 * fileio.c (auto_saving_dir_umask): New static var.
10993 (Fmake_directory_internal): Use it.
10994 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10995 creating the directory. The old code temporarily assigns
10996 too-generous permissions to the directory.
10997 (do_auto_save_eh): Clear it.
10998 (Fdo_auto_save): Catch all errors, not just file errors, so
10999 that the var is always cleared.
11000
11001 2012-01-07 Eli Zaretskii <eliz@gnu.org>
11002
11003 * search.c (scan_buffer): Pass character positions to
11004 know_region_cache, not byte positions. (Bug#6540)
11005
11006 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
11007
11008 * w32.c (sys_rename): Report EXDEV when rename of a directory
11009 fails because the target is on another logical disk. (Bug#10284)
11010
11011 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11012
11013 * xterm.c (x_embed_request_focus): New function.
11014
11015 * xterm.h: Add prototype.
11016
11017 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11018
11019 2012-01-05 Glenn Morris <rgm@gnu.org>
11020
11021 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11022
11023 2012-01-01 Eli Zaretskii <eliz@gnu.org>
11024
11025 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11026 Load gnutls_transport_set_lowat only if GnuTLS version is below
11027 2.11.1.
11028 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11029 GnuTLS versions below 2.11.1.
11030
11031 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11032
11033 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11034 to the doc string advising against its use for altering the way
11035 windows are scrolled.
11036
11037 2011-12-28 Kenichi Handa <handa@m17n.org>
11038
11039 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11040 coding-system ASCII compatible only when it does not produce BOM
11041 on encoding (Bug#10383).
11042
11043 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
11044
11045 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11046 can scroll.
11047 (create_and_show_popup_menu): Always use menu_position_func for
11048 Gtk3 (Bug#10361).
11049
11050 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
11051
11052 * callint.c (Fcall_interactively): Don't truncate prompt string.
11053
11054 2011-12-23 Eli Zaretskii <eliz@gnu.org>
11055
11056 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11057 property that ends at ZV, so that the bidi iteration could be
11058 resumed from there (after widening). (Bug#10360)
11059
11060 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
11061
11062 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11063
11064 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
11065
11066 * nsterm.m (x_free_frame_resources):
11067 Release f->output_data.ns->miniimage.
11068 (ns_index_color): Fix indentation. Do not retain
11069 color_table->colors[i].
11070
11071 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11072 before returning.
11073
11074 * nsfns.m (x_set_background_color): Assign return value from
11075 ns_index_color to face-background instead of NSColor*.
11076 (ns_implicitly_set_icon_type): Fix indentation.
11077 Change assignment in for loop to comparison.
11078
11079 * emacs.c (ns_pool): New variable.
11080 (main): Assign ns_pool.
11081 (Fkill_emacs): Call ns_release_autorelease_pool.
11082
11083 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11084 autorelease fdesc, release fdAttrs and tdict.
11085 (ns_get_covering_families): Release charset.
11086 (ns_findfonts): Release NSFontDescriptor created with new.
11087 (ns_uni_to_glyphs): Fix indentation.
11088 (setString): Release attrStr before assigning new value.
11089
11090 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11091
11092 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11093 and NS_IMPL_COCOA.
11094 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11095 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11096
11097 2011-12-18 David Reitter <reitter@cmu.edu>
11098
11099 * nsterm.m (ns_term_init): Subscribe for notifications
11100 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11101 to method trackingNotification in EmacsMenu.
11102
11103 * nsmenu.m (trackingMenu): New variable.
11104 (trackingNotification): New method (from Aquamacs).
11105 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
11106 from Aquamacs (Bug#7030).
11107
11108 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11109
11110 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11111 (symbol_to_nsstring): Fix indentation.
11112 (ns_symbol_to_pb): New function.
11113 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11114 (Fns_rotate_cut_buffers_internal): Remove.
11115 (Fns_store_selection_internal): Rename from
11116 Fns_store_cut_buffer_internal.
11117 (ns_get_foreign_selection, Fx_own_selection_internal)
11118 (Fx_disown_selection_internal, Fx_selection_exists_p)
11119 (Fns_get_selection_internal, Fns_store_selection_internal):
11120 Use ns_symbol_to_pb and check if return value is nil.
11121 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
11122 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
11123 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11124 renamed to Sns_store_selection_internal.
11125 (ns_handle_selection_request): Move code to Fx_own_selection_internal
11126 and remove this function.
11127 (ns_handle_selection_clear): Remove, never used.
11128 (Fx_own_selection_internal): Move code from ns_handle_selection_request
11129 here.
11130
11131 2011-12-17 Ken Brown <kbrown@cornell.edu>
11132
11133 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11134 GID is unknown (Bug#10257).
11135
11136 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
11137
11138 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11139 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11140 which caused a build failure on GNU/Linux IA-64. This problem was
11141 introduced by my 2011-10-07 patch.
11142
11143 2011-12-15 Juri Linkov <juri@jurta.org>
11144
11145 * image.c (imagemagick_error): New function. (Bug#10112)
11146 (imagemagick_load_image): Comment out `MagickSetResolution' call.
11147 Use `imagemagick_error' where ImageMagick functions return
11148 `MagickFalse'.
11149 (Fimagemagick_types): Add `Fnreverse' to return the list in the
11150 proper order.
11151
11152 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11153
11154 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11155 fill background (Bug#8992).
11156
11157 2011-12-13 Martin Rudalics <rudalics@gmx.at>
11158
11159 * window.c (Vwindow_combination_resize)
11160 (Vwindow_combination_limit): Use t instead of non-nil in
11161 doc-strings.
11162 (Vrecenter_redisplay): Add first sentence of doc-string on
11163 separate line.
11164 (Frecenter): Fix doc-string typo.
11165
11166 2011-12-11 Kenichi Handa <handa@m17n.org>
11167
11168 * coding.c (Funencodable_char_position): Pay attention to the
11169 buffer text relocation (Bug#9389).
11170
11171 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11172
11173 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11174 gtk_init (Bug#10100).
11175
11176 2011-12-10 Eli Zaretskii <eliz@gnu.org>
11177
11178 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
11179 IT->string is nil. (Bug#10263)
11180
11181 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11182
11183 * nsterm.h (x_free_frame_resources): Declare.
11184
11185 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
11186 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
11187
11188 * nsterm.h (ns_get_defaults_value): Declare.
11189
11190 * nsterm.m (ns_default): Call ns_get_defaults_value.
11191
11192 2011-12-09 Eli Zaretskii <eliz@gnu.org>
11193
11194 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
11195 (Bug#10170)
11196
11197 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11198
11199 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
11200 that where the value of an _OBJC_* symbol points to is in the .bss
11201 section (Bug#10240).
11202
11203 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11204
11205 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
11206 after the loop to call ccl_driver at least once (Bug#8619).
11207
11208 2011-12-08 Kenichi Handa <handa@m17n.org>
11209
11210 * ftfont.c (get_adstyle_property): Fix previous change
11211 (Bug#10233).
11212
11213 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
11214
11215 * w32.c (init_environment): If no_site_lisp, remove site-lisp
11216 dirs from the default value of EMACSLOADPATH (bug#10208).
11217
11218 2011-12-07 Glenn Morris <rgm@gnu.org>
11219
11220 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
11221 installation and source directories as well. (Bug#10208)
11222
11223 2011-12-06 Chong Yidong <cyd@gnu.org>
11224
11225 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
11226
11227 2011-12-06 Glenn Morris <rgm@gnu.org>
11228
11229 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
11230 as an error, not just -1. (Bug#10217)
11231
11232 2011-12-05 Chong Yidong <cyd@gnu.org>
11233
11234 * keyboard.c (process_special_events): New function.
11235 (swallow_events, Finput_pending_p): Use it (Bug#10195).
11236
11237 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
11238
11239 * coding.c (encode_designation_at_bol): Don't use uninitialized
11240 local variable (Bug#9318).
11241
11242 2011-12-05 Kenichi Handa <handa@m17n.org>
11243
11244 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
11245 return Qnil (Bug#8046, Bug#10193).
11246
11247 2011-12-05 Kenichi Handa <handa@m17n.org>
11248
11249 * coding.c (encode_designation_at_bol): New args charbuf_end and
11250 dst. Return the number of produced bytes. Callers changed.
11251 (coding_set_source): Return how many bytes coding->source was
11252 relocated.
11253 (coding_set_destination): Return how many bytes
11254 coding->destination was relocated.
11255 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
11256 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
11257
11258 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11259
11260 * coding.c (CODING_CHAR_CHARSET_P): New macro.
11261 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
11262 macro (Bug#9318).
11263
11264 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
11265
11266 The following changes are to fix Bug#9318.
11267
11268 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
11269 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
11270 (encode_coding_iso_2022, encode_coding_sjis)
11271 (encode_coding_big5, encode_coding_charset): Use the above macros.
11272
11273 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
11274
11275 * lisp.h (process_quit_flag): Fix external declaration.
11276
11277 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
11278
11279 Don't macro-inline non-performance-critical code.
11280 * eval.c (process_quit_flag): New function.
11281 * lisp.h (QUIT): Use it.
11282
11283 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
11284
11285 * nsfns.m (get_geometry_from_preferences): New function.
11286 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
11287
11288 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
11289
11290 * emacs.c (Qkill_emacs): Define.
11291 (syms_of_emacs): Initialize it.
11292 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
11293 Qquit_flag to `kill-emacs' instead.
11294 (quit_throw_to_read_char): Add parameter `from_signal'.
11295 All callers changed. Call Fkill_emacs if requested and safe.
11296 * lisp.h (QUIT): Call Fkill_emacs if requested.
11297
11298 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
11299
11300 * widget.c (update_wm_hints): Return if wmshell is null.
11301 (widget_update_wm_size_hints): New function.
11302
11303 * widget.h (widget_update_wm_size_hints): Declare.
11304
11305 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
11306 widget_update_wm_size_hints (Bug#10104).
11307
11308 2011-12-03 Eli Zaretskii <eliz@gnu.org>
11309
11310 * xdisp.c (handle_invisible_prop): If the invisible text ends just
11311 before a newline, prepare the bidi iterator for consuming the
11312 newline, and keep the current paragraph direction. (Bug#10183)
11313 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
11314
11315 2011-12-02 Juri Linkov <juri@jurta.org>
11316
11317 * search.c (Fword_search_regexp): New Lisp function created from
11318 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
11319 (Fword_search_backward, Fword_search_forward)
11320 (Fword_search_backward_lax, Fword_search_forward_lax):
11321 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
11322 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
11323
11324 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
11325
11326 * fileio.c (Finsert_file_contents): Move after-change-function call
11327 to before the "handled:" label, since all "goto handled" appear in
11328 cases where the *-change-functions have already been properly called
11329 (bug#10117).
11330
11331 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
11332
11333 * keyboard.c (interrupt_signal): Don't call kill-emacs when
11334 waiting for input. (Bug#10169)
11335
11336 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11337
11338 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11339 verifies glyph row's hash code--we have just reallocated the
11340 glyphs, so their contents can be complete garbage. (Bug#10164)
11341
11342 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
11343
11344 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11345
11346 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11347
11348 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11349 attributes are tested _before_ calling verify_row_hash, to protect
11350 against GCC re-ordering of the tests. (Bug#10164)
11351
11352 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
11353
11354 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11355
11356 * xterm.c (handle_one_xevent): Only set async_visible and friends
11357 if net_wm_state_hidden_seen is non-zero (Bug#10002)
11358 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11359 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11360
11361 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11362
11363 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11364 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11365 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11366 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11367 All uses changed to use GCPRO1 etc.
11368 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11369 Revert to old implementation (i.e., before 2011-03-11).
11370
11371 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11372
11373 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11374 of scroll runs so as to avoid assigning disabled bogus rows and
11375 unnecessary graphics copy operations.
11376
11377 2011-11-27 Eli Zaretskii <eliz@gnu.org>
11378
11379 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11380 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11381 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11382 (malloc, free, realloc, calloc): Redirect to e_* only when
11383 compiling Emacs.
11384
11385 * lisp.h (GCTYPEBITS): Move before first use.
11386 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11387 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11388 this macro definition.
11389
11390 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11391 _MSC_VER.
11392
11393 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11394
11395 * gtkutil.c (xg_create_frame_widgets):
11396 Call gtk_window_set_has_resize_grip (FALSE) if that function is
11397 present with Gtk+ 2.0.
11398
11399 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11400
11401 * fileio.c (Finsert_file_contents): Undo previous change; see
11402 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11403
11404 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11405
11406 Rename locals to avoid shadowing.
11407 * fileio.c (Finsert_file_contents):
11408 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11409 * process.c (wait_reading_process_output):
11410 Rename inner 'proc' to 'p' to avoid shadowing.
11411 Indent for consistency with usual Emacs style.
11412
11413 2011-11-25 Eli Zaretskii <eliz@gnu.org>
11414
11415 * xdisp.c (redisplay_window): If cursor row is not fully visible
11416 after recentering, and scroll-conservatively is set to a large
11417 number, scroll window by a few more lines to make the cursor fully
11418 visible and out of scroll-margin. (Bug#10105)
11419 (start_display): Don't move to the next line if the display should
11420 start at a newline that is part of a display vector or an overlay
11421 string. (Bug#10119)
11422
11423 2011-11-24 Juri Linkov <juri@jurta.org>
11424
11425 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11426 after the `MagickPingImage' call. (Bug#10112)
11427
11428 2011-11-23 Chong Yidong <cyd@gnu.org>
11429
11430 * window.c (Fcoordinates_in_window_p): Accept only live windows.
11431
11432 2011-11-23 Martin Rudalics <rudalics@gmx.at>
11433
11434 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11435 making another buffer current. (Bug#10114)
11436
11437 2011-11-23 Glenn Morris <rgm@gnu.org>
11438
11439 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
11440
11441 2011-11-23 Chong Yidong <cyd@gnu.org>
11442
11443 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11444 using it (Bug#5984).
11445
11446 2011-11-22 Eli Zaretskii <eliz@gnu.org>
11447
11448 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11449 and header-lines, as they don't have one computed for them.
11450 (Bug#10098)
11451
11452 * .gdbinit (prow): Make displayed values more self-explaining.
11453 Add row's hash code.
11454
11455 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
11456
11457 * process.c (wait_reading_process_output): Fix asynchrounous
11458 GnuTLS socket handling on some versions of the GnuTLS library.
11459 (wait_reading_process_output): Add comment and URL.
11460
11461 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
11462
11463 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11464
11465 2011-11-21 Chong Yidong <cyd@gnu.org>
11466
11467 * window.c (Fnext_window, Fprevious_window): Doc fix.
11468
11469 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11470
11471 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11472
11473 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11474
11475 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11476
11477 2011-11-20 Martin Rudalics <rudalics@gmx.at>
11478
11479 * window.c (Fset_window_combination_limit): Rename argument
11480 STATUS to LIMIT.
11481 (Vwindow_combination_limit): Remove "status" from doc-string.
11482
11483 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11484
11485 * m/ibms390.h: Remove.
11486 * m/ibms390x.h: Don't include "ibms390.h".
11487
11488 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11489
11490 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11491 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11492
11493 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11494
11495 * casetab.c (Fset_case_table):
11496 * charset.c (Fcharset_after): Fix typos.
11497
11498 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11499
11500 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11501 Otherwise, valgrind does not work on some platforms.
11502 Problem reported by Andreas Schwab in
11503 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11504 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11505 is set, removing the need for VIRT_ADDRESS_VARIES.
11506 (PURE_P): Use a more-efficient implementation that needs just one
11507 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11508 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11509 to 4 (xorl, subq, cmpq, setbe).
11510 * alloc.c (pure): Always extern now, since that's the
11511 VIRT_ADDR_VARIES behavior.
11512 (PURE_POINTER_P): Use a single comparison, not two, for
11513 consistency with the new puresize.h.
11514 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11515 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11516 Remove VIRT_ADDR_VARIES no longer needed.
11517
11518 2011-11-19 Eli Zaretskii <eliz@gnu.org>
11519
11520 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11521 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11522 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11523 behave as if the cursor position were at the window margin.
11524
11525 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11526 and the cursor position is out of bounds, behave as if the cursor
11527 position were at the window margin. (Bug#10075)
11528
11529 2011-11-18 Chong Yidong <cyd@gnu.org>
11530
11531 * window.c (Fwindow_combination_limit): Make first argument
11532 non-optional, since it is meaningless for live windows like the
11533 selected window.
11534
11535 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11536
11537 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11538
11539 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11540
11541 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11542 (graft_intervals_into_buffer): Simplify.
11543
11544 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11545
11546 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11547 hash values of the two rows.
11548 (copy_row_except_pointers): Preserve the used[] arrays and the
11549 hash values of the two rows. (Bug#10035)
11550 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11551
11552 * xdisp.c (row_hash): New function, body extracted from
11553 compute_line_metrics.
11554 (compute_line_metrics): Call row_hash, instead of computing the
11555 hash code inline.
11556
11557 * dispnew.c (verify_row_hash): Call row_hash for computing the
11558 hash code of a row, instead of duplicating code from xdisp.c.
11559
11560 * dispextern.h (row_hash): Add prototype.
11561
11562 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11563
11564 * frame.c (delete_frame): Don't delete the terminal when the last
11565 X frame is closed if emacs is built with GTK toolkit.
11566
11567 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
11568
11569 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11570
11571 2011-11-17 Martin Rudalics <rudalics@gmx.at>
11572
11573 * window.c (Vwindow_splits): Rename to
11574 Vwindow_combination_resize. Suggested by Juri Linkov.
11575 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11576 of Vwindow_splits.
11577
11578 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
11579
11580 * nsfns.m (Fns_font_name):
11581 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11582
11583 2011-11-16 Martin Rudalics <rudalics@gmx.at>
11584
11585 * window.h (window): Rename slot "nest" to "combination_limit".
11586 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11587 (Fset_window_nest): Rename to Fset_window_combination_limit.
11588 (Vwindow_nest): Rename to Vwindow_combination_limit.
11589 (recombine_windows, make_parent_window, make_window)
11590 (Fsplit_window_internal, saved_window)
11591 (Fset_window_configuration, save_window_save): Rename all
11592 occurrences of window_nest to window_combination_limit.
11593
11594 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
11595
11596 * image.c (imagemagick_load_image): Fix typo.
11597
11598 2011-11-14 Eli Zaretskii <eliz@gnu.org>
11599
11600 * xdisp.c (display_line): Move the call to
11601 highlight_trailing_whitespace before the call to
11602 compute_line_metrics, since the latter needs to see the final
11603 faces of all the glyphs to compute ROW's hash value.
11604 Fixes assertion violations in row_equal_p. (Bug#10035)
11605
11606 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11607
11608 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11609 just return (bug#10044).
11610
11611 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11612
11613 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11614 with user-defined heap size. Bump the default size of the temacs
11615 heap to 27MB, to avoid memory warning when running temacs.
11616 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11617
11618 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11619 current_matrix and desired_matrix. (Bug#9990)
11620 (verify_row_hash) [XASSERTS]: New function.
11621 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11622 that the hash value of glyph rows is correct.
11623
11624 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11625
11626 * window.h (window): Remove splits slot.
11627 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11628 (Fdelete_other_windows_internal, make_parent_window)
11629 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11630 (Fset_window_configuration, save_window_save): Don't deal with
11631 split status of windows.
11632 (saved_window): Remove splits slot.
11633 (Vwindow_splits): Rewrite doc-string.
11634
11635 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11636
11637 * xfns.c (unwind_create_frame):
11638 * nsfns.m (unwind_create_frame):
11639 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11640 Vframe_list (Bug#9999).
11641
11642 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11643
11644 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11645
11646 2011-11-11 Kenichi Handa <handa@m17n.org>
11647
11648 * callproc.c (Fcall_process): Set the member dst_multibyte of
11649 process_coding.
11650
11651 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11652
11653 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11654 avoid a crash (bug#9496).
11655
11656 2011-11-09 Chong Yidong <cyd@gnu.org>
11657
11658 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11659 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11660
11661 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11662
11663 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11664
11665 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11666
11667 Avoid some portability problems by eschewing 'extern inline' functions.
11668 The trivial performance wins aren't worth the portability hassles; see
11669 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11670 et seq.
11671 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11672 (window_box_width, window_box_left, window_box_left_offset)
11673 (window_box_right, window_box_right_offset): Undo previous change,
11674 by removing the "extern"s.
11675 * intervals.c (adjust_intervals_for_insertion)
11676 (adjust_intervals_for_deletion): Undo previous change,
11677 making these static again.
11678 (offset_intervals, temp_set_point_both, temp_set_point)
11679 (copy_intervals_to_string): No longer inline.
11680 * xdisp.c (window_text_bottom_y, window_box_width)
11681 (window_box_height, window_box_left_offset)
11682 (window_box_right_offset, window_box_left, window_box_right)
11683 (window_box): No longer inline.
11684
11685 2011-11-08 Chong Yidong <cyd@gnu.org>
11686
11687 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11688 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11689 Signal an error if not a live window.
11690 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11691 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11692
11693 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11694
11695 * lisp.h (syms_of_abbrev): Remove declaration.
11696 Reported by CHENG Gao <chenggao@royau.me>.
11697
11698 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11699
11700 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11701 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11702 of temacs in GUI mode.
11703
11704 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11705
11706 * window.h: Declare delete_all_child_windows instead of
11707 delete_all_subwindows.
11708 * window.c (Fwindow_nest, Fset_window_nest)
11709 (Fset_window_new_total, Fset_window_new_normal)
11710 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11711 (delete_all_subwindows): Rename to delete_all_child_windows.
11712 (Fdelete_other_windows_internal, Fset_window_configuration):
11713 Call delete_all_child_windows instead of delete_all_subwindows.
11714 * frame.c (delete_frame): Call delete_all_child_windows instead
11715 of delete_all_subwindows.
11716
11717 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11718
11719 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11720 This is also needed for porting to any host where GC_MARK_STACK is
11721 not GC_MAKE_GCPROS_NOOPS.
11722 (which_symbols): Use it.
11723
11724 2011-11-07 Kenichi Handa <handa@m17n.org>
11725
11726 * coding.c (coding_set_destination): Check coding->src_pos only
11727 when coding->src_object is a buffer (bug#9910).
11728
11729 * process.c (send_process): Set the member src_multibyte of coding
11730 to 0 (bug#9911) when sending a unibyte text.
11731
11732 * callproc.c (Fcall_process): Set the member src_multibyte of
11733 process_coding to 0 (bug#9912).
11734
11735 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11736
11737 * xmenu.c (cleanup_widget_value_tree): New function.
11738 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11739 calling free_menubar_widget_value_tree directly (Bug#9830).
11740
11741 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11742
11743 Fix some portability problems with 'inline'.
11744 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11745 (window_box_width, window_box_left, window_box_left_offset)
11746 (window_box_right, window_box_right_offset): Declare extern.
11747 Otherwise, these inline functions do not conform to C99 and
11748 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11749 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11750 * intervals.c (adjust_intervals_for_insertion)
11751 (adjust_intervals_for_deletion): Now extern, because otherwise the
11752 extern inline functions 'offset_intervals' couldn't refer to it.
11753 (static_offset_intervals): Remove.
11754 (offset_intervals): Rewrite using the old contents of
11755 static_offset_intervals. The old version didn't conform to C99
11756 because an extern inline function contained a reference to an
11757 identifier with static linkage.
11758
11759 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11760
11761 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11762 GC.
11763
11764 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11765
11766 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11767 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11768 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11769 return Qleft_to_right.
11770
11771 2011-11-06 Chong Yidong <cyd@gnu.org>
11772
11773 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11774 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11775 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11776 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11777 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11778 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11779 (Fwindow_vscroll): Doc fix.
11780 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11781 argument, since it makes no sense to pass a live window and for
11782 consistency with window-child.
11783
11784 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11785
11786 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11787 support MSVC.
11788
11789 2011-11-05 Jason Rumney <jasonr@gnu.org>
11790
11791 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11792 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11793 fonts (Bug#6029).
11794 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11795 bitwise arithmetic preventing use of unicode-sip and non-truetype
11796 opentype fonts.
11797
11798 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11799
11800 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11801 "emacs"-only part.
11802
11803 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11804 initialization code to keep similarity to xfns.c after changes
11805 from 2011-11-05.
11806
11807 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11808
11809 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11810 (unwind_create_frame): New function (Bug#9943).
11811 (Fx_create_frame): Restructure code to be more similar to the one in
11812 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11813 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11814 Move terminal->reference_count++ just before making the frame official
11815 (Bug#9943).
11816
11817 * nsterm.m (x_free_frame_resources): New function.
11818 (x_destroy_window): Move code to x_free_frame_resources.
11819
11820 * xfns.c (unwind_create_frame): Fix comment.
11821 (Fx_create_frame, x_create_tip_frame):
11822 Move terminal->reference_count++ just before making the frame
11823 official. Move initialization of image_cache_refcount and
11824 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11825
11826 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11827
11828 Support MSVC build with newer versions of Visual Studio.
11829 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11830 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11831 nt/gmake.defs.
11832
11833 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11834 which are not supported by MSVC.
11835 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11836 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11837 bitfields.
11838 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11839 types in bitfields.
11840 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11841
11842 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11843
11844 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11845
11846 Support MSVC build with newer versions of Visual Studio.
11847 * w32.c: Don't include w32api.h for MSVC.
11848 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11849
11850 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11851 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11852 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11853 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11854 e_* cousins.
11855 (alloca) [_MSC_VER]: Define to _alloca.
11856
11857 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11858
11859 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11860
11861 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11862
11863 * xdisp.c (note_mouse_highlight): If either of
11864 previous/next-single-property-change returns nil, treat that as
11865 the beginning or the end of the buffer. (Bug#9955)
11866
11867 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11868
11869 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11870 label is not null (Bug#9951).
11871 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11872 may be NULL.
11873
11874 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11875
11876 * window.c (Fwindow_body_size): Mention in the doc string that the
11877 return value is in frame's canonical units. (Bug#9949)
11878
11879 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11880
11881 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11882
11883 * w32fns.c (unwind_create_frame): If needed, free the glyph
11884 matrices of the partially constructed frame. (Bug#9943)
11885 * xfns.c (unwind_create_frame): Likewise.
11886
11887 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11888
11889 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11890 Don't stop backward scan on the continuation glyph, even though
11891 its CHARPOS is positive.
11892 (mouse_face_from_buffer_pos, note_mouse_highlight):
11893 Rename cover_string to disp_string.
11894
11895 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11896
11897 * window.c (temp_output_buffer_show): Don't use
11898 Vtemp_buffer_show_specifiers.
11899 (Vtemp_buffer_show_specifiers): Remove unused variable.
11900
11901 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11902
11903 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11904 past the beginning of the current glyph matrix.
11905
11906 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11907
11908 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11909 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11910 HAVE_GTK3 (Bug#9869).
11911
11912 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11913 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11914
11915 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11916
11917 * xterm.c: Declare x_handle_net_wm_state to return int.
11918 (handle_one_xevent): Check if we are iconified but don't have
11919 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11920 (get_current_wm_state): Return non-zero if not hidden,
11921 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11922 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11923 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11924 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11925
11926 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11927
11928 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11929 so that this new function doesn't get optimized away by a
11930 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11931
11932 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11933
11934 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11935
11936 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11937
11938 Fix the `xbytecode' command.
11939 * .gdbinit (xprintbytestr): New command.
11940 (xwhichsymbols): Rename from `which'; all callers changed.
11941 (xbytecode): Print the byte-code string as well.
11942
11943 2011-10-29 Kim Storm <storm@cua.dk>
11944
11945 * alloc.c (which_symbols): New function.
11946
11947 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11948
11949 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11950 line. (Bug#9903)
11951
11952 2011-10-29 Glenn Morris <rgm@gnu.org>
11953
11954 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11955 Not clear what it was for, and it causes various bugs. (Bug#9839)
11956
11957 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11958
11959 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11960 possible random value that matches one of those tested as
11961 condition to clear the mouse face.
11962
11963 2011-10-28 Chong Yidong <cyd@gnu.org>
11964
11965 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11966
11967 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11968
11969 * window.c (make_window): Initialize phys_cursor_on_p.
11970
11971 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11972
11973 * lisp.h (struct Lisp_Symbol): Update comments.
11974
11975 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11976
11977 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11978
11979 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11980
11981 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11982 <oslsachem@gmail.com> for helping to debug this.
11983
11984 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11985 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11986 (g_b_init_get_glyph_outline_w): New static variables.
11987 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11988 (GetGlyphOutlineW_Proc): New typedefs.
11989 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11990 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11991 New functions.
11992 (w32font_open_internal, compute_metrics):
11993 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11994 instead of calling the "wide" APIs directly.
11995
11996 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11997
11998 * w32.h (syms_of_w32font): Add prototype.
11999
12000 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12001
12002 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12003 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12004 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12005 (Fmove_to_window_line): Doc fix.
12006
12007 2011-10-27 Chong Yidong <cyd@gnu.org>
12008
12009 * process.c (make_process): Set gnutls_state to NULL.
12010
12011 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12012 non-NULL, regardless of GNUTLS_INITSTAGE.
12013 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12014 an error. Set process slots as soon as we allocate them.
12015
12016 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12017
12018 2011-10-27 Chong Yidong <cyd@gnu.org>
12019
12020 * gnutls.c (emacs_gnutls_deinit): New function.
12021 Deallocate credentials structures as well as calling gnutls_deinit.
12022 (Fgnutls_deinit, Fgnutls_boot): Use it.
12023
12024 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12025 (deactivate_process): Call emacs_gnutls_deinit.
12026
12027 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12028
12029 * image.c (x_create_x_image_and_pixmap):
12030 * w32.c (sys_rename, w32_delayed_load):
12031 * w32font.c (fill_in_logfont):
12032 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12033
12034 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
12035
12036 * w32fns.c (w32_default_color_map): New function,
12037 extracted from Fw32_default_color_map.
12038 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
12039
12040 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
12041
12042 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12043
12044 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
12045
12046 * keyboard.c (test_undefined): New function (bug#9751).
12047 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12048
12049 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
12050
12051 * sysdep.c (init_sys_modes): Fix the check for the controlling
12052 terminal (Bug#6649).
12053
12054 2011-10-20 Eli Zaretskii <eliz@gnu.org>
12055
12056 * dispextern.h (struct bidi_it): New member next_en_type.
12057
12058 * bidi.c (bidi_line_init): Initialize the next_en_type member.
12059 (bidi_resolve_explicit_1): When next_en_pos is valid for the
12060 current character, check also for next_en_type being WEAK_EN.
12061 (bidi_resolve_weak): Don't enter the expensive loop if the current
12062 position is before next_en_pos. Record the bidi type of the first
12063 non-ET, non-BN character we find, in addition to its position.
12064 (bidi_level_of_next_char): Invalidate next_en_type when
12065 next_en_pos is over-stepped.
12066
12067 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
12068
12069 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12070 * editfns.c: Rewrite current-time-zone so that it invokes
12071 the equivalent of (format-time-string "%Z") to get the time zone name.
12072 This fixes a bug when the time zone name contains characters that
12073 need converting from the system time locale to Emacs internal format.
12074 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12075 that patch fixed format-time-string to do the conversion, but
12076 I forgot to fix current-time-zone.
12077 (format_time_string): New function, containing most of
12078 what Fformat_time_string used to contain.
12079 (Fformat_time_string): Rewrite in terms of format_time_string.
12080 This doesn't change this function's behavior.
12081 (current-time-zone): Rewrite to use format_time_string.
12082 This fixes the bug reported by Michael Schierl in
12083 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12084 Jason Rumney's 2007-06-07 change worked around this bug, but
12085 didn't fix it.
12086 * systime.h (tzname, timezone): Remove no-longer-used declarations.
12087
12088 2011-10-19 Eli Zaretskii <eliz@gnu.org>
12089
12090 * xdisp.c (start_display): If the character at POS is displayed
12091 via a display vector, reset IT->current.dpvec_index to zero.
12092 (try_window_reusing_current_matrix): If a line ends in a display
12093 vector or the next line starts in a display vector, continue
12094 redrawing the window even though the character position of
12095 start_row was reached.
12096 (Bug#9771, part 2)
12097
12098 2011-10-18 Chong Yidong <cyd@gnu.org>
12099
12100 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12101 with nobreak-char-display too.
12102
12103 2011-10-18 Eli Zaretskii <eliz@gnu.org>
12104
12105 Fix part 3 of bug#9771.
12106 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12107 (bidi_resolve_neutral): Don't enter the expensive loop looking for
12108 non-neutral characters if the current character is a paragraph
12109 separator (a.k.a. Newline). This avoids running the same
12110 expensive loop twice, once when we consume the preceding newline
12111 and the other time when the line actually needs to be displayed.
12112 Avoid the loop when we see neutrals on the base embedding level
12113 following a character whose directionality is the same as the
12114 paragraph's. This avoids running the expensive loop when a line
12115 ends in a long sequence of neutrals, like control characters.
12116 Add assertion against STRONG_AL type. Slightly rearrange code
12117 that determines the type of a neutral given the first non-neutral
12118 that follows it.
12119 (bidi_level_of_next_char): Set next_en_pos to zero when
12120 invalidating its info.
12121
12122 2011-10-17 Eli Zaretskii <eliz@gnu.org>
12123
12124 * xdisp.c (push_display_prop): Determine whether to record string
12125 or buffer position by IT->string, not by IT->method. Allow
12126 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
12127 (move_it_vertically_backward): Don't look for character position
12128 immediately after the newline when in a continuation line.
12129 (Bug#9771, part 1)
12130
12131 2011-10-15 Martin Rudalics <rudalics@gmx.at>
12132
12133 * window.c (coordinates_in_window): Rewrite and delabelize
12134 vertical border check. (Bug#5357) (Bug#9618)
12135
12136 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
12137
12138 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12139 errors in XSetWindowBorder (bug#9310).
12140
12141 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
12142
12143 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12144 avoid crash when xmalloc overrun checking is enabled.
12145
12146 2011-10-13 Eli Zaretskii <eliz@gnu.org>
12147
12148 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12149 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
12150 cursor motion with <left> and <right> arrow keys.
12151
12152 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12153 some callers set that themselves.
12154
12155 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12156
12157 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12158 display string and the previous row comes from the same string and
12159 is empty. (Bug#9739) (Bug#9738)
12160
12161 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
12162
12163 * doc.c (get_doc_string): Encode file name (bug#9735).
12164
12165 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12166
12167 * bidi.c (bidi_level_of_next_char):
12168 * xdisp.c (get_visually_first_element): Remove old incorrect
12169 comments regarding the Unicode Line Separator character.
12170
12171 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12172
12173 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
12174
12175 * alloc.c (Fgc_status): Do not access beyond zombies array
12176 boundary if nzombies > MAX_ZOMBIES.
12177 * alloc.c (dump_zombies): Add missing format specifier.
12178
12179 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
12180
12181 * xdisp.c (set_cursor_from_row): Simplify conditionals,
12182 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
12183
12184 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
12185 Some packages use them to denote characters with modifiers.
12186
12187 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
12188
12189 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
12190 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
12191 matching a pp-number. Rename parameter var to var1.
12192
12193 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
12194
12195 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
12196
12197 2011-10-08 Glenn Morris <rgm@gnu.org>
12198
12199 * callint.c (Fcall_interactively): Give a more explicit error for the
12200 'c' case with a non-character input. (Bug#8479)
12201
12202 2011-10-08 Eli Zaretskii <eliz@gnu.org>
12203
12204 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
12205 lines.
12206 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
12207 lines that are hscrolled on the left.
12208
12209 * dispnew.c (buffer_posn_from_coords): Account for a possible
12210 presence of header-line. (Bug#4426)
12211
12212 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
12213
12214 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
12215 Don't advertise functionality which we discourage or doesn't work.
12216
12217 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
12218
12219 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
12220 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
12221 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
12222 this makes Emacs dump core during garbage collection on rare
12223 occasions. sizeof is obviously inferior to offsetof here, so
12224 stick with offsetof.
12225 (GC_POINTER_ALIGNMENT): New macro.
12226 (mark_memory): Omit 3rd (offset) arg; caller changed.
12227 Don't assume EMACS_INT alignment is the same as pointer alignment.
12228
12229 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
12230
12231 * keyboard.c (read_key_sequence_remapped): New var.
12232 (read_key_sequence): Compute remapping in the right buffer.
12233 (command_loop_1): Use read_key_sequence's remapping directly.
12234
12235 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
12236
12237 * dired.c (file_name_completion): Don't expand file name.
12238 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
12239 before checking file name handler.
12240
12241 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
12242 they've been requested explicitly (bug#9591).
12243
12244 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
12245
12246 * keymap.c (Fsingle_key_description): Use make_specified_string
12247 instead of build_string to build string from push_key_description.
12248 (Bug#5193)
12249
12250 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12251
12252 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
12253 This fixes a Y2038 bug on 64-bit hosts.
12254 * buffer.c (reset_buffer):
12255 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
12256 (Fclear_buffer_auto_save_failure):
12257 Use 0, not -1, to represent an unset failure time, since time_t
12258 might not be signed.
12259
12260 Remove dependency on glibc malloc internals.
12261 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12262 Move back here from lisp.h, but with their new implementations.
12263 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12264 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
12265 * charset.c (charset_table_init): New static var.
12266 (syms_of_charset): Use it instead of xmalloc. This removes a
12267 dependency on glibc malloc internals. See Eli Zaretskii's comment in
12268 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
12269 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12270 Move back to alloc.c.
12271 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12272 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
12273
12274 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
12275
12276 * nsterm.m (windowDidResize): Call x_set_window_size only when
12277 ns_in_resize is true. Otherwise set pixelwidth/height and
12278 call change_frame_size (Bug#9628).
12279
12280 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12281
12282 Port --enable-checking=all to Fedora 14 x86-64.
12283 * charset.c (syms_of_charset): Also account for glibc malloc's
12284 internal overhead when calculating the initial malloc maximum.
12285
12286 Port --enable-checking=all to Fedora 14 x86.
12287 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12288 Move to lisp.h.
12289 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
12290 (overrun_check_realloc, overrun_check_free):
12291 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
12292 That way, xmalloc returns a properly-aligned pointer even if
12293 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
12294 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
12295 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
12296 into account when calculating the initial malloc maximum.
12297 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12298 Move here from alloc.c, so that charset.c can use it too.
12299 Properly align; the old code wasn't right for common 32-bit hosts
12300 when configured with --enable-checking=all.
12301 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12302 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
12303
12304 2011-09-29 Eli Zaretskii <eliz@gnu.org>
12305
12306 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
12307 use EDOM.
12308
12309 2011-09-28 Eli Zaretskii <eliz@gnu.org>
12310
12311 * xdisp.c (compute_display_string_end): If there's no display
12312 string at CHARPOS, return -1.
12313
12314 * bidi.c (bidi_fetch_char): When compute_display_string_end
12315 returns a negative value, treat the character as a normal
12316 character not covered by a display string. (Bug#9624)
12317
12318 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
12319
12320 * lread.c (Fread_from_string): Fix typo in docstring.
12321
12322 2011-09-27 Eli Zaretskii <eliz@gnu.org>
12323
12324 * xdisp.c (handle_invisible_prop): If invisible text ends on a
12325 newline, reseat the iterator instead of bidi-iterating there one
12326 character at a time. (Bug#9610)
12327 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
12328 TO_CHARPOS if the bidi iterator is at base embedding level.
12329
12330 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
12331
12332 * lread.c (readevalloop): Use correct code for NBSP.
12333 (read1): Likewise. (Bug#9608)
12334
12335 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
12336
12337 * dbusbind.c (Fdbus_register_signal): When service is not
12338 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
12339
12340 2011-09-25 Glenn Morris <rgm@gnu.org>
12341
12342 * buffer.c (truncate-lines): Doc fix.
12343
12344 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
12345
12346 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12347 (Fset_window_next_buffers): Doc fix.
12348
12349 2011-09-24 Glenn Morris <rgm@gnu.org>
12350
12351 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
12352
12353 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
12354
12355 Fix minor problems found by static checking.
12356 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12357 * indent.c (Fvertical_motion): Fix == vs = typo.
12358
12359 2011-09-24 Eli Zaretskii <eliz@gnu.org>
12360
12361 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12362 Default value is now t. Doc fix.
12363
12364 * indent.c (Fvertical_motion): Compute and apply the overshoot
12365 logic when moving up, not only when moving down. Fix the
12366 confusing name and values of the it_overshoot_expected variable;
12367 logic changes accordingly. (Bug#9254) (Bug#9549)
12368
12369 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12370 CHARPOS is covered by a display string which includes newlines.
12371 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12372 is covered by a display string with embedded newlines.
12373
12374 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
12375
12376 * dbusbind.c (Fdbus_register_signal): Add match rule to
12377 Vdbus_registered_objects_table. (Bug#9581)
12378 (Fdbus_register_method, Vdbus_registered_objects_table):
12379 Fix docstring.
12380
12381 2011-09-24 Jim Meyering <meyering@redhat.com>
12382
12383 do not ignore write error for any output size
12384 The previous change was incomplete.
12385 While it makes emacs --batch detect the vast majority of stdout
12386 write failures, errors were still ignored whenever the output size is
12387 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12388 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12389 && echo FAIL: ignored write error
12390 FAIL: ignored write error
12391 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12392 && echo FAIL: ignored write error
12393 FAIL: ignored write error
12394 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12395
12396 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12397
12398 * emacs.c (Fkill_emacs): In noninteractive mode exit
12399 non-successfully if a write error occurred on stdout. (Bug#9574)
12400
12401 2011-09-21 Eli Zaretskii <eliz@gnu.org>
12402
12403 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12404 the xassert test.
12405
12406 * dispextern.h (struct it): Update the comment documenting what
12407 can it->OBJECT be.
12408
12409 2011-09-20 Eli Zaretskii <eliz@gnu.org>
12410
12411 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12412 a display string, extend search for cursor position to end of row.
12413 (find_row_edges): If the row ends in a newline from a display
12414 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12415 Handle the case of a display string with multiple newlines.
12416 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12417 non-empty line. Fixes confusing cursor motion with arrow keys at
12418 the beginning of a line that starts with whitespace.
12419
12420 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12421
12422 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12423 (bug#9493).
12424
12425 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
12426
12427 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12428 boolean (Bug#9154).
12429
12430 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12431
12432 * xdisp.c (display_line): Record maximum and minimum buffer
12433 positions even if no glyphs were produced (e.g., by a zero-width
12434 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
12435 buffer positions that will be removed from the glyph row because
12436 they don't fit.
12437 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12438 column is beyond frame width: don't subtract 1 "pixel" when
12439 computing width of the stretch.
12440 (reseat_at_next_visible_line_start): Undo the change made on
12441 2011-09-17 that saved paragraph information and restored it after
12442 the call to `reseat'. (Bug#9545)
12443
12444 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12445
12446 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12447 and turn window cursor on if cleared (Bug#9415).
12448
12449 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
12450
12451 * search.c (boyer_moore): Take unibyte characters from pattern
12452 literally. (Bug#9458)
12453
12454 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12455
12456 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12457
12458 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
12459
12460 Fix minor problem found by static checking.
12461 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12462 initialized, to pacify gcc -Wuninitialized.
12463
12464 * fileio.c: Report proper errno when syscall falls.
12465 (Finsert_file_contents): Save and restore errno,
12466 so that report_file_error outputs the correct diagnostic.
12467 (Fwrite_region) [CLASH_DETECTION]: Likewise.
12468
12469 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12470
12471 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12472
12473 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12474
12475 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12476 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
12477
12478 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12479
12480 * xdisp.c (reseat_at_next_visible_line_start): Keep information
12481 about the current paragraph and restore it after the call to reseat.
12482
12483 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12484 (bidi_find_paragraph_start): Search back for paragraph beginning
12485 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12486 (bidi_move_to_visually_next): Only trigger paragraph-related
12487 computations when the last character is a newline or at EOB, not
12488 just any NEUTRAL_B. (Bug#9470)
12489
12490 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12491 truncated lines if point is covered by a display string. (Bug#9524)
12492
12493 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12494
12495 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12496 (cons_to_x_long): New function.
12497 (lisp_data_to_selection_data): Use it. Correct the test for
12498 short-versus-long data; it was negated. Break out of vector
12499 loop, for efficiency, when a long datum is discovered.
12500
12501 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12502
12503 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12504
12505 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12506
12507 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12508 GCC PR/17406) by declaring this function with external scope.
12509
12510 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12511
12512 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12513 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12514
12515 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12516
12517 * editfns.c (Fformat): Correctly handle text properties on "%%".
12518
12519 2011-09-15 Eli Zaretskii <eliz@gnu.org>
12520
12521 * xterm.c (x_draw_composite_glyph_string_foreground):
12522 * w32term.c (x_draw_composite_glyph_string_foreground):
12523 * term.c (encode_terminal_code):
12524 * composite.c (composition_update_it, get_composition_id):
12525 * xdisp.c (get_next_display_element)
12526 (fill_composite_glyph_string): Add comments about special meaning
12527 of TAB characters in a composition.
12528
12529 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12530
12531 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12532 This occurs when processing a multibyte format.
12533 Problem reported by Wolfgang Jenker.
12534
12535 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12536
12537 * xdisp.c (try_cursor_movement): Only check for exact match if
12538 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12539
12540 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12541
12542 Remove unused external symbols.
12543 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12544 * xdisp.c (calc_pixel_width_or_height): Now static.
12545 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12546 * indent.c (check_display_width):
12547 * w32term.c: Fix comment to match code.
12548 * xterm.c, xterm.h (x_catching_errors): Remove.
12549
12550 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12551
12552 * xselect.c: Use signed conversions more consistently (Bug#9498).
12553 (selection_data_to_lisp_data): Assume incoming selection data are
12554 signed integers, not unsigned. This is to be consistent with
12555 outgoing selection data, which was modified to use signed integers
12556 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12557 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12558 expects long, not unsigned long.
12559
12560 2011-09-14 Eli Zaretskii <eliz@gnu.org>
12561
12562 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12563 computation of loop end. Reported by Johan Bockgård
12564 <bojohan@gnu.org>.
12565
12566 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
12567
12568 * frame.c (Fother_visible_frames_p): Function deleted.
12569
12570 2011-09-12 Eli Zaretskii <eliz@gnu.org>
12571
12572 * indent.c (compute_motion): Process display vector front to back
12573 rather than the other way around. (Bug#2496)
12574
12575 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12576
12577 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12578
12579 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
12580
12581 * minibuf.c (Fread_from_minibuffer): Doc fix.
12582
12583 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12584
12585 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12586 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12587
12588 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12589
12590 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12591 value for non-existent files.
12592
12593 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12594
12595 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12596 set its "size" to -1. This will set the modtime_size field of
12597 the corresponding buffer to -1, which is what
12598 verify-visited-file-modtime expects for files that do not exist.
12599 (Bug#9139)
12600
12601 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12602
12603 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12604 here ...
12605 * lisp.h: ... from here. push_key_description is no longer
12606 defined in keyboard.c, so its declaration should not be in
12607 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12608 logically belongs with push_key_description.
12609
12610 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12611
12612 * buffer.h: Include <sys/types.h> instead of <time.h>.
12613 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12614 Problem reported by Herbert J. Skuhra.
12615
12616 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12617
12618 * xml.c (parse_region): Make the parsing work for
12619 non-comment-starting XML files again (bug#9144).
12620
12621 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12622
12623 * image.c (gif_load): Fix calculation of bottom and right corner.
12624 (Bug#9468)
12625
12626 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12627
12628 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12629 redisplay in small windows.
12630
12631 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12632
12633 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12634
12635 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12636
12637 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12638 Operate on live windows only.
12639
12640 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12641
12642 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12643
12644 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12645
12646 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12647 only under bidi iteration.
12648
12649 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12650
12651 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12652
12653 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12654
12655 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12656 Without this fix, the command to link temacs failed due to an
12657 undefined symbol __builtin_isnan. This is because
12658 /usr/include/iso/math_c99.h #defines isnan(x) to
12659 __builtin_isnan(x), but the bundled gcc, which identifies itself
12660 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12661 a __builtin_isnan.
12662 * floatfns.c (isnan): #undef, and then #define to a clone of
12663 what's in data.c.
12664 (Fisnan): Always define, since it's always available now.
12665 (syms_of_floatfns): Always define isnan at the Lisp level.
12666
12667 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12668
12669 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12670
12671 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12672
12673 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12674 The previous code assumed that file offsets (off_t values) fit in
12675 EMACS_INT variables, which is not true on typical 32-bit hosts.
12676 The code messed up by falsely reporting buffer overflow in cases
12677 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12678 when "big" contains more than 2**29 bytes, even though this
12679 inserts just one byte and does not overflow the buffer.
12680 (Finsert_file_contents): Store file offsets as off_t
12681 values, not as EMACS_INT values. Check for overflow when
12682 converting between EMACS_INT and off_t. When checking for
12683 buffer overflow or for overlap, take the offsets into account.
12684 Don't use EMACS_INT for small values where int suffices.
12685 When checking for overlap, fix a typo: ZV was used where
12686 ZV_BYTE was intended.
12687 (Fwrite_region): Don't assume off_t fits into 'long'.
12688 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12689
12690 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12691
12692 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12693
12694 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12695
12696 sprintf-related integer and memory overflow issues (Bug#9412).
12697
12698 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12699 (esprintf, exprintf, evxprintf): New functions.
12700 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12701 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12702 (modify_event_symbol): Do not assume that the length of
12703 name_alist_or_stem is safe to alloca and fits in int.
12704 (Fexecute_extended_command): Likewise for function name and binding.
12705 (Frecursion_depth): Wrap around reliably on integer overflow.
12706 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12707 since some callers pass EMACS_INT values.
12708 (Fsingle_key_description): Don't crash if symbol name contains more
12709 than MAX_ALLOCA bytes.
12710 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12711 (get_minibuffer): Arg is now EMACS_INT, not int.
12712 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12713 (esprintf, exprintf, evxprintf): New decls.
12714 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12715
12716 * dbusbind.c (signature_cat): New function.
12717 (xd_signature, Fdbus_register_signal):
12718 Do not overrun buffer; instead, report string overflow.
12719
12720 * dispnew.c (add_window_display_history): Don't overrun buffer.
12721 Truncate instead; this is OK since it's just a log.
12722
12723 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12724 even if the time zone offset is outlandishly large.
12725 Don't mishandle offset == INT_MIN.
12726
12727 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12728 when creating daemon; the previous buffer-overflow check was incorrect.
12729
12730 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12731 which has the guts of the old verror function.
12732
12733 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12734 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12735
12736 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12737 (font_unparse_xlfd): Don't blindly alloca long strings.
12738 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12739 fits in int, when using sprintf. Use single snprintf to count
12740 length of string rather than counting it via multiple sprintfs;
12741 that's simpler and more reliable.
12742 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12743 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12744 sprintf, in case result does not fit in int.
12745
12746 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12747 (fontset_from_font): Print it.
12748
12749 * frame.c (tty_frame_count): Now printmax_t, not int.
12750 (make_terminal_frame, set_term_frame_name): Print it.
12751 (x_report_frame_params): In X, window IDs are unsigned long,
12752 not signed long, so print them as unsigned.
12753 (validate_x_resource_name): Check for implausibly long names,
12754 and don't assume name length fits in 'int'.
12755 (x_get_resource_string): Don't blindly alloca invocation name;
12756 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12757 not fit in int.
12758
12759 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12760 (xg_check_special_colors, xg_set_geometry):
12761 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12762
12763 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12764 Use esprintf, not sprintf, in case result does not fit in int.
12765
12766 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12767 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12768 it as a large positive number.
12769 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12770 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12771
12772 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12773 in case result does not fit in int.
12774
12775 * print.c (float_to_string): Detect width overflow more reliably.
12776 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12777 buffer overrun. Don't assume list length fits in 'int'. Treat
12778 print length of 0 as 0, not as infinity; to be consistent with other
12779 uses of print length in this function. Don't overflow print length
12780 index. Don't assume hash table size fits in 'long', or that
12781 vectorlike size fits in 'unsigned long'.
12782
12783 * process.c (make_process): Use printmax_t, not int, to format
12784 process-name gensyms.
12785
12786 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12787
12788 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12789 to avoid potential buffer overrun.
12790
12791 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12792 if X resource line is longer than 512 bytes.
12793
12794 * xfns.c (x_window): Make sprintf buffer a bit bigger
12795 to avoid potential buffer overrun.
12796
12797 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12798
12799 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12800
12801 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12802
12803 Integer overflow fixes for scrolling, etc.
12804 Without these, Emacs silently mishandles large integers sometimes.
12805 For example, "C-u 4294967297 M-x recenter" was treated as if
12806 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12807
12808 * xdisp.c (try_window_id): Check Emacs fixnum range before
12809 converting to 'int'.
12810
12811 * window.c (window_scroll_line_based, Frecenter):
12812 Check that an Emacs fixnum is in range before assigning it to 'int'.
12813 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12814 values converted from Emacs fixnums.
12815 (Frecenter): Don't wrap around a line count if it is out of 'int'
12816 range; instead, treat it as an extreme value.
12817 (Fset_window_configuration, compare_window_configurations):
12818 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12819
12820 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12821 that can exceed INT_MAX. Check that EMACS_INT value is in range
12822 before assigning it to the (possibly-narrower) index.
12823 (match_limit): Don't assume that a fixnum can fit in 'int'.
12824
12825 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12826 exceed INT_MAX.
12827
12828 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12829 (Fvertical_motion): Don't wrap around LINES values that don't fit
12830 in 'int'. Instead, treat them as extreme values. This is good
12831 enough for windows, which can't have more than INT_MAX lines anyway.
12832
12833 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12834
12835 * Require libxml/parser.h to avoid compilation warning.
12836
12837 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12838
12839 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12840 since this reportedly can destroy thread storage.
12841
12842 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12843
12844 * syntax.c (find_defun_start): Update all cache variables if
12845 exiting early (Bug#9401).
12846
12847 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12848
12849 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12850
12851 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12852 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12853 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12854
12855 * term.c (tty_append_glyph): New function.
12856 (produce_stretch_glyph): Static function and its prototype deleted.
12857
12858 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12859 Add prototypes.
12860
12861 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12862
12863 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12864 when checking :margin (Bug#9390).
12865 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12866 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12867 so that the name doesn't mislead. All uses changed.
12868
12869 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12870
12871 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12872 set_tty_hooks.
12873
12874 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12875
12876 * xdisp.c (move_it_to): Don't bail out early when reaching
12877 position beyond to_charpos, if we are scanning backwards.
12878 (move_it_vertically_backward): When DY == 0, make sure we get to
12879 the first character in the line after the newline.
12880
12881 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12882
12883 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12884 (ccl_driver): Do not generate an out-of-range pointer.
12885 (Fccl_execute_on_string): Remove unnecessary check for
12886 integer overflow, noted by Stefan Monnier in
12887 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12888 Remove a FIXME that didn't need fixing.
12889 Simplify the newly-introduced buffer reallocation code.
12890
12891 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12892
12893 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12894
12895 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12896
12897 Integer and memory overflow issues (Bug#9196).
12898
12899 * doc.c (get_doc_string): Rework so that
12900 get_doc_string_buffer_size is the actual buffer size, rather than
12901 being 1 less than the actual buffer size; this makes xpalloc more
12902 convenient.
12903
12904 * image.c (x_allocate_bitmap_record, cache_image):
12905 * xselect.c (Fx_register_dnd_atom):
12906 Simplify previous changes by using xpalloc.
12907
12908 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12909 since either will do and ptrdiff_t is convenient with xpalloc.
12910
12911 * charset.c (charset_table_size)
12912 (struct charset_sort_data.priority): Now ptrdiff_t.
12913 (charset_compare): Don't overflow if priorities differ greatly.
12914 (Fsort_charsets): Don't assume list length fits in int.
12915 Check for size-calculation overflow when allocating sort data.
12916 (syms_of_charset): Allocate an initial charset table that is
12917 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12918
12919 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12920
12921 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12922 The actual value is always <= INT_MAX, and leaving it unsigned made
12923 overflow checking harder.
12924
12925 * dispextern.h (struct glyph_matrix.rows_allocated)
12926 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12927 with xpalloc. The values are still always <= INT_MAX.
12928
12929 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12930
12931 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12932 (SAFE_NALLOCA): New macro.
12933
12934 * region-cache.c (struct boundary.pos, find_cache_boundary)
12935 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12936 (set_cache_region, invalidate_region_cache)
12937 (revalidate_region_cache, know_region_cache, region_cache_forward)
12938 (region_cache_backward, pp_cache):
12939 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12940 so that ptrdiff_t * can be passed to xpalloc.
12941 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12942 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12943 (pp_cache): Don't assume cache_len fits in int.
12944 * region-cache.h: Adjust extern decls to match.
12945
12946 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12947 EMACS_INT, since either will do, for xpalloc.
12948
12949 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12950 (xnmalloc, xnrealloc, xpalloc): New functions.
12951
12952 * bidi.c (bidi_shelve_header_size): New constant.
12953 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12954 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12955
12956 * bidi.c (bidi_cache_shrink):
12957 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12958 (overlay_strings):
12959 Don't update size of array until after memory allocation succeeds,
12960 because xmalloc/xrealloc may not return.
12961 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12962 now that we have proper integer overflow checking.
12963 (record_overlay_string, overlay_strings): Catch overflows when
12964 calculating size of overlay_str_buf.
12965
12966 * callproc.c (Fcall_process): Check for size overflow when
12967 calculating size of args2.
12968 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12969 Normally we prefer signed values, but sticking with ptrdiff_t would
12970 require adding more-complicated checks.
12971
12972 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12973 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12974 Redo buffer-overflow calculations to avoid integer overflow.
12975 Add a FIXME comment where memory seems to be over-allocated.
12976
12977 * character.c (Fstring): Check for size-calculation overflow.
12978
12979 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12980 unnecessary integer overflow. Check for size overflow.
12981 (encode_coding_object): Don't update size until xmalloc succeeds.
12982
12983 * composite.c (get_composition_id): Check for overflow in glyph
12984 length calculations.
12985
12986 Integer and memory overflow fixes for display code.
12987 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12988 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12989 (scrolling_window): Check for overflow in size calculations.
12990 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12991 Don't assume glyph table len fits in int.
12992 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12993 (row_table_size): Now ptrdiff_t, not int.
12994 (scrolling_window): Avoid overflow in size calculations.
12995 Don't update size until allocation succeeds.
12996 * fns.c (concat): Check for overflow in size calculations.
12997 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12998 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12999 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13000
13001 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13002 (get_doc_string): Check for size calculation overflow.
13003 Don't update size until allocation succeeds.
13004 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13005 EMACS_INT, where ptrdiff_t will do.
13006 (Fsubstitute_command_keys): Check for string overflow.
13007
13008 * editfns.c (set_time_zone_rule): Don't assume environment length
13009 fits in int.
13010 (message_length): Now ptrdiff_t, not int.
13011 (Fmessage_box): Don't update size until allocation succeeds.
13012 Don't assume message length fits in int.
13013 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13014
13015 * emacs.c (main): Do not reallocate argv, since there is a null at
13016 the end that can be overwritten, and this way there's no need to
13017 worry about size-calculation overflow.
13018 (sort_args): Check for size-calculation overflow.
13019
13020 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13021 alloc succeeds.
13022 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13023
13024 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13025 (x_set_scroll_bar_width, x_figure_window_size):
13026 Check for integer overflow.
13027 (x_set_alpha): Do not assume XINT fits in int.
13028
13029 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13030 This is for the members text_lines, text_cols, total_lines, total_cols,
13031 where the system imposes an 'int' limit.
13032
13033 * fringe.c (Fdefine_fringe_bitmap):
13034 Don't update size until alloc works.
13035
13036 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13037 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13038
13039 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13040 Check for size-calculation overflow.
13041 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13042 do, as we prefer signed integers.
13043 (id_to_widget.max_size, id_to_widget.used)
13044 (xg_store_widget_in_map, xg_remove_widget_from_map)
13045 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13046 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13047 Use and return ptrdiff_t, not int.
13048 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13049 * gtkutil.h: Change prototypes to match the above.
13050
13051 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13052 are duplicate now that they've been promoted to lisp.h.
13053 (x_allocate_bitmap_record, x_alloc_image_color)
13054 (make_image_cache, cache_image, xpm_load):
13055 Don't update size until alloc is done.
13056 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13057 (x_detect_edges):
13058 Check for size calculation overflow.
13059 (ct_colors_allocated_max): New constant.
13060 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13061 overflow.
13062
13063 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13064 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13065 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13066 Use ptrdiff_t, not int, to count maps.
13067 (read_char_minibuf_menu_prompt): Check for overflow in size
13068 calculations. Don't update size until allocation succeeds.
13069 Redo calculations to avoid overflow.
13070 * keyboard.h: Change prototypes to match the above.
13071
13072 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13073 to count maps.
13074 (current_minor_maps): Check for size calculation overflow.
13075 * keymap.h: Change prototypes to match the above.
13076
13077 * lread.c (read1, init_obarray): Don't update size until alloc done.
13078
13079 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13080 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13081
13082 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13083 Now ptrdiff_t, not int.
13084 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13085 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13086
13087 * process.c (Fnetwork_interface_list): Check for overflow
13088 in size calculation.
13089
13090 * region-cache.c (move_cache_gap): Check for size calculation overflow.
13091
13092 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13093 overflow. Don't bother calling xmalloc when xrealloc will do.
13094
13095 * search.c (Freplace_match): Check for size calculation overflow.
13096 (Fset_match_data): Don't assume list lengths fit in 'int'.
13097
13098 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13099 for command line length. Do not attempt to address one before the
13100 beginning of an array, as that's not portable.
13101
13102 * term.c (max_frame_lines): Remove; unused.
13103 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13104 not int.
13105 (encode_terminal_code, calculate_costs): Check for size
13106 calculation overflow.
13107 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13108 table lengths and related sizes. Don't update size until alloc
13109 done. Redo calculations to avoid overflow.
13110 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13111
13112 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13113 subtracting pointers.
13114 (gobble_line): Check for overflow more carefully. Don't update size
13115 until alloc done.
13116
13117 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13118 Don't update size until alloc done.
13119 Redo size calculations to avoid overflow.
13120 Check for size calculation overflow.
13121 (main) [DEBUG]: Fix typo in invoking tparam1.
13122
13123 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13124 Use ptrdiff_t, not int, for sizes.
13125 (store_mode_line_noprop_char): Don't update size until alloc done.
13126
13127 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13128 Use ptrdiff_t, not int, for sizes.
13129 (Finternal_make_lisp_face, cache_face):
13130 Check for size calculation overflow.
13131 (cache_face): Treat size calculation overflows as if they were
13132 memory exhaustion (the usual treatment), rather than aborting.
13133
13134 * xfns.c (x_encode_text, x_set_name_internal)
13135 (Fx_change_window_property): Use ptrdiff_t, not int, to count
13136 sizes, since they can exceed INT_MAX in size. Check for size
13137 calculation overflow.
13138
13139 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13140 (xg_select): Check for size calculation overflow.
13141 Don't update size until alloc done.
13142
13143 * xrdb.c (get_environ_db): Don't assume path length fits in int,
13144 as sprintf is limited to int lengths.
13145
13146 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13147 (X_LONG_MIN): New macros.
13148 Use them to make the following changes clearer.
13149 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13150 This change doesn't affect the value now, but it may help remind
13151 future maintainers not to raise the value too much later.
13152 (SELECTION_QUANTUM): Remove, replacing with ...
13153 (selection_quantum): ... new function, which avoids overflow.
13154 All uses changed.
13155 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13156 assumption that selection length fits in 'int'.
13157 (x_reply_selection_request, x_handle_selection_request)
13158 (x_get_window_property, receive_incremental_selection)
13159 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13160 (lisp_data_to_selection_data, clean_local_selection_data):
13161 Use ptrdiff_t, not int, to record length of selection.
13162 (x_reply_selection_request, x_get_window_property)
13163 (receive_incremental_selection, x_property_data_to_lisp):
13164 Redo calculations to avoid overflow.
13165 (x_reply_selection_request): When sending hint, ceiling it at
13166 X_LONG_MAX rather than relying on wraparound overflow to send
13167 something.
13168 (x_get_window_property, receive_incremental_selection)
13169 (lisp_data_to_selection_data, x_property_data_to_lisp):
13170 Check for size-calculation overflow.
13171 (x_get_window_property, receive_incremental_selection)
13172 (lisp_data_to_selection_data, Fx_register_dnd_atom):
13173 Don't store size until memory allocation succeeds.
13174 (x_get_window_property): Plug memory leak on memory exhaustion.
13175 Don't double-block input; malloc is safe here. Don't assume 2**34
13176 - 4 fits in unsigned long. Add an xassert to check
13177 XGetWindowProperty overflow. Be more careful about overflow
13178 calculations, and distinguish size from memory overflow better.
13179 (receive_incremental_selection): When tracing, don't assume
13180 unsigned int is less than INT_MAX.
13181 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
13182 harmful) conversions of unsigned short to int.
13183 (lisp_data_to_selection_data): Don't assume that integers
13184 in the range -65535 through -1 fit in an X unsigned short.
13185 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
13186 result parameters unless successful. Rely on cons_to_unsigned
13187 to report problems with elements; the old code wasn't right anyway.
13188 (x_check_property_data): Check for int overflow; we cannot use
13189 a wider type due to X limits.
13190 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
13191
13192 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
13193
13194 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
13195 (x_term_init): Check for size calculation overflow.
13196 (x_color_cells): Don't store size until memory allocation succeeds.
13197 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
13198 Don't assume alloca size is less than MAX_ALLOCA.
13199 (x_term_init): Don't assume length fits in int (sprintf is limited
13200 to int size).
13201
13202 Use ptrdiff_t for composition IDs.
13203 * character.c (lisp_string_width):
13204 * composite.c (composition_table_size, n_compositions)
13205 (get_composition_id, composition_gstring_from_id):
13206 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
13207 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
13208 * window.c (Frecenter):
13209 Use ptrdiff_t, not int, for composition IDs.
13210 * composite.c (get_composition_id): Check for integer overflow.
13211 * composite.h: Adjust prototypes to match the above changes.
13212
13213 Use ptrdiff_t for hash table indexes.
13214 * category.c (hash_get_category_set):
13215 * ccl.c (ccl_driver):
13216 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
13217 * coding.c (coding_system_charset_list, detect_coding_system):
13218 * coding.h (struct coding_system.id):
13219 * composite.c (get_composition_id, gstring_lookup_cache):
13220 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
13221 * image.c (xpm_get_color_table_h):
13222 * lisp.h (hash_lookup, hash_put):
13223 * minibuf.c (Ftest_completion):
13224 Use ptrdiff_t for hash table indexes, not int (which is too
13225 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
13226 32-bit --with-wide-int hosts).
13227
13228 * charset.c (Fdefine_charset_internal): Check for integer overflow.
13229 Add a FIXME comment about memory leaks.
13230 (syms_of_charset): Don't assume xmalloc returns.
13231
13232 Don't assume that stated character widths fit in int.
13233 * character.c (Fchar_width, c_string_width, lisp_string_width):
13234 * character.h (CHAR_WIDTH):
13235 * indent.c (MULTIBYTE_BYTES_WIDTH):
13236 Use sanitize_char_width to avoid undefined and/or bad behavior
13237 with outlandish widths.
13238 * character.h (sanitize_tab_width): Rename from sanitize_width,
13239 now that we have two such functions. All uses changed.
13240 (sanitize_char_width): New inline function.
13241
13242 Don't assume that tab-width fits in int.
13243 * character.h (sanitize_width): New inline function.
13244 (SANE_TAB_WIDTH): New macro.
13245 (ASCII_CHAR_WIDTH): Use it.
13246 * indent.c (sane_tab_width): Remove. All uses replaced by
13247 SANE_TAB_WIDTH (current_buffer).
13248 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
13249
13250 * fileio.c: Integer overflow issues with file modes.
13251 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
13252
13253 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
13254 Remove unreachable code.
13255 (read_hex, load_charset_map_from_file): Check for integer overflow.
13256
13257 * xterm.c: Don't go over XClientMessageEvent limit.
13258 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
13259 (x_send_scroll_bar_event): Likewise. Check that the size does not
13260 exceed limits imposed by XClientMessageEvent, as well as the usual
13261 ptrdiff_t and size_t limits.
13262
13263 * keyboard.c: Overflow, signedness and related fixes.
13264 (make_lispy_movement): Use same integer type in forward decl
13265 that is used in the definition.
13266 (read_key_sequence, keyremap_step):
13267 Change bufsize argument back to int, undoing my 2011-03-30 change.
13268 We prefer signed types, and int is wide enough here.
13269 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
13270 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
13271 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
13272 length, not size_t. Use ptrdiff_t for index, not int.
13273 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
13274 possibility of integer overflow.
13275
13276 Overflow, signedness and related fixes for images.
13277
13278 * dispextern.h (struct it.stack[0].u.image.image_id)
13279 (struct_it.image_id, struct image.id, struct image_cache.size)
13280 (struct image_cache.used, struct image_cache.ref_count):
13281 * gtkutil.c (update_frame_tool_bar):
13282 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
13283 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
13284 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
13285 * nsmenu.m (update_frame_tool_bar):
13286 * xdisp.c (calc_pixel_width_or_height):
13287 * xfns.c (image_cache_refcount):
13288 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
13289 on typical 64-bit hosts.
13290
13291 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13292 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
13293 Omit unnecessary casts to int.
13294 (parse_image_spec): Check that integers fall into 'int' range
13295 when the callers expect that.
13296 (image_ascent): Redo ascent calculation to avoid int overflow.
13297 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
13298 (lookup_image): Remove unnecessary tests.
13299 (xbm_image_p): Locals are now of int, not EMACS_INT,
13300 since parse_image_check makes sure they fit into int.
13301 (png_load, gif_load, svg_load_image):
13302 Prefer int to unsigned where either will do.
13303 (tiff_handler): New function, combining the cores of the
13304 old tiff_error_handler and tiff_warning_handler.
13305 This function is rewritten to use vsnprintf and thereby avoid
13306 stack buffer overflows. It uses only the features of vsnprintf
13307 that are common to both POSIX and native Microsoft.
13308 (tiff_error_handler, tiff_warning_handler): Use it.
13309 (tiff_load, gif_load, imagemagick_load_image):
13310 Don't assume :index value fits in 'int'.
13311 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
13312 (imagemagick_load_image): Check that crop parameters fit into
13313 the integer types that MagickCropImage accepts. Don't assume
13314 Vimagemagick_render_type has a nonnegative value. Don't assume
13315 size_t fits in 'long'.
13316 (gs_load): Use printmax_t to print the widest integers possible.
13317 Check for integer overflow when computing image height and width.
13318
13319 2011-08-26 Eli Zaretskii <eliz@gnu.org>
13320
13321 * xdisp.c (redisplay_window): Don't force window start if point
13322 will be invisible in the resulting window. (Bug#9324)
13323
13324 2011-08-25 Eli Zaretskii <eliz@gnu.org>
13325
13326 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
13327 the display spec is of the form `(space ...)'.
13328 (handle_display_spec): Return the value returned by
13329 handle_single_display_spec, not just 1 or zero.
13330 (handle_single_display_spec): If the display spec is of the form
13331 `(space ...)', and specifies display in the text area, return 2
13332 rather than 1.
13333 (try_cursor_movement): Check for the need to scroll more
13334 accurately, and prefer exact match for point under bidi.
13335 Don't advance `row' beyond the last row of the window.
13336
13337 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13338 into disp_prop; all users changed.
13339
13340 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13341 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13342 for the text covered by the display property.
13343
13344 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
13345
13346 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13347 Change return value to nil.
13348 (Frecord_buffer): Delete unused function.
13349
13350 2011-08-24 Eli Zaretskii <eliz@gnu.org>
13351
13352 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13353 buffers, return left-to-right.
13354 (set_cursor_from_row): Consider candidate row a win if its glyph
13355 represents a newline and point is on that newline. Fixes cursor
13356 positioning on the newline at EOL of R2L text within L2R
13357 paragraph, and vice versa.
13358 (try_cursor_movement): Check continued rows, in addition to
13359 continuation rows. Fixes unwarranted scroll when point enters a
13360 continued line of R2L text within an L2R paragraph, or vice versa.
13361 (cursor_row_p): Consider the case of point being equal to
13362 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13363 from the end of a short line to the beginning of a continued line
13364 of R2L text within L2R paragraph.
13365 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13366 composed characters.
13367
13368 * bidi.c (bidi_check_type): Use xassert.
13369 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13370 members.
13371
13372 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13373
13374 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13375 a character.
13376
13377 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
13378
13379 * nsfont.m (ns_otf_to_script): Fix typo.
13380
13381 2011-08-22 Kenichi Handa <handa@m17n.org>
13382
13383 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13384 extra slot even if the purpose is char-code-property-table.
13385
13386 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13387
13388 * xdisp.c (redisplay_window): When computing centering_position,
13389 account for the height of the header line. (Bug#8874)
13390
13391 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13392 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13393 candidate is selected by the mouse, and that candidate has a
13394 composed character under the mouse.
13395
13396 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13397 coordinates reported by pos-visible-in-window-p for a composed
13398 character in column zero.
13399
13400 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13401
13402 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13403
13404 2011-08-22 Eli Zaretskii <eliz@gnu.org>
13405
13406 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13407 consider it a hit if to_charpos is anywhere in the range of the
13408 composed buffer positions.
13409
13410 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
13411
13412 * image.c (gif_load): Don't assume that each subimage has the same
13413 dimensions as the base image. Handle disposal method that is
13414 "undefined" by the gif spec (Bug#9335).
13415
13416 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
13417
13418 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13419 (Fcondition_case): Document `debug' symbol in error handler.
13420
13421 2011-08-19 Eli Zaretskii <eliz@gnu.org>
13422
13423 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13424 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13425 from an Org mode buffer to a Speedbar frame.
13426
13427 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13428 a composition, take its buffer position from IT->cmp_it.charpos.
13429 Fixes cursor positioning at the beginning of a line that begins
13430 with a composed character.
13431
13432 2011-08-18 Eli Zaretskii <eliz@gnu.org>
13433
13434 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13435 character bidirectional type, use STRONG_L instead. Fixes crashes
13436 in a buffer produced by `describe-categories'.
13437
13438 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13439 members before the level stack, so they would be saved and
13440 restored when copying iterator state. Fixes incorrect reordering
13441 around TABs covered by display properties.
13442
13443 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
13444
13445 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13446
13447 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
13448
13449 * eval.c (internal_condition_case, internal_condition_case_1)
13450 (internal_condition_case_2, internal_condition_case_n):
13451 Remove unnecessary aborts (Bug#9081).
13452
13453 2011-08-17 Eli Zaretskii <eliz@gnu.org>
13454
13455 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13456 has no `load' handler, try opening the file locally. (Bug#9311)
13457
13458 2011-08-16 Ken Brown <kbrown@cornell.edu>
13459
13460 * gmalloc.c: Expand comment.
13461
13462 2011-08-16 Eli Zaretskii <eliz@gnu.org>
13463
13464 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13465 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
13466
13467 2011-08-16 Ken Brown <kbrown@cornell.edu>
13468
13469 Fix memory allocation problems in Cygwin build (Bug#9273).
13470
13471 * unexcw.c ( __malloc_initialized): Declare external variable.
13472 (fixup_executable): Force the dumped emacs to reinitialize malloc.
13473
13474 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13475 New variables.
13476 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13477 dumped emacs.
13478 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13479 in the static heap.
13480 [CYGWIN] (special_realloc): New function.
13481 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13482 requests to realloc storage in the static heap.
13483
13484 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13485
13486 * bidi.c (bidi_initialize): Remove unused local.
13487
13488 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13489
13490 * bidimirror.h:
13491 * biditype.h: Remove file.
13492 * makefile.w32-in ($(BLD)/bidi.$(O)):
13493 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13494
13495 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13496
13497 * chartab.c: Improve commentary for the uniprop_table API.
13498
13499 * bidi.c (bidi_paragraph_init): Support zero value of
13500 bidi_ignore_explicit_marks_for_paragraph_level.
13501 (bidi_initialize): Use uniprop_table instead of including
13502 biditype.h and bidimirror.h.
13503
13504 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13505 coordinates of the iterator when restoring from ppos_it.
13506 (Bug#9296)
13507
13508 2011-08-14 Kenichi Handa <handa@m17n.org>
13509
13510 * process.c (create_process): Call setup_process_coding_systems
13511 after the pid of the process is set to -1 (Bug#8162).
13512
13513 2011-08-14 Eli Zaretskii <eliz@gnu.org>
13514
13515 * xdisp.c (move_it_in_display_line_to): Don't invoke
13516 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13517 ppos_it. Fixes vertical cursor motion when line beginning is
13518 covered by an image. (Bug#9296)
13519
13520 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13521
13522 * nsterm.h (ns_run_ascript): Declare.
13523 (NSAPP_DATA2_RUNASSCRIPT): Define.
13524
13525 * nsfns.m (as_script, as_result, as_status): New static variables.
13526 (ns_run_ascript): New function.
13527 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
13528 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13529 the event loop. Get status from as_status (Bug#7276).
13530
13531 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13532 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13533 the event loop (Bug#7276).
13534
13535 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13536
13537 * gnutls.c (QCgnutls_bootprop_priority)
13538 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13539 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13540 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13541 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13542 (QCgnutls_bootprop_verify_hostname_error)
13543 (QCgnutls_bootprop_callbacks_verify): Rename from
13544 Qgnutls_bootprop_..., all uses changed.
13545
13546 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13547 uses changed.
13548
13549 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13550
13551 * xfaces.c (Qframe_set_background_mode): Now static.
13552 * dispextern.h (Qframe_set_background_mode): Remove decl.
13553
13554 * process.c (Fnetwork_interface_info): Declare local only if needed.
13555
13556 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13557
13558 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13559 (Fnetwork_interface_list): Allocate in increments of bytes instead
13560 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13561 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13562 sockaddr.
13563 (struct ifflag_def): notrailers is smart on OSX.
13564 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13565 Get hardware address with getifaddrs if available.
13566
13567 2011-08-12 Eli Zaretskii <eliz@gnu.org>
13568
13569 * xdisp.c (iterate_out_of_display_property): xassert that
13570 IT->position is set to within IT->object's boundaries. Break from
13571 the loop as soon as EOB is reached; avoids infloops in redisplay
13572 when IT->position is set up wrongly due to some bug.
13573 Set IT->current to match the bidi iterator unconditionally.
13574 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13575 entry. Force push_it to save on the stack the current
13576 buffer/string position, to be restored by pop_it. Fix flags in
13577 the iterator structure wrt the object coming from a display
13578 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13579 properties. (Bug#9284)
13580
13581 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
13582
13583 * fontset.c (fontset_get_font_group): Add proper type checks.
13584 (Bug#9172)
13585
13586 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13587
13588 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13589 and LC_VERSION_MIN_MACOSX.
13590 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13591 (dump_it) [LC_FUNCTION_STARTS]: Use it.
13592
13593 2011-08-08 Eli Zaretskii <eliz@gnu.org>
13594
13595 * xdisp.c (forward_to_next_line_start): Allow to use the
13596 no-display-properties-and-no-overlays under bidi display.
13597 Set disp_pos in the bidi iterator to avoid searches for display
13598 properties and overlays.
13599
13600 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
13601
13602 * editfns.c (Fset_time_zone_rule): Document relationship with the
13603 setenv function.
13604
13605 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13606 the font entity extracted from the cache (Bug#8109).
13607
13608 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13609
13610 * composite.c (autocmp_chars): Don't reset point. That is done by
13611 restore_point_unwind (Bug#5984).
13612
13613 2011-08-07 Juri Linkov <juri@jurta.org>
13614
13615 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13616 to show the arg `TIME' instead of `TIMEVAL'.
13617
13618 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13619
13620 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13621 display property strides EOL and includes a newline, as in
13622 longlines-mode. (Bug#9254)
13623 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13624 word-wrap under bidirectional display. (Bug#9224)
13625
13626 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13627 is non-zero, even if the data buffer is NULL. Fixes a crash in
13628 vertical-motion with longlines-mode. (Bug#9254)
13629
13630 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13631
13632 * bidi.c <bidi_cache_total_alloc>: Now static.
13633 (bidi_initialize): Initialize bidi_cache_total_alloc.
13634
13635 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13636 cache. (Bug#9221)
13637
13638 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13639 amount allocated this far in `bidi_cache_total_alloc'.
13640 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13641 non-zero, only free the data buffer without restoring the cache
13642 contents. All callers changed.
13643
13644 * dispextern.h (bidi_unshelve_cache): Update prototype.
13645
13646 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13647 (move_it_in_display_line, move_it_to)
13648 (move_it_vertically_backward, move_it_by_lines): Replace the call
13649 to xfree to an equivalent call to bidi_unshelve_cache.
13650 (move_it_in_display_line_to): Fix logic of returning
13651 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13652
13653 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13654
13655 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13656 came from a string character with a `cursor' property. (Bug#9229)
13657
13658 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13659
13660 * Makefile.in (LIB_PTHREAD): New variable.
13661 (LIBES): Add LIB_PTHREAD (Bug#9216).
13662
13663 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13664 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13665
13666 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13667
13668 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13669
13670 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13671
13672 * xterm.c (x_find_topmost_parent): New function.
13673 (x_set_frame_alpha): Find topmost parent window with
13674 x_find_topmost_parent and set the property there also (bug#9181).
13675 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13676
13677 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13678
13679 * callproc.c (Fcall_process): Avoid vfork clobbering
13680 the local vars buffer, coding_systems, current_dir.
13681
13682 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13683
13684 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13685
13686 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13687
13688 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13689 so that it is not optimized away.
13690
13691 * xdisp.c (compute_display_string_pos): Remove unused local.
13692
13693 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13694
13695 Fix slow cursor motion and scrolling in large buffers with
13696 selective display, like Org Mode buffers. (Bug#9218)
13697
13698 * dispextern.h (struct bidi_it): New member disp_prop_p.
13699
13700 * xdisp.c: Remove one-slot cache of display string positions.
13701 (compute_display_string_pos): Accept an additional argument
13702 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13703 for a display string or property. If found, set DISP_PROP_P
13704 non-zero.
13705
13706 * bidi.c (bidi_fetch_char): Accept an additional argument
13707 DISP_PROP_P, and pass it to compute_display_string_pos.
13708 Only handle text covered by a display string if DISP_PROP_P is returned
13709 non-zero. All callers of bidi_fetch_char changed.
13710
13711 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13712
13713 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13714
13715 2010-12-03 Don March <don@ohspite.net>
13716
13717 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13718 last character M-[char] is translated to ESC [char] (bug#7541).
13719
13720 2011-08-02 Kenichi Handa <handa@m17n.org>
13721
13722 * lisp.h (uniprop_table): Extern it.
13723
13724 * chartab.c (uniprop_table): Make it non-static.
13725
13726 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13727
13728 * xdisp.c (forward_to_next_line_start): Accept additional argument
13729 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13730 on the newline.
13731 (reseat_at_next_visible_line_start): Use the bidi iterator state
13732 returned by forward_to_next_line_start to restore the state of
13733 it->bidi_it after backing up to previous newline. (Bug#9212)
13734
13735 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13736
13737 * regex.c (re_comp): Protoize.
13738 (re_exec): Fix return type.
13739 (regexec): Fix type of `ret'. (Bug#9203)
13740
13741 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13742
13743 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13744 This is needed if max-image-size is a floating-point number.
13745
13746 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13747
13748 * print.c (print_object): Print empty symbol as ##.
13749
13750 * lread.c (read1): Read ## as empty symbol.
13751
13752 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13753
13754 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13755 setting frame foreground color (Bug#9175).
13756 (x_set_background_color): Likewise.
13757
13758 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13759 contents (Bug#9176).
13760 (EmacsTooltip -init): Remove bezels and add shadows to
13761 tooltip windows.
13762
13763 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13764 or scroll bar (Bug#8470).
13765
13766 * nsfont.m (nsfont_open): Remove assignment to voffset and
13767 unnecessary vars hshink, expand, hd, full_height, min_height.
13768 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13769
13770 * nsterm.h (nsfont_info): Remove voffset field.
13771
13772 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13773
13774 Implement strike-through and overline on NextStep (Bug#8863).
13775
13776 * nsfont.m (nsfont_open): Use underline position provided by font,
13777 instead of hard-coded value of 2.
13778 (nsfont_draw): Call ns_draw_text_decoration instead.
13779
13780 * nsterm.h: Add declaration for ns_draw_text_decoration.
13781
13782 * nsterm.m (ns_draw_text_decoration): New function for drawing
13783 underline, overline, and strike-through.
13784 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13785 ns_draw_text_decoration. Change treatment of cursor drawing to
13786 accommodate underlining, etc.
13787
13788 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13789
13790 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13791 default.
13792
13793 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13794
13795 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13796 Without this fix, if a signal arrives just after memory fills up,
13797 'malloc' might be invoked reentrantly.
13798
13799 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13800 In other words, assume that every image size is allowed, on non-X
13801 hosts. This assumption is probably wrong, but it lets Emacs compile.
13802
13803 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13804
13805 * regex.c (re_iswctype): Convert return values to boolean.
13806
13807 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13808
13809 * xdisp.c (compute_display_string_pos): Don't use cached display
13810 string position if the buffer had its restriction changed.
13811 (Bug#9184)
13812
13813 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13814
13815 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13816
13817 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13818
13819 Integer signedness and overflow and related fixes. (Bug#9079)
13820
13821 * bidi.c: Integer size and overflow fixes.
13822 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13823 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13824 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13825 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13826 (bidi_find_other_level_edge):
13827 Use ptrdiff_t instead of EMACS_INT where either will do.
13828 This works better on 32-bit hosts configured --with-wide-int.
13829 (bidi_cache_ensure_space): Check for size-calculation overflow.
13830 Use % rather than repeated addition, for better worst-case speed.
13831 Don't set bidi_cache_size until after xrealloc returns, because it
13832 might not return.
13833 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13834 (bidi_cache_ensure_space): Also check that the bidi cache size
13835 does not exceed that of the largest Lisp string or buffer. See Eli
13836 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13837
13838 * alloc.c (__malloc_size_t): Remove.
13839 All uses replaced by size_t. See Andreas Schwab's note
13840 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13841
13842 * image.c: Improve checking for integer overflow.
13843 (check_image_size): Assume that f is nonnull, since
13844 it is always nonnull in practice. This is one less thing to
13845 worry about when checking for integer overflow later.
13846 (x_check_image_size): New function, which checks for integer
13847 overflow issues inside X.
13848 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13849 This removes the need for a memory_full check.
13850 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13851 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13852 (xbm_read_bitmap_data): Change locals back to 'int', since
13853 their values must fit in 'int'.
13854 (xpm_load_image, png_load, tiff_load):
13855 Invoke x_create_x_image_and_pixmap earlier,
13856 to avoid much needless work if the image is too large.
13857 (tiff_load): Treat overly large images as if
13858 x_create_x_image_and_pixmap failed, not as malloc failures.
13859 (gs_load): Use x_check_image_size.
13860
13861 * gtkutil.c: Omit integer casts.
13862 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13863 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13864
13865 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13866
13867 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13868 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13869 would wrongly return t on a 64-bit host.
13870
13871 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13872 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13873 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13874 and therefore cause GCC to emit a bogus diagnostic in some cases.
13875
13876 * image.c: Integer signedness and overflow and related fixes.
13877 This is not an exhaustive set of fixes, but it's time to
13878 record what I've got.
13879 (lookup_pixel_color, check_image_size): Remove redundant decls.
13880 (check_image_size): Don't assume that arbitrary EMACS_INT values
13881 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13882 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13883 (tiff_load, imagemagick_load_image):
13884 Check for overflow in size calculations.
13885 (x_create_x_image_and_pixmap): Remove unnecessary test for
13886 xmalloc returning NULL; that can't happen.
13887 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13888 (xpm_color_bucket): Use better integer hashing function.
13889 (xpm_cache_color): Don't possibly over-allocate memory.
13890 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13891 (gif_memory_source):
13892 Use ptrdiff_t, not int or size_t, to record sizes.
13893 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13894 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13895 either works, as we prefer signed integers.
13896 (tiff_read_from_memory, tiff_write_from_memory):
13897 Return tsize_t, not size_t, since that's what the TIFF API wants.
13898 (tiff_read_from_memory): Don't fail simply because the read would
13899 go past EOF; instead, return a short read.
13900 (tiff_load): Omit no-longer-needed casts.
13901 (Fimagemagick_types): Don't assume size fits into 'int'.
13902
13903 Improve hashing quality when configured --with-wide-int.
13904 * fns.c (hash_string): New function, taken from sxhash_string.
13905 Do not discard information about ASCII character case; this
13906 discarding is no longer needed.
13907 (sxhash-string): Use it. Change sig to match it. Caller changed.
13908 * lisp.h: Declare it.
13909 * lread.c (hash_string): Remove, since we now use fns.c's version.
13910 The fns.c version returns a wider integer if --with-wide-int is
13911 specified, so this should help the quality of the hashing a bit.
13912
13913 * emacs.c: Integer overflow minor fix.
13914 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13915 Define only if GNU_LINUX.
13916 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13917
13918 * dispnew.c: Integer signedness and overflow fixes.
13919 Remove unnecessary forward decls, that were a maintenance hassle.
13920 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13921 All uses changed.
13922 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13923 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13924 (prepare_desired_row, line_draw_cost):
13925 Use int, not unsigned, where either works.
13926 (save_current_matrix, restore_current_matrix):
13927 Use ptrdiff_t, not size_t, where either works.
13928 (init_display): Check for overflow more accurately, and without
13929 relying on undefined behavior.
13930
13931 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13932 Remove, replacing with the new symbols in lisp.h. All uses changed.
13933 * fileio.c (make_temp_name):
13934 * filelock.c (lock_file_1, lock_file):
13935 * xdisp.c (message_dolog):
13936 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13937 Use pMd etc. instead.
13938 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13939 replacing the pWIDE etc. symbols removed from editfns.c.
13940
13941 * keyboard.h (num_input_events): Now uintmax_t.
13942 This is (very slightly) less likely to mess up due to wraparound.
13943 All uses changed.
13944
13945 * buffer.c: Integer signedness fixes.
13946 (alloc_buffer_text, enlarge_buffer_text):
13947 Use ptrdiff_t rather than size_t when either will do, as we prefer
13948 signed integers.
13949
13950 * alloc.c: Integer signedness and overflow fixes.
13951 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13952 (__malloc_size_t): Default to size_t, not to int.
13953 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13954 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13955 Prefer ptrdiff_t to size_t when either would do, as we prefer
13956 signed integers.
13957 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13958 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13959 Now const. Initialize with values that are in range even if char
13960 is signed.
13961 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13962 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13963 These functions do the right thing with sizes > 2**32.
13964 (check_depth): Now ptrdiff_t, not int.
13965 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13966 Adjust to new way of storing sizes. Check for size overflow bugs
13967 in rest of code.
13968 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13969 slightly wrong anyway, as it missed one instance of
13970 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13971 (refill_memory_reserve): Omit needless cast to size_t.
13972 (mark_object_loop_halt): Mark as externally visible.
13973
13974 * xselect.c: Integer signedness and overflow fixes.
13975 (Fx_register_dnd_atom, x_handle_dnd_message):
13976 Use ptrdiff_t, not size_t, since we prefer signed.
13977 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13978 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13979 x_dnd_atoms_size and x_dnd_atoms_length.
13980
13981 * doprnt.c: Prefer signed to unsigned when either works.
13982 * eval.c (verror):
13983 * doprnt.c (doprnt):
13984 * lisp.h (doprnt):
13985 * xdisp.c (vmessage):
13986 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13987 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13988 prefer signed arithmetic to avoid comparison confusion.
13989 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13990 but is a bit tricky.
13991
13992 Assume freestanding C89 headers, string.h, stdlib.h.
13993 * data.c, doprnt.c, floatfns.c, print.c:
13994 Include float.h unconditionally.
13995 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13996 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13997 * regex.c: Likewise for stddef.h, string.h.
13998 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13999 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14000 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14001 (STDC_HEADERS): Remove obsolete defines.
14002 * sysdep.c: Include limits.h unconditionally.
14003
14004 Assume support for memcmp, memcpy, memmove, memset.
14005 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14006 * regex.c (memcmp, memcpy):
14007 Remove; we assume C89 now.
14008
14009 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14010 (__malloc_safe_bcopy): Remove; no longer needed.
14011
14012 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14013 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14014 well either way, and we prefer signed to unsigned.
14015
14016 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14017
14018 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14019 closes the connection while we're reading (bug#9182).
14020
14021 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
14022
14023 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14024 are specified (Bug#9168).
14025
14026 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14027
14028 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14029 Found by GCC static checking and --with-wide-int on a 32-bit host.
14030
14031 2011-07-25 Eli Zaretskii <eliz@gnu.org>
14032
14033 * xdisp.c (compute_display_string_pos): Fix logic of caching
14034 previous display string position. Initialize cached_prev_pos to
14035 -1. Fixes slow-down at the beginning of a buffer.
14036
14037 2011-07-24 Eli Zaretskii <eliz@gnu.org>
14038
14039 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14040 for attrs[LFACE_FONTSET_INDEX].
14041
14042 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
14043
14044 * xml.c (parse_region): Remove unused local
14045 that was recently introduced.
14046
14047 2011-07-23 Eli Zaretskii <eliz@gnu.org>
14048
14049 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14050 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14051
14052 * xdisp.c (move_it_in_display_line_to): Record the best matching
14053 position for TO_CHARPOS while scanning the line, and restore it on
14054 exit if none of the characters scanned was an exact match.
14055 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14056 when exact match is impossible due to invisible text, and the
14057 lines are truncated.
14058
14059 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
14060
14061 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14062 for OSX >= 10.7.
14063
14064 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14065
14066 Fix a significant slow-down of cursor motion with C-n, C-p,
14067 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14068 auto-repeat under bidi redisplay in fontified buffers.
14069 * xdisp.c (compute_stop_pos_backwards): New function.
14070 (next_element_from_buffer): Call compute_stop_pos_backwards to
14071 find a suitable prev_stop when we find ourselves before
14072 base_level_stop.
14073 (reseat): Don't look for prev_stop, as that could mean a very long
14074 run.
14075 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14076 <cached_disp_overlay_modiff>: Cache for last found display string
14077 position.
14078 (compute_display_string_pos): Return the cached position if asked
14079 about the same buffer in the same area of character positions, and
14080 the buffer wasn't changed since the time the display string
14081 position was cached.
14082
14083 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14084
14085 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14086 is an integer, which is important for empty lines. (Bug#9149)
14087
14088 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
14089
14090 * frame.c (Fmodify_frame_parameters): In tty case, update the
14091 default face if necessary (Bug#4238).
14092
14093 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
14094
14095 * editfns.c (Fstring_to_char): No need to explain what a character
14096 is in the docstring (Bug#6576).
14097
14098 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14099
14100 * xml.c (parse_region): Make sure we always return a tree.
14101
14102 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
14103
14104 * xml.c (parse_region): If a document contains only comments,
14105 return that, too.
14106
14107 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14108
14109 * xml.c (make_dom): Return comments, too.
14110
14111 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
14112
14113 Port to OpenBSD.
14114 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14115 and the surrounding thread.
14116 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14117 rather than fgets, and retry after EINTR. Otherwise, 'emacs
14118 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14119 timer goes off.
14120 * s/openbsd.h (BROKEN_SIGIO): Define.
14121 * unexelf.c (unexec) [__OpenBSD__]:
14122 Don't update the .mdebug section of the Alpha COFF symbol table.
14123
14124 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14125
14126 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14127 (bug#8460).
14128
14129 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
14130
14131 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14132 This fixes some race conditions on the permissions of any newly
14133 created file.
14134
14135 * alloc.c (valid_pointer_p): Use pipe, not open.
14136 This fixes some permissions issues when debugging.
14137
14138 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
14139 If fchown fails to set both uid and gid, try to set just gid,
14140 as that is sometimes allowed. Adjust the file's mode to eliminate
14141 setuid or setgid bits that are inappropriate if fchown fails.
14142
14143 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
14144
14145 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14146 to compare Lisp_Objects.
14147 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14148 global_gnutls_log_level, don't mistake it for a Lisp_Object.
14149 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14150
14151 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
14152
14153 * lread.c (read_integer): Unread even EOF character.
14154 (read1): Likewise. Properly record start position of symbol.
14155
14156 * lread.c (read1): Read `#:' as empty uninterned symbol if no
14157 symbol character follows.
14158
14159 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
14160
14161 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
14162 This works around a problem with the previous change to Fcopy_file.
14163 Recent glibc declares fchown with __attribute__((warn_unused_result)),
14164 and without this change, GCC might complain about discarding
14165 fchown's return value.
14166
14167 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
14168
14169 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14170
14171 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
14172
14173 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
14174
14175 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
14176
14177 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
14178 it's used from the C level.
14179
14180 * process.c: Use the same condition for POLL_FOR_INPUT in both
14181 keyboard.c and process.c (bug#1858).
14182
14183 2011-07-09 Lawrence Mitchell <wence@gmx.li>
14184
14185 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
14186 (Fgnutls_boot): Use it.
14187
14188 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
14189
14190 * doc.c (Fsubstitute_command_keys): Revert last change.
14191
14192 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
14193
14194 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
14195 quotes the next character, and doesn't affect other longer
14196 sequences (bug#8935).
14197
14198 * lread.c (syms_of_lread): Clarify that is isn't only
14199 `eval-buffer' and `eval-defun' that's affected by
14200 `lexical-binding' (bug#8460).
14201
14202 2011-07-15 Eli Zaretskii <eliz@gnu.org>
14203
14204 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
14205 bidi redisplay when a line includes both an image and is truncated.
14206
14207 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
14208
14209 Fix minor problems found by static checking.
14210 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
14211 (elsz): Now a signed constant, not a size_t var. We prefer signed
14212 types to unsigned, to avoid integer comparison confusion. Without
14213 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
14214 "cannot optimize loop, the loop counter may overflow", a symptom
14215 of the confusion.
14216 * indent.c (Fvertical_motion): Mark locals as initialized.
14217 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
14218
14219 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14220
14221 * search.c (Fre_search_backward): Mention `case-fold-search' in
14222 all the re_search_* functions (bug#8138).
14223
14224 * keyboard.c (Fopen_dribble_file): Document when the file is
14225 closed (bug#8056).
14226
14227 2011-07-14 Eli Zaretskii <eliz@gnu.org>
14228
14229 * bidi.c (bidi_dump_cached_states): Fix format of displaying
14230 bidi_cache_idx.
14231
14232 Support bidi reordering of display and overlay strings.
14233 * xdisp.c (compute_display_string_pos)
14234 (compute_display_string_end): Accept additional argument STRING.
14235 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
14236 (reseat_to_string): Initialize bidi_it->string.s and
14237 bidi_it->string.schars.
14238 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
14239 NULL (avoids a crash in bidi_paragraph_init).
14240 Initialize itb.string.lstring.
14241 (init_iterator): Call bidi_init_it only of a valid
14242 buffer position was specified. Initialize paragraph_embedding to
14243 L2R.
14244 (reseat_to_string): Initialize the bidi iterator.
14245 (display_string): If we need to ignore text properties of
14246 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
14247 original value of -1 will not work with bidi.)
14248 (compute_display_string_pos): First arg is now struct
14249 `text_pos *'; all callers changed. Support display properties on
14250 Lisp strings.
14251 (compute_display_string_end): Support display properties on Lisp
14252 strings.
14253 (init_iterator, reseat_1, reseat_to_string): Initialize the
14254 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
14255 when iterating on a string not from display properties).
14256 (compute_display_string_pos, compute_display_string_end):
14257 Fix calculation of the object to scan. Fixes an error when using
14258 arrow keys.
14259 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
14260 base_level_stop; instead, set base_level_stop to BEGV.
14261 Fixes crashes in vertical-motion.
14262 (next_element_from_buffer): Improve commentary for when
14263 the iterator is before prev_stop.
14264 (init_iterator): Initialize bidi_p from the default value of
14265 bidi-display-reordering, not from buffer-local value. Use the
14266 buffer-local value only if initializing for buffer iteration.
14267 (handle_invisible_prop): Support invisible properties on strings
14268 that are being bidi-reordered.
14269 (set_iterator_to_next): Support bidi reordering of C strings and
14270 Lisp strings.
14271 (next_element_from_string): Support bidi reordering of Lisp
14272 strings.
14273 (handle_stop_backwards): Support Lisp strings as well.
14274 (display_string): Support display of R2L glyph rows.
14275 Use IT_STRING_CHARPOS when displaying from a Lisp string.
14276 (init_iterator): Don't initialize it->bidi_p for strings
14277 here.
14278 (reseat_to_string): Initialize it->bidi_p for strings here.
14279 (next_element_from_string, next_element_from_c_string)
14280 (next_element_from_buffer): Add xassert's for correspondence
14281 between IT's object being iterated and it->bidi_it.string
14282 structure.
14283 (face_before_or_after_it_pos): Support bidi iteration.
14284 (next_element_from_c_string): Handle the case of the first string
14285 character that is not the first one in the visual order.
14286 (get_visually_first_element): New function, refactored from common
14287 parts of next_element_from_buffer, next_element_from_string, and
14288 next_element_from_c_string.
14289 (tool_bar_lines_needed, redisplay_tool_bar)
14290 (display_menu_bar): Force left-to-right direction. Add a FIXME
14291 comment for making that be controlled by a user option.
14292 (push_it, pop_it): Save and restore the state of the
14293 bidi iterator. Save and restore the bidi_p flag.
14294 (pop_it): Iterate out of display property for string iteration as
14295 well.
14296 (iterate_out_of_display_property): Support iteration over strings.
14297 (handle_single_display_spec): Set up it->bidi_it for iteration
14298 over a display string, and call bidi_init_it.
14299 (handle_single_display_spec, next_overlay_string)
14300 (get_overlay_strings_1, push_display_prop): Set up the bidi
14301 iterator for displaying display or overlay strings.
14302 (forward_to_next_line_start): Don't use the shortcut if
14303 bidi-iterating.
14304 (back_to_previous_visible_line_start): If handle_display_prop
14305 pushed the iterator stack, restore the internal state of the bidi
14306 iterator by calling bidi_pop_it same number of times.
14307 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
14308 and we are bidi-iterating, don't decrement the iterator position;
14309 instead, set the first_elt flag in the bidi iterator, to produce
14310 the same effect.
14311 (reseat_1): Remove redundant setting of string_from_display_prop_p.
14312 (push_display_prop): xassert that we are iterating a buffer.
14313 (push_it, pop_it): Save and restore paragraph_embedding member.
14314 (handle_single_display_spec, next_overlay_string)
14315 (get_overlay_strings_1, reseat_1, reseat_to_string)
14316 (push_display_prop): Set up the `unibyte' member of bidi_it.string
14317 correctly. Don't assume unibyte strings are not bidi-reordered.
14318 (compute_display_string_pos)
14319 (compute_display_string_end): Fix handling the case of C string.
14320 (push_it, pop_it): Save and restore from_disp_prop_p.
14321 (handle_single_display_spec, push_display_prop): Set the
14322 from_disp_prop_p flag.
14323 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
14324 (pop_it): Call iterate_out_of_display_property only if we are
14325 popping after iteration over a string that came from a display
14326 property. Fix a typo in popping stretch info. Add an assertion
14327 for verifying that the iterator position is in sync with the bidi
14328 iterator.
14329 (handle_single_display_spec, get_overlay_strings_1)
14330 (push_display_prop): Fix initialization of paragraph direction for
14331 string when that of the parent object is not yet determined.
14332 (reseat_1): Call bidi_init_it to resync the bidi
14333 iterator with IT's position. (Bug#7616)
14334 (find_row_edges): If ROW->start.pos gives position
14335 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
14336 (handle_stop, back_to_previous_visible_line_start, reseat_1):
14337 Reset the from_disp_prop_p flag.
14338 (SAVE_IT, RESTORE_IT): New macros.
14339 (pos_visible_p, face_before_or_after_it_pos)
14340 (back_to_previous_visible_line_start)
14341 (move_it_in_display_line_to, move_it_in_display_line)
14342 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14343 (try_scrolling, redisplay_window, display_line): Use them when
14344 saving a temporary copy of the iterator and restoring it back.
14345 (back_to_previous_visible_line_start, reseat_1)
14346 (init_iterator): Empty the bidi cache "stack".
14347 (move_it_in_display_line_to): If iterator ended up at
14348 EOL, but we never saw any buffer positions smaller than
14349 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
14350 motion in bidi-reordered lines.
14351 (move_it_in_display_line_to): Record prev_method and prev_pos
14352 immediately before the call to set_iterator_to_next. Fixes cursor
14353 motion in bidi-reordered lines with stretch glyphs and strings
14354 displayed in margins. (Bug#8133) (Bug#8867)
14355 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14356 TO_CHARPOS.
14357 (pos_visible_p): Support positions in bidi-reordered lines.
14358 Save and restore bidi cache.
14359
14360 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14361 (bidi_paragraph_info): Delete unused struct.
14362 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14363 (bidi_cache_start): New variable.
14364 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14365 to zero.
14366 (bidi_cache_fetch_state, bidi_cache_search)
14367 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14368 (bidi_cache_find, bidi_peek_at_next_level)
14369 (bidi_level_of_next_char, bidi_find_other_level_edge)
14370 (bidi_move_to_visually_next): Compare cache index with
14371 bidi_cache_start rather than with zero.
14372 (bidi_fetch_char): Accept new argument STRING; all callers
14373 changed. Support iteration over a string. Support strings with
14374 display properties. Support unibyte strings. Fix the type of
14375 `len' according to what STRING_CHAR_AND_LENGTH expects.
14376 (bidi_paragraph_init, bidi_resolve_explicit_1)
14377 (bidi_resolve_explicit, bidi_resolve_weak)
14378 (bidi_level_of_next_char, bidi_move_to_visually_next):
14379 Support iteration over a string.
14380 (bidi_set_sor_type, bidi_resolve_explicit_1)
14381 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14382 can now be zero (for strings); special values 0 and -1 were
14383 changed to -1 and -2, respectively.
14384 (bidi_char_at_pos): New function.
14385 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14386 Call it instead of FETCH_MULTIBYTE_CHAR.
14387 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14388 initialized to valid values.
14389 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14390 values.
14391 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14392 the test for valid cached positions. Fix the logic for looking up
14393 the sentinel state in the cache. GCPRO the Lisp string we are
14394 iterating.
14395 (bidi_push_it, bidi_pop_it): New functions.
14396 (bidi_initialize): Initialize the bidi cache start stack pointer.
14397 (bidi_cache_ensure_space): New function, refactored from part of
14398 bidi_cache_iterator_state. Don't assume the required size is just
14399 one BIDI_CACHE_CHUNK away.
14400 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14401 (bidi_count_bytes, bidi_char_at_pos): New functions.
14402 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14403 always valid if bidi_cache_idx is valid.
14404 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14405 is valid if it's going to be used.
14406 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14407 (bidi_cache_fetch_state, bidi_cache_search)
14408 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14409 (bidi_cache_iterator_state, bidi_cache_find)
14410 (bidi_find_other_level_edge, bidi_cache_start_stack):
14411 All variables related to cache indices are now EMACS_INT.
14412
14413 * dispextern.h (struct bidi_string_data): New structure.
14414 (struct bidi_it): New member `string'. Make flag members be 1-bit
14415 fields, and put them last in the struct.
14416 (compute_display_string_pos, compute_display_string_end):
14417 Update prototypes.
14418 (bidi_push_it, bidi_pop_it): Add prototypes.
14419 (struct iterator_stack_entry): New members bidi_p,
14420 paragraph_embedding, and from_disp_prop_p.
14421 (struct it): Member bidi_p is now a bit field 1 bit wide.
14422 (bidi_shelve_cache, bidi_unshelve_cache):
14423 Declare prototypes.
14424
14425 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14426 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14427 and vector-like objects.
14428
14429 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14430 cache around display iteration.
14431
14432 * window.c (Fwindow_end, window_scroll_pixel_based)
14433 (displayed_window_lines, Frecenter): Save and restore the bidi
14434 cache around display iteration.
14435
14436 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14437
14438 * editfns.c (Fdelete_region): Clarify the use of the named
14439 parameters (bug#6788).
14440
14441 2011-07-14 Martin Rudalics <rudalics@gmx.at>
14442
14443 * indent.c (Fvertical_motion): Set and restore w->pointm when
14444 saving and restoring the window's buffer (Bug#9006).
14445
14446 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
14447
14448 * editfns.c (Fstring_to_char): Clarify just what is returned
14449 (bug#6576). Text by Eli Zaretskii.
14450
14451 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
14452
14453 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14454
14455 2011-07-13 Eli Zaretskii <eliz@gnu.org>
14456
14457 * buffer.c (mmap_find): Fix a typo.
14458
14459 2011-07-13 Johan Bockgård <bojohan@gnu.org>
14460
14461 Fix execution of x selection hooks.
14462 * xselect.c (Qx_lost_selection_functions)
14463 (Qx_sent_selection_functions): New vars.
14464 (syms_of_xselect): DEFSYM them.
14465 (x_handle_selection_request): Pass Qx_sent_selection_functions
14466 rather than Vx_sent_selection_functions to Frun_hook_with_args.
14467 (x_handle_selection_clear,x_clear_frame_selections):
14468 Pass Qx_lost_selection_functions rather than
14469 Vx_lost_selection_functions to Frun_hook_with_args.
14470
14471 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
14472
14473 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14474 The old code sometimes used this field without initializing it.
14475
14476 * alloc.c (gc_sweep): Don't read past end of array.
14477 In theory, the old code could also have corrupted Emacs internals,
14478 though it'd be very unlikely.
14479
14480 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
14481
14482 * character.c (Fcharacterp): Don't advertise optional ignored
14483 argument. (Bug#4026)
14484
14485 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14486
14487 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14488 key" (bug#4257).
14489
14490 * window.c (Fset_window_start): Doc fix (bug#4199).
14491 (Fset_window_hscroll): Ditto.
14492
14493 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14494
14495 Fix minor new problems caught by GCC 4.6.1.
14496 * term.c (init_tty): Remove unused local.
14497 * xsettings.c (store_monospaced_changed): Define this function only
14498 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14499 not used otherwise.
14500
14501 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14502
14503 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14504
14505 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14506
14507 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14508 are the mini-buffer and the echo area (bug#3320).
14509
14510 * term.c (init_tty): Remove support for supdup, c10 and perq
14511 terminals, which are no longer supported (bug#1482).
14512
14513 2011-07-10 Johan Bockgård <bojohan@gnu.org>
14514
14515 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14516
14517 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14518
14519 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14520 for non-popups (Bug#3642).
14521
14522 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14523
14524 * alloc.c (reset_malloc_hooks): Protoize.
14525 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14526 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14527 * cm.c (losecursor): Likewise.
14528 * data.c (fmod): Likewise.
14529 * dispnew.c (swap_glyphs_in_rows): Likewise.
14530 * emacs.c (memory_warning_signal): Likewise.
14531 * floatfns.c (float_error): Likewise.
14532 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14533 (otf_open, font_otf_capability, generate_otf_features)
14534 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14535 Likewise.
14536 * image.c (pbm_read_file): Likewise.
14537 * indent.c (string_display_width): Likewise.
14538 * intervals.c (check_for_interval, search_for_interval)
14539 (inc_interval_count, count_intervals, root_interval)
14540 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14541 * lread.c (defalias): Likewise.
14542 * ralloc.c (r_alloc_check): Likewise.
14543 * regex.c (set_image_of_range_1, set_image_of_range)
14544 (regex_grow_registers): Likewise.
14545 * sysdep.c (strerror): Likewise.
14546 * termcap.c (valid_filename_p, tprint, main): Likewise.
14547 * tparam.c (main): Likewise.
14548 * unexhp9k800.c (run_time_remap, save_data_space)
14549 (update_file_ptrs, read_header, write_header, calculate_checksum)
14550 (copy_file, copy_rest, display_header): Likewise.
14551 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14552 Likewise.
14553 * xdisp.c (check_it): Likewise.
14554 * xfaces.c (register_color, unregister_color, unregister_colors):
14555 Likewise.
14556 * xfns.c (print_fontset_result): Likewise.
14557 * xrdb.c (member, fatal, main): Likewise.
14558
14559 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14560
14561 Fix minor problems found by static checking (Bug#9031).
14562 * chartab.c (char_table_set_range, map_sub_char_table):
14563 Remove unused locals.
14564 (uniprop_table): Now static.
14565 * composite.c (_work_char): Remove unused static var.
14566
14567 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
14568
14569 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14570
14571 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14572
14573 * gtkutil.c (qttip_cb): Remove code without function.
14574
14575 2011-07-09 Eli Zaretskii <eliz@gnu.org>
14576
14577 * w32.c (pthread_sigmask): New stub.
14578
14579 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
14580
14581 Use pthread_sigmask, not sigprocmask (Bug#9010).
14582 sigprocmask is portable only for single-threaded applications, and
14583 Emacs can be multi-threaded when it uses GTK.
14584 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14585 (LIBES): Use it.
14586 * callproc.c (Fcall_process):
14587 * process.c (create_process):
14588 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14589 Use pthread_sigmask, not sigprocmask.
14590
14591 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14592
14593 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14594 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14595 wrong (Bug#8591).
14596
14597 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14598
14599 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14600 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14601 (xg_hide_tooltip): Fix comment.
14602
14603 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14604 in registerServicesMenuSendTypes.
14605 (validRequestorForSendType): Don't check ns_return_types.
14606
14607 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14608 ns_return_type.
14609
14610 2011-07-08 Jason Rumney <jasonr@gnu.org>
14611
14612 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14613 SH_SHOW for hidden windows (Bug#5482).
14614
14615 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14616 frame struct members of non-existent frames (Bug#6284).
14617
14618 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14619
14620 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14621 variable firstTime not needed on OSX >= 10.6.
14622 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14623 >= 10.5. Use setKnobProportion, setDoubleValue.
14624
14625 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14626 (MAC_OS_X_VERSION_10_5): Define if not defined.
14627 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14628 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14629 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14630
14631 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14632 cString and lossyCString on OSX >= 10.4.
14633
14634 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14635 sizeToFit on OSX >= 10.2.
14636
14637 * nsimage.m (allocInitFromFile): Don't use deprecated method
14638 bestRepresentationForDevice on OSX >= 10.6.
14639
14640 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14641 to avoid warning.
14642
14643 * emacs.c: Declare unexec_init_emacs_zone.
14644
14645 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14646
14647 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14648
14649 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14650 on svcsMenu (Bug#8842).
14651
14652 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14653 ns_return_types.
14654 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14655
14656 * nsterm.m (QUTF8_STRING): Declare.
14657 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14658 (validRequestorForSendType): Return type is (id).
14659 Change indexOfObjectIdenticalTo to indexOfObject.
14660 Check if we have local selection before returning self (Bug#8842).
14661 (writeSelectionToPasteboard): Put local selection into paste board
14662 if we have a local selection (Bug#8842).
14663 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14664
14665 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14666 (ns_get_local_selection): Declare.
14667
14668 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14669
14670 * keymap.c (describe_map_tree): Don't insert a double newline at
14671 the end of the buffer (bug#1169) and return whether we inserted
14672 something.
14673
14674 * callint.c (Fcall_interactively): Change "reading args" to
14675 "providing args" to try to clarify what it does (bug#1010).
14676
14677 2011-07-07 Kenichi Handa <handa@m17n.org>
14678
14679 * composite.c (composition_compute_stop_pos): Ignore a static
14680 composition starting before CHARPOS (Bug#8915).
14681
14682 * xdisp.c (handle_composition_prop): Likewise.
14683
14684 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14685
14686 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14687 (Bug#9015)
14688
14689 2011-07-07 Kenichi Handa <handa@m17n.org>
14690
14691 * character.h (unicode_category_t): New enum type.
14692
14693 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14694 (Qchar_code_property_table): New variable.
14695 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14696 (UNIPROP_COMPRESSED_FORM_P): New macros.
14697 (char_table_ascii): Uncompress the compressed values.
14698 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14699 Uncompress the compressed values.
14700 (sub_char_table_ref_and_range): Likewise.
14701 (char_table_ref_and_range): Uncompress the compressed values.
14702 (sub_char_table_set): New arg is_uniprop. Callers changed.
14703 Uncompress the compressed values.
14704 (sub_char_table_set_range): Args changed. Callers changed.
14705 (char_table_set_range): Adjuted for the above change.
14706 (map_sub_char_table): Delete args default_val and parent. Add arg
14707 top. Give decoded values to a Lisp function.
14708 (map_char_table): Adjust for the above change. Give decoded
14709 values to a Lisp function. Gcpro more variables.
14710 (uniprop_table_uncompress)
14711 (uniprop_decode_value_run_length): New functions.
14712 (uniprop_decoder, uniprop_decoder_count): New variables.
14713 (uniprop_get_decoder, uniprop_encode_value_character)
14714 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14715 New functions.
14716 (uniprop_encoder, uniprop_encoder_count): New variables.
14717 (uniprop_get_encoder, uniprop_table)
14718 (Funicode_property_table_internal, Fget_unicode_property_internal)
14719 (Fput_unicode_property_internal): New functions.
14720 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14721 Sunicode_property_table_internal, Sget_unicode_property_internal,
14722 and Sput_unicode_property_internal. Defvar_lisp
14723 char-code-property-alist.
14724
14725 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14726 Vunicode_category_table.
14727
14728 * font.c (font_range): Adjust for the change of
14729 Vunicode_category_table.
14730
14731 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14732
14733 * m/iris4d.h: Remove file, move contents ...
14734 * s/irix6-5.h: ... here.
14735
14736 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14737
14738 Remove unportable assumption about struct layout (Bug#8884).
14739 * alloc.c (mark_buffer):
14740 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14741 (clone_per_buffer_values): Don't assume that
14742 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14743 This isn't true in general, and it's particularly not true
14744 if Emacs is configured with --with-wide-int.
14745 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14746 New macros, used in the buffer.c change.
14747
14748 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14749
14750 * xsettings.c: Use both GConf and GSettings if both are available.
14751 (store_config_changed_event): Add comment.
14752 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14753 (store_tool_bar_style_changed): New functions.
14754 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14755 (struct xsettings): Move font inside HAVE_XFT.
14756 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14757 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14758 Move inside HAVE_XFT.
14759 (something_changed_gsettingsCB): Rename from something_changedCB.
14760 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14761 also.
14762 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14763 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14764 (something_changed_gconfCB): Rename from something_changedCB.
14765 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14766 (parse_settings): Move check for font inside HAVE_XFT.
14767 (read_settings, apply_xft_settings): Add comment.
14768 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14769 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14770 call store_font_name_changed.
14771 (xft_settings_event): Add comment.
14772 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14773 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14774 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14775 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14776 (xsettings_initialize): Call init_gsettings last.
14777 (xsettings_get_system_font, xsettings_get_system_normal_font):
14778 Add comment.
14779
14780 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14781
14782 Random fixes. E.g., (random) never returned negative values.
14783 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14784 subseconds part to the entropy, as that's a bit more random.
14785 Prefer signed to unsigned, since the signedness doesn't matter and
14786 in general we prefer signed. When given a limit, use a
14787 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14788 latter isn't right if USE_2_TAGS_FOR_INTS.
14789 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14790 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14791
14792 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14793
14794 * textprop.c (text_property_stickiness):
14795 Obey Vtext_property_default_nonsticky.
14796 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14797 * w32fns.c (syms_of_w32fns):
14798 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14799
14800 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14801
14802 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14803 This is more efficient than Ffile_directory_p and avoids a minor race.
14804
14805 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14806
14807 * buffer.c (Foverlay_put): Say what the return value is
14808 (bug#7835).
14809
14810 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14811 is a directory before asking whether to use the file name
14812 (bug#7564).
14813 (barf_or_query_if_file_exists): Make the "File is a directory"
14814 error be more correct.
14815
14816 * fns.c (Frequire): Remove the mention of the .gz files, since
14817 that's installation-specific, but keep the mention of
14818 `get-load-suffixes'.
14819
14820 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14821
14822 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14823 Report string overflow if the output is too long.
14824
14825 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14826
14827 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14828 (syms_of_gnutls): Remove duplicate DEFSYM for
14829 Qgnutls_bootprop_verify_hostname_error, an error for
14830 Qgnutls_bootprop_verify_error (which is no longer used).
14831
14832 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14833 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14834 Also (re)move comments that are misplaced or no longer relevant.
14835
14836 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14837
14838 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14839
14840 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14841
14842 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14843 and background color parameters if they have been changed.
14844
14845 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14846
14847 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14848
14849 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14850
14851 * xsettings.c (SYSTEM_FONT): Define only when used.
14852 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14853
14854 * keymap.c (access_keymap_1): Now static.
14855
14856 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14857
14858 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14859 leave any prefix arg for the up event (Bug#1586).
14860
14861 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14862
14863 * lread.c (syms_of_lread): Mention single symbols defined by
14864 `defvar' or `defconst' (bug#7154).
14865
14866 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14867 (Frequire): Mention get-load-suffixes.
14868
14869 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14870
14871 * window.h (window): Remove clone_number slot.
14872 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14873 Remove.
14874 (make_parent_window, make_window, saved_window)
14875 (Fset_window_configuration, save_window_save): Don't deal with
14876 clone numbers.
14877 * buffer.c (Qclone_number): Remove declaration.
14878 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14879
14880 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14881
14882 Add multiple inheritance to keymaps.
14883 * keymap.c (Fmake_composed_keymap): New function.
14884 (Fset_keymap_parent): Simplify.
14885 (fix_submap_inheritance): Remove.
14886 (access_keymap_1): New function extracted from access_keymap to handle
14887 embedded parents and handle lists of maps.
14888 (access_keymap): Use it.
14889 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14890 (Fcopy_keymap): Handle embedded parents.
14891 (Fcommand_remapping, define_as_prefix): Simplify.
14892 (Fkey_binding): Simplify.
14893 (syms_of_keymap): Move minibuffer-local-completion-map,
14894 minibuffer-local-filename-completion-map,
14895 minibuffer-local-must-match-map, and
14896 minibuffer-local-filename-must-match-map to Elisp.
14897 (syms_of_keymap): Defsubr make-composed-keymap.
14898 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14899 (parse_menu_item): Trivial simplification.
14900
14901 2011-07-01 Glenn Morris <rgm@gnu.org>
14902
14903 * Makefile.in (SETTINGS_LIBS): Fix typo.
14904
14905 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14906
14907 * coding.c (Fencode_coding_string): Record the last coding system
14908 used, as the function doc string says (bug#8738).
14909
14910 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14911
14912 * xsettings.c (store_monospaced_changed): Take new font as arg and
14913 check for change against current_mono_font.
14914 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14915 (emacs_settings_constructor, emacs_settings_get_property)
14916 (emacs_settings_set_property, emacs_settings_class_init)
14917 (emacs_settings_init, gsettings_obj): Remove.
14918 (something_changedCB): New function for HAVE_GSETTINGS.
14919 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14920 with value as argument.
14921 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14922 g_settings_new (Bug#8967). Do not create gsettings_obj.
14923 Remove calls to g_settings_bind. Connect something_changedCB to
14924 "changed".
14925
14926 * xgselect.c: Add defined (HAVE_GSETTINGS).
14927 (xgselect_initialize): Ditto.
14928
14929 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14930 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14931 xg_select.
14932
14933 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14934
14935 * eval.c (struct backtrace): Simplify and port the data structure.
14936 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14937 signed bit field, as this assumption is not portable and it makes
14938 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14939 "char debug_on_exit : 1" as this is not portable either; instead,
14940 use the portable "unsigned int debug_on_exit : 1". Remove unused
14941 member evalargs. Remove obsolete comments about cc bombing out.
14942
14943 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14944
14945 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14946 Let HAVE_GSETTINGS override HAVE_GCONF.
14947 (store_monospaced_changed): New function.
14948 (EMACS_SETTINGS): A new type derived from GObject to handle
14949 GSettings notifications.
14950 (emacs_settings_constructor, emacs_settings_get_property)
14951 (emacs_settings_set_property, emacs_settings_class_init):
14952 New functions.
14953 (gsettings_client, gsettings_obj): New variables.
14954 (GSETTINGS_SCHEMA): New define.
14955 (something_changedCB): Call store_monospaced_changed.
14956 (init_gsettings): New function.
14957 (xsettings_initialize): Call init_gsettings.
14958 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14959 to NULL.
14960
14961 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14962 GCONF_CFLAGS/LIBS.
14963
14964 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14965
14966 * window.c (resize_root_window, grow_mini_window)
14967 (shrink_mini_window): Rename Qresize_root_window to
14968 Qwindow_resize_root_window and Qresize_root_window_vertically to
14969 Qwindow_resize_root_window_vertically.
14970
14971 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14972
14973 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14974
14975 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14976
14977 * makefile.w32-in: Redesign dependencies so they reflect more
14978 clearly which files are directly included by each source file,
14979 and not through other includes.
14980
14981 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14982
14983 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14984 (sort_overlays, overlay_strings): When an overlay's clone number
14985 matches the window's clone number process the overlay even if
14986 the overlay's window property doesn't match the current window.
14987
14988 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14989 (Fwindow_hchild): Rename to Fwindow_left_child.
14990 (Fwindow_next): Rename to Fwindow_next_sibling.
14991 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14992 (resize_window_check): Rename to window_resize_check.
14993 (resize_window_apply): Rename to window_resize_apply.
14994 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14995 (Fdelete_other_windows_internal, resize_frame_windows)
14996 (Fsplit_window_internal, Fdelete_window_internal)
14997 (grow_mini_window, shrink_mini_window)
14998 (Fresize_mini_window_internal): Fix callers accordingly.
14999
15000 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15001
15002 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15003 (emacs_fixed_set_min_size): Remove.
15004 (emacs_fixed_new): Take frame as argument.
15005
15006 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15007 (_EmacsFixedPrivate): Remove minwidth/height.
15008 Add struct frame *f.
15009 (emacs_fixed_init): Initialize priv->f.
15010 (get_parent_class, emacs_fixed_set_min_size): Remove.
15011 (emacs_fixed_new): Set priv->f to argument.
15012 (emacs_fixed_get_preferred_width)
15013 (emacs_fixed_get_preferred_height): Use min_width/height from
15014 frames size_hint to set minimum and natural (Bug#8919).
15015 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15016 and use min_width/height from frames size_hint to set
15017 min_width/height (Bug#8919).
15018
15019 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15020 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15021 Fix indentation.
15022
15023 2011-06-26 Eli Zaretskii <eliz@gnu.org>
15024
15025 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15026 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15027 called at ZV.
15028
15029 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
15030
15031 * process.c (wait_reading_process_output): Bypass select if
15032 waiting for a cell while ignoring keyboard input, and input is
15033 pending. Suggested by Jan Djärv (Bug#8869).
15034
15035 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
15036
15037 Use gnulib's dup2 module instead of rolling our own.
15038 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15039
15040 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15041
15042 * dispnew.c (scrolling_window): Before scrolling, turn off a
15043 mouse-highlight in the window being scrolled.
15044
15045 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
15046
15047 Move DEFSYM to lisp.h and use everywhere.
15048
15049 * character.h (DEFSYM): Move declaration...
15050 * lisp.h (DEFSYM): ...here.
15051
15052 * gnutls.c:
15053 * minibuf.c:
15054 * w32menu.c:
15055 * w32proc.c:
15056 * w32select.c: Don't include character.h.
15057
15058 * alloc.c (syms_of_alloc):
15059 * buffer.c (syms_of_buffer):
15060 * bytecode.c (syms_of_bytecode):
15061 * callint.c (syms_of_callint):
15062 * casefiddle.c (syms_of_casefiddle):
15063 * casetab.c (init_casetab_once):
15064 * category.c (init_category_once, syms_of_category):
15065 * ccl.c (syms_of_ccl):
15066 * cmds.c (syms_of_cmds):
15067 * composite.c (syms_of_composite):
15068 * dbusbind.c (syms_of_dbusbind):
15069 * dired.c (syms_of_dired):
15070 * dispnew.c (syms_of_display):
15071 * doc.c (syms_of_doc):
15072 * editfns.c (syms_of_editfns):
15073 * emacs.c (syms_of_emacs):
15074 * eval.c (syms_of_eval):
15075 * fileio.c (syms_of_fileio):
15076 * fns.c (syms_of_fns):
15077 * frame.c (syms_of_frame):
15078 * fringe.c (syms_of_fringe):
15079 * insdel.c (syms_of_insdel):
15080 * keymap.c (syms_of_keymap):
15081 * lread.c (init_obarray, syms_of_lread):
15082 * macros.c (syms_of_macros):
15083 * msdos.c (syms_of_msdos):
15084 * print.c (syms_of_print):
15085 * process.c (syms_of_process):
15086 * search.c (syms_of_search):
15087 * sound.c (syms_of_sound):
15088 * syntax.c (init_syntax_once, syms_of_syntax):
15089 * terminal.c (syms_of_terminal):
15090 * textprop.c (syms_of_textprop):
15091 * undo.c (syms_of_undo):
15092 * w32.c (globals_of_w32):
15093 * window.c (syms_of_window):
15094 * xdisp.c (syms_of_xdisp):
15095 * xfaces.c (syms_of_xfaces):
15096 * xfns.c (syms_of_xfns):
15097 * xmenu.c (syms_of_xmenu):
15098 * xsettings.c (syms_of_xsettings):
15099 * xterm.c (syms_of_xterm): Use DEFSYM.
15100
15101 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
15102
15103 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
15104
15105 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
15106
15107 Integer and buffer overflow fixes (Bug#8873).
15108
15109 * print.c (printchar, strout): Check for string overflow.
15110 (PRINTPREPARE, printchar, strout):
15111 Don't set size unless allocation succeeds.
15112
15113 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15114 for sizes. Check for string overflow more accurately.
15115 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15116
15117 * macros.c: Integer and buffer overflow fixes.
15118 * keyboard.h (struct keyboard.kbd_macro_bufsize):
15119 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15120 Use ptrdiff_t, not int, for sizes.
15121 Don't increment bufsize until after realloc succeeds.
15122 Check for size-calculation overflow.
15123 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15124
15125 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15126
15127 * lread.c: Integer overflow fixes.
15128 (read_integer): Radix is now EMACS_INT, not int,
15129 to improve quality of diagnostics for out-of-range radices.
15130 Calculate buffer size correctly for out-of-range radices.
15131 (read1): Check for integer overflow in radices, and in
15132 read-circle numbers.
15133 (read_escape): Avoid int overflow.
15134 (Fload, openp, read_buffer_size, read1)
15135 (substitute_object_recurse, read_vector, read_list, map_obarray):
15136 Use ptrdiff_t, not int, for sizes.
15137 (read1): Use EMACS_INT, not int, for sizes.
15138 Check for size overflow.
15139
15140 * image.c (cache_image): Check for size arithmetic overflow.
15141
15142 * lread.c: Integer overflow issues.
15143 (saved_doc_string_size, saved_doc_string_length)
15144 (prev_saved_doc_string_size, prev_saved_doc_string_length):
15145 Now ptrdiff_t, not int.
15146 (read1): Don't assume doc string length fits in int. Check for
15147 out-of-range doc string lengths.
15148 (read_list): Don't assume file position fits in int.
15149 (read_escape): Check for hex character overflow.
15150
15151 2011-06-22 Leo Liu <sdl.web@gmail.com>
15152
15153 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15154 Move to minibuffer.el.
15155
15156 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15157
15158 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
15159 The following patches are for when GLYPH_DEBUG && !XASSERT.
15160 * dispextern.h (trace_redisplay_p, dump_glyph_string):
15161 * dispnew.c (flush_stdout):
15162 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15163 Mark as externally visible.
15164 * dispnew.c (check_window_matrix_pointers): Now static.
15165 * dispnew.c (window_to_frame_vpos):
15166 * xfns.c (unwind_create_frame):
15167 * xterm.c (x_check_font): Remove unused local.
15168 * scroll.c (CHECK_BOUNDS):
15169 * xfaces.c (cache_fache): Rename local to avoid shadowing.
15170 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15171 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15172 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15173 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15174 Now static.
15175 (debug_method_add): Use va_list and vsprintf rather than relying
15176 on undefined behavior with wrong number of arguments.
15177 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
15178 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
15179 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
15180 since we're not interested in debugging glyphs with old libraries.
15181 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
15182 GCC 4.6.0's static checking.
15183
15184 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15185
15186 Integer overflow and signedness fixes (Bug#8873).
15187 A few related buffer overrun fixes, too.
15188
15189 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
15190
15191 * dispextern.h (struct face.stipple):
15192 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
15193 (x_bitmap_mask, x_allocate_bitmap_record)
15194 (x_create_bitmap_from_data, x_create_bitmap_from_file)
15195 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
15196 (x_create_bitmap_from_xpm_data):
15197 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
15198 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
15199 (.bitmaps_last):
15200 * xfaces.c (load_pixmap):
15201 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
15202 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
15203 (.bitmaps_last, struct x_output.icon_bitmap):
15204 Use ptrdiff_t, not int, for bitmap indexes.
15205 (x_allocate_bitmap_record): Check for size overflow.
15206 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
15207
15208 Use ptrdiff_t, not int, for overlay counts.
15209 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
15210 * editfns.c (overlays_around, get_pos_property):
15211 * textprop.c (get_char_property_and_overlay):
15212 * xdisp.c (next_overlay_change, note_mouse_highlight):
15213 * xfaces.c (face_at_buffer_position):
15214 * buffer.c (OVERLAY_COUNT_MAX): New macro.
15215 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
15216 (Fnext_overlay_change, Fprevious_overlay_change)
15217 (mouse_face_overlay_overlaps, Foverlays_in):
15218 Use ptrdiff_t, not int, for sizes.
15219 (overlays_at, overlays_in): Check for size-calculation overflow.
15220
15221 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
15222
15223 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
15224 (x_session_initialize): Do not assume string length fits in int.
15225
15226 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
15227 This is unlikely, but can occur if DPI is outlandish.
15228
15229 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
15230 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
15231
15232 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
15233 * xrdb.c (magic_file_p, search_magic_path):
15234 Omit last arg SUFFIX; it was always 0. All callers changed.
15235 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
15236
15237 * xfont.c (xfont_match): Avoid need for strlen.
15238
15239 * xfns.c: Don't assume strlen fits in int.
15240 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
15241
15242 * xdisp.c (message_log_check_duplicate): Return intmax_t,
15243 not unsigned long, as we prefer signed integers. All callers changed.
15244 Detect integer overflow in repeat count.
15245 (message_dolog): Don't assume print length fits in 39 bytes.
15246 (display_mode_element): Don't assume strlen fits in int.
15247
15248 * termcap.c: Don't assume sizes fit in int and never overflow.
15249 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
15250 (gobble_line): Check for size-calculation overflow.
15251
15252 * minibuf.c (Fread_buffer):
15253 * lread.c (intern, intern_c_string):
15254 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
15255 Don't assume string length fits in int.
15256
15257 * keyboard.c (parse_tool_bar_item):
15258 * gtkutil.c (style_changed_cb): Avoid need for strlen.
15259
15260 * font.c: Don't assume string length fits in int.
15261 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
15262 Use ptrdiff_t, not int.
15263 (font_intern_prop): Don't assume string length fits in int.
15264 Don't assume integer property fits in fixnum.
15265 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
15266
15267 * filelock.c: Fix some buffer overrun and integer overflow issues.
15268 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
15269 Reformulate so as not to need the command string.
15270 Invoke gzip -cd rather than gunzip, as it's more portable.
15271 (lock_info_type, lock_file_1, lock_file):
15272 Don't assume pid_t and time_t fit in unsigned long.
15273 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
15274 (current_lock_owner): Prefer signed type for sizes.
15275 Use memcpy, not strncpy, where memcpy is what is really wanted.
15276 Don't assume (via atoi) that time_t and pid_t fit in int.
15277 Check for time_t and/or pid_t out of range, e.g., via a network share.
15278 Don't alloca where an auto var works fine.
15279
15280 * fileio.c: Fix some integer overflow issues.
15281 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
15282 Don't assume string length fits in int.
15283 (directory_file_name): Don't assume string length fits in long.
15284 (make_temp_name): Don't assume pid fits in int, or that its print
15285 length is less than 20.
15286
15287 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
15288
15289 * coding.c (make_subsidiaries): Don't assume string length fits in int.
15290
15291 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
15292
15293 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
15294 We prefer signed integers, even for size calculations.
15295
15296 * emacs.c: Don't assume string length fits in 'int'.
15297 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
15298 (main): Don't invoke strlen when not needed.
15299
15300 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
15301 (XD_DEBUG_MESSAGE): Don't waste a byte.
15302
15303 * callproc.c (getenv_internal_1, getenv_internal)
15304 (Fgetenv_internal):
15305 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
15306
15307 * lread.c (invalid_syntax): Omit length argument.
15308 All uses changed. This doesn't fix a bug, but it simplifies the
15309 code away from its former Hollerith-constant appearance, and it's
15310 one less 'int' to worry about when looking at integer-overflow issues.
15311 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
15312
15313 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
15314 This didn't break anything, but it didn't help either.
15315 It's confusing to put a bogus integer in a place where the actual
15316 value does not matter.
15317 (LIST_END_P): Remove unused macro and its bogus comment.
15318 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
15319
15320 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
15321 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
15322 implementation.
15323 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
15324 We prefer signed types, and the value cannot exceed the EMACS_INT
15325 range anyway (because otherwise the length would not be representable).
15326 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
15327 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
15328 This avoids a GCC warning when WIDE_EMACS_INT.
15329
15330 * indent.c (sane_tab_width): New function.
15331 (current_column, scan_for_column, Findent_to, position_indentation)
15332 (compute_motion): Use it. This is just for clarity.
15333 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
15334
15335 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
15336
15337 * lisp.h (lint_assume): New macro.
15338 * composite.c (composition_gstring_put_cache):
15339 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15340
15341 * editfns.c, insdel.c:
15342 Omit unnecessary forward decls, to simplify future changes.
15343
15344 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15345
15346 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15347
15348 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15349 Use much-faster test for byte-length change.
15350 Don't assume string byte-length fits in 'int'.
15351 Check that character arg fits in 'int'.
15352 (mapcar1): Declare byte as byte, for clarity.
15353
15354 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15355
15356 * fns.c (concat): Catch string overflow earlier.
15357 Do not rely on integer wraparound.
15358
15359 * dispextern.h (struct it.overlay_strings_charpos)
15360 (struct it.selective): Now EMACS_INT, not int.
15361 * xdisp.c (forward_to_next_line_start)
15362 (back_to_previous_visible_line_start)
15363 (reseat_at_next_visible_line_start, next_element_from_buffer):
15364 Don't arbitrarily truncate the value of 'selective' to int.
15365
15366 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15367
15368 * composite.c: Don't truncate sizes to 'int'.
15369 (composition_gstring_p, composition_reseat_it)
15370 (composition_adjust_point): Use EMACS_INT, not int.
15371 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15372 not EMACS_UINT, for indexes.
15373
15374 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15375
15376 * buffer.c: Include <verify.h>.
15377 (struct sortvec.priority, struct sortstr.priority):
15378 Now EMACS_INT, not int.
15379 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15380 (struct sortstr.size, record_overlay_string)
15381 (struct sortstrlist.size, struct sortlist.used):
15382 Don't truncate size to int.
15383 (record_overlay_string): Check for size-calculation overflow.
15384 (init_buffer_once): Check at compile-time, not run-time.
15385
15386 2011-06-22 Jim Meyering <meyering@redhat.com>
15387
15388 Don't leak an XBM-image-sized buffer
15389 * image.c (xbm_load): Free the image buffer after using it.
15390
15391 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15392
15393 Port to Sun C.
15394 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15395 that Sun C diagnosed.
15396 * fns.c (secure_hash): Fix pointer signedness issue.
15397 * intervals.c (static_offset_intervals): New function.
15398 (offset_intervals): Use it.
15399
15400 2011-06-21 Leo Liu <sdl.web@gmail.com>
15401
15402 * deps.mk (fns.o):
15403 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15404 sha512.h.
15405
15406 * fns.c (secure_hash): Rename from crypto_hash_function and change
15407 the first arg to accept symbols.
15408 (Fsecure_hash): New primitive.
15409 (syms_of_fns): New symbols.
15410
15411 2011-06-20 Deniz Dogan <deniz@dogan.se>
15412
15413 * process.c (Fset_process_buffer): Clarify return value in
15414 docstring.
15415
15416 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
15417
15418 * dispnew.c (add_window_display_history): Use BVAR.
15419
15420 * xdisp.c (debug_method_add): Use BVAR.
15421 (check_window_end, dump_glyph_matrix, dump_glyph)
15422 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15423
15424 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15425 Likewise.
15426
15427 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15428 check till after the cache is created in init_frame_faces.
15429
15430 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
15431
15432 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15433
15434 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
15435
15436 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15437 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15438 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15439
15440 Improve buffer-overflow checking (Bug#8873).
15441 * fileio.c (Finsert_file_contents):
15442 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15443 Remove the old (too-loose) buffer overflow checks.
15444 They weren't needed, since make_gap checks for buffer overflow.
15445 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15446 The old code merely checked for Emacs fixnum overflow, and relied
15447 on undefined (wraparound) behavior. The new code avoids undefined
15448 behavior, and also checks for ptrdiff_t and/or size_t overflow.
15449
15450 * editfns.c (Finsert_char): Don't dump core with very negative counts.
15451 Tune. Don't use wider integers than needed. Don't use alloca.
15452 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
15453
15454 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15455
15456 * insdel.c, lisp.h (buffer_overflow): New function.
15457 (insert_from_buffer_1, replace_range, replace_range_2):
15458 * insdel.c (make_gap_larger):
15459 * editfns.c (Finsert_char):
15460 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15461
15462 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15463
15464 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
15465
15466 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15467
15468 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15469 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15470
15471 * fileio.c: Don't assume EMACS_INT fits in off_t.
15472 (emacs_lseek): New static function.
15473 (Finsert_file_contents, Fwrite_region): Use it.
15474 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15475
15476 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15477
15478 * fns.c: Don't overflow int when computing a list length.
15479 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15480 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15481 truncation on 64-bit hosts. Check for QUIT every
15482 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15483 faster and is responsive enough.
15484 (Flength): Report an error instead of overflowing an integer.
15485 (Fsafe_length): Return a float if the value is not representable
15486 as a fixnum. This shouldn't happen except in contrived situations.
15487 (Fnthcdr, Fsort): Don't assume list length fits in int.
15488 (Fcopy_sequence): Don't assume vector length fits in int.
15489
15490 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15491 (header_size, word_size): New constants.
15492 (allocate_vectorlike): Don't check size overflow here.
15493 (allocate_vector): Check it here instead, since this is the only
15494 caller of allocate_vectorlike that could cause overflow.
15495 Check that the new vector's length is representable as a fixnum.
15496
15497 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15498 The previous code was bogus. For example, next_almost_prime (32)
15499 returned 39, which is undesirable as it is a multiple of 3; and
15500 next_almost_prime (24) returned 25, which is a multiple of 5 so
15501 why was the code bothering to check for multiples of 7?
15502
15503 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15504
15505 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15506
15507 Variadic C functions now count arguments with ptrdiff_t.
15508 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15509 Back then I didn't know that the Emacs coding style prefers signed int.
15510 Also, in the meantime I found a few more instances where arguments
15511 were being counted with int, which may truncate counts on 64-bit
15512 machines, or EMACS_INT, which may be unnecessarily wide.
15513 * lisp.h (struct Lisp_Subr.function.aMANY)
15514 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15515 Arg counts are now ptrdiff_t, not size_t.
15516 All variadic functions and their callers changed accordingly.
15517 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15518 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15519 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15520 * callint.c (Fcall_interactively): Check arg count for overflow,
15521 to avoid potential buffer overrun. Use signed char, not 'int',
15522 for 'varies' array, so that we needn't bother to check its size
15523 calculation for overflow.
15524 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15525 * eval.c (apply_lambda):
15526 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15527 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15528 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15529
15530 * callint.c (Fcall_interactively): Don't use index var as event count.
15531
15532 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15533 * mem-limits.h (SIZE): Remove; no longer used.
15534
15535 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15536
15537 Remove unnecessary casts.
15538 * xterm.c (x_term_init):
15539 * xfns.c (x_set_border_pixel):
15540 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15541 These aren't needed now that we assume ANSI C.
15542
15543 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15544 It's more likely to cause problems (due to unsigned overflow)
15545 than to cure them.
15546
15547 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15548
15549 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15550
15551 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15552
15553 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15554
15555 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15556
15557 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15558
15559 GLYPH_CODE_FACE returns EMACS_INT, not int.
15560 * dispextern.h (merge_faces):
15561 * xfaces.c (merge_faces):
15562 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15563 Don't assume EMACS_INT fits in int.
15564
15565 * character.h (CHAR_VALID_P): Remove unused parameter.
15566 * fontset.c, lisp.h, xdisp.c: All uses changed.
15567
15568 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15569
15570 * fns.c (concat): Minor tuning based on overflow analysis.
15571 This doesn't fix any bugs. Use int to hold character, instead
15572 of constantly refetching from Emacs object. Use XFASTINT, not
15573 XINT, for value known to be a character. Don't bother comparing
15574 a single byte to 0400, as it's always less.
15575
15576 * floatfns.c (Fexpt):
15577 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15578
15579 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15580 for characters.
15581
15582 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15583
15584 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15585 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15586 incorrectly succeed when S was a string, because 4294967386 was
15587 truncated before it was used.
15588
15589 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15590 Otherwise, an out-of-range integer could cause undefined behavior
15591 on a 64-bit host.
15592
15593 * composite.c: Use int, not EMACS_INT, for characters.
15594 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15595 EMACS_INT, for values that are known to be in character range.
15596 This doesn't fix any bugs but is the usual style inside Emacs and
15597 may generate better code on 32-bit machines.
15598
15599 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15600 This is for reasons similar to the recent CHAR_STRING fix.
15601 * charset.c (Fencode_char): Check that character arg is actually
15602 a character. Pass an int to ENCODE_CHAR.
15603 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15604 wider than 'int', as a compile-time check to prevent future regressions
15605 in this area.
15606
15607 * character.c (char_string): Remove unnecessary casts.
15608
15609 Make sure a 64-bit char is never passed to CHAR_STRING.
15610 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15611 by silently ignoring the top 32 bits, allowing some values
15612 that were far too large to be valid characters.
15613 * character.h: Include <verify.h>.
15614 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15615 arguments are no wider than unsigned, as a compile-time check
15616 to prevent future regressions in this area.
15617 * data.c (Faset):
15618 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15619 (Fsubst_char_in_region):
15620 * fns.c (concat):
15621 * xdisp.c (decode_mode_spec_coding):
15622 Adjust to CHAR_STRING's new requirement.
15623 * editfns.c (Finsert_char, Fsubst_char_in_region):
15624 * fns.c (concat): Check that character args are actually
15625 characters. Without this test, these functions did the wrong
15626 thing with wildly out-of-range values on 64-bit hosts.
15627
15628 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15629 These casts should not be needed on 32-bit hosts, either.
15630 * keyboard.c (read_char):
15631 * lread.c (Fload): Remove casts to unsigned.
15632
15633 * lisp.h (UNSIGNED_CMP): New macro.
15634 This fixes comparison bugs on 64-bit hosts.
15635 (ASCII_CHAR_P): Use it.
15636 * casefiddle.c (casify_object):
15637 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15638 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15639 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15640 * dispextern.h (FACE_FROM_ID):
15641 * keyboard.c (read_char): Use UNSIGNED_CMP.
15642
15643 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15644 not to EMACS_INT, to avoid GCC warning.
15645
15646 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15647
15648 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15649 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15650 isn't needed on 32-bit machines.
15651
15652 * buffer.c (Fgenerate_new_buffer_name):
15653 Use EMACS_INT for count, not int.
15654 (advance_to_char_boundary): Return EMACS_INT, not int.
15655
15656 * data.c (Qcompiled_function): Now static.
15657
15658 * window.c (window_body_lines): Now static.
15659
15660 * image.c (gif_load): Rename local to avoid shadowing.
15661
15662 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15663 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15664 * alloc.c (make_save_value): Integer argument is now of type
15665 ptrdiff_t, not int.
15666 (mark_object): Use ptrdiff_t, not int.
15667 * lisp.h (pD): New macro.
15668 * print.c (print_object): Use it.
15669
15670 * alloc.c: Use EMACS_INT, not int, to count objects.
15671 (total_conses, total_markers, total_symbols, total_vector_size)
15672 (total_free_conses, total_free_markers, total_free_symbols)
15673 (total_free_floats, total_floats, total_free_intervals)
15674 (total_intervals, total_strings, total_free_strings):
15675 Now EMACS_INT, not int. All uses changed.
15676 (Fgarbage_collect): Compute overall total using a double, so that
15677 integer overflow is less likely to be a problem. Check for overflow
15678 when converting back to an integer.
15679 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15680 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15681 These were 'int' variables that could overflow on 64-bit hosts;
15682 they were never used, so remove them instead of repairing them.
15683 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15684 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15685 Previously, this ceilinged at INT_MAX, but that doesn't work on
15686 64-bit machines.
15687 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15688
15689 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15690 (allocate_vectorlike): Check for ptrdiff_t overflow.
15691 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15692 when a (possibly-narrower) signed value would do just as well.
15693 We prefer using signed arithmetic, to avoid comparison confusion.
15694
15695 * alloc.c: Catch some string size overflows that we were missing.
15696 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15697 for convenience in STRING_BYTES_MAX.
15698 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15699 The definition here is exact; the one in lisp.h was approximate.
15700 (allocate_string_data): Check for string overflow. This catches
15701 some instances we weren't catching before. Also, it catches
15702 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15703 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15704 and ptrdiff_t and EMACS_INT are both 64 bits.
15705
15706 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15707 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15708 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15709
15710 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15711
15712 * alloc.c (Fmake_string): Check for out-of-range init.
15713
15714 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15715
15716 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15717
15718 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15719
15720 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15721 xg_get_default_scrollbar_width.
15722
15723 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15724 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15725 (style_changed_cb): Call update_theme_scrollbar_width and call
15726 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15727 all frames (Bug#8505).
15728 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15729 Call gtk_window_set_resizable if HAVE_GTK3.
15730 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15731 and height if HAVE_GTK3 (Bug#8505).
15732 (scroll_bar_width_for_theme): New variable.
15733 (update_theme_scrollbar_width): New function.
15734 (xg_get_default_scrollbar_width): Move code to
15735 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15736 (xg_initialize): Call update_theme_scrollbar_width.
15737
15738 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15739
15740 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15741
15742 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15743
15744 * frame.c (make_frame): Call other_buffer_safely instead of
15745 other_buffer.
15746
15747 * window.c (temp_output_buffer_show): Call display_buffer with
15748 second argument Vtemp_buffer_show_specifiers and reset latter
15749 immediately after the call.
15750 (Vtemp_buffer_show_specifiers): New variable.
15751 (auto_window_vscroll_p, next_screen_context_lines)
15752 (Vscroll_preserve_screen_position): Remove leading asterisks from
15753 doc-strings.
15754
15755 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15756
15757 Fix minor problems found by GCC 4.6.0 static checking.
15758 * buffer.c (Qclone_number): Remove for now, as it's unused.
15759 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15760 (record_buffer): Remove unused local.
15761 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15762 (set_frame_buffer_list): Remove; unused.
15763 * frame.h (other_visible_frames): Remove decl.
15764 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15765 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15766 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15767 if HAVE_GPM.
15768 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15769 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15770 Define only if HAVE_GPM.
15771 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15772 (update_hints_inhibit): Remove; never set. All uses removed.
15773 * widgetprv.h (emacsFrameClassRec): Remove decl.
15774 * window.c (delete_deletable_window): Now returns void, since it
15775 wasn't returning anything.
15776 (compare_window_configurations): Remove unused locals.
15777 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15778 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15779 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15780 the same widths as pointers. This follows up on the 2011-05-06 patch.
15781 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15782 * xterm.h: Likewise.
15783 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15784
15785 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15786
15787 * makefile.w32-in: Update dependencies.
15788 (LISP_H): Add lib/intprops.h.
15789
15790 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15791
15792 * image.c (gif_load): Add animation frame delay to the metadata.
15793 (syms_of_image): Use DEFSYM. New symbol `delay'.
15794
15795 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15796
15797 * window.c (delete_deletable_window): Re-add.
15798 (Fset_window_configuration): Rewrite to handle dead buffers and
15799 consequently deletable windows.
15800 (window_tree, Fwindow_tree): Remove. Supply functionality in
15801 window.el.
15802 (compare_window_configurations): Simplify code.
15803
15804 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15805
15806 * image.c (imagemagick_load_image): Fix type mismatch.
15807 (Fimagemagick_types): Likewise.
15808
15809 * window.h (replace_buffer_in_windows): Declare.
15810
15811 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15812
15813 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15814 Qclone_number. Remove external declaration of Qdelete_window.
15815 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15816 code.
15817 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15818 Run Qbuffer_list_update_hook if allowed.
15819 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15820 buffer list implementation.
15821 (other_buffer_safely): New function.
15822 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15823 calls to replace_buffer_in_windows and
15824 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15825 if allowed.
15826 (record_buffer): Inhibit quitting and rewrite using quittable
15827 functions. Run Qbuffer_list_update_hook if allowed.
15828 (Frecord_buffer, Funrecord_buffer): New functions.
15829 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15830 Move switch-to-buffer to window.el.
15831 (bury-buffer): Move to window.el.
15832 (Vbuffer_list_update_hook): New variable.
15833
15834 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15835 section.
15836
15837 * window.h (resize_frame_windows): Move up in code.
15838 (Fwindow_frame): Remove EXFUN.
15839 (replace_buffer_in_all_windows): Remove prototype.
15840 (replace_buffer_in_windows_safely): Add prototype.
15841
15842 * window.c: Declare Qdelete_window static again. Move down
15843 declaration of select_count.
15844 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15845 (Fother_window): Move to window.el.
15846 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15847 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15848 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15849 window.el.
15850 (replace_buffer_in_windows): Implement by calling
15851 Qreplace_buffer_in_windows.
15852 (replace_buffer_in_all_windows): Remove with some functionality
15853 moved into replace_buffer_in_windows_safely.
15854 (replace_buffer_in_windows_safely): New function.
15855 (select_window_norecord, select_frame_norecord): Move in front
15856 of run_window_configuration_change_hook. Remove now obsolete
15857 declarations.
15858 (Fset_window_buffer): Rewrite doc-string.
15859 Call Qrecord_window_buffer.
15860 (keys_of_window): Move binding for other-window to window.el.
15861
15862 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15863
15864 * dispextern.h (struct image): Replace data member, whose int_val
15865 and ptr_val fields were not used by anything, with a single
15866 lisp_val object.
15867
15868 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15869 (gif_clear_image, gif_load, imagemagick_load_image)
15870 (gs_clear_image, gs_load): Callers changed.
15871
15872 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15873
15874 * buffer.h: Include <time.h>, for time_t.
15875 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15876
15877 Fix minor problems found by static checking.
15878
15879 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15880
15881 Make identifiers static if they are not used in other modules.
15882 * data.c (Qcompiled_function, Qframe, Qvector):
15883 * image.c (QimageMagick, Qsvg):
15884 * minibuf.c (Qmetadata):
15885 * window.c (resize_window_check, resize_root_window): Now static.
15886 * window.h (resize_window_check, resize_root_window): Remove decls.
15887
15888 * window.c (window_deletion_count, delete_deletable_window):
15889 Remove; unused.
15890 (window_body_lines): Now static.
15891 (Fdelete_other_windows_internal): Mark vars as initialized.
15892 Make sure 'resize_failed' is initialized.
15893 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15894 (resize_window_apply): Remove unused local.
15895 * window.h (delete_deletable_window): Remove decl.
15896
15897 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15898 (imagemagick_load_image): Fix pointer signedness problem by changing
15899 last arg from unsigned char * to char *. All uses changed.
15900 Also, fix a local for similar reasons.
15901 Remove unused locals. Remove locals to avoid shadowing.
15902 (fn_rsvg_handle_free): Remove; unused.
15903 (svg_load, svg_load_image): Fix pointer signedness problem.
15904 (imagemagick_load_image): Don't use garbage pointer image_wand.
15905
15906 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15907
15908 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15909
15910 * image.c (gif_load): Fix omitted cast error introduced by
15911 2011-06-06 change.
15912
15913 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15914
15915 * window.h (resize_proportionally, orig_total_lines)
15916 (orig_top_line): Remove from window structure.
15917 (set_window_height, set_window_width, change_window_heights)
15918 (Fdelete_window): Remove prototypes.
15919 (resize_frame_windows): Remove duplicate declaration.
15920
15921 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15922
15923 * window.h (resize_frame_windows, resize_window_check)
15924 (delete_deletable_window, resize_root_window)
15925 (resize_frame_windows): Declare prototypes.
15926
15927 * window.c (resize_window_apply): Make definition be "static" to
15928 match the prototype.
15929
15930 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15931
15932 * window.c: Remove declarations of Qwindow_size_fixed,
15933 window_min_size_1, window_min_size_2, window_min_size,
15934 size_window, window_fixed_size_p, enlarge_window, delete_window.
15935 Remove static from declaration of Qdelete_window, it's
15936 temporarily needed by Fbury_buffer.
15937 (replace_window): Don't assign orig_top_line and
15938 orig_total_lines.
15939 (Fdelete_window, delete_window): Remove. Window deletion is
15940 handled by window.el.
15941 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15942 Replace Fdelete_window calls with calls to Qdelete_window.
15943 (Fdelete_other_windows): Remove. Deleting other windows is
15944 handled by window.el.
15945 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15946 handled in window.el.
15947 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15948 Window minimum sizes are handled in window.el.
15949 (shrink_windows, size_window, set_window_height)
15950 (set_window_width, change_window_heights, window_height)
15951 (window_width, CURBEG, CURSIZE, enlarge_window)
15952 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15953 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15954 handled in window.el.
15955 (make_dummy_parent): Rename to make_parent_window and give it a
15956 second argument horflag.
15957 (make_window): Don't set resize_proportionally any more.
15958 (Fsplit_window): Remove. Windows are split in window.el.
15959 (save_restore_action, save_restore_orig_size)
15960 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15961 Resize mini windows in window.el.
15962 (grow_mini_window, shrink_mini_window): Implement by calling
15963 Qresize_root_window_vertically, resize_window_check and
15964 resize_window_apply.
15965 (saved_window, Fset_window_configuration, save_window_save):
15966 Do not handle orig_top_line, orig_total_lines, and
15967 resize_proportionally.
15968 (window_min_height, window_min_width): Move to window.el.
15969 (keys_of_window): Move bindings for delete-other-windows,
15970 split-window, delete-window and enlarge-window to window.el.
15971
15972 * buffer.c: Temporarily extern Qdelete_window.
15973 (Fbury_buffer): Temporarily call Qdelete_window instead of
15974 Fdelete_window (Fbury_buffer will move to window.el soon).
15975
15976 * frame.c (set_menu_bar_lines_1): Remove code handling
15977 orig_top_line and orig_total_lines.
15978
15979 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15980 set_window_height but set heights directly.
15981 (change_frame_size_1): Use resize_frame_windows.
15982
15983 * xdisp.c (init_xdisp): Don't use set_window_height but set
15984 heights directly.
15985
15986 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15987 Use resize_frame_windows instead of change_window_heights and run
15988 run_window_configuration_change_hook.
15989
15990 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15991 instead of change_window_heights and run
15992 run_window_configuration_change_hook.
15993
15994 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15995
15996 * window.c (replace_window): Rename second argument REPLACEMENT to
15997 NEW. New third argument SETFLAG. Rewrite.
15998 (delete_window, make_dummy_parent): Call replace_window with
15999 third argument 1.
16000 (window_list_1): Move down in code.
16001 (run_window_configuration_change_hook): Move set_buffer part
16002 before select_frame_norecord part in order to unwind correctly.
16003 Rename count1 to count.
16004 (recombine_windows, delete_deletable_window, resize_root_window)
16005 (Fdelete_other_windows_internal)
16006 (Frun_window_configuration_change_hook, make_parent_window)
16007 (resize_window_check, resize_window_apply, Fresize_window_apply)
16008 (resize_frame_windows, Fsplit_window_internal)
16009 (Fdelete_window_internal, Fresize_mini_window_internal):
16010 New functions.
16011 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16012
16013 2011-06-08 Martin Rudalics <rudalics@gmx.at>
16014
16015 * window.h (window): Add some new members to window structure -
16016 normal_lines, normal_cols, new_total, new_normal, clone_number,
16017 splits, nest, prev_buffers, next_buffers.
16018 (WINDOW_TOTAL_SIZE): Move here from window.c.
16019 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16020
16021 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16022 Remove.
16023 (make_dummy_parent): Set new members of windows structure.
16024 (make_window): Move down in code. Handle new members of window
16025 structure.
16026 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16027 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16028 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16029 (Fset_window_prev_buffers, Fwindow_next_buffers)
16030 (Fset_window_next_buffers, Fset_window_clone_number):
16031 New functions.
16032 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16033 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16034 Doc-string fixes.
16035 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16036 Argument WINDOW can be now internal window too.
16037 (Fwindow_use_time): Move up in code.
16038 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16039 Rewrite doc-string.
16040 (Fset_window_configuration, saved_window)
16041 (Fcurrent_window_configuration, save_window_save): Handle new
16042 members of window structure.
16043 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16044 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16045 (syms_of_window): New Lisp objects Qrecord_window_buffer,
16046 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16047 Qget_mru_window, Qresize_root_window,
16048 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16049 Qauto_buffer_name; staticpro them.
16050
16051 2011-06-07 Martin Rudalics <rudalics@gmx.at>
16052
16053 * window.c (Fwindow_total_size, Fwindow_left_column)
16054 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16055 (Fwindow_list_1): New functions.
16056 (window_box_text_cols): Replace with window_body_cols.
16057 (Fwindow_width, Fscroll_left, Fscroll_right):
16058 Use window_body_cols instead of window_box_text_cols.
16059 (delete_window, Fset_window_configuration):
16060 Call delete_all_subwindows with window as argument.
16061 (delete_all_subwindows): Take a window as argument and not a
16062 structure. Rewrite.
16063 (window_loop): Remove handling of GET_LRU_WINDOW and
16064 GET_LARGEST_WINDOW.
16065 (Fget_lru_window, Fget_largest_window): Move to window.el.
16066
16067 * window.h: Extern window_body_cols instead of
16068 window_box_text_cols. delete_all_subwindows now takes a
16069 Lisp_Object as argument.
16070
16071 * indent.c (compute_motion, Fcompute_motion):
16072 Use window_body_cols instead of window_box_text_cols.
16073
16074 * frame.c (delete_frame): Call delete_all_subwindows with root
16075 window as argument.
16076
16077 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
16078
16079 * fns.c (Fputhash): Document return value.
16080
16081 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
16082
16083 * image.c (gif_load): Implement gif89a spec "no disposal" method.
16084
16085 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16086
16087 Cons<->int and similar integer overflow fixes (Bug#8794).
16088
16089 Check for overflow when converting integer to cons and back.
16090 * charset.c (Fdefine_charset_internal, Fdecode_char):
16091 Use cons_to_unsigned to catch overflow.
16092 (Fencode_char): Use INTEGER_TO_CONS.
16093 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16094 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16095 * data.c (long_to_cons, cons_to_long): Remove.
16096 (cons_to_unsigned, cons_to_signed): New functions.
16097 These signal an error for invalid or out-of-range values.
16098 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16099 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16100 * font.c (Ffont_variation_glyphs):
16101 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16102 * lisp.h: Include <intprops.h>.
16103 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16104 (cons_to_signed, cons_to_unsigned): New decls.
16105 (long_to_cons, cons_to_long): Remove decls.
16106 * undo.c (record_first_change): Use INTEGER_TO_CONS.
16107 (Fprimitive_undo): Use CONS_TO_INTEGER.
16108 * xfns.c (Fx_window_property): Likewise.
16109 * xselect.c: Include <limits.h>.
16110 (x_own_selection, selection_data_to_lisp_data):
16111 Use INTEGER_TO_CONS.
16112 (x_handle_selection_request, x_handle_selection_clear)
16113 (x_get_foreign_selection, Fx_disown_selection_internal)
16114 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16115 (lisp_data_to_selection_data): Use cons_to_unsigned.
16116 (x_fill_property_data): Use cons_to_signed.
16117 Report values out of range.
16118
16119 Check for buffer and string overflow more precisely.
16120 * buffer.h (BUF_BYTES_MAX): New macro.
16121 * lisp.h (STRING_BYTES_MAX): New macro.
16122 * alloc.c (Fmake_string):
16123 * character.c (string_escape_byte8):
16124 * coding.c (coding_alloc_by_realloc):
16125 * doprnt.c (doprnt):
16126 * editfns.c (Fformat):
16127 * eval.c (verror):
16128 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16129 since they may not be the same number.
16130 * editfns.c (Finsert_char):
16131 * fileio.c (Finsert_file_contents):
16132 Likewise for BUF_BYTES_MAX.
16133
16134 * image.c: Use ptrdiff_t, not int, for sizes.
16135 (slurp_file): Switch from int to ptrdiff_t.
16136 All uses changed.
16137 (slurp_file): Check that file size fits in both size_t (for
16138 malloc) and ptrdiff_t (for sanity and safety).
16139
16140 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16141 if b->modtime has its maximal value.
16142
16143 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16144
16145 Don't assume time_t can fit into int.
16146 * buffer.h (struct buffer.modtime): Now time_t, not int.
16147 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16148 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16149
16150 Minor fixes for signed vs unsigned integers.
16151 * character.h (MAYBE_UNIFY_CHAR):
16152 * charset.c (maybe_unify_char):
16153 * keyboard.c (read_char, reorder_modifiers):
16154 XINT -> XFASTINT, since the integer must be nonnegative.
16155 * ftfont.c (ftfont_spec_pattern):
16156 * keymap.c (access_keymap, silly_event_symbol_error):
16157 XUINT -> XFASTINT, since the integer must be nonnegative.
16158 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16159 since it makes no difference and we prefer signed.
16160 * keyboard.c (record_char): Use XUINT when all the neighbors do.
16161 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16162 nonnegative.
16163
16164 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
16165
16166 * window.h (Fwindow_frame): Declare.
16167
16168 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16169
16170 * alloc.c: Simplify handling of large-request failures (Bug#8800).
16171 (SPARE_MEMORY): Always define.
16172 (LARGE_REQUEST): Remove.
16173 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16174
16175 2011-06-06 Martin Rudalics <rudalics@gmx.at>
16176
16177 * lisp.h: Move EXFUNS for Fframe_root_window,
16178 Fframe_first_window and Fset_frame_selected_window to window.h.
16179
16180 * window.h: Move EXFUNS for Fframe_root_window,
16181 Fframe_first_window and Fset_frame_selected_window here from
16182 lisp.h.
16183
16184 * frame.c (Fwindow_frame, Fframe_first_window)
16185 (Fframe_root_window, Fframe_selected_window)
16186 (Fset_frame_selected_window): Move to window.c.
16187 (Factive_minibuffer_window): Move to minibuf.c.
16188 (Fother_visible_frames_p): New function.
16189
16190 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
16191
16192 * window.c (decode_window, decode_any_window): Move up in code.
16193 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
16194 (inhibit_frame_unsplittable): Remove unused variable.
16195 (Fwindow_buffer): Move up and rewrite doc-string.
16196 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
16197 (Fwindow_prev): New functions.
16198 (Fwindow_frame): Move here from frame.c. Accept any window as
16199 argument.
16200 (Fframe_root_window, Fframe_first_window)
16201 (Fframe_selected_window): Move here from frame.c. Accept frame
16202 or arbitrary window as argument. Update doc-strings.
16203 (Fminibuffer_window): Move up in code.
16204 (Fwindow_minibuffer_p): Move up in code and simplify.
16205 (Fset_frame_selected_window): Move here from frame.c.
16206 Marginal rewrite.
16207 (Fselected_window, select_window, Fselect_window): Move up in
16208 code. Minor doc-string fixes.
16209
16210 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16211
16212 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
16213 Do not assume that spare memory exists; that assumption is valid
16214 only if SYSTEM_MALLOC.
16215 (LARGE_REQUEST): New macro, so that the issue of large requests
16216 is separated from the issue of spare memory.
16217
16218 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
16219
16220 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
16221 format. (Bug#8806)
16222
16223 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
16224
16225 * xfns.c (x_set_scroll_bar_default_width): Move declarations
16226 before statements.
16227
16228 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
16229
16230 * gtkutil.c (xg_get_default_scrollbar_width): New function.
16231
16232 * gtkutil.h: Declare xg_get_default_scrollbar_width.
16233
16234 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
16235 min width by calling x_set_scroll_bar_default_width (Bug#8505).
16236
16237 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
16238
16239 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
16240
16241 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
16242
16243 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
16244 (x_clipboard_manager_save): Add return value.
16245 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
16246 New error handlers.
16247 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
16248 Obey Vx_select_enable_clipboard_manager. Catch errors in
16249 x_clipboard_manager_save (Bug#8779).
16250 (Vx_select_enable_clipboard_manager): New variable.
16251 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
16252
16253 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
16254
16255 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
16256
16257 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16258
16259 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
16260 in the current matrix if keep_current_p is non-zero.
16261
16262 2011-06-04 Eli Zaretskii <eliz@gnu.org>
16263
16264 * bidi.c (bidi_level_of_next_char): Fix last change.
16265
16266 2011-06-03 Eli Zaretskii <eliz@gnu.org>
16267
16268 Support bidi reordering of text covered by display properties.
16269
16270 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
16271 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
16272 (bidi_cache_search, bidi_cache_iterator_state)
16273 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
16274 (bidi_level_of_next_char, bidi_move_to_visually_next):
16275 Support character positions inside a run of characters covered by a
16276 display string.
16277 (bidi_paragraph_init, bidi_resolve_explicit_1)
16278 (bidi_level_of_next_char): Call bidi_fetch_char and
16279 bidi_fetch_char_advance instead of FETCH_CHAR and
16280 FETCH_CHAR_ADVANCE.
16281 (bidi_init_it): Initialize new members.
16282 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
16283 definitions.
16284 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
16285 instead of using explicit *_CHAR codes.
16286 (bidi_resolve_explicit, bidi_resolve_weak):
16287 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
16288 bidirectional text is supported only in multibyte buffers.
16289 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
16290 it to initialize the frame_window_p member of struct bidi_it.
16291 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
16292 (bidi_resolve_explicit, bidi_resolve_weak)
16293 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
16294 bidi_it->nchars is non-positive.
16295 (bidi_level_of_next_char): Don't try to lookup the cache for the
16296 next/previous character if nothing is cached there yet, or if we
16297 were just reseat()'ed to a new position.
16298
16299 * xdisp.c (set_cursor_from_row): Set start and stop points
16300 according to the row's direction when priming the loop that looks
16301 for the glyph on which to display cursor.
16302 (single_display_spec_intangible_p): Function deleted.
16303 (display_prop_intangible_p): Reimplement to call
16304 handle_display_spec instead of single_display_spec_intangible_p.
16305 Accept 3 additional arguments needed by handle_display_spec.
16306 This fixes incorrect cursor motion across display property with complex
16307 values: lists, `(when COND...)' forms, etc.
16308 (single_display_spec_string_p): Support property values that are
16309 lists with the argument STRING its top-level element.
16310 (display_prop_string_p): Fix the condition for processing a
16311 property that is a list to be consistent with handle_display_spec.
16312 (handle_display_spec): New function, refactored from the
16313 last portion of handle_display_prop.
16314 (compute_display_string_pos): Accept additional argument
16315 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
16316 value of a `display' property is a "replacing spec".
16317 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
16318 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
16319 the display property, but just return a value indicating whether
16320 the display property will replace the characters it covers.
16321 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
16322 frame_window_p members of struct bidi_it.
16323 (compute_display_string_pos, compute_display_string_end):
16324 New functions.
16325 (push_it): Accept second argument POSITION, where pop_it should
16326 jump to continue iteration.
16327 (reseat_1): Initialize bidi_it.disp_pos.
16328
16329 * keyboard.c (adjust_point_for_property): Adjust the call to
16330 display_prop_intangible_p to its new signature.
16331
16332 * dispextern.h (struct bidi_it): New member frame_window_p.
16333 (bidi_init_it): Update prototypes.
16334 (display_prop_intangible_p): Update prototype.
16335 (compute_display_string_pos, compute_display_string_end):
16336 Declare prototypes.
16337 (struct bidi_it): New members nchars and disp_pos. ch_len is now
16338 EMACS_INT.
16339
16340 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
16341
16342 Malloc failure behavior now depends on size of allocation.
16343 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16344 * lisp.h: Change signatures accordingly.
16345 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16346 All callers changed. (Bug#8762)
16347
16348 * gnutls.c: Use Emacs's memory allocators.
16349 Without this change, the gnutls library would invoke malloc etc.
16350 directly, which causes problems on non-SYNC_INPUT hosts, and which
16351 runs afoul of improving memory_full behavior. (Bug#8761)
16352 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16353 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16354 xfree instead of the default malloc, realloc, free.
16355 (Fgnutls_boot): No need to check for memory allocation failure,
16356 since xmalloc does that for us.
16357
16358 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
16359 * category.c (hash_get_category_set):
16360 * ccl.c (ccl_driver):
16361 * charset.c (Fdefine_charset_internal):
16362 * charset.h (struct charset.hash_index):
16363 * composite.c (get_composition_id, gstring_lookup_cache)
16364 (composition_gstring_put_cache):
16365 * composite.h (struct composition.hash_index):
16366 * dispextern.h (struct image.hash):
16367 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16368 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16369 (hashfn_equal, hashfn_user_defined, make_hash_table)
16370 (maybe_resize_hash_table, hash_lookup, hash_put)
16371 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16372 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16373 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16374 * image.c (make_image, search_image_cache, lookup_image)
16375 (xpm_put_color_table_h):
16376 * lisp.h (struct Lisp_Hash_Table):
16377 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16378 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16379 for hashes and hash indexes, instead of 'unsigned' and 'int'.
16380 * alloc.c (allocate_vectorlike):
16381 Check for overflow in vector size calculations.
16382 * ccl.c (ccl_driver):
16383 Check for overflow when converting EMACS_INT to int.
16384 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16385 need to be updated by these changes.
16386 * fns.c (make_hash_table, maybe_resize_hash_table):
16387 Check for integer overflow with large hash tables.
16388 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16389 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16390 (SXHASH_REDUCE): New macro.
16391 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16392 Use it instead of discarding useful hash info with large hash values.
16393 (sxhash_float): New function.
16394 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16395 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16396 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16397 Rewrite to use FIXNUM_BITS, as this simplifies things.
16398 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16399 Adjust signatures to match updated version of code.
16400 (consing_since_gc): Now EMACS_INT, since a single hash table can
16401 use more than INT_MAX bytes.
16402
16403 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16404
16405 Make it possible to build with GCC-4.6+ -O2 -flto.
16406
16407 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16408
16409 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16410
16411 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16412 Call minibuffer-inactive-mode.
16413
16414 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
16415
16416 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16417 Update dependencies.
16418
16419 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16420
16421 * data.c (init_data): Remove code for UTS, this system is not
16422 supported anymore.
16423
16424 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16425
16426 Don't force ./temacs to start in terminal mode.
16427
16428 * frame.c (make_initial_frame): Initialize faces in all cases, not
16429 only when CANNOT_DUMP is defined.
16430 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16431
16432 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16433
16434 * dispnew.c (add_window_display_history): Use const for the string
16435 pointer. Remove declaration, not needed.
16436
16437 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16438
16439 Use 'inline', not 'INLINE'.
16440 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16441 * alloc.c, fontset.c (INLINE): Remove.
16442 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16443 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16444 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16445 * gmalloc.c (register_heapinfo): Use inline unconditionally.
16446 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16447
16448 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16449
16450 Make it possible to run ./temacs.
16451
16452 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16453 syms_of_callproc does the same thing. Remove test for
16454 "initialized", do it in the caller.
16455 * emacs.c (main): Avoid calling set_initial_environment when dumping.
16456
16457 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
16458
16459 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16460 (read_minibuf): Use get_minibuffer.
16461 (syms_of_minibuf): Use DEFSYM.
16462 (Qmetadata): New var.
16463 * data.c (Qbuffer): Don't make it static.
16464 (syms_of_data): Use DEFSYM.
16465
16466 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16467
16468 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
16469 (CCL_CODE_MIN): New macro.
16470
16471 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
16472
16473 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16474
16475 * eval.c (Qdebug): Now static.
16476 * lisp.h (Qdebug): Remove decl. This reverts a part of the
16477 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16478 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16479
16480 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16481
16482 * image.c: Various fixes to ImageMagick code comments.
16483 (Fimagemagick_types): Doc fix.
16484
16485 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16486
16487 Minor fixes prompted by GCC 4.6.0 warnings.
16488
16489 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16490
16491 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16492 (x_clipboard_manager_save_all): Move extern decl to ...
16493 * xterm.h: ... here, so that it can be checked for consistency.
16494
16495 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16496
16497 * xselect.c (x_clipboard_manager_save_frame)
16498 (x_clipboard_manager_save_all): New functions.
16499 (Fx_clipboard_manager_save): Lisp function deleted.
16500
16501 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16502 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16503
16504 * xterm.h: Update prototype.
16505
16506 2011-05-28 William Xu <william.xwl@gmail.com>
16507
16508 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16509 exiting (Bug#8239).
16510
16511 2011-05-28 Jim Meyering <meyering@redhat.com>
16512
16513 Avoid a sign-extension bug in crypto_hash_function.
16514 * fns.c (to_uchar): Define.
16515 (crypto_hash_function): Use it to convert some newly-signed
16516 variables to unsigned, to avoid sign-extension bugs. For example,
16517 without this change, (md5 "truc") would evaluate to
16518 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16519 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
16520 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16521
16522 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16523
16524 Integer overflow fixes.
16525
16526 * dbusbind.c: Serial number integer overflow fixes.
16527 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16528 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16529 to hold a serial number that is too large for a fixnum.
16530 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16531 Check for serial numbers out of range. Decode any serial number
16532 that was so large that it became a float. (Bug#8722)
16533
16534 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16535 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16536 Use XFASTINT rather than XUINT when numbers are nonnegative.
16537 (xd_append_arg, Fdbus_method_return_internal):
16538 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16539 arguments, check that Lisp number is nonnegative, rather than
16540 silently wrapping negative numbers around. (Bug#8722)
16541 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16542 (Bug#8722)
16543
16544 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16545
16546 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16547
16548 ccl: Add integer overflow checks.
16549 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16550 (IN_INT_RANGE): New macros.
16551 (ccl_driver): Use them to check for integer overflow when
16552 decoding a CCL program. Many of the new checks are whether XINT (x)
16553 fits in int; it doesn't always, on 64-bit hosts. The new version
16554 doesn't catch all possible integer overflows, but it's an
16555 improvement. (Bug#8719)
16556
16557 * alloc.c (make_event_array): Use XINT, not XUINT.
16558 There's no need for unsigned here.
16559
16560 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16561 This follows up to the 2011-05-06 change that substituted uintptr_t
16562 for EMACS_INT. This case wasn't caught back then.
16563
16564 Rework Fformat to avoid integer overflow issues.
16565 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16566 now (part of C89). Include <verify.h>.
16567 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16568 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16569 (Fformat): Avoid the prepass trying to compute sizes; it was only
16570 approximate and thus did not catch overflow reliably. Instead, walk
16571 through the format just once, formatting and computing sizes as we go,
16572 checking for integer overflow at every step, and allocating a larger
16573 buffer as needed. Keep track separately whether the format is
16574 multibyte. Keep only the most-recently calculated precision, rather
16575 than them all. Record whether each argument has been converted to
16576 string. Use EMACS_INT, not int, for byte and char and arg counts.
16577 Support field widths and precisions larger than INT_MAX. Avoid
16578 sprintf's undefined behavior with conversion specifications such as %#d
16579 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16580 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16581 formatting out-of-range floating point numbers with int
16582 formats. (Bug#8668)
16583
16584 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16585
16586 * data.c: Avoid integer truncation in expressions involving floats.
16587 * data.c: Include <intprops.h>.
16588 (arith_driver): When there's an integer overflow in an expression
16589 involving floating point, convert the integers to floating point
16590 so that the resulting value does not suffer from catastrophic
16591 integer truncation. For example, on a 64-bit host (* 4
16592 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16593 Do not rely on undefined behavior after integer overflow.
16594
16595 merge count_size_as_multibyte, parse_str_to_multibyte
16596 * character.c, character.h (count_size_as_multibyte):
16597 Rename from parse_str_to_multibyte; all uses changed.
16598 Check for integer overflow.
16599 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16600 since it's now a duplicate of the other. This is more of
16601 a character than a buffer op, so better that it's in character.c.
16602 * fns.c, print.c: Adjust to above changes.
16603
16604 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16605
16606 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16607
16608 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16609
16610 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16611 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16612 (x_clipboard_manager_save): Now static.
16613 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16614
16615 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16616 (crypto_hash_function): Now static.
16617 Fix pointer signedness problems. Avoid unnecessary initializations.
16618
16619 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16620
16621 * termhooks.h (Vselection_alist): Make it terminal-local.
16622
16623 * terminal.c (create_terminal): Initialize it.
16624
16625 * xselect.c: Support for clipboard managers.
16626 (Vselection_alist): Move to termhooks.h as terminal-local var.
16627 (LOCAL_SELECTION): New macro.
16628 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16629 (symbol_to_x_atom): Remove gratuitous arg.
16630 (x_handle_selection_request, lisp_data_to_selection_data)
16631 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16632 (x_own_selection, x_get_local_selection, x_convert_selection):
16633 New arg, specifying work frame. Use terminal-local Vselection_alist.
16634 (some_frame_on_display): Delete unused function.
16635 (Fx_own_selection_internal, Fx_get_selection_internal)
16636 (Fx_disown_selection_internal, Fx_selection_owner_p)
16637 (Fx_selection_exists_p): New optional frame arg.
16638 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16639 (x_handle_selection_clear): Don't treat other terminals with the
16640 same keyboard specially. Use the terminal-local Vselection_alist.
16641 (x_clear_frame_selections): Use Frun_hook_with_args.
16642
16643 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16644
16645 * xterm.h: Add support for those atoms.
16646
16647 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16648
16649 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16650 (converted_selections, conversion_fail_tag): New global variables.
16651 (x_selection_request_lisp_error): Free the above.
16652 (x_get_local_selection): Remove unnecessary code.
16653 (x_reply_selection_request): Args changed; handle arbitrary array
16654 of converted selections stored in converted_selections.
16655 Separate the XChangeProperty and SelectionNotify steps.
16656 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16657 (x_convert_selection): New function.
16658 (x_handle_selection_event): Simplify.
16659 (x_get_foreign_selection): Don't ignore incoming requests while
16660 waiting for an answer; this will fail when we implement
16661 SAVE_TARGETS, and seems unnecessary anyway.
16662 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16663 (Vx_sent_selection_functions): Doc fix.
16664
16665 2011-05-26 Leo Liu <sdl.web@gmail.com>
16666
16667 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16668
16669 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16670
16671 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16672
16673 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16674 for fringe update if it has periodic bitmap.
16675 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16676 and fringe_bitmap_periodic_p.
16677
16678 * fringe.c (get_fringe_bitmap_data): New function.
16679 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16680 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16681 row. Mark glyph row for fringe update if periodicity changed.
16682
16683 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16684 for fringe update unless it has periodic bitmap.
16685
16686 2011-05-25 Kenichi Handa <handa@m17n.org>
16687
16688 * xdisp.c (get_next_display_element): Set correct it->face_id for
16689 a static composition.
16690
16691 2011-05-24 Leo Liu <sdl.web@gmail.com>
16692
16693 * deps.mk (fns.o):
16694 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16695
16696 * fns.c (crypto_hash_function, Fsha1): New function.
16697 (Fmd5): Use crypto_hash_function.
16698 (syms_of_fns): Add Ssha1.
16699
16700 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16701
16702 * gnutls.c: Remove unused macros.
16703 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16704 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16705 Remove macros that are defined and never used.
16706 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16707
16708 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16709
16710 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16711 (Fx_get_selection_internal): Minor cleanup.
16712 (Fx_own_selection_internal): Rename arguments for consistency with
16713 select.el.
16714
16715 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16716
16717 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16718
16719 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16720
16721 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16722
16723 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16724
16725 * dispnew.c (scrolling_window): Don't exclude the case that the
16726 last enabled row in the desired matrix touches the bottom boundary.
16727
16728 2011-05-21 Glenn Morris <rgm@gnu.org>
16729
16730 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16731 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16732 and add some more files.
16733
16734 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16735
16736 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16737 report_file_error introduced by the change from 2011-05-07.
16738
16739 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16740
16741 * systime.h (Time): Define only if emacs is defined.
16742 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16743 where the include path doesn't have X11/X.h by default. See
16744 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16745
16746 2011-05-20 Kenichi Handa <handa@m17n.org>
16747
16748 * composite.c (find_automatic_composition): Fix previous change.
16749
16750 2011-05-20 Glenn Morris <rgm@gnu.org>
16751
16752 * lisp.mk: New file, split from Makefile.in.
16753 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16754 (shortlisp): Remove.
16755 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16756
16757 2011-05-19 Glenn Morris <rgm@gnu.org>
16758
16759 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16760 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16761 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16762 (lisp): Set the order to that of loadup.el.
16763 (shortlisp): Make it a copy of $lisp.
16764 (SOME_MACHINE_LISP): Remove.
16765 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16766 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16767
16768 2011-05-18 Kenichi Handa <handa@m17n.org>
16769
16770 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16771 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16772 (find_automatic_composition): Mostly rewrite for efficiency.
16773
16774 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16775
16776 * makefile.w32-in: Update dependencies.
16777
16778 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16779
16780 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16781 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16782
16783 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16784
16785 Fix some integer overflow issues, such as string length overflow.
16786
16787 * insdel.c (count_size_as_multibyte): Check for string overflow.
16788
16789 * character.c (lisp_string_width): Check for string overflow.
16790 Use EMACS_INT, not int, for string indexes and lengths; in
16791 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16792 the resulting string length overflows an EMACS_INT; instead,
16793 report a string overflow if no precision given. When checking for
16794 precision exhaustion, use a check that cannot possibly have
16795 integer overflow. (Bug#8675)
16796 * character.h (lisp_string_width): Adjust to new signature.
16797
16798 * alloc.c (string_overflow): New function.
16799 (Fmake_string): Use it. This doesn't change behavior, but saves
16800 a few bytes and will simplify future changes.
16801 * character.c (string_escape_byte8): Likewise.
16802 * lisp.h (string_overflow): New decl.
16803
16804 Fixups, following up to the user-interface timestamp change.
16805 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16806 for UI timestamps, instead of unsigned long.
16807 * msdos.c (mouse_get_pos): Likewise.
16808 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16809 * w32gui.h (Time): Define by including "systime.h" rather than by
16810 declaring it ourselves. (Bug#8664)
16811
16812 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16813 * image.c (clear_image_cache): Likewise.
16814
16815 * term.c (term_mouse_position): Don't assume time_t wraparound.
16816
16817 Be more systematic about user-interface timestamps.
16818 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16819 and sometimes 'EMACS_UINT', to represent these timestamps.
16820 This change causes it to use 'Time' uniformly, as that's what X uses.
16821 This makes the code easier to follow, and makes it easier to catch
16822 integer overflow bugs such as Bug#8664.
16823 * frame.c (Fmouse_position, Fmouse_pixel_position):
16824 Use Time, not unsigned long, for user-interface timestamps.
16825 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16826 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16827 * keyboard.h (last_event_timestamp): Likewise.
16828 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16829 * menu.h (xmenu_show): Likewise.
16830 * term.c (term_mouse_position): Likewise.
16831 * termhooks.h (struct input_event.timestamp): Likewise.
16832 (struct terminal.mouse_position_hook): Likewise.
16833 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16834 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16835 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16836 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16837 what it was before.
16838 * menu.h, termhooks.h: Include "systime.h", for Time.
16839
16840 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16841 Don't assume that the difference between two unsigned long values
16842 can fit into an integer. At this point, we know button_down_time
16843 <= event->timestamp, so the difference must be nonnegative, so
16844 there's no need to cast the result if double-click-time is
16845 nonnegative, as it should be; check that it's nonnegative, just in
16846 case. This bug is triggered when events are more than 2**31 ms
16847 apart (about 25 days). (Bug#8664)
16848
16849 * xselect.c (last_event_timestamp): Remove duplicate decl.
16850 (x_own_selection): Remove needless cast to unsigned long.
16851
16852 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16853 that always fit in int. Use a sentinel instead of a counter, to
16854 avoid a temp and to allay GCC's concerns about possible int overflow.
16855 * frame.h (struct frame): Use int for menu_bar_items_used
16856 instead of EMACS_INT, since it always fits in int.
16857
16858 * menu.c (grow_menu_items): Check for int overflow.
16859
16860 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16861
16862 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16863 Before, the code was not consistent. These values cannot exceed
16864 2**31 - 1 so there's no need to make them unsigned.
16865 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16866 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16867 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16868 as modifiers.
16869 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16870
16871 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16872 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16873 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16874 presumably because the widths might not match.
16875
16876 * window.c (size_window): Avoid needless test at loop start.
16877
16878 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16879
16880 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16881
16882 2011-05-12 Drew Adams <drew.adams@oracle.com>
16883
16884 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16885
16886 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16887
16888 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16889 `width' to `bar_area_x' and `bar_area_width', respectively.
16890 (x_scroll_run): Take account of fringe background extension.
16891
16892 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16893 Rename local vars `left' and `width' to `bar_area_x' and
16894 `bar_area_width', respectively.
16895 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16896 background extension.
16897
16898 2011-05-10 Jim Meyering <meyering@redhat.com>
16899
16900 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16901
16902 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16903
16904 * image.c (Finit_image_library): Return t for built-in image types,
16905 like pbm and xbm. (Bug#8640)
16906
16907 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16908
16909 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16910
16911 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16912
16913 * w32console.c (Fset_screen_color): Doc fix.
16914 (Fget_screen_color): New function.
16915 (syms_of_ntterm): Defsubr it.
16916
16917 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16918 unlink the temporary file if Fcall_process didn't create it in the
16919 first place.
16920 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16921 child process will be redirected to a file specified with `:file'.
16922 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16923 cue to call_process_cleanup not to close that handle.
16924
16925 2011-05-07 Ben Key <bkey76@gmail.com>
16926
16927 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16928 one of two shell specific rules, either bootstrap-temacs-CMD or
16929 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16930 to the previous implementation of the bootstrap-temacs rule.
16931 The bootstrap-temacs-CMD rule is similar to the previous
16932 implementation of the bootstrap-temacs rule except that it
16933 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16934 variable.
16935
16936 These changes, along with some changes to nt/configure.bat,
16937 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16938 earlier fix to add support for --cflags and --ldflags options
16939 that include quotes so that it works whether make uses cmd or
16940 sh as the shell.
16941
16942 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16943
16944 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16945 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16946 is a constant.
16947 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16948 a string. Handle both cases.
16949 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16950 (Fdbus_register_method): Use Qinvalid_function.
16951
16952 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16953
16954 * makefile.w32-in: Update dependencies.
16955 (LISP_H): Add inttypes.h and stdin.h.
16956 (PROCESS_H): Add unistd.h.
16957
16958 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16959
16960 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16961 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16962
16963 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16964
16965 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16966
16967 * term.c (vfatal): Remove stray call to va_end.
16968 It's not needed and the C Standard doesn't allow it here anyway.
16969
16970 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16971 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16972
16973 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16974 bytes.
16975
16976 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16977
16978 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16979
16980 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16981
16982 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16983
16984 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16985
16986 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16987 * charset.c (Fdefine_charset_internal): Don't initialize
16988 charset.code_space[15]. The value was garbage, on hosts with
16989 32-bit int (Bug#8600).
16990
16991 * lread.c (read_integer): Be more consistent with string-to-number.
16992 Use string_to_number to do the actual conversion; this avoids
16993 rounding errors and fixes some other screwups. Without this fix,
16994 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16995 (digit_to_number): Move earlier, for benefit of read_integer.
16996 Return -1 if the digit is out of range for the base, -2 if it is
16997 not a digit in any supported base. (Bug#8602)
16998
16999 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17000
17001 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17002 to match comment at start of function. This also removes a
17003 GCC warning about overflow in a 32+64-bit port.
17004
17005 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17006
17007 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17008 Reported by Stefan Monnier in
17009 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17010 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17011 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17012
17013 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17014 (EMACS_UINTPTR): Likewise, with uintptr_t.
17015
17016 * lisp.h: Prefer 64-bit EMACS_INT if available.
17017 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17018 on 32-bit hosts that have 64-bit int, so that they can access
17019 large files.
17020 However, temporarily disable this change unless the temporary
17021 symbol WIDE_EMACS_INT is defined.
17022
17023 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17024
17025 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17026 This removes an assumption that EMACS_INT and long are the same
17027 width as pointers. The assumption is true for Emacs porting targets
17028 now, but we want to make other targets possible.
17029 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17030 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17031 In the rest of the code, change types of integers that hold casted
17032 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17033 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17034 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17035 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17036 No need to cast type when ORing.
17037 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17038 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17039 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17040 assume EMACS_INT is the same width as char *.
17041 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17042 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17043 Remove no-longer-needed casts.
17044 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17045 (xg_tool_bar_help_callback, xg_make_tool_item):
17046 Use EMACS_INTPTR to hold an integer
17047 that will be cast to void *; this can avoid a GCC warning
17048 if EMACS_INT is not the same width as void *.
17049 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17050 * xdisp.c (display_echo_area_1, resize_mini_window_1):
17051 (current_message_1, set_message_1):
17052 Use a local to convert to proper width without a cast.
17053 * xmenu.c (dialog_selection_callback): Likewise.
17054
17055 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17056 Also, don't assume VALBITS / RAND_BITS is less than 5,
17057 and don't rely on undefined behavior when shifting a 1 left into
17058 the sign bit.
17059 * lisp.h (get_random): Change signature to match.
17060
17061 * lread.c (hash_string): Use size_t, not int, for hash computation.
17062 Normally we prefer signed values; but hashing is special, because
17063 it's better to use unsigned division on hash table sizes so that
17064 the remainder is nonnegative. Also, size_t is the natural width
17065 for hashing into memory. The previous code used 'int', which doesn't
17066 retain enough info to hash well into very large tables.
17067 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17068
17069 * dbusbind.c: Don't possibly lose pointer info when converting.
17070 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17071 Use XPNTR rather than XHASH, so that the high-order bits of
17072 the pointer aren't lost when converting through void *.
17073
17074 * eval.c (Fautoload): Don't double-shift a pointer.
17075
17076 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17077
17078 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17079
17080 * gnutls.c (DEF_GNUTLS_FN):
17081 * image.c (DEF_IMGLIB_FN): Make function pointers static.
17082
17083 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
17084
17085 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17086 marker. (Bug#8610)
17087
17088 2011-05-05 Eli Zaretskii <eliz@gnu.org>
17089
17090 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17091 New version that can reserve upto 2GB of heap space.
17092
17093 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
17094
17095 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17096
17097 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
17098
17099 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17100 `gnutls_certificate_set_x509_key_file'.
17101
17102 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
17103
17104 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17105 Update dependencies.
17106
17107 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17108
17109 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17110 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17111 Remove unused parameter `fildes'.
17112 * process.c (read_process_output, send_process): Don't pass it.
17113
17114 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17115
17116 Fix previous change: the library cache is defined in w32.c.
17117 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17118 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17119
17120 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17121
17122 Implement dynamic loading of GnuTLS on Windows.
17123
17124 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17125 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17126 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17127 Declare.
17128
17129 * gnutls.c (Qgnutls_dll): Define.
17130 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17131 (gnutls_*): Declare function pointers.
17132 (init_gnutls_functions): New function to initialize function pointers.
17133 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17134 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17135 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17136 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17137 (emacs_gnutls_write, emacs_gnutls_read)
17138 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17139 (Fgnutls_available_p): New function.
17140 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
17141 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17142 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17143
17144 * image.c: Include w32.h.
17145 (Vimage_type_cache): Delete.
17146 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17147 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17148 (w32_delayed_load): Move to w32.c.
17149
17150 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17151
17152 * w32.c (QCloaded_from, Vlibrary_cache): Define.
17153 (w32_delayed_load): Move from image.c. When loading a library, record
17154 its filename in the :loaded-from property of the library id.
17155 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17156 Initialize and staticpro them.
17157 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17158
17159 * process.c: Include lisp.h before w32.h, not after.
17160 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17161 instead of gnutls_record_check_pending.
17162
17163 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17164
17165 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
17166
17167 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17168 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
17169 as passed in.
17170
17171 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
17172
17173 * xterm.c (x_set_frame_alpha): Do not set property on anything
17174 else than FRAME_X_OUTER_WINDOW (Bug#8608).
17175
17176 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17177
17178 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
17179
17180 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17181
17182 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
17183 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
17184 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
17185 (gnutls_global_initialized, Qgnutls_bootprop_priority)
17186 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
17187 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
17188 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
17189 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
17190 (Qgnutls_bootprop_callbacks_verify): Make static.
17191
17192 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
17193
17194 * callproc.c: Indentation fixup.
17195
17196 * sysdep.c (wait_for_termination_1): Make static.
17197 (wait_for_termination, interruptible_wait_for_termination):
17198 Move after wait_for_termination_1.
17199
17200 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
17201
17202 * sysdep.c (interruptible_wait_for_termination): New function
17203 which is like wait_for_termination, but allows keyboard
17204 interruptions.
17205
17206 * callproc.c (Fcall_process): Add (:file "file") as an option for
17207 the STDOUT buffer.
17208 (Fcall_process_region): Ditto.
17209
17210 2011-04-30 Eli Zaretskii <eliz@gnu.org>
17211
17212 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
17213 rather than `XVECTOR (FOO)->size'.
17214
17215 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
17216 inttypes.h, as a gnulib replacement is used if it not available in
17217 system headers.
17218
17219 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17220
17221 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
17222 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
17223 of MOST_POSITIVE_FIXNUM. (Bug#8528)
17224
17225 * coding.c (coding_alloc_by_realloc): Error out if destination
17226 will grow beyond MOST_POSITIVE_FIXNUM.
17227 (decode_coding_emacs_mule): Abort if there isn't enough place in
17228 charbuf for the composition carryover bytes. Reserve an extra
17229 space for up to 2 characters produced in a loop.
17230 (decode_coding_iso_2022): Abort if there isn't enough place in
17231 charbuf for the composition carryover bytes.
17232
17233 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17234
17235 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
17236 aborting when %lld or %lll format is passed.
17237 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
17238 %llo or %llx format is passed. (Bug#8545)
17239
17240 * window.c (window_scroll_line_based): Use a marker instead of
17241 simple variables to record original value of point. (Bug#7952)
17242
17243 * doprnt.c (doprnt): Fix the case where a multibyte sequence
17244 produced by %s or %c overflows available buffer space. (Bug#8545)
17245
17246 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
17247
17248 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
17249 (SIZE_MAX): Move defn after all includes, as they might #define it.
17250
17251 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17252
17253 * w32.c (init_environment): Warn about defaulting HOME to C:\.
17254
17255 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17256
17257 * keyboard.c (Qdelayed_warnings_hook): Define.
17258 (command_loop_1): Run `delayed-warnings-hook'
17259 if Vdelayed_warnings_list is non-nil.
17260 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
17261 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
17262
17263 2011-04-28 Eli Zaretskii <eliz@gnu.org>
17264
17265 * doprnt.c (doprnt): Don't return value smaller than the buffer
17266 size if the message was truncated. (Bug#8545).
17267
17268 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17269
17270 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
17271 (Fx_window_property): #if-0 the whole functions, not just the bodies.
17272
17273 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17274
17275 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
17276
17277 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
17278
17279 * makefile.w32-in: Update dependencies.
17280
17281 2011-04-27 Eli Zaretskii <eliz@gnu.org>
17282
17283 Improve `doprnt' and its usage. (Bug#8545)
17284 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
17285 `format_end'. Remove support for %l as a conversion specifier.
17286 Don't use xrealloc. Improve diagnostics when the %l size modifier
17287 is used. Update the commentary.
17288
17289 * eval.c (verror): Simplify calculation of size_t.
17290
17291 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
17292 messages.
17293
17294 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
17295
17296 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
17297 change.
17298
17299 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17300
17301 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
17302 This makes this file independent of the recent pseudovector change.
17303
17304 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
17305
17306 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
17307
17308 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
17309 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
17310 Remove unused local.
17311 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
17312
17313 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
17314 GCC 4.6.0 optimizes based on type-based alias analysis.
17315 For example, if b is of type struct buffer * and v of type struct
17316 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
17317 != &v->size, and therefore "v->size = 1; b->size = 2; return
17318 v->size;" must therefore return 1. This assumption is incorrect
17319 for Emacs, since it type-puns struct Lisp_Vector * with many other
17320 types. To fix this problem, this patch adds a new type struct
17321 vectorlike_header that documents the constraints on layout of vectors
17322 and pseudovectors, and helps optimizing compilers not get fooled
17323 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
17324 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
17325 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
17326 the size member.
17327 (XSETPVECTYPE): Rewrite in terms of new macro.
17328 (XSETPVECTYPESIZE): New macro, specifying both type and size.
17329 This is a bit clearer, and further avoids the possibility of
17330 undesirable aliasing.
17331 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
17332 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
17333 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17334 since Lisp_Subr is a special case (no "next" field).
17335 (ASIZE): Now uses header.size rather than size.
17336 All previous uses of XVECTOR (foo)->size replaced to use this macro,
17337 to avoid the hassle of writing XVECTOR (foo)->header.size.
17338 (struct vectorlike_header): New type.
17339 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17340 object, to help avoid aliasing.
17341 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17342 (SUBRP): Likewise, since Lisp_Subr is a special case.
17343 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17344 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17345 (struct Lisp_Hash_Table): Combine first two members into a single
17346 struct vectorlike_header member. All uses of "size" and "next" members
17347 changed to be "header.size" and "header.next".
17348 * buffer.h (struct buffer): Likewise.
17349 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17350 * frame.h (struct frame): Likewise.
17351 * process.h (struct Lisp_Process): Likewise.
17352 * termhooks.h (struct terminal): Likewise.
17353 * window.c (struct save_window_data, struct saved_window): Likewise.
17354 * window.h (struct window): Likewise.
17355 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17356 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17357 * buffer.c (init_buffer_once): Likewise.
17358 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17359 special case.
17360 * process.c (Fformat_network_address): Use local var for size,
17361 for brevity.
17362
17363 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17364
17365 Make the Lisp reader and string-to-float more consistent (Bug#8525)
17366 * data.c (atof): Remove decl; no longer used or needed.
17367 (digit_to_number): Move to lread.c.
17368 (Fstring_to_number): Use new string_to_number function, to be
17369 consistent with how the Lisp reader treats infinities and NaNs.
17370 Do not assume that floating-point numbers represent EMACS_INT
17371 without losing information; this is not true on most 64-bit hosts.
17372 Avoid double-rounding errors, by insisting on integers when
17373 parsing non-base-10 numbers, as the documentation specifies.
17374 * lisp.h (string_to_number): New decl, replacing ...
17375 (isfloat_string): Remove.
17376 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17377 (read1): Do not accept +. and -. as integers; this
17378 appears to have been a coding error. Similarly, do not accept
17379 strings like +-1e0 as floating point numbers. Do not report
17380 overflow for integer overflows unless the base is not 10 which
17381 means we have no simple and reliable way to continue.
17382 Break out the floating-point parsing into a new
17383 function string_to_number, so that Fstring_to_number parses
17384 floating point numbers consistently with the Lisp reader.
17385 (digit_to_number): Move here from data.c. Make it static inline.
17386 (E_CHAR, EXP_INT): Remove, replacing with ...
17387 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17388 (string_to_number): New function, replacing isfloat_string.
17389 This function checks for valid syntax and produces the resulting
17390 Lisp float number too. Rework it so that string-to-number
17391 no longer mishandles examples like "1.0e+". Use strtoumax,
17392 so that overflow for non-base-10 numbers is reported only when
17393 there's no portable and simple way to convert to floating point.
17394
17395 * textprop.c (set_text_properties_1): Rewrite for clarity,
17396 and to avoid GCC warning about integer overflow.
17397
17398 * intervals.h (struct interval): Use EMACS_INT for members
17399 where EMACS_UINT might cause problems. See
17400 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17401 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17402 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17403 All uses changed.
17404 (offset_intervals): Tell GCC not to worry about length overflow
17405 when negating a negative length.
17406
17407 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17408 (overrun_check_free): Likewise.
17409
17410 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17411 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17412 word size.
17413
17414 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17415 (gnutls_make_error): Rename local to avoid shadowing.
17416 (gnutls_emacs_global_deinit): ifdef out; not used.
17417 (Fgnutls_boot): Use const for pointer to readonly storage.
17418 Comment out unused local. Fix pointer signedness problems.
17419
17420 * lread.c (openp): Don't stuff size_t into an 'int'.
17421 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17422 about possible signed overflow.
17423
17424 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17425 (GDK_KEY_g): Don't define if already defined.
17426 (xg_prepare_tooltip): Avoid pointer signedness problem.
17427 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17428
17429 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17430 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
17431
17432 * xfns.c (Fx_window_property): Simplify a bit,
17433 to make a bit faster and to avoid GCC 4.6.0 warning.
17434 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17435
17436 * fns.c (internal_equal): Don't assume size_t fits in int.
17437
17438 * alloc.c (compact_small_strings): Tighten assertion a little.
17439
17440 Replace pEd with more-general pI, and fix some printf arg casts.
17441 * lisp.h (pI): New macro, generalizing old pEd macro to other
17442 conversion specifiers. For example, use "...%"pI"d..." rather
17443 than "...%"pEd"...".
17444 (pEd): Remove. All uses replaced with similar uses of pI.
17445 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17446 * alloc.c (check_pure_size): Don't overflow by converting size to int.
17447 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17448 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17449 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17450 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17451 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17452 64-bit hosts.
17453 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17454 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17455 * print.c (safe_debug_print, print_object): Likewise.
17456 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17457 to int.
17458 Use pI instead of if-then-else-abort. Use %p to avoid casts,
17459 avoiding the 0 flag, which is not portable.
17460 * process.c (Fmake_network_process): Use pI to avoid cast.
17461 * region-cache.c (pp_cache): Likewise.
17462 * xdisp.c (decode_mode_spec): Likewise.
17463 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17464 behavior on 64-bit hosts with printf arg.
17465 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17466 (x_stop_queuing_selection_requests): Likewise.
17467 (x_get_window_property): Don't truncate byte count to an 'int'
17468 when tracing.
17469
17470 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17471 here, since it parses constructs like leading '-' and spaces,
17472 which are not wanted; and it overflows with large numbers.
17473 Instead, simply match F[0-9]+, which is what is wanted anyway.
17474
17475 * alloc.c: Remove unportable assumptions about struct layout.
17476 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17477 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17478 (allocate_vectorlike, make_pure_vector): Use the new macros,
17479 plus offsetof, to remove unportable assumptions about struct layout.
17480 These assumptions hold on all porting targets that I know of, but
17481 they are not guaranteed, they're easy to remove, and removing them
17482 makes further changes easier.
17483
17484 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17485 This doesn't fix a bug but makes the code clearer.
17486 (string_overrun_cookie): Now const. Use initializers that
17487 don't formally overflow signed char, to avoid warnings.
17488 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17489 can cause Emacs to crash when string overrun checking is enabled.
17490 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17491 multiple of sizeof (EMACS_INT); it need not be, if
17492 alignof(EMACS_INT) < sizeof (EMACS_INT).
17493 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17494
17495 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17496
17497 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17498
17499 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17500
17501 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17502 supposed to be handshaking. (Bug#8556)
17503 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17504
17505 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17506
17507 * lisp.h (Qdebug): List symbol.
17508 * eval.c (Qdebug): Restore global linkage.
17509 * keyboard.c (debug-on-event): New variable.
17510 (handle_user_signal): Break into debugger when debug-on-event
17511 matches the current signal symbol.
17512
17513 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17514
17515 * alloc.c (check_sblock, check_string_bytes)
17516 (check_string_free_list): Convert to standard C.
17517
17518 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17519
17520 * w32.c (emacs_gnutls_push): Fix typo.
17521
17522 2011-04-25 Eli Zaretskii <eliz@gnu.org>
17523
17524 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17525 "cast to pointer from integer of different size".
17526
17527 Improve doprnt and its use in verror. (Bug#8545)
17528 * doprnt.c (doprnt): Document the set of format control sequences
17529 supported by the function. Use SAFE_ALLOCA instead of always
17530 using `alloca'.
17531
17532 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17533 is one byte too soon. Don't use xrealloc; instead xfree and
17534 xmalloc anew.
17535
17536 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17537
17538 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17539 callbacks stage.
17540
17541 * gnutls.c: Renamed global_initialized to
17542 gnutls_global_initialized. Added internals for the
17543 :verify-hostname-error, :verify-error, and :verify-flags
17544 parameters of `gnutls-boot' and documented those parameters in the
17545 docstring. Start callback support.
17546 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17547 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17548 on error. Return error code.
17549 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17550 (emacs_gnutls_read): Likewise.
17551 (Fgnutls_boot): Return handshake error code.
17552 (emacs_gnutls_handle_error): New function.
17553 (wsaerror_to_errno): Likewise.
17554
17555 * w32.h (emacs_gnutls_pull): Add prototype.
17556 (emacs_gnutls_push): Likewise.
17557
17558 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17559 (emacs_gnutls_push): Likewise.
17560
17561 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17562
17563 * process.c (wait_reading_process_output): Check if GnuTLS
17564 buffered some data internally if no FDs are set for TLS
17565 connections.
17566
17567 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17568 (LIBS): Link to USER_LIBS.
17569 ($(BLD)/gnutls.$(0)): New target.
17570
17571 2011-04-24 Eli Zaretskii <eliz@gnu.org>
17572
17573 * xdisp.c (handle_single_display_spec): Rename the
17574 display_replaced_before_p argument into display_replaced_p, to
17575 make it consistent with the commentary. Fix typos in the
17576 commentary.
17577
17578 * textprop.c (syms_of_textprop): Remove dead code.
17579 (copy_text_properties): Delete obsolete commentary about an
17580 interface that was deleted long ago. Fix typos in the description
17581 of arguments.
17582
17583 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17584 to changes in oldXMenu/XMenu.h from 2011-04-16.
17585 <menu_help_message, prev_menu_help_message>: Constify.
17586 (IT_menu_make_room): menu->help_text is now `const char **';
17587 adjust.
17588
17589 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17590 to changes in oldXMenu/XMenu.h from 2011-04-16.
17591 (struct XMenu): Declare `help_text' `const char **'.
17592
17593 * xfaces.c <Qunspecified>: Make extern again.
17594
17595 * syntax.c: Include sys/types.h before including regex.h, as
17596 required by POSIX.
17597
17598 * doc.c (get_doc_string): Improve the format passed to `error'.
17599
17600 * doprnt.c (doprnt): Improve commentary.
17601
17602 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17603
17604 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17605 them with etags.
17606
17607 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17608 changes in globals.h immediately force recompilation.
17609 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17610 $(CURDIR)/s/ms-w32.h.
17611 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17612
17613 * character.c (Fchar_direction): Function deleted.
17614 (syms_of_character): Don't defsubr it.
17615 <char-direction-table>: Deleted.
17616
17617 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17618
17619 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17620 * doprnt.c: Include limits.h.
17621 (SIZE_MAX): New macro.
17622 (doprnt): Return a size_t value. 2nd arg is now size_t.
17623 Many local variables are now size_t instead of int or unsigned.
17624 Improve overflow protection. Support `l' modifier for integer
17625 conversions. Support %l conversion. Don't assume an EMACS_INT
17626 argument for integer conversions and for %c.
17627
17628 * lisp.h (doprnt): Restore prototype.
17629
17630 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17631 $(SRC)/character.h.
17632
17633 * Makefile.in (base_obj): Add back doprnt.o.
17634
17635 * deps.mk (doprnt.o): Add back prerequisites.
17636 (callint.o): Depend on character.h.
17637
17638 * eval.c (internal_lisp_condition_case): Include the handler
17639 representation in the error message.
17640 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17641 when breaking from the loop.
17642
17643 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17644
17645 * callint.c (Fcall_interactively): When displaying error message
17646 about invalid control letter, pass the character's codepoint, not
17647 a pointer to its multibyte form. Improve display of the character
17648 in octal and display also its hex code.
17649
17650 * character.c (char_string): Use %x to display the (unsigned)
17651 codepoint of an invalid character, to avoid displaying a bogus
17652 negative value.
17653
17654 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17655 `error', not SYMBOL_NAME itself.
17656
17657 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17658 character arguments to `error'.
17659
17660 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17661 to `error' in error message about FINAL_CHAR argument. Make sure
17662 FINAL_CHAR is a character, and use %c when it is passed as
17663 argument to `error'.
17664
17665 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17666
17667 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17668
17669 * w32.c: Include <time.h>.
17670 (sys_localtime): New function.
17671
17672 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17673
17674 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17675
17676 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17677
17678 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17679
17680 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17681 zombies (Bug#8467).
17682
17683 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17684
17685 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17686 gl_state.e_property when gl_state.object is Qt.
17687
17688 * insdel.c (make_gap_larger): Remove limitation of buffer size
17689 to <= INT_MAX.
17690
17691 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17692
17693 * xdisp.c (lookup_glyphless_char_display)
17694 (produce_glyphless_glyph): Handle cons cell entry in
17695 glyphless-char-display.
17696 (Vglyphless_char_display): Document it.
17697
17698 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17699 glyphless-char-display.
17700
17701 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17702
17703 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17704
17705 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17706
17707 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17708 definition for no-X builds.
17709
17710 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17711
17712 Static checks with GCC 4.6.0 and non-default toolkits.
17713
17714 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17715
17716 * process.c (keyboard_bit_set): Define only if SIGIO.
17717 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17718 (send_process): Repair possible setjmp clobbering.
17719
17720 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17721
17722 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17723
17724 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17725
17726 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17727 Define only if needed.
17728
17729 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17730 by pacifying GCC about it. Maybe it's time to retire it?
17731 * xfaces.c (USG, __TIMEVAL__): Likewise.
17732
17733 * dispextern.h (struct redisplay_interface): Rename param
17734 to avoid shadowing.
17735 * termhooks.h (struct terminal): Likewise.
17736 * xterm.c (xembed_send_message): Likewise.
17737
17738 * insdel.c (make_gap_smaller): Define only if
17739 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17740
17741 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17742 it.
17743
17744 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17745 so that we aren't warned about unused symbols.
17746
17747 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17748
17749 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17750
17751 * xfns.c (x_real_positions): Mark locals as initialized.
17752
17753 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17754
17755 * xterm.c: Fix problems found by static analysis with other toolkits.
17756 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17757 (x_dispatch_event): Declare static if USE_GTK, and
17758 define if USE_GTK || USE_X_TOOLKIT.
17759 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17760 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17761 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17762 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17763
17764 * xmenu.c (menu_help_callback): Pointer type fixes.
17765 Use const pointers when pointing at readonly data. Avoid pointer
17766 signedness clashes.
17767 (FALSE): Remove unused macro.
17768 (update_frame_menubar): Remove unused decl.
17769
17770 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17771
17772 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17773 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17774 (single_menu_item): Rename local to avoid shadowing.
17775
17776 * keyboard.c (make_lispy_event): Remove unused local var.
17777
17778 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17779 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17780
17781 * bitmaps: Change bitmaps from unsigned char back to the X11
17782 compatible char. Avoid the old compiler warnings about
17783 out-of-range initializers by using, for example, '\xab' rather
17784 than 0xab.
17785
17786 * xgselect.c (xgselect_initialize): Check vs interface
17787 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17788
17789 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17790
17791 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17792 to read-only memory.
17793
17794 * fns.c (vector): Remove; this old hack is no longer needed.
17795
17796 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17797 Remove unused var.
17798 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17799
17800 * xrdb.c (x_load_resources): Omit unused local.
17801
17802 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17803 (x_window): Rename locals to avoid shadowing.
17804 (USG): Use the kludged USG macro, to pacify gcc.
17805
17806 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17807 (x_term_init): Remove local to avoid shadowing.
17808
17809 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17810
17811 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17812 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17813
17814 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17815
17816 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17817
17818 Fix regex.c, syntax.c and friends for buffers > 2GB.
17819 * syntax.h (struct gl_state_s): Declare character position members
17820 EMACS_INT.
17821
17822 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17823
17824 * textprop.c (verify_interval_modification, interval_of):
17825 Declare arguments EMACS_INT.
17826
17827 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17828 EMACS_INT.
17829
17830 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17831
17832 * indent.c (Fvertical_motion): Local variable it_start is now
17833 EMACS_INT.
17834
17835 * regex.c (re_match, re_match_2, re_match_2_internal)
17836 (bcmp_translate, regcomp, regexec, print_double_string)
17837 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17838 (re_compile_pattern, re_exec): Declare arguments and local
17839 variables `size_t' and `ssize_t' and return values `regoff_t', as
17840 appropriate.
17841 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17842 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17843 <compile_stack_type>: `size' and `avail' are now `size_t'.
17844
17845 * regex.h <regoff_t>: Use ssize_t, not int.
17846 (re_search, re_search_2, re_match, re_match_2): Arguments that
17847 specify buffer/string position and length are now ssize_t and
17848 size_t. Return type is regoff_t.
17849
17850 2011-04-16 Ben Key <bkey76@gmail.com>
17851
17852 * nsfont.m: Fixed bugs in ns_get_family and
17853 ns_descriptor_to_entity that were caused by using free to
17854 deallocate memory blocks that were allocated by xmalloc (via
17855 xstrdup). This caused Emacs to crash when compiled with
17856 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17857 --enable-checking=xmallocoverrun). xfree is now used to
17858 deallocate these memory blocks.
17859
17860 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17861
17862 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17863
17864 emacs_write: Accept and return EMACS_INT for sizes.
17865 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17866 et seq.
17867 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17868 Accept and return EMACS_INT.
17869 (emacs_gnutls_write): Return the number of bytes written on
17870 partial writes.
17871 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17872 (emacs_read, emacs_write): Remove check for negative size, as the
17873 Emacs source code has been audited now.
17874 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17875 (emacs_read, emacs_write): Use it.
17876 * process.c (send_process): Adjust to the new signatures of
17877 emacs_write and emacs_gnutls_write. Do not attempt to store
17878 a byte offset into an 'int'; it might overflow.
17879 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17880
17881 * sound.c: Don't assume sizes fit in 'int'.
17882 (struct sound_device.period_size, alsa_period_size):
17883 Return EMACS_INT, not int.
17884 (struct sound_device.write, vox_write, alsa_write):
17885 Accept EMACS_INT, not int.
17886 (wav_play, au_play): Use EMACS_INT to store sizes and to
17887 record read return values.
17888
17889 2011-04-15 Ben Key <bkey76@gmail.com>
17890
17891 * keyboard.c (Qundefined): Don't declare static since it is used
17892 in nsfns.m.
17893 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17894 static since they are used in nsfont.m.
17895
17896 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17897
17898 * process.c (Qprocessp): Don't declare static.
17899 * lisp.h (Qprocessp): Declare again.
17900
17901 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17902
17903 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17904
17905 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17906
17907 Improve C-level modularity by making more things 'static'.
17908
17909 Don't publish debugger-only interfaces to other modules.
17910 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17911 (verify_bytepos, count_markers): Move decls to the only modules
17912 that need them.
17913 * region-cache.h (pp_cache): Likewise.
17914 * window.h (check_all_windows): Likewise.
17915 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17916
17917 * sysdep.c (croak): Now static, if
17918 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17919 * syssignal.h (croak): Declare only if not static.
17920
17921 * alloc.c (refill_memory_reserve): Now static if
17922 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17923 * lisp.h (refill_memory_reserve): Declare only if not static.
17924
17925 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17926 Define only if USE_LUCID.
17927
17928 * xrdb.c (x_customization_string, x_rm_string): Now static.
17929
17930 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17931 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17932
17933 * xdisp.c (draw_row_with_mouse_face): Now static.
17934 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17935
17936 * window.h (check_all_windows): Mark externally visible.
17937
17938 * window.c (window_deletion_count): Now static.
17939
17940 * undo.c: Make symbols static if they're not exported.
17941 (last_undo_buffer, last_boundary_position, pending_boundary):
17942 Now static.
17943
17944 * textprop.c (interval_insert_behind_hooks): Now static.
17945 (interval_insert_in_front_hooks): Likewise.
17946
17947 * term.c: Make symbols static if they're not exported.
17948 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17949 (max_frame_lines, tty_set_terminal_modes):
17950 (tty_reset_terminal_modes, tty_turn_off_highlight):
17951 (get_tty_terminal): Now static.
17952 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17953 * termhooks.h (term_mouse_moveto): Do not declare if
17954 HAVE_WINDOW_SYSTEM.
17955 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17956 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17957
17958 * sysdep.c: Make symbols static if they're not exported.
17959 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17960 Now static.
17961 (sigprocmask_set, full_mask): Remove; unused.
17962 (wait_debugging): Mark as visible.
17963 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17964 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17965
17966 * syntax.c (syntax_temp): Define only if !__GNUC__.
17967
17968 * sound.c (current_sound_device, current_sound): Now static.
17969
17970 * search.c (searchbufs, searchbuf_head): Now static.
17971
17972 * scroll.c (scroll_cost): Remove; unused.
17973 * dispextern.h (scroll_cost): Remove decl.
17974
17975 * region-cache.h (pp_cache): Mark as externally visible.
17976
17977 * process.c: Make symbols static if they're not exported.
17978 (process_tick, update_tick, create_process, chan_process):
17979 (Vprocess_alist, proc_buffered_char, datagram_access):
17980 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17981 (deactivate_process): Mark defn as static, as well as decl.
17982 * lisp.h (create_process): Remove decl.
17983 * process.h (chan_process, Vprocess_alist): Remove decls.
17984
17985 * print.c: Make symbols static if they're not exported.
17986 (print_depth, new_backquote_output, being_printed, print_buffer):
17987 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17988 (print_interval, print_number_index, initial_stderr_stream):
17989 Now static.
17990 * lisp.h (Fprinc): Remove decl.
17991 (debug_output_compilation_hack): Mark as externally visible.
17992
17993 * sysdep.c (croak): Move decl from here to syssignal.h.
17994 * syssignal.h (croak): Put it here, so the API can be checked when
17995 'croak' is called from dissociate_if_controlling_tty.
17996
17997 * minibuf.c: Make symbols static if they're not exported.
17998 (minibuf_save_list, choose_minibuf_frame): Now static.
17999 * lisp.h (choose_minibuf_frame): Remove decl.
18000
18001 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18002
18003 * lread.c: Make symbols static if they're not exported.
18004 (read_objects, initial_obarray, oblookup_last_bucket_number):
18005 Now static.
18006 (make_symbol): Remove; unused.
18007 * lisp.h (initial_obarray, make_symbol): Remove decls.
18008
18009 * keyboard.c: Make symbols static if they're not exported.
18010 (single_kboard, recent_keys_index, total_keys, recent_keys):
18011 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18012 (this_single_command_key_start, echoing, last_auto_save):
18013 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18014 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18015 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18016 (Vlispy_mouse_stem, double_click_count):
18017 Now static.
18018 (force_auto_save_soon): Define only if SIGDANGER.
18019 (ignore_mouse_drag_p): Now static if
18020 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18021 (print_help): Remove; unused.
18022 (stop_character, last_timer_event): Mark as externally visible.
18023 * keyboard.h (ignore_mouse_drag_p): Declare only if
18024 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18025 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18026 * lisp.h (echoing): Remove decl.
18027 (force_auto_save_soon): Declare only if SIGDANGER.
18028 * xdisp.c (redisplay_window): Simplify code, to make it more
18029 obvious that ignore_mouse_drag_p is not accessed if !defined
18030 USE_GTK && !defined HAVE_NS.
18031
18032 * intervals.c: Make symbols static if they're not exported.
18033 (merge_properties_sticky, merge_interval_right, delete_interval):
18034 Now static.
18035 * intervals.h (merge_interval_right, delete_interval): Remove decls.
18036
18037 * insdel.c: Make symbols static if they're not exported.
18038 However, leave prepare_to_modify_buffer alone. It's never
18039 called from outside this function, but that appears to be a bug.
18040 (combine_after_change_list, combine_after_change_buffer):
18041 (adjust_after_replace, signal_before_change): Now static.
18042 (adjust_after_replace_noundo): Remove; unused.
18043 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18044 (signal_before_change): Remove decls.
18045
18046 * indent.c (val_compute_motion, val_vmotion): Now static.
18047
18048 * image.c: Make symbols static if they're not exported.
18049 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18050 if USE_GTK.
18051 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18052 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18053
18054 * fringe.c (standard_bitmaps): Now static.
18055 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18056
18057 * frame.c: Make symbols static if they're not exported.
18058 (x_report_frame_params, make_terminal_frame): Now static.
18059 (get_frame_param): Now static, unless HAVE_NS.
18060 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18061 (x_get_resource_string): Remove; not used.
18062 * frame.h (make_terminal_frame, x_report_frame_params):
18063 (x_get_resource_string); Remove decls.
18064 (x_fullscreen_adjust): Declare only if WINDOWSNT.
18065 * lisp.h (get_frame_param): Declare only if HAVE_NS.
18066
18067 * font.c, fontset.c: Make symbols static if they're not exported.
18068 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18069 (FACE_SUITABLE_FOR_CHAR_P): Use it.
18070 * font.c (font_close_object): Now static.
18071 * font.h (font_close_object): Remove.
18072 * fontset.c (FONTSET_OBJLIST): Remove.
18073 (free_realized_fontset) #if-0 the body, which does nothing.
18074 (face_suitable_for_char_p): #if-0, as it's never called.
18075 * fontset.h (face_suitable_for_char_p): Remove decl.
18076 * xfaces.c (face_at_string_position):
18077 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18078 since 0 is always ASCII.
18079
18080 * fns.c (weak_hash_tables): Now static.
18081
18082 * fileio.c: Make symbols static if they're not exported.
18083 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18084 (Vwrite_region_annotation_buffers): Now static.
18085
18086 * eval.c: Make symbols static if they're not exported.
18087 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18088 * lisp.h (backtrace_list): Remove decl.
18089
18090 * emacs.c: Make symbols static if they're not exported.
18091 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18092 (fatal_error_code, fatal_error_signal_hook, standard_args):
18093 Now static.
18094 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18095 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18096 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18097 * lisp.h (fatal_error_signal_hook): Remove decl.
18098 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18099
18100 * editfns.c: Move a (normally-unused) function to its only use.
18101 * editfns.c, lisp.h (get_operating_system_release): Remove.
18102 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18103 worth the hassle of breaking this out.
18104
18105 * xterm.c: Make symbols static if they're not exported.
18106 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18107 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18108 (x_destroy_window, x_delete_display):
18109 Now static.
18110 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18111 (x_mouse_leave): Remove; unused.
18112 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18113 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18114 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18115 Remove decls.
18116 (x_mouse_leave): Declare only if WINDOWSNT.
18117 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18118 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18119 USE_X_TOOLKIT.
18120
18121 * ftxfont.c: Make symbols static if they're not exported.
18122 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18123 HAVE_FREETYPE.
18124 * font.h (ftxfont_driver): Likewise.
18125
18126 * xfns.c: Make symbols static if they're not exported.
18127 (x_last_font_name, x_display_info_for_name):
18128 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18129 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18130 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18131 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18132 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18133 (last_show_tip_args): Now static.
18134 (xic_defaut_fontset, xic_create_fontsetname): Define only if
18135 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18136 (x_screen_planes): Remove; unused.
18137 * dispextern.h (x_screen_planes): Remove decl.
18138
18139 * dispnew.c: Make symbols static if they're not exported.
18140 * dispextern.h (redraw_garbaged_frames, scrolling):
18141 (increment_row_positions): Remove.
18142 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18143 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18144 Now static.
18145 (redraw_garbaged_frames): Remove; unused.
18146
18147 * xfaces.c: Make symbols static if they're not exported.
18148 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18149 Remove decls.
18150 * xterm.h (defined_color): Remove decls.
18151 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18152 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18153 (menu_face_changed_default, defined_color, free_realized_face):
18154 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18155 (ascii_face_of_lisp_face): Remove; unused.
18156
18157 * xdisp.c: Make symbols static if they're not exported.
18158 * dispextern.h (scratch_glyph_row, window_box_edges):
18159 (glyph_to_pixel_coords, set_cursor_from_row):
18160 (get_next_display_element, set_iterator_to_next):
18161 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18162 (show_mouse_face): Remove decls
18163 * frame.h (message_buf_print): Likewise.
18164 * lisp.h (pop_message, set_message, check_point_in_composition):
18165 Likewise.
18166 * xterm.h (set_vertical_scroll_bar): Likewise.
18167 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18168 (message_buf_print, scratch_glyph_row, displayed_buffer):
18169 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18170 (get_next_display_element, show_mouse_face, window_box_edges):
18171 (frame_to_window_pixel_xy, check_point_in_composition):
18172 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18173 (glyph_to_pixel_coords): Remove; unused.
18174
18175 * dired.c (file_name_completion): Now static.
18176
18177 * dbusbind.c (xd_in_read_queued_messages): Now static.
18178
18179 * lisp.h (circular_list_error, FOREACH): Remove; unused.
18180 * data.c (circular_list_error): Remove.
18181
18182 * commands.h (last_point_position, last_point_position_buffer):
18183 (last_point_position_window): Remove decls.
18184 * keyboard.c: Make these variables static.
18185
18186 * coding.h (coding, code_convert_region, encode_coding_gap):
18187 Remove decls.
18188 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
18189 (iso_code_class, detect_coding, code_convert_region): Now static.
18190 (encode_coding_gap): Remove; unused.
18191
18192 * chartab.c (chartab_chars, chartab_bits): Now static.
18193
18194 * charset.h (charset_iso_8859_1): Remove decl.
18195 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
18196 Now static.
18197
18198 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
18199 * ccl.c (Vccl_program_table): Now static.
18200 (check_ccl_update): Remove; unused.
18201
18202 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
18203 * category.h: ... from here.
18204 * category.c (check_category_table, set_category_set): Now static.
18205
18206 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
18207 * lisp.h: Remove these decls.
18208
18209 * buffer.c (buffer_count): Remove unused var.
18210
18211 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
18212 so that it's not optimized away.
18213 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
18214 * dispextern.h (bidi_dump_cached_states): Remove, since it's
18215 exported only to the debugger.
18216
18217 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
18218 * atimer.h (run_all_atimers): Remove; not exported.
18219
18220 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
18221 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
18222 was inaccessible from Lisp.
18223 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
18224 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
18225
18226 alloc.c: Import and export fewer symbols, and remove unused items.
18227 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
18228 is defined.
18229 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
18230 it's not optimized away by whole-program optimization.
18231 (message_enable_multibyte, free_misc): Remove.
18232 (catchlist, handlerlist, mark_backtrace):
18233 Declare only if BYTE_MARK_STACK.
18234 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
18235 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
18236 (message_enable_multibyte): Remove decl.
18237 (free_misc, interval_free_list, float_block, float_block_index):
18238 (n_float_blocks, float_free_list, cons_block, cons_block_index):
18239 (cons_free_list, last_marked_index):
18240 Now static.
18241 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
18242 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
18243 (mark_backtrace): Define only if BYTE_MARK_STACK.
18244 * xdisp.c (message_enable_multibyte): Now static.
18245
18246 Declare Lisp_Object Q* variables to be 'static' if not exported.
18247 This makes it easier for human readers (and static analyzers)
18248 to see whether these variables are used from other modules.
18249 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
18250 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
18251 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
18252 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
18253 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
18254 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
18255 * xmenu.c, xselect.c:
18256 Declare Q* vars static if they are not used in other modules.
18257 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
18258 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
18259 Remove decls of unexported vars.
18260 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
18261
18262 * lisp.h (DEFINE_FUNC): Make sname 'static'.
18263
18264 Make Emacs functions such as Fatom 'static' by default.
18265 This makes it easier for human readers (and static analyzers)
18266 to see whether these functions can be called from other modules.
18267 DEFUN now defines a static function. To make the function external
18268 so that it can be used in other C modules, use the new macro DEFUE.
18269 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
18270 (Finit_image_library):
18271 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
18272 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
18273 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
18274 Remove decls, since these functions are now static.
18275 (Funintern, Fget_internal_run_time): New decls, since these functions
18276 were already external.
18277
18278 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
18279 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
18280 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
18281 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
18282 * keyboard.c, keymap.c, lread.c:
18283 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
18284 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
18285 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
18286 Mark functions with DEFUE instead of DEFUN,
18287 if they are used in other modules.
18288 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
18289 decls for now-static functions.
18290 * buffer.h (Fdelete_overlay): Remove decl.
18291 * callproc.c (Fgetenv_internal): Mark as internal.
18292 * composite.c (Fremove_list_of_text_properties): Remove decl.
18293 (Fcomposition_get_gstring): New forward static decl.
18294 * composite.h (Fcomposite_get_gstring): Remove decl.
18295 * dired.c (Ffile_attributes): New forward static decl.
18296 * doc.c (Fdocumntation_property): New forward static decl.
18297 * eval.c (Ffetch_bytecode): New forward static decl.
18298 (Funintern): Remove extern decl; now in .h file where it belongs.
18299 * fileio.c (Fmake_symbolic_link): New forward static decl.
18300 * image.c (Finit_image_library): New forward static decl.
18301 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
18302 * intervals.h (Fprevious_property_change):
18303 (Fremove_list_of_text_properties): Remove decls.
18304 * keyboard.c (Fthis_command_keys): Remove decl.
18305 (Fcommand_execute): New forward static decl.
18306 * keymap.c (Flookup_key): New forward static decl.
18307 (Fcopy_keymap): Now static.
18308 * keymap.h (Flookup_key): Remove decl.
18309 * process.c (Fget_process): New forward static decl.
18310 (Fprocess_datagram_address): Mark as internal.
18311 * syntax.c (Fsyntax_table_p): New forward static decl.
18312 (skip_chars): Remove duplicate decl.
18313 * textprop.c (Fprevious_property_change): New forward static decl.
18314 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
18315 Now internal.
18316 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
18317 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
18318
18319 * editfns.c (Fformat): Remove unreachable code.
18320
18321 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
18322
18323 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
18324 change. (Bug#8496)
18325
18326 2011-04-13 Eli Zaretskii <eliz@gnu.org>
18327
18328 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
18329 when at ZV. (Bug#8487)
18330
18331 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
18332
18333 * charset.c (Fclear_charset_maps): Use xfree instead of free.
18334 (Bug#8437)
18335 * keyboard.c (parse_tool_bar_item): Likewise.
18336 * sound.c (sound_cleanup, alsa_close): Likewise.
18337 * termcap.c (tgetent): Likewise.
18338 * xfns.c (x_default_font_parameter): Likewise.
18339 * xsettings.c (read_and_apply_settings): Likewise.
18340
18341 * alloc.c (overrun_check_malloc, overrun_check_realloc)
18342 (overrun_check_free): Protoize.
18343
18344 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
18345
18346 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18347 since callers should never pass a negative size.
18348 Change the signature to match that of plain 'read' and 'write'; see
18349 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18350 * lisp.h: Update prototypes of emacs_write and emacs_read.
18351
18352 2011-04-11 Eli Zaretskii <eliz@gnu.org>
18353
18354 * xdisp.c (redisplay_window): Don't try to determine the character
18355 position of the scroll margin if the window start point w->startp
18356 is outside the buffer's accessible region. (Bug#8468)
18357
18358 2011-04-10 Eli Zaretskii <eliz@gnu.org>
18359
18360 Fix write-region and its subroutines for buffers > 2GB.
18361 * fileio.c (a_write, e_write): Modify declaration of arguments and
18362 local variables to support buffers larger than 2GB.
18363 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18364
18365 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18366 argument, local variables, and return value.
18367
18368 * lisp.h: Update prototypes of emacs_write and emacs_read.
18369
18370 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18371
18372 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
18373
18374 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18375
18376 Fix more problems found by GCC 4.6.0's static checks.
18377
18378 * xdisp.c (vmessage): Use a better test for character truncation.
18379
18380 * charset.c (load_charset_map): <, not <=, for optimization,
18381 and to avoid potential problems with integer overflow.
18382 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18383 * casetab.c (set_identity, shuffle): Likewise.
18384 * editfns.c (Fformat): Likewise.
18385 * syntax.c (skip_chars): Likewise.
18386
18387 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18388 This also lets GCC 4.6.0 generate slightly better loop code.
18389
18390 * callint.c (Fcall_interactively): <, not <=, for optimization.
18391 (Fcall_interactively): Count the number of arguments produced,
18392 not the number of arguments given. This is simpler and lets GCC
18393 4.6.0 generate slightly better code.
18394
18395 * ftfont.c: Distingish more carefully between FcChar8 and char.
18396 The previous code passed unsigned char * to a functions like
18397 strlen and xstrcasecmp that expect char *, which does not
18398 conform to the C standard.
18399 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18400 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18401 char * when the C standard requires it.
18402
18403 * keyboard.c (read_char): Remove unused var.
18404
18405 * eval.c: Port to Windows vsnprintf (Bug#8435).
18406 Include <limits.h>.
18407 (SIZE_MAX): Define if the headers do not.
18408 (verror): Do not give up if vsnprintf returns a negative count.
18409 Instead, grow the buffer. This ports to Windows vsnprintf, which
18410 does not conform to C99. Problem reported by Eli Zaretskii.
18411 Also, simplify the allocation scheme, by avoiding the need for
18412 calling realloc, and removing the ALLOCATED variable.
18413
18414 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18415
18416 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18417 But keep the doprint source code for now, as we might revamp it
18418 and use it again (Bug#8435).
18419 * lisp.h (doprnt): Remove.
18420 * Makefile.in (base_obj): Remove doprnt.o.
18421 * deps.mk (doprnt.o): Remove.
18422
18423 error: Print 32- and 64-bit integers portably (Bug#8435).
18424 Without this change, on typical 64-bit hosts error ("...%d...", N)
18425 was used to print both 32- and 64-bit integers N, which relied on
18426 undefined behavior.
18427 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18428 * lisp.h (error, verror): Mark as printf-like functions.
18429 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18430 Report overflow in size calculations when allocating printf buffer.
18431 Do not truncate output string at its first null byte.
18432 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18433 Truncate the output at a character boundary, since vsnprintf does not
18434 do that.
18435 * charset.c (check_iso_charset_parameter): Convert internal
18436 character to string before calling 'error', since %c now has the
18437 printf meaning.
18438 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18439 overflow when computing char to be passed to 'error'. Do not
18440 pass Lisp_Object to 'error'; pass the integer instead.
18441 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18442 formatted with plain %d.
18443
18444 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18445
18446 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18447
18448 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18449
18450 * xterm.c (x_catch_errors): Remove duplicate declaration.
18451
18452 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18453
18454 * xdisp.c, lisp.h (message_nolog): Remove; unused.
18455
18456 2011-04-10 Jim Meyering <meyering@redhat.com>
18457
18458 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18459 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18460 return ssize_t not "int", and use size_t as the buffer length.
18461 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18462 * gnutls.h: Update declarations.
18463 * process.c (read_process_output): Use ssize_t, to match.
18464 (send_process): Likewise.
18465
18466 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18467
18468 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18469
18470 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18471
18472 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18473 Use unsigned char, to match FcChar8 type definition.
18474
18475 * xterm.c (handle_one_xevent):
18476 * xmenu.c (create_and_show_popup_menu):
18477 * xselect.c (x_decline_selection_request)
18478 (x_reply_selection_request): Avoid type-punned deref of X events.
18479
18480 2011-04-09 Eli Zaretskii <eliz@gnu.org>
18481
18482 Fix some uses of `int' instead of EMACS_INT.
18483 * search.c (string_match_1, fast_string_match)
18484 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18485 (scan_buffer, find_next_newline_no_quit)
18486 (find_before_next_newline, search_command, Freplace_match)
18487 (Fmatch_data): Make some `int' variables be EMACS_INT.
18488
18489 * xdisp.c (display_count_lines): 3rd argument and return value now
18490 EMACS_INT. All callers changed.
18491 (pint2hrstr): Last argument is now EMACS_INT.
18492
18493 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18494 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18495 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18496 (decode_coding_utf_16, decode_coding_emacs_mule)
18497 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18498 (decode_coding_ccl, decode_coding_charset)
18499 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18500 (decode_coding_iso_2022, decode_coding_emacs_mule)
18501 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18502 <char_offset, last_offset>: Declare EMACS_INT.
18503 (encode_coding_utf_8, encode_coding_utf_16)
18504 (encode_coding_emacs_mule, encode_invocation_designation)
18505 (encode_designation_at_bol, encode_coding_iso_2022)
18506 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18507 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18508 Declare EMACS_INT.
18509 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18510 (encode_invocation_designation): Last argument P_NCHARS is now
18511 EMACS_INT.
18512 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18513 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18514
18515 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18516 All users changed.
18517
18518 * ccl.c (Fccl_execute_on_string): Declare some variables
18519 EMACS_INT.
18520
18521 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
18522
18523 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18524
18525 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18526
18527 * process.c (Fformat_network_address): Doc fix.
18528
18529 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18530
18531 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18532
18533 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18534
18535 * keyboard.c (read_char): Call Lisp function help-form-show,
18536 instead of using internal_with_output_to_temp_buffer.
18537 (Qhelp_form_show): New var.
18538 (syms_of_keyboard): Use DEFSYM macro.
18539
18540 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18541
18542 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18543
18544 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18545
18546 * process.c (Flist_processes): Remove to Lisp.
18547 (list_processes_1): Delete.
18548
18549 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18550
18551 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18552
18553 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18554
18555 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
18556
18557 Fix more problems found by GCC 4.6.0's static checks.
18558
18559 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18560
18561 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18562
18563 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18564
18565 * xdisp.c (vmessage): Mark as a printf-like function.
18566
18567 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18568
18569 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18570
18571 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18572 printf-like functions.
18573 (tiff_load): Add casts to remove these marks before passing them
18574 to system-supplied API.
18575
18576 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18577
18578 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18579 This avoids several warnings with gcc -Wstrict-overflow.
18580 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18581 directly, rather than having caller test rule sign. This avoids
18582 some unnecessary tests.
18583 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18584 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18585 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18586
18587 * xfont.c (xfont_text_extents): Remove var that was set but not used.
18588 (xfont_open): Avoid unnecessary tests.
18589
18590 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18591
18592 * composite.h, composite.c (composition_gstring_put_cache):
18593 Use EMACS_INT, not int, for length.
18594
18595 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18596 breaking out part of COMPOSITION_DECODE_RULE.
18597 (COMPOSITION_DECODE_RULE): Use it.
18598 * composite.c (get_composition_id): Remove unused local vars,
18599 by using the new macro.
18600
18601 * textprop.c (set_text_properties_1): Change while to do-while,
18602 since the condition is always true at first.
18603
18604 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18605 (interval_deletion_adjustment): Return unsigned value.
18606 All uses changed.
18607
18608 * process.c (list_processes_1, create_pty, read_process_output):
18609 (exec_sentinel): Remove vars that were set but not used.
18610 (create_pty): Remove unnecessary "volatile"s.
18611 (Fnetwork_interface_info): Avoid possibility of int overflow.
18612 (read_process_output): Do adaptive read buffering even if carryover.
18613 (read_process_output): Simplify nbytes computation if buffered.
18614
18615 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18616
18617 * syntax.c (scan_words): Remove var that was set but not used.
18618 (update_syntax_table): Use unsigned instead of int.
18619
18620 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18621 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18622 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18623
18624 * print.c (print_error_message): Avoid int overflow.
18625
18626 * font.c (font_list_entities): Redo for clarity,
18627 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18628
18629 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18630 (font_score): Avoid potential overflow in diff calculation.
18631
18632 * fns.c (substring_both): Remove var that is set but not used.
18633 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18634
18635 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18636
18637 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18638 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18639 can always succeed if overflow has undefined behavior.
18640
18641 * search.c (boyer_moore, wordify): Remove vars set but not used.
18642 (wordify): Omit three unnecessary tests.
18643
18644 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18645 All callers changed. This avoids the need for an unused var.
18646
18647 * casefiddle.c (casify_region): Remove var that is set but not used.
18648
18649 * dired.c (file_name_completion): Remove var that is set but not used.
18650
18651 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18652
18653 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18654 (Finsert_file_contents): Remove unnecessary code checking fd.
18655
18656 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18657 Check for integer overflow on size calculations.
18658
18659 * buffer.c (Fprevious_overlay_change): Remove var that is set
18660 but not used.
18661
18662 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18663 Remove vars that are set but not used.
18664 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18665 (timer_check_2): Mark vars as initialized.
18666
18667 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18668
18669 * image.c (lookup_image): Remove var that is set but not used.
18670 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18671
18672 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18673 that are set but not used.
18674
18675 * xfns.c (make_invisible_cursor): Don't return garbage
18676 if XCreateBitmapFromData fails (Bug#8410).
18677
18678 * xselect.c (x_get_local_selection, x_handle_property_notify):
18679 Remove vars that are set but not used.
18680
18681 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18682 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18683
18684 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18685 Remove var that is set but not used.
18686 (scroll_bar_windows_size): Now size_t, not int.
18687 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18688 Check for overflow.
18689
18690 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18691 (map_tty_color) [!defined MSDOS]: Likewise.
18692
18693 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18694
18695 * coding.c: Remove vars that are set but not used.
18696 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18697 All callers changed.
18698 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18699 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18700 (decode_coding_charset): Remove vars that are set but not used.
18701
18702 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18703 that is set but not used.
18704
18705 * print.c (print_object): Remove var that is set but not used.
18706
18707 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18708 The gnulib version avoids calling malloc in the usual case,
18709 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18710 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18711 * filelock.c (current_lock_owner): Likewise.
18712 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18713 * sysdep.c: Include allocator.h, careadlinkat.h.
18714 (emacs_no_realloc_allocator): New static constant.
18715 (emacs_readlink): New function.
18716 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18717 ../lib/careadlinkat.h.
18718
18719 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18720
18721 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18722 first non-nil return value).
18723
18724 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18725
18726 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18727 if not defined (Bug#8403).
18728
18729 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18730
18731 * xdisp.c (display_count_lines): Remove parameter `start',
18732 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18733 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18734 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18735 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18736 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18737 and thereabouts. All callers changed.
18738 (get_per_char_metric): Remove parameter `f', unused since
18739 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18740
18741 2011-04-02 Jim Meyering <meyering@redhat.com>
18742
18743 do not dereference NULL upon failed strdup
18744 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18745 (ns_get_family): Likewise.
18746
18747 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18748
18749 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18750
18751 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18752
18753 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18754 later (Bug#8403).
18755
18756 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18757
18758 Add lexical binding.
18759
18760 * window.c (Ftemp_output_buffer_show): New fun.
18761 (Fsave_window_excursion):
18762 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18763
18764 * lread.c (lisp_file_lexically_bound_p): New function.
18765 (Fload): Bind Qlexical_binding.
18766 (readevalloop): Remove `evalfun' arg.
18767 Bind Qinternal_interpreter_environment.
18768 (Feval_buffer): Bind Qlexical_binding.
18769 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18770 Mark as dynamic.
18771 (syms_of_lread): Declare `lexical-binding'.
18772
18773 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18774
18775 * keyboard.c (eval_dyn): New fun.
18776 (menu_item_eval_property): Use it.
18777
18778 * image.c (parse_image_spec): Use Ffunctionp.
18779
18780 * fns.c (concat, mapcar1): Accept byte-code-functions.
18781
18782 * eval.c (Fsetq): Handle lexical vars.
18783 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18784 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18785 (FletX, Flet): Obey lexical binding.
18786 (Fcommandp): Handle closures.
18787 (Feval): New `lexical' arg.
18788 (eval_sub): New function extracted from Feval. Use it almost
18789 everywhere where Feval was used. Look up vars in lexical env.
18790 Handle closures.
18791 (Ffunctionp): Move from subr.el.
18792 (Ffuncall): Handle closures.
18793 (apply_lambda): Remove `eval_flags'.
18794 (funcall_lambda): Handle closures and new byte-code-functions.
18795 (Fspecial_variable_p): New function.
18796 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18797 but without exporting it to Lisp.
18798
18799 * doc.c (Fdocumentation, store_function_docstring):
18800 * data.c (Finteractive_form): Handle closures.
18801
18802 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18803 interactive spec.
18804
18805 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18806 New byte-codes.
18807 (exec_byte_code): New function extracted from Fbyte_code to handle new
18808 calling convention for byte-code-functions. Add new byte-codes.
18809
18810 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18811
18812 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18813
18814 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18815
18816 * xdisp.c (redisplay_internal): Fix prototype.
18817
18818 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18819
18820 * xdisp.c (SCROLL_LIMIT): New macro.
18821 (try_scrolling): Use it when setting scroll_limit.
18822 Limit scrolling to 100 screen lines.
18823 (redisplay_window): Even when falling back on "recentering",
18824 position point in the window according to scroll-conservatively,
18825 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18826
18827 (try_scrolling): When point is above the window, allow searching
18828 as far as scroll_max, or one screenful, to compute vertical
18829 distance from PT to the scroll margin position. This prevents
18830 try_scrolling from unnecessarily failing when
18831 scroll-conservatively is set to a value slightly larger than the
18832 window height. Clean up the case of PT below the margin at bottom
18833 of window: scroll_max can no longer be INT_MAX. When aggressive
18834 scrolling is in use, don't let point enter the opposite scroll
18835 margin as result of the scroll.
18836 (syms_of_xdisp) <scroll-conservatively>: Document the
18837 threshold of 100 lines for never-recentering scrolling.
18838
18839 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18840
18841 * dispextern.h (move_it_by_lines):
18842 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18843 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18844 (message_log_check_duplicate): Remove parameters `prev_bol' and
18845 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18846 (redisplay_internal): Remove parameter `preserve_echo_area',
18847 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18848
18849 * indent.c (Fvertical_motion):
18850 * window.c (window_scroll_pixel_based, Frecenter):
18851 Don't pass `need_y_p' to `move_it_by_lines'.
18852
18853 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18854
18855 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18856 steal a few bits to be more compact.
18857 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18858 Remove unneeded casts.
18859
18860 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18861
18862 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18863
18864 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18865 binding" message (bug#7967).
18866
18867 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18868
18869 Fix more problems found by GCC 4.6.0's static checks.
18870
18871 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18872 Remove unused local var.
18873
18874 * editfns.c (Fmessage_box): Remove unused local var.
18875
18876 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18877 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18878 Omit unused local vars.
18879 * window.c (shrink_windows): Omit unused local var.
18880 * menu.c (digest_single_submenu): Omit unused local var.
18881 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18882 Omit unused local var.
18883
18884 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18885 Don't assume string length fits in int.
18886 (keyremap_step, read_key_sequence): Use size_t for sizes.
18887 (read_key_sequence): Don't check last_real_key_start redundantly.
18888
18889 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18890 instead of alloca (Bug#8344).
18891
18892 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18893 (Fbacktrace_frame): Don't assume nframes fits in int.
18894
18895 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18896
18897 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18898 concerns.
18899
18900 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18901
18902 * cm.c (calccost): Turn while-do into do-while, for clarity.
18903
18904 * keyboard.c (syms_of_keyboard): Use the same style as later
18905 in this function when indexing through an array. This also
18906 works around GCC bug 48267.
18907
18908 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18909
18910 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18911
18912 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18913 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18914
18915 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18916 This avoids undefined behavior on integer overflow, and is a bit
18917 more convenient anyway since it is compared to a size_t variable.
18918
18919 Variadic C functions now count arguments with size_t, not int.
18920 This avoids an unnecessary limitation on 64-bit machines, which
18921 caused (substring ...) to crash on large vectors (Bug#8344).
18922 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18923 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18924 All variadic functions and their callers changed accordingly.
18925 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18926 * data.c (arith_driver, float_arith_driver): Likewise.
18927 * editfns.c (general_insert_function): Likewise.
18928 * eval.c (struct backtrace.nargs, interactive_p)
18929 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18930 (funcall_lambda, mark_backtrace): Likewise.
18931 * fns.c (concat): Likewise.
18932 * frame.c (x_set_frame_parameters): Likewise.
18933 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18934 0 if not found, not -1. All callers changed.
18935
18936 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18937 (stack_copy_size): Now size_t, not int.
18938 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18939
18940 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18941
18942 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18943 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18944 All callers changed.
18945
18946 * lisp.h (multibyte_char_to_unibyte):
18947 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18948 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18949 * character.h (CHAR_TO_BYTE8):
18950 * cmds.c (internal_self_insert):
18951 * editfns.c (general_insert_function):
18952 * keymap.c (push_key_description):
18953 * search.c (Freplace_match):
18954 * xdisp.c (message_dolog, set_message_1): All callers changed.
18955
18956 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18957
18958 * keyboard.c (safe_run_hook_funcall): New function.
18959 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18960 don't set the hook to nil, but remove the offending function instead.
18961 (Qcommand_hook_internal): Remove, unused.
18962 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18963 Vcommand_hook_internal.
18964
18965 * eval.c (enum run_hooks_condition): Remove.
18966 (funcall_nil, funcall_not): New functions.
18967 (run_hook_with_args): Call each function through a `funcall' argument.
18968 Remove `cond' argument, now redundant.
18969 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18970 (Frun_hook_with_args_until_failure): Adjust accordingly.
18971 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18972
18973 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18974
18975 * dispextern.h (string_buffer_position): Remove declaration.
18976
18977 * print.c (strout): Remove parameter `multibyte', unused since
18978 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18979
18980 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18981 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18982 All callers changed.
18983
18984 * w32.c (_wsa_errlist): Use braces for struct initializers.
18985
18986 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18987 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18988 All callers changed.
18989 (string_buffer_position): Likewise. Also, make static (it's never
18990 used outside xdisp.c).
18991 (cursor_row_p): Remove parameter `w', unused since
18992 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18993 (decode_mode_spec): Remove parameter `precision', introduced during
18994 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18995 All callers changed.
18996
18997 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18998
18999 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19000
19001 2011-03-27 Anders Lindgren <andlind@gmail.com>
19002
19003 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19004 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19005 (ns_update_auto_hide_menu_bar): New functions.
19006 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19007 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19008 ns_constrain_all_frames.
19009 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19010 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19011
19012 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19013
19014 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19015
19016 2011-03-27 Glenn Morris <rgm@gnu.org>
19017
19018 * syssignal.h: Replace RETSIGTYPE with void.
19019 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19020 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19021 Replace SIGTYPE with void everywhere.
19022 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19023 * s/template.h (SIGTYPE): Remove commented out definition.
19024
19025 2011-03-26 Eli Zaretskii <eliz@gnu.org>
19026
19027 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19028 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19029
19030 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
19031
19032 * w32.c (read_unc_volume): Use parameter `henum', instead of
19033 global variable `wget_enum_handle'.
19034
19035 * keymap.c (describe_vector): Remove parameters `indices' and
19036 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19037 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19038
19039 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19040
19041 * keyboard.c (timer_check): Remove parameter `do_it_now',
19042 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19043 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19044 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19045
19046 * keyboard.c (read_char):
19047 * w32menu.c (w32_menu_display_help):
19048 * xmenu.c (show_help_event, menu_help_callback):
19049 Adjust calls to `show_help_echo'.
19050
19051 * gtkutil.c (xg_maybe_add_timer):
19052 * keyboard.c (readable_events):
19053 * process.c (wait_reading_process_output):
19054 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19055
19056 * insdel.c (adjust_markers_gap_motion):
19057 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19058 (gap_left, gap_right): Don't call it.
19059
19060 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
19061
19062 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19063 incurred during fontification.
19064
19065 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19066
19067 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19068 (DEFVAR_PER_BUFFER): Don't pass it.
19069
19070 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19071 (scrolling_window): Don't pass it.
19072
19073 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19074
19075 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19076
19077 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19078 and `suffix'.
19079 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19080 of variables specific to SELinux and computation of `encoded_absname'.
19081
19082 * image.c (XPutPixel): Remove unused variable `height'.
19083
19084 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19085
19086 * unexw32.c (get_section_info): Remove unused variable `section'.
19087
19088 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19089 (system_process_attributes): Remove unused variable `sess'.
19090 (sys_read): Remove unused variable `err'.
19091
19092 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19093 (w32_wnd_proc): Remove unused variable `isdead'.
19094 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19095 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19096 (x_create_tip_frame): Remove unused variable `tem'.
19097
19098 * w32inevt.c (w32_console_read_socket):
19099 Remove unused variable `no_events'.
19100
19101 * w32term.c (x_draw_composite_glyph_string_foreground):
19102 Remove unused variable `width'.
19103
19104 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
19105
19106 * w32term.c (x_set_glyph_string_clipping):
19107 Don't pass uninitialized region to CombineRgn.
19108
19109 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
19110
19111 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19112 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19113 (Fx_close_connection): Remove unused variable `i'.
19114
19115 * w32font.c (w32font_draw): Return number of glyphs.
19116 (w32font_open_internal): Remove unused variable `i'.
19117 (w32font_driver): Add missing initializer.
19118
19119 * w32menu.c (utf8to16): Remove unused variable `utf16'.
19120 (fill_in_menu): Remove unused variable `items_added'.
19121
19122 * w32term.c (last_mouse_press_frame): Remove static global variable.
19123 (w32_clip_to_row): Remove unused variable `f'.
19124 (x_delete_terminal): Remove unused variable `i'.
19125
19126 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19127 (NOTHING): Remove unused static global variable.
19128 (uniscribe_check_otf): Remove unused variable `table'.
19129 (uniscribe_font_driver): Add missing initializers.
19130
19131 2011-03-23 Julien Danjou <julien@danjou.info>
19132
19133 * term.c (Fsuspend_tty, Fresume_tty):
19134 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19135 * window.c (temp_output_buffer_show):
19136 * insdel.c (signal_before_change):
19137 * frame.c (Fhandle_switch_frame):
19138 * fileio.c (Fdo_auto_save):
19139 * emacs.c (Fkill_emacs):
19140 * editfns.c (save_excursion_restore):
19141 * cmds.c (internal_self_insert):
19142 * callint.c (Fcall_interactively):
19143 * buffer.c (Fkill_all_local_variables):
19144 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19145 Use Frun_hooks.
19146 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
19147 unconditionally since it does the check itself.
19148
19149 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
19150
19151 Fix more problems found by GCC 4.5.2's static checks.
19152
19153 * coding.c (encode_coding_raw_text): Avoid unnecessary test
19154 the first time through the loop, since we know p0 < p1 then.
19155 This also avoids a gcc -Wstrict-overflow warning.
19156
19157 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19158 leading to a memory leak, possible in functions like
19159 load_charset_map_from_file that can allocate an unbounded number
19160 of objects (Bug#8318).
19161
19162 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19163 that could (at least in theory) be that large.
19164
19165 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19166 This is less likely to overflow, and avoids undefined behavior if
19167 overflow does occur. All callers changed. Use strtoul to scan
19168 for the unsigned long integer.
19169 (pint2hrstr): Simplify and tune code slightly.
19170 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19171
19172 * scroll.c (do_scrolling): Work around GCC bug 48228.
19173 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19174
19175 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19176 This also avoids a warning with gcc -Wstrict-overflow.
19177 (validate_x_resource_name): Simplify count usage.
19178 This also avoids a warning with gcc -Wstrict-overflow.
19179
19180 * fileio.c (Fcopy_file): Report error if fchown or fchmod
19181 fail (Bug#8306).
19182
19183 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
19184
19185 * process.c (Fmake_network_process): Use socklen_t, not int,
19186 where POSIX says socklen_t is required in portable programs.
19187 This fixes a porting bug on hosts like 64-bit HP-UX, where
19188 socklen_t is wider than int (Bug#8277).
19189 (Fmake_network_process, server_accept_connection):
19190 (wait_reading_process_output, read_process_output):
19191 Likewise.
19192
19193 * process.c: Rename or move locals to avoid shadowing.
19194 (list_processes_1, Fmake_network_process):
19195 (read_process_output_error_handler, exec_sentinel_error_handler):
19196 Rename or move locals.
19197 (Fmake_network_process): Define label "retry_connect" only if needed.
19198 (Fnetwork_interface_info): Fix pointer signedness.
19199 (process_send_signal): Add cast to avoid pointer signedness problem.
19200 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
19201 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
19202
19203 Make tparam.h and terminfo.c consistent.
19204 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
19205 Include tparam.h instead, since it declares them.
19206 * cm.h (PC): Remove extern decl; tparam.h now does this.
19207 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
19208 * terminfo.c: Include tparam.h, to check interfaces.
19209 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
19210 (tparam): Adjust signature to match interface in tparam.h;
19211 this removes some undefined behavior. Check that outstring and len
19212 are zero, which they always are with Emacs.
19213 * tparam.h (PC, BC, UP): New extern decls.
19214
19215 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
19216 (xftfont_open): Rename locals to avoid shadowing.
19217
19218 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
19219 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
19220 (OTF_TAG_SYM): Omit macro if not needed.
19221 (ftfont_list): Remove unused local.
19222 (get_adstyle_property, ftfont_pattern_entity):
19223 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
19224 Rename locals to avoid shadowing.
19225
19226 * xfont.c (xfont_list_family): Mark var as initialized.
19227
19228 * xml.c (make_dom): Now static.
19229
19230 * composite.c (composition_compute_stop_pos): Rename local to
19231 avoid shadowing.
19232 (composition_reseat_it): Remove unused locals.
19233 (find_automatic_composition, composition_adjust_point): Likewise.
19234 (composition_update_it): Mark var as initialized.
19235 (find_automatic_composition): Mark vars as initialized,
19236 with a FIXME (Bug#8290).
19237
19238 character.h: Rename locals to avoid shadowing.
19239 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
19240 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
19241 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
19242 (BUF_DEC_POS): Be more systematic about renaming local temporaries
19243 to avoid shadowing.
19244
19245 * textprop.c (property_change_between_p): Remove; unused.
19246
19247 * intervals.c (interval_start_pos): Now static.
19248
19249 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
19250
19251 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
19252 Rename locals to avoid shadowing.
19253
19254 * sound.c (wav_play, au_play, Fplay_sound_internal):
19255 Fix pointer signedness.
19256 (alsa_choose_format): Remove unused local var.
19257 (wav_play): Initialize a variable to 0, to prevent undefined
19258 behavior (Bug#8278).
19259
19260 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
19261
19262 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
19263
19264 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
19265 clobbering (Bug#8298).
19266 * sysdep.c (sys_subshell): Likewise.
19267 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
19268
19269 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
19270 This should get cleaned up, so that child_setup has the
19271 same signature on all platforms.
19272
19273 * callproc.c (call_process_cleanup): Now static.
19274 (relocate_fd): Rename locals to avoid shadowing.
19275
19276 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
19277
19278 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
19279 not to be necessary, and produces flickering.
19280
19281 2011-03-20 Glenn Morris <rgm@gnu.org>
19282
19283 * config.in: Remove file.
19284
19285 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
19286
19287 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
19288 are now in src/globals.h.
19289 (syms_of_minibuf): Remove spurious & from previous change.
19290
19291 2011-03-20 Leo Liu <sdl.web@gmail.com>
19292
19293 * minibuf.c (completing-read-function): New variable.
19294 (completing-read-default): Rename from completing-read.
19295 (completing-read): Call completing-read-function.
19296
19297 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19298
19299 * xfaces.c (Fx_load_color_file):
19300 Read color file from absolute filename (bug#8250).
19301
19302 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19303
19304 * makefile.w32-in: Update dependencies.
19305
19306 2011-03-17 Eli Zaretskii <eliz@gnu.org>
19307
19308 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
19309
19310 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
19311
19312 Fix more problems found by GCC 4.5.2's static checks.
19313
19314 * process.c (make_serial_process_unwind, send_process_trap):
19315 (sigchld_handler): Now static.
19316
19317 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
19318 That way, the code declares only the vars that it needs.
19319 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
19320 * s/cygwin.h (PTY_ITERATION): Likewise.
19321 * s/darwin.h (PTY_ITERATION): Likewise.
19322 * s/gnu-linux.h (PTY_ITERATION): Likewise.
19323
19324 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
19325 * process.c (allocate_pty): Don't declare stb unless it's needed.
19326
19327 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19328 (CONSTANTLIM): Remove; unused.
19329 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
19330 Define only if needed.
19331
19332 * unexelf.c (unexec): Name an expression,
19333 to avoid gcc -Wbad-function-cast warning.
19334 Use a different way to cause a compilation error if anyone uses
19335 n rather than nn, a way that does not involve shadowing.
19336 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
19337
19338 * deps.mk (unexalpha.o): Remove; unused.
19339
19340 New file unexec.h, the (simple) interface for unexec (Bug#8267).
19341 * unexec.h: New file.
19342 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19343 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19344 Depend on unexec.h.
19345 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19346 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19347 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19348 Change as necessary to match prototype in unexec.h.
19349
19350 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19351 shadowing.
19352 (back_comment, skip_chars): Mark vars as initialized.
19353
19354 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19355 Rename locals to avoid shadowing.
19356
19357 * lread.c (read1): Rewrite so as not to use empty "else".
19358 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19359
19360 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19361
19362 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19363 warning when compiling print.c.
19364
19365 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19366 instead of using an uninitialized var.
19367 (font_sort_entities): Mark var as initialized.
19368
19369 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19370
19371 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19372 pointers to constants.
19373 (font_parse_fcname): Remove unused vars.
19374 (font_delete_unmatched): Now static.
19375 (font_get_spec): Remove; unused.
19376 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19377 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19378 Rename or move locals to avoid shadowing.
19379
19380 * fns.c (require_nesting_list, require_unwind): Now static.
19381 (Ffillarray): Rename locals to avoid shadowing.
19382
19383 * floatfns.c (domain_error2): Define only if needed.
19384 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19385
19386 * alloc.c (mark_backtrace): Move decl from here ...
19387 * lisp.h: ... to here, so that it can be checked.
19388
19389 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19390 (Fdefvar): Rewrite so as not to use empty "else".
19391 (lisp_indirect_variable): Name an expression,
19392 to avoid gcc -Wbad-function-cast warning.
19393 (Fdefvar): Rename locals to avoid shadowing.
19394
19395 * callint.c (quotify_arg, quotify_args): Now static.
19396 (Fcall_interactively): Rename locals to avoid shadowing.
19397 Use const pointer when appropriate.
19398
19399 * lisp.h (get_system_name, get_operating_system_release):
19400 Move decls here, to check interfaces.
19401 * process.c (get_operating_system_release): Move decl to lisp.h.
19402 * xrdb.c (get_system_name): Likewise.
19403 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19404 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19405 some of which prompt warnings from gcc -Wbad-function-cast.
19406 (Fformat_time_string, Fencode_time, Finsert_char):
19407 (Ftranslate_region_internal, Fformat):
19408 Rename or remove local vars to avoid shadowing.
19409 (Ftranslate_region_internal): Mark var as initialized.
19410
19411 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19412 avoid shadowing.
19413
19414 * lisp.h (eassert): Check that the argument compiles, even if
19415 ENABLE_CHECKING is not defined.
19416
19417 * data.c (Findirect_variable): Name an expression, to avoid
19418 gcc -Wbad-function-cast warning.
19419 (default_value, arithcompare, arith_driver, arith_error): Now static.
19420 (store_symval_forwarding): Rename local to avoid shadowing.
19421 (Fmake_variable_buffer_local, Fmake_local_variable):
19422 Mark variables as initialized.
19423 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
19424
19425 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
19426 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19427 Rename locals to avoid shadowing.
19428 (mark_stack): Move local variables into the #ifdef region where
19429 they're used.
19430 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19431 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19432 needed otherwise.
19433 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19434 (GC_STRING_CHARS): Remove; not used.
19435 (Fmemory_limit): Cast sbrk's returned value to char *.
19436
19437 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19438 avoids undefined behavior in theory.
19439
19440 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19441
19442 Use functions, not macros, for up- and down-casing (Bug#8254).
19443 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19444 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
19445 to use the following functions instead of these macros.
19446 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
19447 EMACS_INT, since callers assume the returned value fits in int.
19448 (upcase1): Likewise, for UPCASE_TABLE.
19449 (uppercasep, lowercasep, upcase): New static inline functions.
19450 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19451 the race-condition problem in the old DOWNCASE.
19452
19453 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19454 Rename locals to avoid shadowing.
19455 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19456 (regex_compile, re_search_2, re_match_2_internal):
19457 Remove unused local vars.
19458 (FREE_VAR): Rewrite so as not to use empty "else",
19459 which gcc can warn about.
19460 (regex_compile, re_match_2_internal): Mark locals as initialized.
19461 (RETALLOC_IF): Define only if needed.
19462 (WORDCHAR_P): Likewise. This one is never needed, but is used
19463 only in a comment talking about a compiler bug, so put inside
19464 the #if 0 of that comment.
19465 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19466 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19467 Remove; unused.
19468
19469 * search.c (boyer_moore): Rename locals to avoid shadowing.
19470 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19471 (PREV_CHAR_BOUNDARY): Likewise.
19472
19473 * search.c (simple_search): Remove unused var.
19474
19475 * dired.c (compile_pattern): Move decl from here ...
19476 * lisp.h: ... to here, so that it can be checked.
19477 (struct re_registers): New forward decl.
19478
19479 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19480
19481 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19482 All uses changed.
19483 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19484 Rename locals to avoid shadowing.
19485 (Fvertical_motion): Mark locals as initialized.
19486
19487 * casefiddle.c (casify_object, casify_region): Now static.
19488 (casify_region): Mark local as initialized.
19489
19490 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19491
19492 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19493 New macros, so that the caller can use some names other than
19494 gcpro1, gcpro2, etc.
19495 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19496 of the new macros.
19497 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19498 argument, for consistency with GCPRO2_VAR, etc: it is now the
19499 prefix of the variable, not the variable itself. All uses
19500 changed.
19501 * dired.c (directory_files_internal, file_name_completion):
19502 Rename locals to avoid shadowing.
19503
19504 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19505 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19506 dired.c's scmp function, had undefined behavior.
19507 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19508 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19509 * buffer.h: ... to here, because these macros use current_buffer,
19510 and the new implementation with inline functions needs to have
19511 current_buffer in scope now, rather than later when the macros
19512 are used.
19513 (downcase, upcase1): New static inline functions.
19514 (DOWNCASE, UPCASE1): Reimplement using these functions.
19515 This avoids undefined behavior in expressions like
19516 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19517 from race conditions in accessing the global variables
19518 case_temp1 and case_temp2.
19519 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19520 * lisp.h (case_temp1, case_temp2): Remove their decls.
19521 * character.h (ASCII_CHAR_P): Move from here ...
19522 * lisp.h: ... to here, so that the inline functions mentioned
19523 above can use them.
19524
19525 * dired.c (directory_files_internal_unwind): Now static.
19526
19527 * fileio.c (file_name_as_directory, directory_file_name):
19528 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19529 Now static.
19530 (file_name_as_directory): Use const pointers when appropriate.
19531 (Fexpand_file_name): Likewise. In particular, newdir might
19532 point at constant storage, so make it a const pointer.
19533 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19534 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19535 signedness issues.
19536 (Fset_file_times, Finsert_file_contents, auto_save_error):
19537 Rename locals to avoid shadowing.
19538
19539 * minibuf.c (choose_minibuf_frame_1): Now static.
19540 (Ftry_completion, Fall_completions): Rename or remove locals
19541 to avoid shadowing.
19542
19543 * marker.c (bytepos_to_charpos): Remove; unused.
19544
19545 * lisp.h (verify_bytepos, count_markers): New decls,
19546 so that gcc does not warn that these functions aren't declared.
19547
19548 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19549 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19550 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19551 (copy_text): Remove unused local var.
19552
19553 * filelock.c (within_one_second): Now static.
19554 (lock_file_1): Rename local to avoid shadowing.
19555
19556 * buffer.c (fix_overlays_before): Mark locals as initialized.
19557 (fix_start_end_in_overlays): Likewise. This function should be
19558 simplified by using pointers-to-pointers, but that's a different
19559 matter.
19560 (switch_to_buffer_1): Now static.
19561 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19562 (report_overlay_modification): Rename locals to avoid shadowing.
19563
19564 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19565 Fix pointer signedness issue.
19566 (sys_subshell): Mark local as volatile if checking for lint,
19567 to suppress a gcc -Wclobbered warning that does not seem to be right.
19568 (MAXPATHLEN): Define only if needed.
19569
19570 * process.c (serial_open, serial_configure): Move decls from here ...
19571 * systty.h: ... to here, so that they can be checked.
19572
19573 * fns.c (get_random, seed_random): Move extern decls from here ...
19574 * lisp.h: ... to here, so that they can be checked.
19575
19576 * sysdep.c (reset_io): Now static.
19577 (wait_for_termination_signal): Remove; unused.
19578
19579 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19580 (copy_keymap_item, append_key, push_text_char_description):
19581 Now static.
19582 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19583 (DENSE_TABLE_SIZE): Remove; unused.
19584 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19585 (describe_map_tree):
19586 Rename locals to avoid shadowing.
19587
19588 * keyboard.c: Declare functions static if they are not used elsewhere.
19589 (echo_char, echo_dash, cmd_error, top_level_2):
19590 (poll_for_input, handle_async_input): Now static.
19591 (read_char, kbd_buffer_get_event, make_lispy_position):
19592 (make_lispy_event, make_lispy_movement, apply_modifiers):
19593 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19594 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19595 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19596 (read_key_sequence, read_char): Mark locals as initialized.
19597 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19598
19599 * keyboard.h (make_ctrl_char): New decl.
19600 (mark_kboards): Move decl here ...
19601 * alloc.c (mark_kboards): ... from here.
19602
19603 * lisp.h (force_auto_save_soon): New decl.
19604
19605 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19606 (DEFINE_DUMMY_FUNCTION): New macro.
19607 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19608 Use it.
19609 (main): Add casts to avoid warnings
19610 if GCC considers string literals to be constants.
19611
19612 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19613
19614 * dbusbind.c: Pointer signedness fixes.
19615 (xd_signature, xd_append_arg, xd_initialize):
19616 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19617 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19618 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19619 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19620
19621 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19622 if GCC considers string literals to be constants.
19623 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19624
19625 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19626
19627 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19628 (print_preprocess, print_object): New macro to fix last change.
19629
19630 * print.c (print_preprocess): Don't forget font objects.
19631
19632 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19633
19634 * emacs.c (USAGE3): Doc fixes.
19635
19636 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19637
19638 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19639 structure.
19640
19641 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19642
19643 * lisp.h (VWindow_system, Qfile_name_history):
19644 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19645 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19646 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19647
19648 * w32select.c: Don't #include "keyboard.h".
19649 (run_protected): Add extern declaration for waiting_for_input.
19650
19651 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19652 * w32console.c (detect_input_pending, read_input_pending)
19653 (encode_terminal_code):
19654 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19655 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19656 (w32_system_caret_y, Qfile_name_history):
19657 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19658 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19659 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19660 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19661 * w32proc.c (Qlocal, report_file_error):
19662 * w32term.c (Vwindow_system, updating_frame):
19663 * w32uniscribe.c (initialized, uniscribe_font_driver):
19664 Remove unneeded extern declarations.
19665
19666 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19667
19668 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19669
19670 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19671
19672 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19673 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19674 These macros can no longer be used for assignment.
19675
19676 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19677 Assign struct members directly, instead of using BUF_BEGV etc.
19678 (record_buffer_markers, fetch_buffer_markers): New functions for
19679 recording and fetching special buffer markers.
19680 (set_buffer_internal_1, set_buffer_temp): Use them.
19681
19682 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19683
19684 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19685
19686 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19687 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19688
19689 * xdisp.c (hscroll_window_tree):
19690 (reconsider_clip_changes): Use PT instead of BUF_PT.
19691
19692 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19693
19694 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19695 $(EMACS_ROOT)/lib/intprops.h.
19696
19697 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19698
19699 Fix more problems found by GCC 4.5.2's static checks.
19700
19701 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19702 to unsigned char * to avoid compiler diagnostic.
19703 (xg_free_frame_widgets): Make it clear that a local variable is
19704 needed only if USE_GTK_TOOLTIP.
19705 (gdk_window_get_screen): Make it clear that this macro is needed
19706 only if USE_GTK_TOOLTIP.
19707 (int_gtk_range_get_value): New function, which avoids a diagnostic
19708 from gcc -Wbad-function-cast.
19709 (xg_set_toolkit_scroll_bar_thumb): Use it.
19710 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19711 diagnostic from gcc -Wbad-function-cast.
19712 (get_utf8_string, xg_get_file_with_chooser):
19713 Rename locals to avoid shadowing.
19714 (create_dialog): Move locals to avoid shadowing.
19715
19716 * xgselect.c (xg_select): Remove unused var.
19717
19718 * image.c (four_corners_best): Mark locals as initialized.
19719 (gif_load): Initialize transparent_p to zero (Bug#8238).
19720 Mark another local as initialized.
19721 (my_png_error, my_error_exit): Mark with NO_RETURN.
19722
19723 * image.c (clear_image_cache): Now static.
19724 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19725 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19726 (x_edge_detection): Remove unnecessary cast that
19727 gcc -Wbad-function-cast diagnoses.
19728 (gif_load): Fix pointer signedness.
19729 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19730 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19731
19732 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19733
19734 Improve quality of tests for time stamp overflow.
19735 For example, without this patch (encode-time 0 0 0 1 1
19736 1152921504606846976) returns the obviously-bogus value (-948597
19737 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19738 reports time overflow. See
19739 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19740 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19741 * editfns.c: Include limits.h and intprops.h.
19742 (TIME_T_MIN, TIME_T_MAX): New macros.
19743 (time_overflow): Move earlier, to before first use.
19744 (hi_time, lo_time): New functions, for an accurate test for
19745 out-of-range times.
19746 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19747 (Fget_internal_run_time): Don't assume time_t fits in int.
19748 (make_time): Use list2 instead of Fcons twice.
19749 (Fdecode_time): More accurate test for out-of-range times.
19750 (check_tm_member): New function.
19751 (Fencode_time): Use it, to test for out-of-range times.
19752 (lisp_time_argument): Don't rely on undefined left-shift and
19753 right-shift behavior when checking for time stamp overflow.
19754
19755 * editfns.c (time_overflow): New function, refactoring common code.
19756 (Fformat_time_string, Fdecode_time, Fencode_time):
19757 (Fcurrent_time_string): Use it.
19758
19759 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19760 * dired.c (make_time): Move to ...
19761 * editfns.c (make_time): ... here.
19762 * systime.h: Note the move.
19763
19764 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19765
19766 * fringe.c (update_window_fringes): Remove unused variables.
19767
19768 * unexmacosx.c (copy_data_segment): Also copy __got section.
19769 (Bug#8223)
19770
19771 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19772
19773 * termcap.c [MSDOS]: Include "msdos.h".
19774 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19775 Constify `char *' arguments and their references according to
19776 prototypes in tparam.h.
19777
19778 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19779
19780 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19781 Adapt all references accordingly.
19782
19783 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19784
19785 2011-03-11 Tom Tromey <tromey@redhat.com>
19786
19787 * buffer.c (syms_of_buffer): Remove obsolete comment.
19788
19789 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19790
19791 * termhooks.h (encode_terminal_code): Declare prototype.
19792
19793 * msdos.c (encode_terminal_code): Don't declare prototype.
19794
19795 * term.c (encode_terminal_code): Now external again, used by
19796 w32console.c and msdos.c.
19797
19798 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19799 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19800
19801 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19802
19803 Fix some minor problems found by GCC 4.5.2's static checks.
19804
19805 * fringe.c (update_window_fringes): Mark locals as initialized
19806 (Bug#8227).
19807 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19808
19809 * alloc.c (mark_fringe_data): Move decl from here ...
19810 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19811 to check its interface.
19812 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19813
19814 * fontset.c (free_realized_fontset): Now static.
19815 (Fset_fontset_font): Rename local to avoid shadowing.
19816 (fontset_font): Mark local as initialized.
19817 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19818
19819 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19820
19821 * xselect.c (x_disown_buffer_selections): Remove; not used.
19822 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19823 (x_own_selection, Fx_disown_selection_internal): Rename locals
19824 to avoid shadowing.
19825 (x_handle_dnd_message): Remove local to avoid shadowing.
19826
19827 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19828 so that the caller can use some name other than gcpro1.
19829 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19830 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19831 (Fx_backspace_delete_keys_p):
19832 Use them to avoid shadowing, and rename vars to avoid shadowing.
19833 (x_decode_color, x_set_name, x_window): Now static.
19834 (Fx_create_frame): Add braces to silence GCC warning.
19835 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19836 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19837 Remove unused locals.
19838 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19839 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19840 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19841 macros.
19842
19843 * xterm.h (x_mouse_leave): New decl.
19844
19845 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19846 Remove unused functions.
19847 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19848 (x_calc_absolute_position): Now static.
19849 (XTread_socket): Don't define label "out" unless it's used.
19850 Don't declare local "event" unless it's used.
19851 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19852 unless they are used.
19853 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19854 (x_fatal_error_signal): Remove; not used.
19855 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19856 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19857 (x_error_catcher, x_connection_closed, x_error_handler):
19858 (x_error_quitter, xembed_send_message, x_iconify_frame):
19859 (my_log_handler): Rename locals to avoid shadowing.
19860 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19861 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19862
19863 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19864 Rename or move locals to avoid shadowing.
19865 (tty_defined_color, merge_face_heights): Now static.
19866 (free_realized_faces_for_fontset): Remove; not used.
19867 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19868 does not deduce is never used uninitialized.
19869 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19870 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19871
19872 * terminal.c (store_terminal_param): Now static.
19873
19874 * xmenu.c (menu_highlight_callback): Now static.
19875 (set_frame_menubar): Remove unused local.
19876 (xmenu_show): Rename parameter to avoid shadowing.
19877 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19878 since they might point to immutable storage.
19879 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19880 since it's unused otherwise.
19881
19882 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19883 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19884 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19885 avoids a gcc -Wuninitialized diagnostic.
19886 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19887 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19888 does not deduce are never used uninitialized.
19889
19890 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19891
19892 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19893 * window.c (window_loop, size_window):
19894 (run_window_configuration_change_hook, enlarge_window): Likewise.
19895
19896 * window.c (display_buffer): Now static.
19897 (size_window): Mark variables that gcc -Wuninitialized
19898 does not deduce are never used uninitialized.
19899 * window.h (check_all_windows): New decl, to forestall
19900 gcc -Wmissing-prototypes diagnostic.
19901 * dispextern.h (bidi_dump_cached_states): Likewise.
19902
19903 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19904 shadowing.
19905 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19906 Include <limits.h>.
19907 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19908 and to avoid gcc -Wuninitialized warning.
19909 (load_charset_map): Mark variables that gcc -Wuninitialized
19910 does not deduce are never used uninitialized.
19911 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19912
19913 * coding.c (coding_set_source, coding_set_destination):
19914 Use "else { /* comment */ }" rather than "else /* comment */;"
19915 for clarity, and to avoid gcc -Wempty-body warning.
19916 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19917 a block, when the outer 'i' will do.
19918 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19919 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19920 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19921 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19922 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19923 Rename locals to avoid shadowing.
19924 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19925 * coding.c (emacs_mule_char, encode_invocation_designation):
19926 Now static, since they're not used elsewhere.
19927 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19928 (decode_coding_object, encode_coding_object, detect_coding_system):
19929 (decode_coding_emacs_mule): Mark variables that gcc
19930 -Wuninitialized does not deduce are never used uninitialized.
19931 (detect_coding_iso_2022): Initialize a local variable that might
19932 be used uninitialized. Leave a FIXME because it's not clear that
19933 this initialization is needed. (Bug#8211)
19934 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19935 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19936 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19937 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19938 Remove unused macros.
19939
19940 * category.c (hash_get_category_set): Remove unused local var.
19941 (copy_category_table): Now static, since it's not used elsewhere.
19942 * character.c (string_count_byte8): Likewise.
19943
19944 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19945 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19946
19947 * chartab.c (copy_sub_char_table): Now static, since it's not used
19948 elsewhere.
19949 (sub_char_table_ref_and_range, char_table_ref_and_range):
19950 Rename locals to avoid shadowing.
19951 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19952
19953 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19954 (BIDI_BOB): Remove unused macro.
19955
19956 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19957 deduce are never used uninitialized.
19958 * term.c (encode_terminal_code): Likewise.
19959
19960 * term.c (encode_terminal_code): Now static. Remove unused local.
19961
19962 * tparam.h: New file.
19963 * term.c, tparam.h: Include it.
19964 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19965 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19966 Move these decls to tparam.h, and make them agree with what
19967 is actually in tparam.c. The previous trick of using incompatible
19968 decls in different modules does not conform to the C standard.
19969 All callers of tparam changed to use tparam's actual API.
19970 * tparam.c (tparam1, tparam, tgoto):
19971 Use const pointers where appropriate.
19972
19973 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19974 * cm.h (struct cm): Likewise.
19975 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19976 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19977 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19978 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19979 (turn_on_face, init_tty): Likewise.
19980 * termchar.h (struct tty_display_info): Likewise.
19981
19982 * term.c (term_mouse_position): Rename local to avoid shadowing.
19983
19984 * alloc.c (mark_ttys): Move decl from here ...
19985 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19986
19987 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19988
19989 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19990
19991 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19992
19993 * search.c (compile_pattern_1): Remove argument regp, unused since
19994 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19995 (compile_pattern): Don't pass it.
19996
19997 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19998
19999 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20000 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20001 for ! HAVE_GTK3.
20002 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20003
20004 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20005
20006 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20007 gdk_window_get_screen, gdk_window_get_geometry,
20008 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20009 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20010 (xg_get_pixbuf_from_pixmap): New function.
20011 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20012 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20013 Call xg_get_pixbuf_from_pixmap instead of
20014 gdk_pixbuf_get_from_drawable.
20015 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20016 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20017 (xg_check_special_colors): Use GtkStyleContext and its functions
20018 for HAVE_GTK3.
20019 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20020 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20021 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20022 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20023 Call gtk_widget_get_preferred_size.
20024 (xg_frame_resized): gdk_window_get_geometry only takes 5
20025 parameters.
20026 (xg_win_to_widget, xg_event_is_for_menubar):
20027 Call gdk_x11_window_lookup_for_display.
20028 (xg_set_widget_bg): New function.
20029 (delete_cb): New function.
20030 (xg_create_frame_widgets): Connect delete-event to delete_cb.
20031 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
20032 (xg_set_background_color): Call xg_set_widget_bg.
20033 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20034 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20035 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20036 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20037 if ! HAVE_GTK3.
20038 (update_frame_tool_bar): Call gtk_widget_hide.
20039 (xg_initialize): Use GDK_KEY_g.
20040
20041 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20042 if ! HAVE_GTK3
20043 (x_session_initialize): Call gdk_x11_set_sm_client_id.
20044
20045 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20046 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20047 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20048
20049 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
20050
20051 * w32xfns.c (select_palette): Check success of RealizePalette against
20052 GDI_ERROR, not zero.
20053
20054 See ChangeLog.11 for earlier changes.
20055
20056 ;; Local Variables:
20057 ;; coding: utf-8
20058 ;; End:
20059
20060 Copyright (C) 2011-2012 Free Software Foundation, Inc.
20061
20062 This file is part of GNU Emacs.
20063
20064 GNU Emacs is free software: you can redistribute it and/or modify
20065 it under the terms of the GNU General Public License as published by
20066 the Free Software Foundation, either version 3 of the License, or
20067 (at your option) any later version.
20068
20069 GNU Emacs is distributed in the hope that it will be useful,
20070 but WITHOUT ANY WARRANTY; without even the implied warranty of
20071 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20072 GNU General Public License for more details.
20073
20074 You should have received a copy of the GNU General Public License
20075 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.