Merge from emacs-24; up to 2012-11-15T23:31:37Z!dancol@dancol.org
[bpt/emacs.git] / src / ChangeLog
1 2012-11-18 Eli Zaretskii <eliz@gnu.org>
2
3 * w32select.c: Include w32common.h before w32term.h, so that
4 windows.h gets included before w32term.h uses some of its
5 features, see below.
6
7 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
8 typedefs.
9 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
10 prototypes.
11 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
12
13 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
14
15 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
16 (ns_select): Return at once if events are held (Bug#12834).
17
18 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
19
20 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
21 Needed following 2012-10-20 change. (Bug#12902)
22
23 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
24
25 * w32proc.c (waitpid): Remove unused label get_result.
26
27 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
28
29 * makefile.w32-in (SYSWAIT_H): New macro.
30 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
31 ($(BLD)/sysdep.$(O)): Update dependencies.
32
33 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
34
35 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
36 * callproc.c (relocate_fd): Assume F_DUPFD.
37 * emacs.c, term.c (O_RDWR): Remove.
38 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
39 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
40 * nsterm.m: Assume <fcntl.h> exists.
41 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
42 (create_pty, Fmake_network_process, server_accept_connection)
43 (wait_reading_process_output, init_process_emacs):
44 Assume O_NONBLOCK.
45 (wait_reading_process_output): Put in a special case for WINDOWSNT
46 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
47 It's not clear this is needed, but it's a more-conservative change.
48 (create_process): Assume FD_CLOEXEC.
49 (create_process, create_pty): Assume O_NOCTTY.
50 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
51 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
52 Omit if not DOS_NT, since F_GETFL is not defined there.
53 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
54 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
55 (O_NOCTTY): Remove.
56 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
57 lack it, since gnulib guarantees this.
58 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
59
60 2012-11-17 Eli Zaretskii <eliz@gnu.org>
61
62 * w32.c (faccessat): Pretend that directories have the execute bit
63 set. Emacs expects that, e.g., in files.el:cd-absolute.
64
65 * w32proc.c (create_child): Don't clip the PID of the child
66 process to fit into an Emacs integer, as this is no longer a
67 restriction.
68 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
69 reaping only the process specified by PID argument, if that is
70 positive. Use PID instead of dead_child to know which process to
71 reap. Wait for the child to die only if WNOHANG is not in
72 OPTIONS.
73 (sys_select): Don't set dead_child.
74
75 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
76 as it is no longer needed.
77
78 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
79 no longer needed.
80 (record_child_status_change): Remove the setting of
81 record_at_most_one_child for the !WNOHANG case.
82
83 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
84
85 Fix problems in ns port found by static checking.
86 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
87 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
88 not to process group.
89 (ns_select): Use emacs_write, not write, as that's more robust
90 in the presence of signals.
91 (fd_handler:): Check for read errors.
92
93 2012-11-16 Glenn Morris <rgm@gnu.org>
94
95 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
96
97 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
98
99 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
100
101 2012-11-16 Eli Zaretskii <eliz@gnu.org>
102
103 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
104 use the same value of thread handle.
105 (start_timer_thread): If the timer thread exited (due to error),
106 clean up by closing the two handles it used. Duplicate the caller
107 thread's handle here, so it gets duplicated only once, when
108 launching the timer thread. Set priority of the timer thread, not
109 the caller thread.
110 (getitimer): Don't duplicate the caller thread's handle here.
111 (Bug#12832)
112
113 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
114
115 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
116 called (Bug#12834).
117
118 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
119
120 Remove no-longer-used pty_max_bytes variable.
121 * process.c (pty_max_bytes): Remove; unused.
122 (send_process): Do not set it.
123
124 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
125
126 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
127 Update dependencies.
128
129 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
130
131 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
132 This follows up on the 2012-09-29 patch that removed indirection
133 for the 'function' field. Reported by Sergey Vinokurov in
134 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
135
136 2012-11-14 Eli Zaretskii <eliz@gnu.org>
137
138 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
139 different name, as the MS runtime does not have such a function,
140 and probably never will.) All callers changed. Ignore DIRFD
141 value if PATH is an absolute file name, to match Posix spec
142 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
143 symlinks.
144
145 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
146
147 * xdisp.c (echo_area_display, redisplay_internal):
148 Omit redundant check whether frame_garbaged is set.
149
150 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
151
152 Use faccessat, not access, when checking file permissions (Bug#12632).
153 This fixes a bug that has been present in Emacs since its creation.
154 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
155 which must set some sort of record. (Torek's bug report was against
156 a predecessor of GNU Emacs, but GNU Emacs happened to have the
157 same common flaw.) See Torek's Usenet posting
158 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
159 Posted: Fri Apr 8 14:18:56 1983.
160 * Makefile.in (LIB_EACCESS): New macro.
161 (LIBES): Use it.
162 * callproc.c (init_callproc):
163 * charset.c (init_charset):
164 * fileio.c (check_existing, check_executable, check_writable)
165 (Ffile_readable_p):
166 * lread.c (openp, load_path_check):
167 * process.c (allocate_pty):
168 * xrdb.c (file_p):
169 Use effective UID when checking permissions, not real UID.
170 * callproc.c (init_callproc):
171 * charset.c (init_charset):
172 * lread.c (load_path_check, init_lread):
173 Test whether directories are accessible, not merely whether they exist.
174 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
175 * fileio.c (check_existing, check_executable, check_writable)
176 (Ffile_readable_p):
177 Use symbolic names instead of integers for the flags, as they're
178 portable now.
179 (check_writable): New arg AMODE. All uses changed.
180 Set errno on failure.
181 (Ffile_readable_p): Use faccessat, not stat + open + close.
182 (Ffile_writable_p): No need to call check_existing + check_writable.
183 Just call check_writable and then look at errno. This saves a syscall.
184 dir should never be nil; replace an unnecessary runtime check
185 with an eassert. When checking the parent directory of a nonexistent
186 file, check that the directory is searchable as well as writable, as
187 we can't create files in unsearchable directories.
188 (file_directory_p): New function, which uses 'stat' on most platforms
189 but faccessat with D_OK (for efficiency) if WINDOWSNT.
190 (Ffile_directory_p, Fset_file_times): Use it.
191 (file_accessible_directory_p): New function, which uses a single
192 syscall for efficiency.
193 (Ffile_accessible_directory_p): Use it.
194 * xrdb.c (file_p): Use file_directory_p.
195 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
196 * lread.c (openp): When opening a file, use fstat rather than
197 stat, as that avoids a permissions race. When not opening a file,
198 use file_directory_p rather than stat.
199 (dir_warning): First arg is now a usage string, not a format.
200 Use errno. All uses changed.
201 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
202 that merely introduced a race.
203 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
204 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
205 and similarly for the other O_* flags.
206 * w32.c (sys_faccessat): Rename from sys_access and switch to
207 faccessat's API. All uses changed.
208 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
209 (magic_db): Rename from magic_file_p.
210 (magic_db, search_magic_path): Return an XrmDatabase rather than a
211 char *, so that we don't have to test for file existence
212 separately from opening the file for reading. This removes a race
213 fixes a permission-checking problem, and simplifies the code.
214 All uses changed.
215 (file_p): Remove; no longer needed.
216
217 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
218
219 Omit glyphs initialization at startup.
220 * dispnew.c (glyphs_initialized_initially_p): Remove.
221 (adjust_frame_glyphs_initially): Likewise. Adjust users.
222 (Fredraw_frame): Move actual code from here...
223 (redraw_frame): ...to here. Add eassert. Adjust comment.
224 (Fredraw_display): Use redraw_frame.
225 * xdisp.c (clear_garbaged_frames): Likewise.
226
227 2012-11-13 Eli Zaretskii <eliz@gnu.org>
228
229 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
230 passed to pint2str and pint2hrstr to be at most the size of the
231 frame's decode_mode_spec_buffer. This avoids crashes with very
232 large values of FIELD_WIDTH argument to decode_mode_spec.
233 (Bug#12867)
234
235 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
236
237 Fix a race with verify-visited-file-modtime (Bug#12863).
238 Since at least 1991 Emacs has ignored an mtime difference of no
239 more than one second, but my guess is that this was to work around
240 file system bugs that were fixed long ago. Since the race is
241 causing problems now, let's remove that code.
242 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
243 whose time stamp is off by no more than a second. Insist that the
244 file time stamps match exactly.
245
246 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
247
248 * frame.h (struct frame): Convert external_tool_bar member to
249 1-bit unsigned bitfield.
250 * termhooks.h (struct terminal): Remove mouse_moved member since
251 all users are long dead. Adjust comment on mouse_position_hook.
252
253 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
254
255 Simplify by using FOR_EACH_FRAME here and there.
256 * frame.c (next_frame, prev_frame, other_visible_frames)
257 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
258 * w32term.c (x_window_to_scroll_bar): Likewise.
259 * window.c (window_list): Likewise.
260 * xdisp.c (x_consider_frame_title): Likewise.
261 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
262 * xfns.c (x_window_to_frame, x_any_window_to_frame)
263 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
264 * xmenu.c (menubar_id_to_frame): Likewise.
265 * xselect.c (frame_for_x_selection): Likewise.
266 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
267 (x_window_to_menu_bar): Likewise.
268 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
269
270 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
271
272 * data.c (Qdefalias_fset_function): Now static.
273
274 Another tweak to vectorlike_header change.
275 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
276 Remove, and replace all uses with ...
277 (next_in_free_list, set_next_in_free_list):
278 New functions, which respect C's aliasing rules better.
279
280 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
281
282 * window.c (list4i): Rename from 'quad'. All uses changed.
283 Needed because <sys/types.h> defines 'quad' on Solaris 10.
284
285 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
286
287 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
288 warning about mixing declarations and code in ISO C90.
289
290 2012-11-10 Martin Rudalics <rudalics@gmx.at>
291
292 * window.c (Fsplit_window_internal): Set combination limit of
293 new parent window to t iff Vwindow_combination_limit is t;
294 fixing a regression introduced with the change from 2012-09-22.
295 (Fset_window_combination_limit): Fix doc-string.
296
297 2012-11-10 Eli Zaretskii <eliz@gnu.org>
298
299 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
300 amount when the scroll margins are too large. When scrolling
301 backwards in the buffer, give up if cannot reach point or the
302 scroll margin within a reasonable number of screen lines. Fixes
303 point position in window under scroll-up/down-aggressively when
304 point is positioned many lines beyond the window top/bottom.
305 (Bug#12811)
306
307 * ralloc.c (relinquish): If real_morecore fails to return memory
308 to the system, don't crash; instead, leave the last heap
309 unchanged and return. (Bug#12774)
310
311 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
312
313 * lisp.h (AUTOLOADP): New macro.
314 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
315 * data.c (Ffset): Remove special ad-advice-info handling.
316 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
317 (Fsubr_arity): CSE.
318 (Finteractive_form): Simplify.
319 (Fquo): Don't insist on having at least 2 arguments.
320 (Qdefalias_fset_function): New var.
321
322 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
323
324 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
325
326 * nsfont.m (Qcondensed, Qexpanded): New variables.
327 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
328 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
329
330 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
331
332 Fix recently introduced crash on MS-Windows (Bug#12839).
333 * w32term.h (struct scroll_bar): Use convenient header.
334 (SCROLL_BAR_VEC_SIZE): Remove.
335 * w32term.c (x_scroll_bar_create): Use VECSIZE.
336
337 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
338
339 Tweak last vectorlike_header change.
340 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
341 vectorlike object on the free list. This is introduced to avoid
342 some (but not all) pointer casting and aliasing problems, see
343 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
344 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
345 objects.
346 (xvectype, xvecsize): Use them to examine Lisp_Object values.
347
348 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
349
350 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
351 been removed, so remove them here also.
352
353 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
354
355 * doc.c (Fdocumentation): Handle new property
356 dynamic-docstring-function to replace the old ad-advice-info.
357
358 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
359
360 * fns.c (Qeql, hashtest_eq): Now static.
361
362 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
363
364 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
365 * fns.c (hashfn_eq, hashfn_eql, sxhash):
366 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
367 * buffer.c (compare_overlays): Use XLI rather than XHASH.
368
369 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
370
371 Use same hash function for hashfn_profiler as for hash_string etc.
372 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
373 * lisp.h (sxhash_combine): New inline function, with the contents
374 of the old SXHASH_COMBINE.
375 * profiler.c (hashfn_profiler): Use it, instead of having a
376 special hash function containing a comparison that always yields 1.
377
378 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
379
380 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
381 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
382 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
383 Remove unused vars.
384
385 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
386
387 * image.c (xpm_make_color_table_h): Fix compiler error because
388 make_hash_table changed.
389
390 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
391
392 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
393
394 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
395
396 Use ad-hoc comparison function for the profiler's hash-tables.
397 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
398 (make_log): Use them.
399 (handle_profiler_signal): Don't inhibit quit any longer since we don't
400 call Fequal any more.
401 (Ffunction_equal): New function.
402 (cmpfn_profiler, hashfn_profiler): New functions.
403 (syms_of_profiler): Initialize them.
404 * lisp.h (struct hash_table_test): New struct.
405 (struct Lisp_Hash_Table): Use it.
406 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
407 * fns.c (make_hash_table): Take a struct to describe the test.
408 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
409 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
410 (hash_lookup, hash_remove_from_table): Move assertion checking of
411 hashfn result here. Check hash-equality before calling cmpfn.
412 (Fmake_hash_table): Adjust call to make_hash_table.
413 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
414 (syms_of_fns): Initialize them.
415 * emacs.c (main): Move syms_of_fns earlier.
416 * xterm.c (syms_of_xterm):
417 * category.c (hash_get_category_set): Adjust call to make_hash_table.
418 * print.c (print_object): Adjust to new hash-table struct.
419 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
420
421 2012-11-08 Eli Zaretskii <eliz@gnu.org>
422
423 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
424 value of w32-scroll-lock-modifier is neither nil nor one of the
425 known key modifiers. (Bug#12806)
426
427 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
428
429 Shrink struct vectorlike_header to the only size field.
430 * lisp.h (enum pvec_type): Avoid explicit enum member values.
431 Adjust comment.
432 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
433 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
434 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
435 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
436 information from the vector header. Adjust comment.
437 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
438 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
439 layout.
440 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
441 (struct vectorlike_header): Remove next member. Adjust comment.
442 (struct Lisp_Subr): Add convenient header. Adjust comment.
443 (allocate_pseudovector): Adjust prototype.
444 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
445 (sweep_string, lisp_malloc): Remove useless prototypes.
446 (enum mem_type): Adjust comment.
447 (NEXT_IN_FREE_LIST): New macro.
448 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
449 (Fmake_bool_vector): Likewise.
450 (struct large_vector): New type to represent allocation unit for
451 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
452 (large_vectors): Change type to struct large_vector.
453 (allocate_vector_from_block): Simplify.
454 (PSEUDOVECTOR_NBYTES): Replace with...
455 (vector_nbytes): ...new function. Adjust users.
456 (sweep_vectors): Adjust processing of large vectors.
457 (allocate_vectorlike): Likewise.
458 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
459 Add easserts. Adjust XSETPVECTYPESIZE usage.
460 (allocate_buffer): Use BUFFER_PVEC_INIT.
461 (live_vector_p): Adjust to match large vector.
462 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
463 * buffer.h (struct buffer): Add next member.
464 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
465 New macros.
466 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
467 * fns.c (internal_equal): Adjust to match enum pvec_type change.
468 (copy_hash_table): Adjust to match vector header change.
469 * lread.c (defsubr): Use XSETPVECTYPE.
470 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
471 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
472 (xvecsize): New command.
473
474 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
475
476 * keyboard.c (event_to_kboard): Do not dereference
477 frame_or_window field of SELECTION_REQUEST_EVENT
478 and SELECTION_CLEAR_EVENT events (Bug#12814).
479 * xterm.h (struct selection_input_event): Adjust comment.
480
481 2012-11-07 Eli Zaretskii <eliz@gnu.org>
482
483 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
484 such as Scroll Lock, if the respective keys are treated as
485 function keys, not as modifiers. This avoids destroying non-ASCII
486 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
487
488 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
489
490 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
491
492 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
493
494 Restore some duplicate definitions (Bug#12814).
495 This undoes part of the 2012-11-03 changes. Some people build
496 with plain -g rather than with -g3, and they need the duplicate
497 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
498 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
499 Define as macros, as well as as enums or as constants.
500
501 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
502
503 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
504 to keypad keys (Bug#12816).
505
506 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
507
508 Minor adjustments of recently-changed frame functions.
509 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
510 known to be a frame (we're in the FRAMEP branch).
511 * lisp.h (Qframep): Remove decl. frame.h declares this.
512 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
513 since they're meant for Lisp fixnum values.
514
515 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
516
517 * window.c (Fwindow_combination_limit): Revert to the only
518 required argument and adjust docstring as suggested in
519 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
520 by Martin Rudalics <rudalics@gmx.at>.
521
522 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
523
524 Widely used frame validity and checking functions.
525 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
526 * frame.c (decode_live_frame, decode_any_frame): New functions.
527 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
528 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
529 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
530 (Fframe_pointer_visible_p): Use decode_any_frame.
531 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
532 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
533 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
534 (Fframe_focus): Likewise. Allow zero number of arguments.
535 Adjust docstring.
536 (frame_buffer_list, frame_buffer_predicate): Remove.
537 * lisp.h (frame_buffer_predicate): Remove prototype.
538 * buffer.c (Fother_buffer): Use decode_any_frame.
539 * xdisp.c (Ftool_bar_lines_needed): Likewise.
540 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
541 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
542 (Fclose_font, Ffont_info): Use decode_live_frame.
543 * fontset.c (check_fontset_name): Likewise.
544 * terminal.c (Fframe_terminal): Likewise.
545 * w32fns.c (check_x_frame): Likewise.
546 * window.c (Fminibuffer_window, Fwindow_at)
547 (Fcurrent_window_configuration): Likewise.
548 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
549 Likewise. Allow zero number of arguments. Adjust docstring.
550 * dispnew.c (Fredraw_frame): Likewise.
551 * xfaces.c (frame_or_selected_frame): Remove.
552 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
553 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
554 (Fframe_face_alist): Use decode_live_frame.
555 * xfns.c (check_x_frame): Likewise.
556
557 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
558
559 * window.c (quad): New function.
560 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
561 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
562 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
563 (Fwindow_line_height): Use it.
564 (Fwindow_fringes): Use list3.
565 (Fwindow_scroll_bars): Use list4.
566 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
567 (Fwindow_combination_limit): Allow zero number of arguments.
568
569 2012-11-05 Eli Zaretskii <eliz@gnu.org>
570
571 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
572
573 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
574 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
575 file descriptor 2 for standard error. (Bug#12805)
576
577 2012-11-05 Chong Yidong <cyd@gnu.org>
578
579 * process.c (wait_reading_process_output): Revert previous change.
580
581 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
582
583 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
584 This removes code that has been obsolete since around 1990.
585 * callproc.c (Fcall_process):
586 * emacs.c (main):
587 * process.c (create_process):
588 * term.c (dissociate_if_controlling_tty):
589 Assume setsid exists.
590 * callproc.c (child_setup): Assume setpgid exists and behaves as
591 per POSIX.1-1988 or later.
592 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
593 * emacs.c (shut_down_emacs):
594 * sysdep.c (sys_suspend, init_foreground_group):
595 Assume getpgrp behaves as per POSIX.1-1998 or later.
596 * msdos.c (setpgrp): Remove.
597 (tcgetpgrp, setpgid, setsid): New functions.
598 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
599 * term.c (no_controlling_tty): Remove; unused.
600 * w32proc.c (setpgrp): Remove.
601 (setsid, tcgetpgrp): New functions.
602
603 Simplify by assuming __fpending.
604 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
605 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
606 Do not assume that __fpending's result fits in int.
607
608 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
609
610 Remove EMACS_OUTQSIZE+sleep hack.
611 * dispnew.c (update_frame_1): Remove hack for terminals slower
612 than 2400 bps, which throttled Emacs by having it sleep.
613 This code hasn't worked since at least 2007, when the multi-tty stuff
614 was added, and anyway those old terminals are long dead.
615 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
616 without the dispnew.c change, as dispnew.c doesn't include systty.h.
617
618 Fix data-loss with --version (Bug#9574).
619 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
620 as we can't assume that emacs_strerror is initialized, and strerror
621 is good enough here.
622 (main): Invoke atexit earlier, to catch earlier instances of
623 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
624
625 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
626
627 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
628 (keyDown): Remap keypad keys to X11 virtual key codes.
629
630 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
631
632 Fix data-loss with --batch (Bug#9574).
633 * emacs.c: Include <close-stream.h>.
634 (close_output_streams): New function.
635 (main): Pass it to atexit, so that Emacs closes stdout and stderr
636 and handles errors appropriately.
637 (Fkill_emacs): Don't worry about flushing, as close_output_stream
638 does that now.
639
640 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
641 The symptom is a diagnostic "GLib-WARNING **: In call to
642 g_spawn_sync(), exit status of a child process was requested but
643 SIGCHLD action was set to SIG_IGN and ECHILD was received by
644 waitpid(), so exit status can't be returned." The diagnostic
645 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
646 The real bug is a race condition between Emacs and glib: Emacs
647 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
648 so that glib can't find it. Work around the bug by invoking
649 waitpid only on subprocesses that Emacs itself creates.
650 * process.c (create_process, record_child_status_change):
651 Don't use special value -1 in pid field, as the caller now must
652 know the pid rather than having the callee infer it.
653 The inference was sometimes incorrect anyway, due to another race.
654 (create_process): Set new 'alive' member if child is created.
655 (process_status_retrieved): New function.
656 (record_child_status_change): Use it.
657 Accept negative 1st argument, which means to wait for the
658 processes that Emacs already knows about. Move special-case code
659 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
660 processes that have already been waited for, by testing and
661 clearing new 'alive' member.
662 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
663 now does this internally.
664 (handle_child_signal): Let record_child_status_change do all
665 the work, since we do not want to reap all exited child processes,
666 only the child processes that Emacs itself created.
667 * process.h (Lisp_Process): New boolean member 'alive'.
668
669 Omit duplicate definitions no longer needed with gcc -g3.
670 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
671 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
672 Define only as macros. There's no longer any need to also define
673 these symbols as enums or as constants, since we now assume
674 gcc -g3 when debugging.
675
676 2012-11-03 Eli Zaretskii <eliz@gnu.org>
677
678 * lisp.mk: Adjust comments to the fact that term/internal is now
679 loaded from loadup.el.
680
681 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
682 (msdos_fatal_signal): New function.
683 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
684 its argument list.
685
686 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
687 for GCC versions before 4.
688 (emacs_raise): Define to call msdos_fatal_signal.
689
690 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
691 iterator when starting in the middle of a display or overlay
692 string. (Bug#12745)
693
694 2012-11-03 Chong Yidong <cyd@gnu.org>
695
696 * process.c (wait_reading_process_output): Clean up the last
697 change.
698
699 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
700
701 * process.c (wait_reading_process_output): Avoid a race condition
702 with SIGIO delivery (Bug#11536).
703
704 2012-11-03 Chong Yidong <cyd@gnu.org>
705
706 * buffer.c (cursor_type): Untabify docstring.
707
708 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
709
710 * frame.h (struct frame): Drop can_have_scroll_bars member
711 which is meaningless for a long time. Adjust comments.
712 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
713 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
714
715 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
716
717 * window.c (decode_next_window_args): Update window arg after
718 calling decode_live_window and so fix crash reported at
719 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
720 by Juanma Barranquero <lekktu@gmail.com>.
721 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
722 * font.c (Ffont_at): Likewise.
723
724 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
725
726 * widget.c (resize_cb): New function.
727 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
728 (EmacsFrameResize): Check if all is up to date before changing frame
729 size.
730
731 2012-11-02 Eli Zaretskii <eliz@gnu.org>
732
733 Implement backtrace output for fatal errors on MS-Windows.
734 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
735 (BACKTRACE_LIMIT_MAX): New macro.
736 (w32_backtrace): New function.
737 (emacs_abort): Use w32_backtrace when the user chooses not to
738 attach a debugger. Update the text of the abort dialog.
739
740 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
741
742 Window-related stuff cleanup here and there.
743 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
744 Use decode_any_window.
745 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
746 * xdisp.c (Fformat_mode_line): Likewise.
747 * font.c (Ffont_at): Use decode_live_window.
748 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
749 * window.c (decode_next_window_args): Likewise.
750 (decode_any_window): Remove static.
751 * window.h (decode_any_window): Add prototype.
752 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
753 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
754 respectively.
755
756 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
757
758 Remove pad from struct input_event.
759 * termhooks.h (struct input_event): Remove padding field.
760 Adjust comment.
761 * keyboard.c (event_to_kboard): Simplify because frame_or_window
762 member is never cons for a long time. Adjust comment.
763 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
764 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
765 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
766 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
767
768 2012-11-01 Eli Zaretskii <eliz@gnu.org>
769
770 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
771
772 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
773
774 Fix crash when using Emacs as commit editor for git (Bug#12697).
775 * callproc.c (setpgrp): Remove macro, as we now use setpgid
776 and it is configured in conf_post.h.
777 (Fcall_process): Don't invoke both setsid and setpgid; the former
778 is enough, if it exists.
779 * callproc.c (Fcall_process, child_setup):
780 * process.c (create_process): Use setpgid.
781 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
782 for the real thing.
783 * dispnew.c (init_display): Initialize the foreground group
784 if we are running a tty display.
785 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
786 * lisp.h (init_foreground_group): New decl.
787 * sysdep.c (inherited_pgroup): New static var.
788 (init_foreground_group, tcsetpgrp_without_stopping)
789 (narrow_foreground_group, widen_foreground_group): New functions.
790 (init_sys_modes): Narrow foreground group.
791 (reset_sys_modes): Widen foreground group.
792
793 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
794
795 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
796
797 2012-10-31 Martin Rudalics <rudalics@gmx.at>
798
799 * minibuf.c (read_minibuf): Restore current buffer since
800 choose_minibuf_frame calling Fset_frame_selected_window may
801 change it (Bug#12766).
802
803 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
804
805 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
806
807 2012-10-30 Kenichi Handa <handa@gnu.org>
808
809 * font.c (Ffont_at): If WINDOW is specified and it is not
810 displaying the current buffer, signal an error.
811
812 2012-10-29 Daniel Colascione <dancol@dancol.org>
813
814 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
815 In preparation for fixing bug#12739, move these functions from
816 here...
817
818 * coding.h, coding.c: ... to here, and compile them only when
819 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
820 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
821
822 2012-10-28 Eli Zaretskii <eliz@gnu.org>
823
824 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
825 (timer_loop, getitimer, setitimer): Use it instead of
826 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
827 'clock'.
828 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
829 literal 10000.
830
831 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
832
833 * nsterm.m (NO_APPDEFINED_DATA): New define.
834 (last_appdefined_event_data): New variable
835 (last_appdefined_event): Remove.
836 (ns_select): Initialize t from last_appdefined_event_data instead
837 of [last_appdefined_event data1].
838 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
839 remove last_appdefined_event (Bug#12698).
840
841 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
842
843 * frame.c (x_set_font): Catch internal error.
844
845 2012-10-27 Eli Zaretskii <eliz@gnu.org>
846
847 Avoid overflow in w32 implementation of interval timers.
848 When possible, for ITIMER_PROF count only times the main thread
849 actually executes.
850 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
851 'volatile ULONGLONG' types. All the other data which was
852 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
853 (GetThreadTimes_Proc): New typedef.
854 (w32_get_timer_time): New function, returns a suitable time value
855 for the timer.
856 (timer_loop): Enter critical section when accessing ULONGLONG
857 values of the itimer_data struct, as these accesses are no longer
858 atomic. Call 'w32_get_timer_time' instead of 'clock'.
859 Remove unused variable.
860 (init_timers): Initialize s_pfn_Get_Thread_Times.
861 (start_timer_thread): Don't assign itimer->caller_thread here.
862 (getitimer): Assign itimer->caller_thread here.
863 (setitimer): Always call getitimer to get the value of ticks_now.
864 (sys_spawnve): Avoid compiler warning about format mismatch.
865
866 2012-10-26 Eli Zaretskii <eliz@gnu.org>
867
868 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
869 mouse movement events if the menu bar is active. This avoids
870 producing a busy "hour-glass" cursor by Windows if the mouse
871 pointer is positioned over a tooltip shown for some menu item.
872
873 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
874
875 Don't assume process IDs fit in int.
876 * emacs.c (shut_down_emacs) [!DOS_NT]:
877 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
878 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
879 Use pid_t, not int, to store process IDs, as 'int'
880 is not wide enough on a few platforms (e.g., AIX and IRIX).
881
882 2012-10-23 Kenichi Handa <handa@gnu.org>
883
884 The following change is to make face-font-rescale-alist work
885 correctly for non-ASCII fonts.
886
887 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
888 (font_open_for_lface): Handle Vface_font_rescale_alist.
889
890 2012-10-23 Chong Yidong <cyd@gnu.org>
891
892 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
893
894 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
895
896 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
897 for screen font.
898 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
899
900 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
901 event (Bug#12681).
902
903 2012-10-21 Glenn Morris <rgm@gnu.org>
904
905 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
906
907 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
908
909 Port to OpenBSD 5.1.
910 * frame.c (Fmouse_position, Fmouse_pixel_position):
911 * xdisp.c (produce_stretch_glyph):
912 Declare local vars only when they're needed.
913 This is clearer and avoids a warning on OpenBSD about unused vars.
914 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
915 This is safer, and avoids OpenBSD warnings about unused vars.
916 * keyboard.c (record_menu_key): Remove unnecessary decl.
917 (poll_timer): Define only if POLL_FOR_INPUT is defined.
918 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
919 as our definition clashes with OpenBSD's.
920 * xfaces.c (load_face_colors, check_lface_attrs)
921 (get_lface_attributes_no_remap, get_lface_attributes)
922 (lface_fully_specified_p, x_supports_face_attributes_p)
923 (tty_supports_face_attributes_p, face_fontset, realize_face)
924 (realize_x_face, realize_tty_face):
925 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
926 merely Lisp_Object *. This is more informative and avoids
927 a warning on OpenBSD about accessing beyond an object's size.
928
929 2012-10-20 Chong Yidong <cyd@gnu.org>
930
931 * lread.c (Fload): Doc fix (Bug#12592).
932
933 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
934
935 * font.c (Ffont_at): Fix previous change.
936
937 2012-10-19 Eli Zaretskii <eliz@gnu.org>
938
939 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
940 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
941 for the reasons.
942
943 * alloc.c (NSTATICS): Decrease to 0x800.
944
945 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
946
947 * fns.c (Fnreverse): Include the problem element when signalling an
948 error (bug#12677).
949
950 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
951
952 * nsterm.m (ns_select): Check writefds before call to
953 FD_ISSET (Bug#12668).
954
955 2012-10-18 Daniel Colascione <dancol@dancol.org>
956
957 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
958 (staticpro): If we run out of staticpro slots, die with an
959 informative error instead of just calling emacs_abort.
960
961 2012-10-18 Martin Rudalics <rudalics@gmx.at>
962
963 Fix two flaws reported by Dmitry Antipov.
964 * window.c (Ftemp_output_buffer_show): Remove.
965 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
966 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
967
968 2012-10-17 Eli Zaretskii <eliz@gnu.org>
969
970 * makefile.w32-in ($(BLD)/w32.$(O)):
971 ($(BLD)/vm-limit.$(O)):
972 ($(BLD)/term.$(O)):
973 ($(BLD)/unexw32.$(O)):
974 ($(BLD)/fileio.$(O)):
975 ($(BLD)/dispnew.$(O)): Update dependencies.
976
977 * w32term.h (w32_initialize_display_info, initialize_w32_display):
978 Add prototypes.
979
980 * w32proc.c: Include ctype.h.
981
982 * w32.h (init_environment, check_windows_init_file)
983 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
984 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
985 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
986 (sys_link): Add prototypes.
987
988 * w32.c: Include w32select.h.
989 (sys_access, e_malloc, sys_select): Add prototypes.
990 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
991
992 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
993
994 * unexw32.c: Include lisp.h and w32.h.
995
996 * term.c [WINDOWSNT]: Include w32term.h.
997
998 * process.c [WINDOWSNT]: Add prototype of sys_select.
999
1000 * fileio.c [WINDOWSNT]: Include w32.h.
1001
1002 * dispnew.c [WINDOWSNT]: Include w32.h.
1003
1004 * cygw32.c (Fcygwin_convert_path_to_windows)
1005 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1006 Lisp_Object values. (Bug#12661)
1007
1008 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1009 to Lisp_Object. (Bug#12661)
1010
1011 2012-10-17 Kenichi Handa <handa@gnu.org>
1012
1013 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1014 invalidate.
1015
1016 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1017
1018 * buffer.c (Fkill_buffer): When unchaining the marker,
1019 reset its buffer pointer to NULL (Bug#12652).
1020
1021 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1022
1023 Do not verify indirection counters of killed buffers (Bug#12579).
1024 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1025 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1026
1027 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1028
1029 * alloc.c (Fmake_byte_code): Fix typo in comment.
1030 * print.c (print_interval): Define as static to match prototype.
1031 * indent.c (disptab_matches_widthtab, recompute_width_table):
1032 Convert to eassert.
1033
1034 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1035
1036 * editfns.c (get_system_name): Remove.
1037 * lisp.h (get_system_name): Remove prototype.
1038 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1039 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1040
1041 2012-10-15 Daniel Colascione <dancol@dancol.org>
1042
1043 * dbusbind.c: Add comment explaining reason for previous change.
1044
1045 2012-10-15 Martin Rudalics <rudalics@gmx.at>
1046
1047 * window.c (Fwindow_end): Rewrite check whether cached position
1048 can be used (Bug#12600).
1049 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1050 Set windows_or_buffers_changed.
1051
1052 2012-10-15 Daniel Colascione <dancol@dancol.org>
1053
1054 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1055 enabled by undefining the symbol "interface", which the platform
1056 headers define to something incompatible.
1057
1058 2012-10-14 Daniel Colascione <dancol@dancol.org>
1059
1060 * image.c (init_tiff_functions, init_imagemagick_functions)
1061 (init_svg_functions): Fix cygw32 build break by using these
1062 functions only when WINDOWSNT _and_ HAVE_NTGUI.
1063
1064 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
1065
1066 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1067
1068 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
1069
1070 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1071
1072 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
1073
1074 * coding.c (detect_coding): Set coding->id before calling
1075 this->detector.
1076
1077 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
1078
1079 * fileio.c: Formatting fixes.
1080
1081 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
1082
1083 Fix some stat-related races.
1084 * fileio.c (Fwrite_region): Avoid race condition if a file is
1085 removed or renamed by some other process immediately after Emacs
1086 writes it but before Emacs stats it. Do not assume that stat (or
1087 fstat) succeeds.
1088 * image.c (slurp_file): Resolve the file name with fopen + fstat
1089 rather than stat + fopen.
1090 (pbm_read_file) [0]: Remove unused code with stat race.
1091 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1092 Remove ineffective code with stat race.
1093
1094 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
1095
1096 * doc.c (get_doc_string): Don't signal an error if the file is missing.
1097
1098 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1099
1100 * nsterm.m (hold_event_q): New static variable.
1101 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1102 ! q_event_ptr.
1103 (hold_event): New function.
1104 (ns_read_socket): If hold_event_q have events, store them and
1105 return (Bug#12384).
1106 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1107 is zero (Bug#12384).
1108
1109 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
1110
1111 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1112
1113 2012-10-12 Eli Zaretskii <eliz@gnu.org>
1114
1115 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1116
1117 * fileio.c (check_existing): New function.
1118 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1119 instead of calling 'stat', when what's needed is to check whether
1120 a file exists. This avoids expensive system calls on MS-Windows.
1121 (Bug#12587)
1122
1123 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
1124
1125 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1126 determine whether a file exists and is not a directory.
1127
1128 * lisp.h (check_existing): Add prototype.
1129
1130 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1131
1132 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1133
1134 2012-10-12 Glenn Morris <rgm@gnu.org>
1135
1136 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
1137
1138 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
1139
1140 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1141
1142 * eval.c (Fautoload): Remember previous autoload status in load-history.
1143
1144 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1145
1146 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1147 * lread.c (load_each_byte, new_backquote_flag, readchar)
1148 (read_filtered_event, lisp_file_lexically_bound_p)
1149 (safe_to_load_version, Fload, complete_filename_p, openp)
1150 (build_load_history, readevalloop, read_escape, read1)
1151 (string_to_number, read_vector, read_list):
1152 * macros.c (Fstart_kbd_macro):
1153 * marker.c (CONSIDER):
1154 * menu.c (parse_single_submenu, digest_single_submenu)
1155 (find_and_return_menu_selection, Fx_popup_menu):
1156 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1157 (Ftry_completion):
1158 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1159 (ns_menu_show):
1160 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1161 (xmenu_show, xdialog_show):
1162 Use bool for booleans.
1163 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1164 as it's not a predicate. All uses changed. Omit unnecessary
1165 buffer termination.
1166
1167 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
1168
1169 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1170 (save_excursion_restore): Do not restore mark if it was not saved.
1171
1172 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1173
1174 * marker.c (cached_modiff): EMACS_INT, not int.
1175
1176 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1177 instead of having a wrong decl.
1178 * nsmenu.m (waiting_for_input): Remove wrong decl.
1179
1180 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1181
1182 keyboard.c, keymap.c: Use bool for booleans.
1183 * dispnew.c (sit_for): Distinguish between 3-way display_option
1184 and boolean do_display.
1185 * keyboard.c (single_kboard, this_command_key_count_reset)
1186 (waiting_for_input, echoing, immediate_quit, input_pending)
1187 (interrupt_input, interrupts_deferred, pop_kboard)
1188 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1189 (command_loop_1, adjust_point_for_property)
1190 (safe_run_hooks_error, input_polling_used, read_char):
1191 (help_char_p, readable_events, kbd_buffer_events_waiting)
1192 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1193 (lucid_event_type_list_p, get_input_pending):
1194 (gobble_input, menu_separator_name_p, menu_bar_item)
1195 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1196 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1197 (keyremap_step, test_undefined, read_key_sequence)
1198 (detect_input_pending, detect_input_pending_ignore_squeezables)
1199 (detect_input_pending_run_timers, requeued_events_pending_p)
1200 (quit_throw_to_read_char, Fset_input_interrupt_mode):
1201 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
1202 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
1203 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
1204 (accessible_keymaps_1, Fkey_description, push_key_description):
1205 (shadow_lookup, struct where_is_internal_data)
1206 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
1207 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
1208 (describe_map, describe_vector):
1209 * menu.c (single_menu_item):
1210 * nsmenu.m (ns_update_menubar):
1211 * process.c (wait_reading_process_output):
1212 * search.c (scan_buffer, scan_newline):
1213 Use bool for boolean.
1214 * keyboard.c (timers_run, swallow_events)
1215 (detect_input_pending_run_timers):
1216 * process.c (wait_reading_process_output):
1217 Use unsigned for counter where wraparound-on-overflow is desired,
1218 since unsigned is guaranteed to have that behavior and signed is not.
1219 (read_char): Use ptrdiff_t for string length.
1220 (get_input_pending): Remove first argument, since it was always
1221 the same pointer-to-int (now pointer-to-boolean) &input_pending,
1222 and behave as if it had that value. Return new value of
1223 input_pending. All callers changed.
1224 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
1225 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
1226 a string length.
1227 * keymap.c (push_key_description): Omit last arg, which was always 1.
1228 All callers changed.
1229
1230 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
1231
1232 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
1233
1234 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
1235 ($(BLD)/term.$(O)): Update dependencies.
1236
1237 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1238
1239 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
1240 * lisp.h (enum pvec_type): Adjust comments and omit explicit
1241 initializer for PVEC_NORMAL_VECTOR.
1242
1243 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1244
1245 Clean out old termopts cruft.
1246 * termopts.h (flow_control, meta_key): Remove unused decls.
1247 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
1248 Don't include termopts.h.
1249
1250 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1251
1252 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
1253
1254 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1255
1256 * commands.h (immediate_quit): Remove duplicate decl.
1257
1258 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
1259
1260 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
1261 caching.
1262 (nsfont_open): Remove setting of Vfonts_in_cache.
1263 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
1264
1265 2012-10-09 Eli Zaretskii <eliz@gnu.org>
1266
1267 * w32fns.c (w32_last_error): Change the return value to DWORD, to
1268 match what GetLastError returns. Explain why the function is
1269 needed.
1270
1271 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
1272 'is_tooltip_frame', to avoid confusion with its global namesake.
1273
1274 2012-10-08 Daniel Colascione <dancol@dancol.org>
1275
1276 * xdisp.c (start_hourglass): Call w32_note_current_window when
1277 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
1278 build that caused Emacs to display the hourglass cursor forever.
1279
1280 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
1281 which is broken under remote desktop, calculate the number of
1282 colors available for a display based on the display's number of
1283 planes and number of bits per pixel per plane. (bug#10397).
1284
1285 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
1286
1287 * nsfont.m (Vfonts_in_cache): New variable.
1288 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
1289 are used. Add cached fonts to Vfonts_in_cache.
1290 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
1291
1292 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
1293
1294 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
1295 in nt/config.nt.
1296 (FONT_H): Define after FRAME_H.
1297 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
1298 Update dependencies.
1299
1300 * w32term.c: Remove leftover declaration of keyboard_codepage.
1301
1302 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1303
1304 * makefile.w32-in (FONT_H): Add $(FRAME_H).
1305 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
1306 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
1307 (GLOBAL_SOURCES): Add cygw32.c.
1308 ($(BLD)/unexw32.$(O)):
1309 ($(BLD)/w32.$(O)):
1310 ($(BLD)/w32console.$(O)):
1311 ($(BLD)/w32fns.$(O)):
1312 ($(BLD)/w32heap.$(O)):
1313 ($(BLD)/w32menu.$(O)):
1314 ($(BLD)/w32proc.$(O)): Add w32common.h.
1315
1316 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
1317 'const char *'.
1318 (x_to_w32_color): Don't modify the argument, modify a copy instead.
1319
1320 2012-10-08 Daniel Colascione <dancol@dancol.org>
1321
1322 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
1323 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
1324 accidental message numbering hole. Change other messages to
1325 match.
1326
1327 * w32select.h (HAVE_W32SELECT): Remove.
1328
1329 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1330 w32common.h instead of w32heap.h.
1331
1332 * w32heap.h (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 declarations to
1337 w32common.
1338
1339 * w32heap.c: Include w32common.h.
1340 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
1341 (w32_minor_version, w32_build_number, w32_subtype):
1342 Remove duplicate definitions.
1343
1344 * w32fns.c: Include w32common.h; include w32heap.h only in
1345 WINDOWSNT.
1346
1347 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
1348 Use `report_file_error' instead of `error' in order to better
1349 inform users of what went wrong. Increase NTGUI_UNICODE file
1350 dialog box file name length to 32k, the maximum allowed by the NT
1351 kernel.
1352
1353 * w32common.h: New file.
1354 (ROUND_UP, ROUND_DOWN, get_page_size)
1355 (get_allocation_unit, get_processor_type, get_w32_major_version)
1356 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1357 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1358 (OS_NT, os_subtype, cache_system_info): Move here.
1359
1360 * unexw32.c, unexcw.c: Include w32common.h.
1361
1362 * emacs.c (main): Use (defined (WINDOWSNT) || defined
1363 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1364 to call syms_of_w32select.
1365
1366 * cygw32.h: Remove obsolete EXFUN declarations.
1367
1368 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1369
1370 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1371 of w32inevt.o from SOME_MACHINE_OBJECTS.
1372
1373 2012-10-08 Daniel Colascione <dancol@dancol.org>
1374
1375 * image.c: Permanent fix for JPEG compilation issue --- limit
1376 jpeglib `boolean' redefinition to Cygwin builds.
1377
1378 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1379
1380 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1381
1382 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1383 Cygwin.
1384
1385 2012-10-08 Daniel Colascione <dancol@dancol.org>
1386
1387 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1388 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1389 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1390 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1391 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1392 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1393 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1394 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1395 now a supported configuration.
1396
1397 * Makefile.in: consolidate image variables into LIBIMAGE; add
1398 W32_OBJ and W32_LIBS. Compile new files.
1399
1400 * conf_post.h:
1401 (_DebPrint) declare tracing facility for W32 debugging. We need
1402 to unify tracing later.
1403
1404 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1405 unconditional use of W32 Unicode functions. Cygwin runs only on
1406 100% Unicode operating systems.
1407
1408 * cygw32.c: New file. Define Cygwin-specific facilities.
1409 (Fcygwin_convert_path_to_windows)
1410 (Fcygwin_convert_path_from_windows): New user functions for
1411 accessing Cygwin path-munging routines.
1412
1413 * cygw32.h: New file.
1414 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1415 UTF-16LE strings temporarily inside non-Lisp-visible string
1416 objects.
1417
1418 (w32_strerror): Just what it says on the tin.
1419
1420 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1421 also run for Cygwin; both systems have the same problem with using
1422 GUI facilities in a forked child. Also call syms_of_cygw32,
1423 syms_of_w32select in correct places.
1424
1425 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1426 needs fork-then-exec for daemon launching.
1427
1428 * font.h: Include frame.h.
1429
1430 * image.c: Use the image library cache machinery only when we're
1431 compiling for native WINDOWSNT; Cygwin can use shared libraries
1432 like any other Unixlike system.
1433
1434 * keyboard.c: Clarify a comment regarding the input loop.
1435
1436 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1437 functions directly instead of trying to detect at runtime that our
1438 host operating system supports them. We make this change for two
1439 reasons: Cygwin lacks support for the multibyte character
1440 conversion functions used by the legacy menu code, and Cygwin
1441 never needs to rely on non-Unicode APIs.
1442
1443 * unexw32.c (hinst): Declare extern.
1444
1445 * w32.c: Change header order;
1446 (w32_strerror): Move to w32fns.c because we need it for
1447 non-WINDOWSNT builds.
1448
1449 * w32.h: Add #error macro to make sure we don't include w32.h for
1450 Cygwin builds. Remove w32select declarations.
1451
1452 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1453 w32fns.c. w32console.c is WINDOWSNT-only.
1454
1455 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1456 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
1457 POSIXy alternative.
1458 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1459 (w32_major_version, w32_minor_version, w32_build_number)
1460 (os_subtype, sound_type): Define here
1461 (w32_defined_color): Make color parameter const for consistency
1462 with other _defined_color functions.
1463 (w32_createwindow): Unconditionally call w32_init_class instead of
1464 doing so only when hprevinst is non-NULL. Plumbing hprevinst
1465 through the code is complex and unnecessary because class
1466 registration is practically free.
1467 (w32_name_of_message): New EMACSDEBUG-only function.
1468 (Fset_message_beep): Move here
1469 (Fx_open_connection): Require that the display name for Windows be
1470 "w32" for consistency, emacsclient disambiguation, and maybe, one
1471 day, multi-window-system support.
1472 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1473 Cygwin files for W32 GUI facilities, since these clearly don't
1474 expect Cygwin names.
1475 (_DebPrint): Define.
1476 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1477 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1478 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1479 (w32_last_error): Remove.
1480
1481 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1482
1483 * w32heap.c (syspage_mask): Declare here.
1484 (cache_system_info): Remove.
1485
1486 * w32inevt.c (faked_key): Define globally, not statically.
1487 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1488 (w32_console_toggle_lock_key): Move to w32fns.c.
1489
1490 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
1491
1492 * w32proc.c (_DebPrint): Move to w32fns.c.
1493 * w32select.c: Include string.h, stdio.h for Cygwin.
1494 * w32select.h: New File.
1495
1496 * w32term.c: Include io.h for non-CYGWIN builds; needed for
1497 get_osfhandle.
1498 (w32_message_fd): New variable. Under Cygwin, holds the file
1499 descriptor the system used to tell us about pending thread
1500 messages.
1501
1502 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1503 that prevented compilation under non-WINDOWSNT systems.
1504
1505 (w32_initialize): Open /dev/windows and assign it to
1506 w32_message_fd. Provide w32 feature.
1507
1508 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1509 (WM_EMACS_INPUT_READY): add.
1510 (prepend_msg, w32_message_fd): Declare globally.
1511
1512 * w32xfns.c:
1513 (keyboard_handle): Use only when WINDOWSNT.
1514 (notify_msg_ready): New function. Posts a message to the main
1515 thread's message queue under CYGWIN, which wakes up the main
1516 thread from select(2) by making the /dev/windows file descriptor
1517 ready. Under WINDOWSNT, it sets an event the same way the old
1518 code did.
1519
1520 (post, prepend_msg): Actually call notify_msg_ready instead of
1521 setting the input event directly.
1522
1523 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1524
1525 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1526 but it still has blocs in it, don't return it to the system,
1527 instead of aborting. (Bug#12402)
1528
1529 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1530
1531 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1532
1533 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1534 MAC_OS_X_VERSION_10_6.
1535 (syms_of_nsterm): Remove comment about Panther and above for
1536 ns-antialias-text.
1537 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1538 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1539 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1540
1541 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1542 MAC_OS_X_VERSION_10_4.
1543
1544 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1545 MAC_OS_X_VERSION_10_2.
1546
1547 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1548
1549 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1550 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1551
1552 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1553 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1554 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1555 Remove ns_in_resize check.
1556 (ns_clear_frame_area): Remove resize handle code.
1557
1558 * nsfns.m (ns_in_resize): Remove.
1559 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1560 Remove ns_in_resize check.
1561
1562 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1563
1564 Improve sys_siglist detection.
1565 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1566 defined as a macro, as is done in Solaris.
1567 (sys_siglist_entries): New macro.
1568 (save_strsignal): Use it.
1569 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1570 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1571
1572 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1573
1574 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1575 fullscreen/Fullscreen.
1576
1577 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1578 tobar_height is new.
1579
1580 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1581 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1582 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1583 (windowDidResize:): Check for correct window if old style fullscreen.
1584 Capitalize word in comment. Remove incorrect comment.
1585 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1586 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1587 error in drawing background.
1588 (toggleFullScreen:): Remove comment. Rearrange calls.
1589 Set toolbar values to zero, save old height in tobar_height.
1590 Restore tool bar height when leaving fullscreen.
1591 (canBecomeMainWindow): New function.
1592
1593 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1594
1595 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1596
1597 2012-10-05 Eli Zaretskii <eliz@gnu.org>
1598
1599 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1600
1601 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1602 that time stamps of directories could also be changed.
1603 Don't request the too broad GENERIC_WRITE, only the more restrictive
1604 FILE_WRITE_ATTRIBUTES access rights.
1605
1606 * fileio.c (Fset_file_times): Special-case ignoring errors for
1607 directories only on MSDOS, not on MS-Windows.
1608
1609 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
1610
1611 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1612
1613 2012-10-04 Eli Zaretskii <eliz@gnu.org>
1614
1615 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1616 see whether CreateFile failed.
1617
1618 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1619
1620 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1621 to avoid similar races.
1622 * keyboard.c (pending_signals): Now bool, not int.
1623
1624 Port timers to OpenBSD, plus check for timer failures.
1625 OpenBSD problem reported by Han Boetes.
1626 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1627 and/or setitimer.
1628 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1629 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1630 like OpenBSD, which has timer_settime but does not declare it.
1631 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1632 whether to use itimerspec-related primitives. All uses of
1633 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1634
1635 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1636
1637 * profiler.c (handle_profiler_signal): Fix a malloc race
1638 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1639
1640 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1641
1642 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1643
1644 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1645
1646 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1647 consistent with the change in return value of 'safe_strsignal'.
1648
1649 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1650
1651 Prefer plain 'static' to 'static inline' (Bug#12541).
1652 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1653 (bidi_set_sor_type, bidi_push_embedding_level)
1654 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1655 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1656 (bidi_cache_search, bidi_cache_ensure_space)
1657 (bidi_cache_iterator_state, bidi_cache_find)
1658 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1659 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1660 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1661 Now 'static', not 'static inline'.
1662
1663 Count overruns when profiling; change units to ns.
1664 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1665 Give extra weight to samples after overruns, to attempt to count
1666 the time more accurately.
1667 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1668 the underlying primitives nominally do ns.
1669 (Fprofiler_cpu_start): Document the change. Mention that
1670 the sampling intervals are only approximate.
1671
1672 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1673
1674 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1675
1676 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1677 case for the special 0 coding-system.
1678
1679 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1680 (Fmake_overlay): Remove redundant tests.
1681 (fix_start_end_in_overlays): Remove redundant recentering.
1682
1683 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1684
1685 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1686 Update dependencies.
1687
1688 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1689
1690 Fix a malloc race condition involving strsignal.
1691 A signal can arrive in the middle of a malloc, and Emacs's signal
1692 handler can invoke strsignal, which can invoke malloc, which is
1693 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1694 Fix it by altering the signal handler so that it does not invoke
1695 strsignal.
1696 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1697 * process.c (status_message): Use const pointer, in case strsignal
1698 is #defined to safe_strsignal.
1699 * sysdep.c (sys_siglist, init_signals): Always define and
1700 initialize a substitute sys_siglist if the system does not define
1701 one, even if HAVE_STRSIGNAL.
1702 (safe_strsignal): Rename from strsignal. Always define,
1703 using sys_siglist. Return a const pointer.
1704 * syssignal.h (safe_strsignal): New decl.
1705 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1706
1707 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1708
1709 * w32proc.c (timer_loop): Fix code that waits for timer
1710 expiration, to avoid high CPU usage.
1711
1712 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1713
1714 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1715 (sweep_weak_table): Remove redundant prototypes.
1716
1717 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1718
1719 * emacs.c: Move the inclusion of TERM_HEADER after including
1720 windows.h on WINDOWSNT. This avoids compilation problems with
1721 MSVC.
1722
1723 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1724
1725 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1726 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1727 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1728 as the previous version used 'void *'.
1729
1730 * ralloc.c (ROUNDUP): Fix last change.
1731 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1732 'size_t'.
1733
1734 * w32proc.c <disable_itimers>: New static flag.
1735 (init_timers): Initialize it to zero, after creating the critical
1736 sections used by the timer threads.
1737 (term_timers): Set to 1 before deleting the critical sections.
1738 (getitimer, setitimer): If disable_itimers is non-zero, return an
1739 error indication without doing anything. Reported by Fabrice
1740 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1741 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1742 return results.
1743 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1744 support timers.
1745
1746 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1747 term_ntproc after all the other bookkeeping, to get timers working
1748 as long as possible.
1749
1750 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1751
1752 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1753 Suggested by Juri Linkov in
1754 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1755
1756 Prefer plain 'static' to 'static inline' (Bug#12541).
1757 With static functions, modern compilers inline pretty well by
1758 themselves; advice from programmers often hurts as much as it helps.
1759 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1760 this change shrinks the text size of the Emacs executable by 1.1%
1761 without affecting CPU significantly in my benchmark.
1762 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1763 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1764 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1765 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1766 (bset_auto_fill_function, bset_auto_save_file_format)
1767 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1768 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1769 (bset_cache_long_line_scans, bset_case_fold_search)
1770 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1771 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1772 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1773 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1774 (bset_header_line_format, bset_indicate_buffer_boundaries)
1775 (bset_indicate_empty_lines, bset_invisibility_spec)
1776 (bset_left_fringe_width, bset_major_mode, bset_mark)
1777 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1778 (bset_name, bset_overwrite_mode, bset_pt_marker)
1779 (bset_right_fringe_width, bset_save_length)
1780 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1781 (bset_scroll_up_aggressively, bset_selective_display)
1782 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1783 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1784 (set_buffer_overlays_after):
1785 * category.c (bset_category_table):
1786 * charset.c (read_hex):
1787 * coding.c (produce_composition, produce_charset)
1788 (handle_composition_annotation, handle_charset_annotation)
1789 (char_encodable_p):
1790 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1791 (assign_row, set_frame_matrix_frame, make_current)
1792 (add_row_entry):
1793 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1794 * fns.c (maybe_resize_hash_table):
1795 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1796 * gmalloc.c (register_heapinfo):
1797 * image.c (lookup_image_type):
1798 * intervals.c (set_interval_object, set_interval_left)
1799 (set_interval_right, copy_interval_parent, rotate_right)
1800 (rotate_left, balance_possible_root_interval):
1801 * keyboard.c (kset_echo_string, kset_kbd_queue)
1802 (kset_keyboard_translate_table, kset_last_prefix_arg)
1803 (kset_last_repeatable_command, kset_local_function_key_map)
1804 (kset_overriding_terminal_local_map, kset_real_last_command)
1805 (kset_system_key_syms, clear_event, set_prop):
1806 * lread.c (digit_to_number):
1807 * marker.c (attach_marker, live_buffer, set_marker_internal):
1808 * nsterm.m (ns_compute_glyph_string_overhangs):
1809 * process.c (pset_buffer, pset_command)
1810 (pset_decode_coding_system, pset_decoding_buf)
1811 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1812 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1813 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1814 * syntax.c (bset_syntax_table, dec_bytepos):
1815 * terminal.c (tset_param_alist):
1816 * textprop.c (interval_has_some_properties)
1817 (interval_has_some_properties_list):
1818 * window.c (wset_combination_limit, wset_dedicated)
1819 (wset_display_table, wset_hchild, wset_left_fringe_width)
1820 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1821 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1822 (wset_right_fringe_width, wset_right_margin_cols)
1823 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1824 (wset_vertical_scroll_bar_type, wset_window_parameters):
1825 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1826 (wset_column_number_displayed, wset_region_showing)
1827 (window_box_edges, run_window_scroll_functions)
1828 (append_glyph_string_lists, prepend_glyph_string_lists)
1829 (append_glyph_string, set_glyph_string_background_width)
1830 (append_glyph, append_composite_glyph)
1831 (take_vertical_position_into_account):
1832 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1833 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1834 (lface_hash, lface_same_font_attributes_p, lookup_face):
1835 * xml.c (libxml2_loaded_p):
1836 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1837 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1838 Now 'static', not 'static inline'.
1839
1840 * bidi.c: Tune.
1841 (bidi_copy_it): Do the whole copy with a single memcpy.
1842 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1843
1844 Revert the FOLLOW-SYMLINKS change for file-attributes.
1845 Doing it right would require several changes to Tramp, and there's
1846 not enough time to get that tested before the freeze today.
1847 * dired.c (directory_files_internal, Ffile_attributes):
1848 Undo last change.
1849
1850 * frame.c (x_report_frame_params): Port better to wider ints.
1851 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1852 or that pointers can be printed in 15 decimal digits.
1853 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1854
1855 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1856
1857 Support x64 build on MS-Windows.
1858 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1859 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1860 compatibility with x64.
1861 (x_get_focus_frame): Add prototype.
1862
1863 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1864 defining an XRectangle structure.
1865
1866 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1867 arithmetics for compatibility with x64.
1868
1869 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1870 compatibility with x64.
1871
1872 * w32heap.h: Adjust prototypes and declarations.
1873
1874 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1875 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1876 DWORD, long, and unsigned long, for compatibility with x64.
1877 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1878 (sbrk): Argument is now of type ptrdiff_t.
1879
1880 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1881 less than 0x0500.
1882 (w32_msg_pump): Use WPARAM type for 'result'.
1883
1884 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1885 architecture.
1886 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1887 compatibility with x64.
1888
1889 * vm-limit.c (lim_data): Now size_t.
1890 (check_memory_limits): Adjust prototypes of real_morecore and
1891 __morecore to receive argument of type ptrdiff_t. Use size_t for
1892 five_percent and data_size.
1893
1894 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1895 variables, for compatibility with x64.
1896 (rva_to_section, offset_to_section, relocate_offset)
1897 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1898 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1899 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1900 for compatibility with x64.
1901
1902 * sysdep.c (STDERR_FILENO): Define if not already defined.
1903
1904 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1905 (__morecore): Argument type is now ptrdiff_t.
1906 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1907 (relinquish): Use ptrdiff_t type for 'excess'.
1908 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1909
1910 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1911 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1912 instead of a literal number.
1913
1914 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1915 (min): Define only if not already defined.
1916
1917 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1918 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1919 hosts.
1920
1921 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1922 'bitmaps' is a pointer.
1923
1924 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1925
1926 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1927
1928 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1929
1930 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1931 * dired.c (directory_files_internal, Ffile_attributes):
1932 New arg follow_symlinks. All uses changed.
1933
1934 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1935
1936 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1937
1938 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1939
1940 Support atimers and CPU profiler via profile.c on MS-Windows.
1941 * w32proc.c (sig_mask, crit_sig): New static variables.
1942 (sys_signal): Support SIGALRM and SIGPROF.
1943 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1944 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1945 sigfillset, and sigprocmask are no longer no-ops.
1946 (sigismember): New function.
1947 (struct itimer_data): New definition.
1948 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1949 (crit_prof): New static variables.
1950 (MAX_SINGLE_SLEEP): New definition.
1951 (timer_loop, stop_timer_thread, term_timers, init_timers)
1952 (start_timer_thread, getitimer, setitimer): New functions.
1953 (alarm): No longer a no-op, calls setitimer.
1954
1955 * w32.c (term_ntproc): Call term_timers.
1956 (init_ntproc): Make sure all signals are unblocked at startup, to
1957 erase any traces of dumping. Call init_timers.
1958
1959 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1960 Windows-specific code to display the hourglass mouse pointer is no
1961 longer used.
1962 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1963 to hourglass timer expiration.
1964 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1965 Remove, no longer used.
1966 (w32_note_current_window, show_hourglass, hide_hourglass):
1967 New functions, in support of hourglass cursor display similar to other
1968 window systems.
1969 (syms_of_w32fns): Don't initialize hourglass_timer.
1970
1971 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1972 WINDOWSNT as well.
1973 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1974
1975 * w32.h (init_timers, term_timers): Add prototypes.
1976
1977 2012-09-30 Kenichi Handa <handa@gnu.org>
1978
1979 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1980 to the buffer relocation which may be caused by ccl_driver.
1981
1982 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1983
1984 * xfns.c (Fx_file_dialog): Update comment.
1985
1986 * w32fns.c (Fx_file_dialog): Update comment.
1987
1988 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1989 Initialize panel name field if OSX >= 10.6.
1990
1991 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1992
1993 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1994
1995 * nsterm.m (NEW_STYLE_FS): New define.
1996 (ns_fullscreen_hook, windowWillEnterFullScreen)
1997 (windowDidEnterFullScreen, windowWillExitFullScreen)
1998 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1999 (setFSValue): New functions.
2000 (EmacsFSWindow): New implementation.
2001 (canBecomeKeyWindow): New function for EmacsFSWindow.
2002 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2003 (dealloc): Release nonfs_window if in fullscreen.
2004 (updateFrameSize:): Call windowDidMove to update top/left.
2005 (windowWillResize:toSize:): Check if frame is still maximized.
2006 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2007 next_maximized, maximized_width, maximized_height and nonfs_window.
2008 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
2009 tbar_height.
2010 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2011 fullscreen. Set maximized_width/height. Act on next_maximized.
2012
2013 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2014 (EmacsView): Add variables for fullscreen.
2015 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2016 (EmacsFSWindow): New interface for fullscreen.
2017
2018 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
2019
2020 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2021
2022 2012-09-30 Chong Yidong <cyd@gnu.org>
2023
2024 * fns.c (Frandom): Doc fix.
2025
2026 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2027
2028 * window.c (Vwindow_combination_limit): New default value.
2029 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2030
2031 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2032
2033 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2034 Suggested by Eli Zaretskii in
2035 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2036
2037 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2038
2039 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2040 HAVE_TIMER_SETTIME is defined.
2041
2042 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2043
2044 Profiler improvements: more-accurate timers, overflow checks.
2045 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2046 signal.h, setjmp.h. Include systime.h instead.
2047 (saturated_add): New function.
2048 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2049 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2050 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2051 New static vars.
2052 (enum profiler_cpu_running): New enum.
2053 (profiler_cpu_running): Now of that enum type, not bool.
2054 All uses changed to store the new value.
2055 (handle_profiler_signal): Rename from sigprof_handler_1,
2056 for consistency with other handlers. Do not check whether
2057 cpu_log is a hash-table if garbage collecting, since it
2058 doesn't matter in that case.
2059 (deliver_profiler_signal): Rename from sigprof_handler,
2060 for consistency with other handlers.
2061 (setup_cpu_timer): New function, with much of what used to be in
2062 Fprofiler_cpu_start. Check for out-of-range argument.
2063 Prefer timer_settime if available, and prefer
2064 thread cputime clocks, then process cputime clocks, then
2065 monotonic clocks, to the old realtime clock. Use make_timeval
2066 to round more-correctly when falling back to setitimer.
2067 (Fprofiler_cpu_start): Use it.
2068 (Fprofiler_cpu_stop): Prefer timer_settime if available.
2069 Don't assume that passing NULL as the 2nd argument of setitimer
2070 is the same as passing a pointer to all-zero storage.
2071 Ignore SIGPROF afterwards.
2072 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2073 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2074 non-fatal signal handlers. Ignore SIGPROF on startup.
2075 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2076 in profiler.c, since sysdep.c now uses it.
2077
2078 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2079 Suggested by Eli Zaretskii in
2080 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2081
2082 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
2083
2084 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2085
2086 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2087
2088 * lisp.h (struct backtrace): Remove indirection for `function' field.
2089 * xdisp.c (redisplay_internal):
2090 * profiler.c (record_backtrace, sigprof_handler_1):
2091 * alloc.c (Fgarbage_collect):
2092 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2093 (Fbacktrace_frame): Adjust accordingly.
2094
2095 2012-09-28 Glenn Morris <rgm@gnu.org>
2096
2097 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2098 (Frun_hook_with_args_until_failure): Doc fixes.
2099
2100 2012-09-28 Eli Zaretskii <eliz@gnu.org>
2101
2102 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2103 Qautomatic_redisplay and change the symbol name. All users changed.
2104
2105 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
2106
2107 * profiler.c (sigprof_handler): Fix race condition.
2108
2109 2012-09-28 Glenn Morris <rgm@gnu.org>
2110
2111 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
2112
2113 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
2114
2115 Check more robustly for timer_settime.
2116 * Makefile.in (LIB_TIMER_TIME): New macro.
2117 (LIBES): Add it.
2118 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2119 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2120 call timer_settime.
2121
2122 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2123
2124 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2125
2126 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
2127
2128 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2129
2130 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
2131
2132 * character.h (MAYBE_UNIFY_CHAR): Remove.
2133 * charset.c, charset.h (maybe_unify_char): Now static.
2134 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2135 Since this stuff is now private to charset.c, there's no need for
2136 a public macro and no need to inline by hand.
2137
2138 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2139 Stefan Monnier <monnier@iro.umontreal.ca>
2140 Juanma Barranquero <lekktu@gmail.com>
2141
2142 * profiler.c: New file.
2143 * Makefile.in (base_obj): Add profiler.o.
2144 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2145 ($(BLD)/profiler.$(O)): New target.
2146 * emacs.c (main): Call syms_of_profiler.
2147 * alloc.c (Qautomatic_gc): New constant.
2148 (MALLOC_PROBE): New macro.
2149 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2150 (total_bytes_of_live_objects): New function.
2151 (Fgarbage_collect): Use it. Record itself in backtrace_list.
2152 Call malloc_probe for the memory profiler.
2153 (syms_of_alloc): Define Qautomatic_gc.
2154 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2155 race condition.
2156 (struct backtrace): Move definition...
2157 * lisp.h (struct backtrace): ..here.
2158 (Qautomatic_gc, profiler_memory_running): Declare vars.
2159 (malloc_probe, syms_of_profiler): Declare functions.
2160 * xdisp.c (Qautomatic_redisplay): New constant.
2161 (redisplay_internal): Record itself in backtrace_list.
2162 (syms_of_xdisp): Define Qautomatic_redisplay.
2163
2164 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2165 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2166
2167 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2168
2169 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
2170
2171 Prefer POSIX timers if available.
2172 They avoid a race if the timer is too close to the current time.
2173 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2174 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
2175 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
2176
2177 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2178
2179 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2180 CHAR_STRING_ADVANCE.
2181 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2182 STRING_CHAR_ADVANCE.
2183
2184 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2185
2186 Move Vlibrary_cache to emacs.c and reset before dumping.
2187
2188 * lisp.h (reset_image_types): Declare.
2189 [WINDOWSNT] (Vlibrary_cache): Declare.
2190
2191 * image.c (reset_image_types): New function.
2192
2193 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2194 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2195 (Fdump_emacs): Reset Vlibrary_cache and image_types.
2196
2197 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2198 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
2199
2200 * w32.h (Vlibrary_cache): Do not declare.
2201
2202 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2203
2204 * w32proc.c (sys_signal): Handle all signals defined by the
2205 MS-Windows runtime, not just SIGCHLD. Actually install the signal
2206 handlers for signals supported by Windows. Don't override
2207 term_ntproc as the handler for SIGABRT.
2208 (sigaction): Rewrite to call sys_signal instead of duplicating its
2209 code.
2210 (sys_kill): Improve commentary.
2211
2212 * w32.c (term_ntproc): Accept (and ignore) one argument, for
2213 consistency with a signature of a signal handler. All callers
2214 changed.
2215 (init_ntproc): Accept an argument DUMPING. If dumping, don't
2216 install term_ntproc as a signal handler for SIGABRT, as that
2217 should be done by the dumped Emacs.
2218
2219 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
2220
2221 * w32select.c (term_w32select): Protect against repeated
2222 invocation by setting clipboard_owner to NULL after calling
2223 DestroyWindow.
2224
2225 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
2226 and term_ntproc to their modified signatures.
2227
2228 * character.c (char_string, string_char): Remove calls to
2229 MAYBE_UNIFY_CHAR. See the discussion starting at
2230 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
2231 for the details.
2232
2233 2012-09-25 Chong Yidong <cyd@gnu.org>
2234
2235 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
2236
2237 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
2238
2239 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
2240 when encountering an unknown bytecode.
2241
2242 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
2243
2244 image.c, indent.c: Use bool for booleans.
2245 * dispextern.h (struct image_type): Members valid_p, load, init
2246 now return bool, not int. All uses changed.
2247 * image.c: Omit unnecessary static decls.
2248 (x_create_bitmap_mask, x_build_heuristic_mask):
2249 Return void, not int, since callers don't care about the return value.
2250 (x_create_bitmap_mask, define_image_type, valid_image_p)
2251 (struct image_keyword, parse_image_spec, image_spec_value)
2252 (check_image_size, image_background)
2253 (image_background_transparent, x_clear_image_1)
2254 (postprocess_image, lookup_image, x_check_image_size)
2255 (x_create_x_image_and_pixmap, xbm_image_p)
2256 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
2257 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
2258 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
2259 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
2260 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
2261 (png_image_p, init_png_functions, png_load_body, png_load)
2262 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
2263 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
2264 (init_gif_functions, gif_load, imagemagick_image_p)
2265 (imagemagick_load_image, imagemagick_load, svg_image_p)
2266 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
2267 (gs_load):
2268 * nsimage.m (ns_load_image):
2269 * nsterm.m (ns_defined_color):
2270 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
2271 * xfns.c (x_defined_color):
2272 * xterm.c (x_alloc_lighter_color_for_widget)
2273 (x_alloc_nearest_color_1, x_alloc_nearest_color)
2274 (x_alloc_lighter_color):
2275 * indent.c (disptab_matches_widthtab, current_column)
2276 (scan_for_column, string_display_width, indented_beyond_p)
2277 (compute_motion, vmotion, Fvertical_motion):
2278 Use bool for booleans.
2279
2280 2012-09-24 Chong Yidong <cyd@gnu.org>
2281
2282 * chartab.c (Fset_char_table_default): Obsolete function removed.
2283
2284 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2285
2286 Move pid_t related decls out of lisp.h.
2287 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
2288 (interruptible_wait_for_termination):
2289 Move these decls from lisp.h to syswait.h, since they use pid_t.
2290 Needed on FreeBSD; see Herbert J. Skuhra in
2291 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
2292 * callproc.c: Include syswait.h.
2293
2294 gnutls.c, gtkutil.c: Use bool for boolean.
2295 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
2296 (emacs_gnutls_handle_error):
2297 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
2298 (xg_hide_tooltip, xg_create_frame_widgets)
2299 (create_dialog, xg_uses_old_file_dialog)
2300 (xg_get_file_with_chooser, xg_get_file_with_selection)
2301 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
2302 (xg_item_label_same_p, xg_update_menubar)
2303 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
2304 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
2305 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
2306 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
2307 (update_frame_tool_bar, free_frame_tool_bar):
2308 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
2309 * nsmenu.m (ns_update_menubar):
2310 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
2311 * xfns.c (Fx_show_tip) [USE_GTK]:
2312 Use bool for boolean.
2313 * gtkutil.c (xg_update_frame_menubar):
2314 * xmenu.c (update_frame_menubar):
2315 Return void, not int, since caller ignores return value.
2316 * gtkutil.c (xg_change_toolbar_position):
2317 Return void, not 1.
2318
2319 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2320
2321 * makefile.w32-in (BLOCKINPUT_H): Remove.
2322 (SYSSIGNAL_H): New macro.
2323 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
2324 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
2325 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
2326 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
2327 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
2328 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
2329 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
2330 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
2331 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
2332 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
2333 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
2334 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
2335 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
2336 ($(BLD)/w32xfns.$(O)): Update dependencies.
2337
2338 2012-09-23 Eli Zaretskii <eliz@gnu.org>
2339
2340 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
2341 fatal_error_backtrace.
2342
2343 * w32proc.c (sys_kill): Undo last change: don't do anything when
2344 invoked to deliver SIGABRT to our own process. This is now
2345 handled by emacs_raise.
2346
2347 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2348
2349 * w32term.c (w32_read_socket): Remove leftover reference to
2350 interrupt_input_pending.
2351
2352 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2353
2354 Do not use SA_NODEFER.
2355 Problem reported by Dani Moncayo in
2356 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2357 * alloc.c (die):
2358 * sysdep.c (emacs_abort): Do not reset signal handler.
2359 * emacs.c (terminate_due_to_signal): Reset signal handler here.
2360 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
2361 wanted even on POSIXish hosts, and it doesn't work on Windows.
2362
2363 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2364
2365 * xterm.c (x_term_init): Call fixup_locale before and after calling
2366 gtk_init (Bug#12392).
2367
2368 2012-09-23 Chong Yidong <cyd@gnu.org>
2369
2370 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2371 Vdynamic_library_alist.
2372
2373 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2374 (Fgnutls_available_p): Caller changed.
2375
2376 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2377 (Flibxml_parse_xml_region): Likewise.
2378
2379 * dispextern.h (struct image_type): Remove arg from init function.
2380
2381 * image.c (Finit_image_library, lookup_image_type)
2382 (define_image_type): Remove now-unneeded second arg.
2383 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2384 (init_tiff_functions, init_gif_functions, init_svg_functions):
2385 Arglist and w32_delayed_load calling convention changed.
2386 (gs_type): Remove init_gs_functions; there is no such function.
2387 (valid_image_p, make_image): Fix caller to lookup_image_type.
2388
2389 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2390
2391 Simplify and avoid signal-handling races (Bug#12471).
2392 * alloc.c (die):
2393 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2394 Avoid recursive loop if there's a fatal error in the function itself.
2395 * atimer.c (pending_atimers):
2396 * blockinput.h: Don't include "atimer.h"; no longer needed.
2397 (interrupt_input_pending): Remove. All uses removed.
2398 pending_signals now counts both atimers and ordinary interrupts.
2399 This is less racy than having three separate pending-signal flags.
2400 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2401 (input_blocked_p):
2402 Rename from their upper-case counterparts BLOCK_INPUT,
2403 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2404 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2405 This makes it easier to access volatile variables more accurately.
2406 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2407 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2408 that's more reliable if the code is buggy and sets
2409 interrupt_input_blocked to a negative value. All uses changed.
2410 * atimer.c (deliver_alarm_signal):
2411 Remove. No need to deliver this to the parent; any thread can
2412 handle this signal now. All uses replaced by underlying handler.
2413 * atimer.c (turn_on_atimers):
2414 * dispnew.c (handle_window_change_signal):
2415 * emacs.c (handle_danger_signal):
2416 * keyboard.c (kbd_buffer_get_event):
2417 Don't reestablish signal handler; not needed with sigaction.
2418 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2419 (UNBLOCK_INPUT_TO):
2420 Rework to avoid unnecessary accesses to volatile variables.
2421 (UNBLOCK_INPUT_TO): Now a function.
2422 (totally_unblock_input, unblock_input): New decls.
2423 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2424 (init_data): Remove. Necessary stuff now done in init_signal.
2425 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2426 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2427 (fatal_error_code): Remove; no longer needed.
2428 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2429 it doesn't always backtrace. All uses changed. No need to reset
2430 signal to default, since sigaction and/or die does that for us now.
2431 Use emacs_raise (FOO), not kill (getpid (), FOO).
2432 (main): Check more-accurately whether we're dumping.
2433 Move fatal-error setup to sysdep.c
2434 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2435 * gtkutil.c (xg_get_file_name, xg_get_font):
2436 Remove no-longer-needed signal-mask manipulation.
2437 * keyboard.c, process.c (POLL_FOR_INPUT):
2438 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2439 * keyboard.c (read_avail_input): Remove.
2440 All uses replaced by gobble_input.
2441 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2442 (kbd_buffer_store_event_hold, gobble_input):
2443 (record_asynch_buffer_change) [USABLE_SIGIO]:
2444 (store_user_signal_events):
2445 No need to mess with signal mask.
2446 (gobble_input): If blocking input and there are terminals, simply
2447 set pending_signals to 1 and return. All hooks changed to not
2448 worry about whether input is blocked.
2449 (process_pending_signals): Clear pending_signals before processing
2450 them, in case a signal comes in while we're processing.
2451 By convention callers now test pending_signals before calling us.
2452 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2453 New functions, to support changes to blockinput.h.
2454 (handle_input_available_signal): Now extern.
2455 (reinvoke_input_signal): Remove. All uses replaced by
2456 handle_async_input.
2457 (quit_count): Now volatile, since a signal handler uses it.
2458 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2459 All callers changed. Block SIGINT only if not already blocked.
2460 Clear sigmask reliably, even if Fsignal returns, which it can.
2461 Omit unnecessary accesses to volatile var.
2462 (quit_throw_to_read_char): No need to restore sigmask.
2463 * keyboard.c (gobble_input, handle_user_signal):
2464 * process.c (wait_reading_process_output):
2465 Call signal-handling code rather than killing ourselves.
2466 * lisp.h: Include <float.h>, for...
2467 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2468 (pending_signals): Now volatile.
2469 (syms_of_data): Now const if IEEE floating point.
2470 (handle_input_available_signal) [USABLE_SIGIO]:
2471 (terminate_due_to_signal, record_child_status_change): New decls.
2472 * process.c (create_process): Avoid disaster if memory is exhausted
2473 while we're processing a vfork, by tightening the critical section
2474 around the vfork.
2475 (send_process_frame, process_sent_to, handle_pipe_signal)
2476 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
2477 ignores SIGPIPE.
2478 (send_process): No need for setjmp/longjmp any more, since the
2479 SIGPIPE stuff is now gone. Instead, report an error if errno
2480 is EPIPE.
2481 (record_child_status_change): Now extern. PID and W are now args.
2482 Return void, not bool. All callers changed.
2483 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2484 Remove. All uses removed. This bug should be fixed now in a
2485 different way.
2486 (wait_for_termination_1): Use waitpid rather than sigsuspend,
2487 and record the child status change directly. This avoids the
2488 need to futz with the signal mask.
2489 (process_fatal_action): Move here from emacs.c.
2490 (emacs_sigaction_flags): New function, containing
2491 much of what used to be in emacs_sigaction_init.
2492 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
2493 caught by emacs, to make races less likely.
2494 (deliver_process_signal): Rename from handle_on_main_thread.
2495 All uses changed.
2496 (BACKTRACE_LIMIT_MAX): Now at top level.
2497 (thread_backtrace_buffer, threadback_backtrace_pointers):
2498 New static vars.
2499 (deliver_thread_signal, deliver_fatal_thread_signal):
2500 New functions, for more-accurate delivery of thread-specific signals.
2501 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2502 (deliver_arith_signal): Handle in this thread, not
2503 in the main thread, since it's triggered by this thread.
2504 (maybe_fatal_sig): New function.
2505 (init_signals): New arg DUMPING so that we can be more accurate
2506 about whether we're dumping. Caller changed.
2507 Treat thread-specific signals differently from process-general signals.
2508 Block all signals while handling fatal error; that's safer.
2509 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2510 on IEEE hosts.
2511 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2512 Ignore SIGPIPE unless batch.
2513 (emacs_backtrace): Output backtrace for the appropriate thread,
2514 which is not necessarily the main thread.
2515 * syssignal.h: Include <stdbool.h>.
2516 (emacs_raise): New macro.
2517 * xterm.c (x_connection_signal): Remove; no longer needed
2518 now that we use sigaction.
2519 (x_connection_closed): No need to mess with sigmask now.
2520 (x_initialize): No need to reset SIGPIPE handler here, since
2521 init_signals does this for us now.
2522
2523 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2524
2525 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2526 background rect may be larger (Bug#12245).
2527
2528 2012-09-23 Chong Yidong <cyd@gnu.org>
2529
2530 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2531
2532 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2533
2534 * .gdbinit: Just stop at fatal_error_backtrace.
2535 See Stefan Monnier's request in
2536 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2537 Remove no-longer-used query of system type.
2538
2539 2012-09-22 Chong Yidong <cyd@gnu.org>
2540
2541 * search.c (Freplace_match): Doc fix (Bug#12325).
2542
2543 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2544
2545 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2546 (Fline_end_position): Doc fix.
2547
2548 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2549
2550 2012-09-22 Chong Yidong <cyd@gnu.org>
2551
2552 * dispextern.h (struct image_type): Add new slot, storing a type
2553 initialization function.
2554
2555 * image.c (define_image_type): Call the image initializer function
2556 if it is defined. Arguments and return value changed.
2557 (valid_image_p, make_image): Callers changed.
2558 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2559 (gif_type, imagemagick_type, svg_type, gs_type):
2560 Add initialization functions.
2561 (Finit_image_library): Call lookup_image_type.
2562 (CHECK_LIB_AVAILABLE): Macro deleted.
2563 (lookup_image_type): Call define_image_type here, rather than via
2564 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2565 (syms_of_image): Move define_image_type calls for xbm_type and
2566 pbm_type to lookup_image_type.
2567
2568 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2569
2570 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2571 'idle_timers' from here ...
2572 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2573 lists, to avoid infloops when the timer does something stupid,
2574 like reinvoke itself with the same or smaller time-out.
2575 (Bug#12447)
2576
2577 2012-09-22 Martin Rudalics <rudalics@gmx.at>
2578
2579 * window.c (Fsplit_window_internal): Handle only Qt value of
2580 Vwindow_combination_limit separately.
2581 (Qtemp_buffer_resize): New symbol.
2582 (Vwindow_combination_limit): New default value.
2583 Rewrite doc-string.
2584
2585 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2586
2587 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2588 the new overlay string. (Bug#10159)
2589
2590 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2591
2592 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2593 or that fprintf is async-signal-safe. POSIX doesn't require
2594 either assumption.
2595
2596 2012-09-22 Chong Yidong <cyd@gnu.org>
2597
2598 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2599 (Bug#8207).
2600
2601 2012-09-22 Kenichi Handa <handa@gnu.org>
2602
2603 * composite.c (composition_reseat_it): Handle the case that a
2604 grapheme cluster is not covered by a single font (Bug#12352).
2605
2606 2012-09-21 Chong Yidong <cyd@gnu.org>
2607
2608 * image.c (define_image_type): Avoid adding duplicate types to
2609 image_types (Bug#12463). Suggested by Jörg Walter.
2610
2611 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2612
2613 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2614 (print_load_command_name): Add case LC_DATA_IN_CODE.
2615 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2616
2617 2012-09-21 Glenn Morris <rgm@gnu.org>
2618
2619 * eval.c (Frun_hook_with_args_until_success)
2620 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2621
2622 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
2623
2624 * fileio.c (Ffile_selinux_context): Only call freecon when
2625 lgetfilecon succeeded.
2626 (Fset_file_selinux_context): Likewise. (Bug#12444)
2627
2628 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2629
2630 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2631 reordering, locate the cursor by calling set_cursor_from_row; if
2632 that fails, clear the desired glyph matrix before returning a
2633 failure indication to the caller. Fixes leaving garbled display
2634 when fast scrolling with a down-key. (Bug#12403)
2635 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2636 scrolling through multibyte text.
2637
2638 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2639
2640 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2641 calling mark_vectorlike since that's the one that marks the window.
2642 (mark_discard_killed_buffers): Mark the final cdr.
2643 * window.h (struct window): Move prev/next_buffers to the
2644 non-standard fields.
2645 * window.c (make_window): Initialize prev/next_buffers manually.
2646
2647 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2648
2649 Omit unused arg EXPECTED from socket hooks.
2650 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2651 * nsterm.m (ns_term_init):
2652 * termhooks.h (struct terminal.read_socket_hook):
2653 * w32inevt.c (w32_console_read_socket):
2654 * w32term.c (w32_read_socket):
2655 * xterm.c (XTread_socket):
2656 Omit unused arg EXPECTED. All callers changed.
2657 (store_user_signal_events): Return void, not int, since callers no
2658 longer care about the return value. All uses changed.
2659
2660 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2661
2662 * w32gui.h (XParseGeometry): Do not declare.
2663
2664 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2665
2666 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2667 Ignore 'expected'. See Eli Zaretskii in
2668 <http://bugs.gnu.org/12471#8> (last line).
2669
2670 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2671 (XParseGeometry): Now static. Substitute extremal values for
2672 values that are out of range.
2673
2674 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2675
2676 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2677
2678 * nsfns.m (XParseGeometry): Remove.
2679 (Fx_create_frame): Call x_set_offset to correctly interpret
2680 top_pos in geometry.
2681
2682 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2683 (Fx_parse_geometry): If there is a space in string, call
2684 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2685
2686 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2687
2688 * search.c (scan_buffer): Use character positions in calls to
2689 region_cache_forward and region_cache_backward, not byte
2690 positions. (Bug#12196)
2691
2692 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2693 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2694
2695 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2696 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2697 emacs_blocked_malloc, now deleted.
2698
2699 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2700
2701 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2702 The workaround was for improving performance on Solaris 2.4, but
2703 is getting in the way now. Emacs will still work if someone is
2704 still running Solaris 2.4 in a museum somewhere; Sun dropped
2705 support for Solaris 2.4 in 2003.
2706 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2707 * process.c (create_process) [HAVE_WORKING_VFORK]:
2708 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2709 since Emacs no longer uses vfork on that platform.
2710
2711 2012-09-17 Glenn Morris <rgm@gnu.org>
2712
2713 * emacs.c: Use COPYRIGHT.
2714
2715 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2716
2717 Remove configure's --without-sync-input option (Bug#12450).
2718 When auditing signal-handling in preparation for cleaning it up,
2719 I found that SYNC_INPUT has race conditions and would be a real
2720 pain to fix. Since it's an undocumented and deprecated
2721 configure-time option, now seems like a good time to remove it.
2722 Also see <http://bugs.gnu.org/11080#16>.
2723 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2724 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2725 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2726 (malloc_hysteresis):
2727 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2728 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2729 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2730 (dont_register_blocks, bytes_used_when_reconsidered)
2731 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2732 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2733 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2734 Remove. All uses removed.
2735 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2736 implementation, one that depends on whether the new macro
2737 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2738 is defined.
2739 * atimer.c (run_timers, handle_alarm_signal):
2740 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2741 (handle_async_input, process_pending_signals)
2742 (handle_input_available_signal, init_keyboard):
2743 * nsterm.m (ns_read_socket):
2744 * process.c (wait_reading_process_output):
2745 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2746 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2747 (emacs_write):
2748 * xterm.c (XTread_socket):
2749 Assume SYNC_INPUT.
2750 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2751 * eval.c (handling_signal): Remove. All uses removed.
2752 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2753 All uses replaced with the SYNC_INPUT version.
2754 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2755 Remove decls.
2756 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2757 Now static.
2758
2759 * font.c (Ffont_shape_gstring): Remove unused local.
2760
2761 2012-09-16 Glenn Morris <rgm@gnu.org>
2762
2763 * Makefile.in (clean): No longer run nextstep's clean.
2764
2765 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2766 (ns_frag): Remove.
2767 (ns-app): Move here from ns.mk, and simplify.
2768 (clean): Simplify nextstep entry.
2769 * ns.mk: Remove file.
2770
2771 2012-09-17 Kenichi Handa <handa@gnu.org>
2772
2773 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2774 not covert the last few charactes.
2775
2776 2012-09-16 Kenichi Handa <handa@gnu.org>
2777
2778 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2779 here, but just check the validity of glyphs in the glyph-string.
2780
2781 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2782
2783 * window.c (Fwindow_parameter, Fset_window_parameter):
2784 Accept any window as argument (Bug#12452).
2785
2786 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2787
2788 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2789 to ns_term_init to avoid memory leak.
2790
2791 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2792 explicit retain/release.
2793 (ns_term_init): Only allow one display. Initialize outerpool and
2794 ns_*_types.
2795
2796 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2797
2798 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2799 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2800 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2801 the Microsoft problem in a different way, by altering ../nt/config.nt.
2802
2803 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2804
2805 * w32xfns.c:
2806 * w32uniscribe.c:
2807 * w32term.c:
2808 * w32select.c:
2809 * w32reg.c:
2810 * w32proc.c:
2811 * w32menu.c:
2812 * w32inevt.c:
2813 * w32heap.c:
2814 * w32font.c:
2815 * w32fns.c:
2816 * w32console.c:
2817 * w32.c:
2818 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2819 by lisp.h. This completes removal of setjmp.h inclusion
2820 erroneously announced in the previous commit. (Bug#12446)
2821
2822 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2823 more accurate.
2824
2825 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2826 not defined as a macro. The latter happens on MS-Windows.
2827 (Bug#12446)
2828
2829 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2830
2831 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2832 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2833 Some instances of '#include <setjmp.h>' removed, if the
2834 only reason for the instance was because "lisp.h" was included.
2835 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2836 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2837 and _longjmp with the new symbols. Emacs already uses _setjmp if
2838 available, so this change affects only POSIXish hosts that have
2839 sigsetjmp but not _setjmp, such as some versions of Solaris and
2840 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2841 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2842 (png_load_body) [HAVE_PNG]:
2843 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2844 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2845 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2846 since PNG requires jmp_buf. This is the only exception to the
2847 general rule that we now use sys_setjmp and sys_longjmp.
2848 This exception is OK since this code does not change the signal
2849 mask or longjmp out of a signal handler.
2850
2851 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2852
2853 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2854 Include "syssignal.h", for 'main_thread'.
2855
2856 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2857
2858 Avoid out-of-range marker position (Bug#12426).
2859 * insdel.c (replace_range, replace_range_2):
2860 Adjust markers before overlays, as suggested by comments.
2861 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2862 Remove redundant check before calling offset_intervals.
2863
2864 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2865
2866 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2867 current buffer (Bug#12387).
2868
2869 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2870
2871 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2872
2873 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2874
2875 Use a more backwards-compatible timer format (Bug#12430).
2876 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2877 vector element, not from the 4th, since PSECS is now at the end.
2878 (Fcurrent_idle_time): Doc fix.
2879
2880 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2881
2882 Function to mark objects and remove killed buffers at once.
2883 * alloc.c (discard_killed_buffers): Rename to ...
2884 (mark_discard_killed buffers) ... new name. Add marking
2885 of remaining objects. Fix comment. Adjust users.
2886 (mark_object): Do not touch frame buffer lists here.
2887 * frame.c (delete_frame): Reset frame buffer lists here.
2888
2889 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2890
2891 Better workaround for GNOME bug when --enable-gcc-warnings.
2892 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2893 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2894 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2895
2896 Simplify SIGIO usage (Bug#12408).
2897 The code that dealt with SIGIO was crufty and confusing, e.g., it
2898 played tricks like "#undef SIGIO" but these tricks were not used
2899 consistently. Simplify mostly by not #undeffing standard symbols,
2900 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2901 or not as we please) rather than "defined SIGIO" (standard symbol
2902 that we probably shouldn't #undef).
2903 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2904 Modules that need it can include it.
2905 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2906 * dispextern.h (ignore_sigio): New decl.
2907 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2908 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2909 * emacs.c (shut_down_emacs):
2910 * keyboard.c (kbd_buffer_store_event_hold):
2911 Use ignore_sigio rather than invoking 'signal' directly.
2912 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2913 for FIONREAD.
2914 (FIONREAD, SIGIO): Do not #undef.
2915 (tty_read_avail_input): Use #error rather than a syntax error.
2916 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2917 for I_PIPE, used by SETUP_SLAVE_PTY.
2918 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2919 * sysdep.c (croak): Remove; no longer needed. This bit of
2920 temporary code, with Fred N. Fish's comment that it's temporary,
2921 has been in Emacs since at least 1992!
2922 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2923 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2924 * syssignal.h (croak): Remove decl.
2925 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2926 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2927 now that we're termios-only.
2928 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2929 * term.c (dissociate_if_controlling_tty): Use #error rather than
2930 a run-time error.
2931
2932 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2933 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2934 to work around GNOME bug 683906.
2935 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2936 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2937 This works around GCC bug 54561.
2938
2939 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2940
2941 More fixes for 'volatile' and setjmp/longjmp.
2942 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2943 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2944 (png_load_body) [HAVE_PNG]:
2945 (jpeg_load_body) [HAVE_JPEG]:
2946 New function, with most of the old parent function's body.
2947 (png_load) [HAVE_PNG]:
2948 (jpeg_load) [HAVE_JPEG]:
2949 Invoke the new function, to avoid longjmp munging our locals.
2950 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2951 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2952 longjmp is passed 2, as the C standard doesn't guarantee this.
2953 Instead, store the failure code into mgr->failure_code.
2954
2955 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2956
2957 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2958 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2959 (syms_of_keyboard): Remove support for unread-command-char.
2960
2961 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2962
2963 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2964 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2965 violation. (Bug#12426)
2966
2967 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2968
2969 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2970
2971 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2972
2973 * eval.c: Add `inhibit-debugger'.
2974 (Qinhibit_debugger): New symbol.
2975 (call_debugger): Bind it instead of Qdebug_on_error.
2976 (maybe_call_debugger): Test Vinhibit_debugger.
2977 (syms_of_eval): Define inhibit-debugger.
2978 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2979 (syms_of_xdisp): Remove inhibit-debug-on-message.
2980
2981 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2982
2983 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2984 If a nonvolatile local variable is written before a _longjmp to
2985 the frame containing the variable, and is read after the _longjmp,
2986 the value read is indeterminate. Some local variables of type
2987 'struct handler' and 'struct catchtag' are used in this way, so
2988 mark each of their slots as volatile if the slot can be set before
2989 _longjmp and read afterwards.
2990 * lisp.h (struct handler): var and chosen_clause are now volatile.
2991 (struct catchtag): val, next, and pdlcount are now volatile.
2992
2993 * bidi.c (bidi_push_it, bidi_pop_it):
2994 * fns.c (copy_hash_table):
2995 * image.c (define_image_type):
2996 * keyboard.c (kbd_buffer_store_event_hold):
2997 * process.c (Fprocess_send_eof):
2998 * xfaces.c (x_create_gc) [HAVE_NS]:
2999 * xgselect.c (xg_select):
3000 Prefer assignment to memcpy when either will do.
3001
3002 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3003 Use pointer-to-a-pointer to simplify and avoid a NILP check each
3004 time an item is removed. No need to mark this function 'inline';
3005 the compiler knows better than we do.
3006
3007 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
3008
3009 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3010 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3011 to change_frame_size (Bug#12388).
3012 (windowDidResize:): Pass YES to updateFrameSize.
3013
3014 * nsterm.h: Add delay parameter to updateFrameSize.
3015
3016 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3017
3018 Discard killed buffers from deleted window and frame objects.
3019 This reduces an amount of references to killed buffers and
3020 helps GC to reclaim them faster.
3021 * alloc.c (discard_killed_buffers): New function.
3022 (mark_object): Use it for deleted windows and frames.
3023 (mark_object): If symbol's value is set up for a killed buffer
3024 or deleted frame, restore its global binding.
3025 * data.c (swap_in_global_binding): Add GC notice.
3026 (swap_in_symval_forwarding): Use convenient set_blv_where.
3027 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3028 * window.h: ... to here.
3029
3030 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3031
3032 Convenient macro to check whether the buffer is live.
3033 * buffer.h (BUFFER_LIVE_P): New macro.
3034 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3035 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3036
3037 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3038
3039 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3040 composition cases (Bug#12364).
3041
3042 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3043 overhang of succeeding glyphs overlapping box cursor.
3044
3045 * w32term.c (x_draw_glyph_string): Likewise.
3046
3047 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3048
3049 Simplify, document, and port floating-point (Bug#12381).
3050 The porting part of this patch fixes bugs on non-IEEE platforms
3051 with frexp, ldexp, logb.
3052 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3053 Now static.
3054 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3055 support, by removing commented-out code and briefly listing the
3056 C89 functions excluded. The commented-out stuff was confusing
3057 maintenance, e.g., we thought we needed cbrt but it was commented out.
3058 (logb): Remove decl; no longer needed.
3059 (isfinite): New macro, if not already supplied.
3060 (isnan): Don't replace any existing macro.
3061 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3062 are present on all C89 platforms.
3063 (Ffrexp): Do not special-case zero, as frexp does the right thing
3064 for that case.
3065 (Flogb): Do not use logb, as it doesn't have the desired meaning
3066 on hosts that use non-base-2 floating point. Instead, stick with
3067 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
3068 frexp, to avoid getting an unspecified result.
3069
3070 * xdisp.c (Qinhibit_debug_on_message): Now static.
3071
3072 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
3073
3074 * nsterm.m (ns_update_begin): Set clip path to whole view by using
3075 NSBezierPath (Bug#12131).
3076
3077 2012-09-10 Chong Yidong <cyd@gnu.org>
3078
3079 * fns.c (Fdelq, Fdelete): Doc fix.
3080
3081 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
3082
3083 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3084 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3085
3086 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
3087
3088 * lisp.h (make_lisp_ptr): New macro to replace XSET.
3089 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3090 Use it.
3091
3092 2012-09-09 Eli Zaretskii <eliz@gnu.org>
3093
3094 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3095 left fringe if the window has a left margin. This avoids leaving
3096 traces of the cursor because its leftmost pixel is not drawn over.
3097
3098 * dispnew.c (update_window_line): When the left margin area of a
3099 screen line is updated, set the redraw_fringe_bitmaps_p flag of
3100 that screen line. (Bug#12277)
3101
3102 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
3103
3104 Assume C89 or later for math functions (Bug#12381).
3105 This simplifies the code, and makes it a bit smaller and faster,
3106 and (most important) makes it easier to clean up signal handling
3107 since we can stop worring about floating-point exceptions in
3108 library code. That was a problem before C89, but the problem
3109 went away many years ago on all practical Emacs targets.
3110 * data.c, image.c, lread.c, print.c:
3111 Don't include <math.h>; no longer needed.
3112 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3113 might be autoconfigured, as that never happens.
3114 * data.c (fmod):
3115 * doprnt.c (DBL_MAX_10_EXP):
3116 * print.c (DBL_DIG):
3117 Remove. C89 or later always defines these.
3118 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3119 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3120 (arith_error, domain_error, domain_error2):
3121 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
3122 no longer needed -- we simply return what C returns. All uses removed.
3123 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
3124 the wrapped code.
3125 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3126 Remove. All uses expanded, as these macros are no longer used
3127 more than once and are now more trouble than they're worth.
3128 (Ftan): Use tan, not sin / cos.
3129 (Flogb): Assume C89 frexp.
3130 (fmod_float): Assume C89 fmod.
3131 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3132 (init_floatfns): Remove. All uses removed.
3133
3134 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3135
3136 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3137 compositeToPoint for OSX < 10.6 (Bug#12390).
3138
3139 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
3140
3141 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3142 This produces more-accurate results.
3143
3144 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3145
3146 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3147 changes (Bug#12088).
3148
3149 2012-09-08 Chong Yidong <cyd@gnu.org>
3150
3151 * syntax.c (Fstring_to_syntax): Doc fix.
3152
3153 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3154
3155 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3156 in the internal border.
3157 (x_set_window_size): Remove static variables and their usage.
3158 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3159 (ns_after_update_window_line, ns_draw_fringe_bitmap):
3160 Remove fringe/internal border adjustment (Bug#11052).
3161 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3162 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3163 (ns_fix_rect_ibw): Remove.
3164 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3165 (ns_dumpglyphs_box_or_relief): Ditto.
3166 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3167 adjustment.
3168 (ns_dumpglyphs_image): Ditto.
3169 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
3170 border adjustment.
3171 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3172 their usage. Add fringe_extended_p and its use as in other terms.
3173 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
3174 scroll bar was removed.
3175 (updateFrameSize): New function.
3176 (windowDidResize): Move code to updateFrameSize and call it.
3177
3178 * nsterm.h (EmacsView): Add updateFrameSize.
3179
3180 2012-09-07 Chong Yidong <cyd@gnu.org>
3181
3182 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3183
3184 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3185
3186 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3187
3188 More signal-handler cleanup (Bug#12327).
3189 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3190 Problem introduced when merging patches. Noted by Eli Zaretskii in
3191 <http://bugs.gnu.org/12327#67>.
3192 * floatfns.c: Comment fix.
3193 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3194 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3195 and anyway the declaration is harmless even if SIGDANGER is not defined.
3196 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3197 defined BROKEN_FIONREAD). systty.h formerly did this, but other
3198 source files not surprisingly expected syssignal.h to define, or
3199 not define, SIGIO, and it's cleaner to do it that way, for consistency.
3200 Include <sys/ioctl.h>, for FIONREAD.
3201 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
3202 This eliminates a problem whereby other files mysteriously had
3203 to include "syssignal.h" before including "systty.h" if they
3204 wanted to use "#ifdef SIGIO".
3205
3206 2012-09-07 Eli Zaretskii <eliz@gnu.org>
3207
3208 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
3209
3210 * w32.c (sigemptyset): Empty the set.
3211 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
3212
3213 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
3214
3215 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
3216
3217 * alloc.c (mark_buffer): Revert unsafe marking optimization.
3218 (mark_object): Likewise for frame objects.
3219
3220 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3221
3222 * syssignal.h (handle_on_main_thread): Always declare,
3223 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
3224 This ports to platforms without HAVE_PTHREAD.
3225
3226 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3227
3228 Signal-handler cleanup (Bug#12327).
3229 Emacs's signal handlers were written in the old 4.2BSD style with
3230 sigblock and sigmask and so forth, and this led to some
3231 inefficiencies and confusion. Rewrite these to use
3232 pthread_sigmask etc. without copying signal sets around. Also,
3233 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
3234 'signal', and instead use functions that do not attempt to take
3235 over the system name space. This patch causes Emacs's text
3236 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
3237 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
3238 Do not include <signal.h> or "syssignal.h", as these
3239 modules do not use signals.
3240 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
3241 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
3242 Do not include <signal.h>, as "syssignal.h" does that for us now.
3243 * atimer.c (sigmask_atimers): New function.
3244 (block_atimers, unblock_atimers): New functions,
3245 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
3246 All uses replaced.
3247 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
3248 no longer needed here.
3249 * emacs.c (main): Inspect existing signal handler with sigaction,
3250 so that there's no need to block and unblock SIGHUP.
3251 * sysdep.c (struct save_signal): New member 'action', replacing
3252 old member 'handler'.
3253 (save_signal_handlers, restore_signal_handlers):
3254 Use sigaction instead of 'signal' to save and restore.
3255 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
3256 New function. All users of 'signal' modified to use set_sighandler
3257 if they're writeonly, and to use sys_signal if they're read+write.
3258 (emacs_sigaction_init, forwarded_signal): New functions.
3259 (sys_signal): Remove. All uses replaced by calls to sigaction
3260 and emacs_sigaction_init, or by direct calls to 'signal'.
3261 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
3262 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
3263 all uses replaced by pthread_sigmask etc. calls.
3264 * syssignal.h: Include <signal.h>.
3265 (emacs_sigaction_init, forwarded_signal): New decls.
3266 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
3267 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
3268 (sigmask, sys_sigmask): Remove; no longer needed.
3269 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
3270 (sigblock, sigunblock, sigfree):
3271 (sigsetmask) [!defined sigsetmask]:
3272 Remove. All uses replaced by pthread_sigmask.
3273 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
3274 no longer need to be replaced, and its typical old uses
3275 are now done via emacs_sigaction_init and sigaction.
3276 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
3277 (sys_sigdel): Remove; unused.
3278 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
3279
3280 2012-09-06 Eli Zaretskii <eliz@gnu.org>
3281
3282 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
3283 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
3284
3285 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3286
3287 Explicitly mark buffer_defaults and buffer_local_symbols.
3288 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
3289 mark_local_symbols here.
3290 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
3291 since special buffers aren't marked here any more.
3292 (allocate_buffer): Chain new buffer with all_buffers here...
3293 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
3294 not here.
3295 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
3296 (syms_of_buffer): Remove staticpro of the above.
3297 (init_buffer_once): Set names for buffer_defaults and
3298 buffer_local_symbols.
3299
3300 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3301
3302 Use bool for booleans in font-related modules.
3303 * font.c (font_intern_prop, font_style_to_value)
3304 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
3305 (generate_otf_features, font_check_otf_features, font_check_otf)
3306 (font_match_p, font_list_entities, font_at):
3307 * fontset.c (fontset_id_valid_p, reorder_font_vector
3308 (fontset_find_font, Fset_fontset_font)
3309 (face_suitable_for_char_p) [0]:
3310 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
3311 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
3312 (m17n_flt_initialized, ftfont_shape_by_flt):
3313 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
3314 * nsfont.m (nsfont_draw):
3315 * w32font.c (w32font_draw):
3316 * w32term.c (x_draw_glyphless_glyph_string_foreground):
3317 Use bool for booleans.
3318 * font.h: Adjust to above API changes.
3319 (struct font, struct font_driver, struct font_driver_list):
3320 Use bool for booleans.
3321 (struct font): Remove useless member encoding_type.
3322 All users removed.
3323 * fontset.c, xftfont.c: Omit unnecessary static decls.
3324
3325 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3326
3327 * alloc.c (mark_object): Revert window marking code
3328 since it's unsafe for the Fset_window_configuration.
3329
3330 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3331
3332 Fix race conditions with signal handlers and errno (Bug#12327).
3333 Be more systematic about preserving errno whenever a signal
3334 handler returns, even if it's not in the main thread. Do this by
3335 renaming signal handlers to distinguish between signal delivery
3336 and signal handling. All uses changed.
3337 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
3338 * data.c (deliver_arith_signal): Rename from arith_error.
3339 * dispnew.c (deliver_window_change_signal): Rename from
3340 window_change_signal.
3341 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
3342 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
3343 * keyboard.c (deliver_input_available_signal): Rename from
3344 input_available_signal.
3345 (deliver_user_signal): Rename from handle_user_signal.
3346 (deliver_interrupt_signal): Rename from interrupt_signal.
3347 * process.c (deliver_pipe_signal): Rename from send_process_trap.
3348 (deliver_child_signal): Rename from sigchld_handler.
3349 * atimer.c (handle_alarm_signal):
3350 * data.c (handle_arith_signal):
3351 * dispnew.c (handle_window_change_signal):
3352 * emacs.c (handle_fatal_signal, handle_danger_signal):
3353 * keyboard.c (handle_input_available_signal):
3354 * keyboard.c (handle_user_signal, handle_interrupt_signal):
3355 * process.c (handle_pipe_signal, handle_child_signal):
3356 New functions, with the actual signal-handling code taken from the
3357 original respective signal handlers, sans the sporadic attempts to
3358 preserve errno, since that's now done by handle_on_main_thread.
3359 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3360 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3361 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3362 Move to sysdep.c.
3363 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3364 Move initialization of main_thread to sysdep.c's init_signals.
3365 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3366 our usage, and simplifies the mainline code.
3367 (record_child_status_change): New static function, as a helper
3368 for handle_child_signal, and with most of the old child handler's
3369 contents.
3370 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3371 (handle_child_signal): Use the above.
3372 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3373 Moved here from emacs.c.
3374 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3375 code moved here from emacs.c's main function.
3376 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3377 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
3378 This lets callers save and restore errno properly.
3379
3380 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3381
3382 Remove redundant or unused things here and there.
3383 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3384 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3385 * editfns.c (Fcompare_buffer_substrings): Likewise.
3386 * frame.h (struct terminal, struct font_driver_list):
3387 Remove redundant declarations.
3388 * window.h (Qleft, Qright): Likewise.
3389
3390 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3391
3392 Do not mark objects from deleted buffers, windows and frames.
3393 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3394 (mark_object): Likewise for windows and frames.
3395
3396 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3397
3398 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3399 buffer_defaults and buffer_local_symbols as valid objects.
3400 Return special value to denote them.
3401
3402 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3403
3404 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3405 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3406 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3407 (file_name_absolute_p, Fsubstitute_in_file_name):
3408 (check_executable, check_writable, Ffile_accessible_directory_p)
3409 (Fset_file_selinux_context, Fdefault_file_modes)
3410 (Finsert_file_contents, choose_write_coding_system)
3411 (Fwrite_region, build_annotations, a_write, e_write)
3412 (Fdo_auto_save):
3413 * filelock.c (boot_time_initialized, get_boot_time)
3414 (get_boot_time_1, lock_file_1, within_one_second):
3415 * floatfns.c (in_float):
3416 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3417 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3418 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3419 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3420 * window.c (compare_window_configurations):
3421 Use bool for booleans.
3422 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3423 (Fdefault_file_modes): Now mode_t, not int, for modes.
3424 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3425 (internal_delete_file): Now returns void, not a (boolean) int,
3426 since nobody was looking at the return value.
3427 * lisp.h, window.h: Adjust to above API changes.
3428
3429 * xdisp.c (set_message): Simplify and reindent last change.
3430
3431 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
3432
3433 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3434
3435 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3436
3437 * eval.c (call_debugger): Make the function non-static so that we
3438 can call it from set_message.
3439
3440 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3441 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3442
3443 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3444
3445 Give more-useful info on a fatal error (Bug#12328).
3446 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3447 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3448 of doing the work ourselves.
3449 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3450 do most of the work.
3451 (fatal_error_backtrace): New function, taken from the guts
3452 of the old fatal_error_signal, but with a new option to output
3453 a backtrace.
3454 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3455 info about the signal than just its number.
3456 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3457 * sysdep.c: Include <execinfo.h>
3458 (emacs_backtrace): New function, taken partly from the previous
3459 code of the 'die' function.
3460 (emacs_abort): Call fatal_error_backtrace rather than abort.
3461
3462 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
3463
3464 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3465 eager (load-time) macro-expansion.
3466 * lisp.mk (lisp): Add macroexp.
3467
3468 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3469
3470 Simplify redefinition of 'abort' (Bug#12316).
3471 Do not try to redefine the 'abort' function. Instead, redo
3472 the code so that it calls 'emacs_abort' rather than 'abort'.
3473 This removes the need for the NO_ABORT configure-time macro
3474 and makes it easier to change the abort code to do a backtrace.
3475 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3476 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3477 Remove; sysdep.c's emacs_abort now takes its place.
3478 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
3479 'abort' changed to use 'emacs_abort'.
3480 * msdos.c (dos_abort) [defined abort]: Remove; not used.
3481 (abort) [!defined abort]: Rename to ...
3482 (emacs_abort): ... new name.
3483 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3484 the place of the old 'abort' in emacs.c.
3485 * w32.c, w32fns.c (abort): Do not #undef.
3486 * w32.c (emacs_abort): Rename from w32_abort.
3487
3488 2012-09-04 Eli Zaretskii <eliz@gnu.org>
3489
3490 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3491 offsets[j].dv, since the y axis of the screen coordinates points
3492 down, while the y axis of the font definition coordinates points
3493 up. This fixes display of Arabic diacritics such as KASRA and
3494 KASRATAN. (Bug#11860)
3495
3496 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3497
3498 Be more systematic about _setjmp vs setjmp.
3499 * alloc.c (test_setjmp, mark_stack):
3500 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3501 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3502 (png_load, my_error_exit, jpeg_load):
3503 * process.c (send_process_trap, send_process):
3504 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3505 The underscored versions are up to 30x faster on some hosts.
3506 Formerly, the code used setjmp+longjmp sometimes and
3507 _setjmp+_longjmp at other times, with no particular reason to
3508 prefer setjmp+longjmp.
3509
3510 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3511
3512 Fix minor problem found by static checking.
3513 * buffer.c (Fdelete_all_overlays): Return nil.
3514
3515 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3516
3517 * buffer.c (Fdelete_all_overlays): New function.
3518
3519 2012-09-03 Chong Yidong <cyd@gnu.org>
3520
3521 * gtkutil.c: Add extern decl for Qxft.
3522
3523 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3524
3525 * emacs.c, eval.c: Use bool for boolean.
3526 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3527 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3528 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3529 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3530 (main, decode_env_path, Fdaemon_initialized):
3531 * eval.c (call_debugger, Finteractive_p, interactive_p):
3532 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3533 (maybe_call_debugger, Fbacktrace):
3534 * process.c (read_process_output, exec_sentinel):
3535 Use bool for booleans.
3536 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3537 All callers changed.
3538 * eval.c (interactive_p): Omit always-true boolean argument
3539 EXCLUDE_SUBRS_P. All callers changed.
3540 * dispextern.h, lisp.h: Reflect above API changes.
3541 * firstfile.c (dummy): Use the address of 'main', whose signature
3542 won't change, instead of the address of 'initialize', whose
3543 signature just changed from int to bool.
3544 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3545 * msdos.c (fatal_error_in_progress): ... from here.
3546 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3547 of incrementing it.
3548 (redisplay_internal, unwind_redisplay): Simply clear
3549 REDISPLAYING_P when unwinding, instead of saving its previous,
3550 always-false value and then restoring it.
3551
3552 Clean up some extern decls.
3553 Mostly, this hoists extern decls out of .c files and into .h files.
3554 That way, we're more likely to catch errors if the interfaces change.
3555 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3556 declare xg_mark_data.
3557 * dispextern.h (x_frame_parm_handlers):
3558 * font.h (Qxft):
3559 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3560 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3561 (Qultra_bold, Qoblique, Qitalic):
3562 Move extern decl here from .c file.
3563 * alloc.c (xg_mark_data) [USE_GTK]:
3564 * doc.c (Qclosure):
3565 * eval.c (Qlexical_binding):
3566 * fns.c (time) [!HAVE_UNISTD_H]:
3567 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3568 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3569 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3570 * lread.c (Qinternal_interpreter_environment):
3571 * minibuf.c (Qbuffer):
3572 * process.c (QCfamily, QCfilter):
3573 * widget.c (free_frame_faces):
3574 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3575 * xfont.c (x_clear_errors):
3576 * xterm.c (x_frame_parm_handlers):
3577 Remove now-redundant extern decls.
3578 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3579 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3580 Now static.
3581 * xfaces.c: Remove unnecessary static decls.
3582 * xterm.c (updating_frame): Remove decl of nonexistent object.
3583
3584 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3585 when building globals.h, as the objects that are not built on
3586 this host are not needed to compile C files on this host.
3587
3588 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3589
3590 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3591
3592 * frame.h: Add missing prototype for x_wm_set_size_hint.
3593
3594 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3595
3596 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3597 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3598 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3599 (Fsubstitute_command_keys):
3600 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3601 (save_excursion_save, save_excursion_restore)
3602 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3603 (format_time_string, general_insert_function)
3604 (make_buffer_string, make_buffer_string_both)
3605 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3606 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3607 (copy_text, insert_1, insert_1_both, insert_from_string)
3608 (insert_from_string_before_markers, insert_from_string_1)
3609 (insert_from_buffer, insert_from_buffer_1, replace_range)
3610 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3611 (del_range_2, modify_region):
3612 * intervals.c (intervals_equal, balance_possible_root_interval)
3613 (adjust_intervals_for_insertion, merge_properties_sticky)
3614 (graft_intervals_into_buffer, lookup_char_property)
3615 (adjust_for_invis_intang, set_point_both)
3616 (get_property_and_range, compare_string_intervals)
3617 (set_intervals_multibyte_1, set_intervals_multibyte):
3618 * keyboard.c (decode_timer):
3619 Use bool for boolean.
3620 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3621 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3622
3623 2012-09-02 Chong Yidong <cyd@gnu.org>
3624
3625 * keymap.c (push_key_description): Print M-TAB as C-M-i
3626 (Bug#11758).
3627
3628 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3629
3630 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3631 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3632 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3633 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3634 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3635 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3636 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3637
3638 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3639
3640 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3641 more than one grapheme cluster passed to the shaper: compute the
3642 offset adjustment values separately for each cluster. (Bug#11860)
3643
3644 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3645 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3646 about implicit conversions from integer to pointer.
3647
3648 2012-09-01 Daniel Colascione <dancol@dancol.org>
3649
3650 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3651 system used too early.
3652
3653 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3654
3655 Better seed support for (random).
3656 * emacs.c (main): Call init_random.
3657 * fns.c (Frandom): Set the seed from a string argument, if given.
3658 Remove long-obsolete Gentzel cruft.
3659 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3660 (init_random): New function.
3661
3662 2012-09-01 Daniel Colascione <dancol@dancol.org>
3663
3664 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3665 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3666 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3667 x_wm_set_size_hint, x_query_colors, x_real_positions,
3668 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3669 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3670 all of which have been moved to common code.
3671
3672 * xfaces.c: Include TERM_HEADER instead of listing all possible
3673 window-system headers.
3674
3675 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3676 to match header.
3677
3678 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3679 directly accessing frame internals.
3680
3681 * w32font.h: Include font.h. Define syms_of_w32font and
3682 globals_of_w32font.
3683
3684 * process.c: Include TERM_HEADER instead of listing all possible
3685 window-system headers.
3686
3687 * nsterm.h: Remove declarations now in frame.h.
3688 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3689
3690 * menu.c: Include TERM_HEADER instead of listing all possible
3691 window-system headers.
3692
3693 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3694 window system.
3695
3696 * keyboard.c: Include TERM_HEADER instead of listing all possible
3697 window-system headers.
3698
3699 * image.c: Include TERM_HEADER instead of listing all possible
3700 window-system headers. Declare Vlibrary_cache when compiling for
3701 Windows.
3702
3703 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3704 window system declarations.
3705
3706 * frame.h: Move common functions here: set_frame_menubar,
3707 x_set_window_size, x_sync, x_get_focus_frame,
3708 x_set_mouse_position, x_set_mouse_pixel_position,
3709 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3710 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3711 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3712 x_activate_menubar, x_real_positions, x_bitmap_icon,
3713 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3714 and x_query_colors.
3715
3716 * frame.c: Include TERM_HEADER instead of listing all possible
3717 window-system headers.
3718
3719 * font.c: Include TERM_HEADER instead of listing all possible
3720 window-system headers.
3721
3722 * emacs.c: Include TERM_HEADER.
3723
3724 * dispnew.c: Include TERM_HEADER instead of listing all possible
3725 window-system headers.
3726
3727 * ccl.h: Include character.h.
3728
3729 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3730 the current window system; include in list of objects to link into
3731 Emacs.
3732
3733 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3734
3735 Remove mark_ttys function and fix tty_display_info initialization.
3736 * lisp.h (mark_ttys): Remove prototype.
3737 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3738 to mark_ttys because all possible values of 'top_frame' slot are
3739 the frames which are reachable from Vframe_list.
3740 * term.c (mark_ttys): Remove.
3741 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3742
3743 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3744
3745 Change struct frame bitfields from unsigned char to unsigned.
3746 * frame.h (struct frame): Change type of 'display_preempted',
3747 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3748 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3749 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3750 bitfields from unsigned char to unsigned.
3751
3752 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3753
3754 Remove unused member of struct x_output and struct w32_output.
3755 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3756 * w32term.h (struct w32_output): Likewise.
3757
3758 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3759
3760 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3761 does not become zero (Bug#12234).
3762
3763 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3764
3765 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3766 for GCC 4.7.1 x86-64.
3767
3768 2012-08-30 Glenn Morris <rgm@gnu.org>
3769
3770 * lread.c (init_lread): For out-of-tree builds, only add the
3771 source directory's site-lisp dir to the load-path if it exists,
3772 consistent with in-tree builds. (Bug#12302)
3773
3774 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3775
3776 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3777 button_values to NULL. Call setStykeMask so dialogs get a close button.
3778 (windowShouldClose:): Set window_closed.
3779 (dealloc): New member, free button_values.
3780 (process_dialog:): Make member function. Remove window argument,
3781 replace window with self. Count buttons and allocate and store values
3782 in button_values.
3783 (addButton:value:row:): value is int with the name tag. Call setTag
3784 with tag. Remove return self, declare return value as void.
3785 (addString:row:): Remove return self, declare return value as void.
3786 (addSplit): Remove return self, declare return value as void.
3787 (clicked:): Remove return self, declare return value as void.
3788 Set dialog_return to button_values[seltag]. Code formatting change.
3789 (initFromContents:isQuestion:): Adjust call to process_dialog.
3790 Code formatting change.
3791 (timeout_handler:): Set timer_fired to YES.
3792 (runDialogAt:): Set timer_fired to NO.
3793 Handle click on close button as quit.
3794
3795 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3796 Add window_closed and button_values. Add void as return value for
3797 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3798 Add process_dialog as new member.
3799
3800 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3801
3802 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3803 is not one of the heaps we manage. (Bug#12242)
3804
3805 2012-08-28 Glenn Morris <rgm@gnu.org>
3806
3807 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3808
3809 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3810
3811 * window.c (Fset_window_configuration): Remove handling of
3812 auto-buffer-name window parameter. Install revision of reverted
3813 fix.
3814
3815 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3816
3817 Do not allow to set major mode for a dead buffer.
3818 * buffer.c (Fset_buffer_major_mode): Signal an error
3819 if the buffer is dead.
3820 (Fother_buffer, other_buffer_safely): Remove redundant
3821 nested declaration.
3822
3823 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3824
3825 Always use set_buffer_if_live to restore original buffer at unwind.
3826 * buffer.h (record_unwind_current_buffer): New function.
3827 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3828 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3829 * undo.c, window.c: Adjust users.
3830 * buffer.c (set_buffer_if_live): Fix comment.
3831
3832 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3833
3834 Fix usage of set_buffer_internal.
3835 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3836 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3837 * coding.c (decode_coding): Omit redundant test.
3838 * fileio.c (decide_coding_unwind): Likewise.
3839 * fns.c (secure_hash): Likewise.
3840 * insdel.c (modify_region): Likewise.
3841 * keyboard.c (command_loop_1): Likewise.
3842 * print.c (PRINTFINISH): Likewise.
3843 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3844
3845 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3846
3847 * dispnew.c: Use bool for boolean.
3848 (frame_garbaged, display_completed, delayed_size_change)
3849 (fonts_changed_p, add_window_display_history)
3850 (add_frame_display_history, verify_row_hash)
3851 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3852 (row_equal_p, realloc_glyph_pool)
3853 (allocate_matrices_for_frame_redisplay)
3854 (showing_window_margins_p)
3855 (adjust_frame_glyphs_for_frame_redisplay)
3856 (build_frame_matrix_from_leaf_window, make_current)
3857 (mirrored_line_dance, mirror_line_dance, update_frame)
3858 (update_window_tree, update_single_window)
3859 (check_current_matrix_flags, update_window, update_text_area)
3860 (update_window_line, set_window_update_flags, scrolling_window)
3861 (update_frame_1, scrolling, buffer_posn_from_coords)
3862 (do_pending_window_change, change_frame_size)
3863 (change_frame_size_1, sit_for):
3864 Use bool for boolean.
3865 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3866 and remove last int (actually boolean) argument, which was always 0.
3867 All callers changed.
3868 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3869 * dispextern.h (struct composition_it): Use bool for boolean.
3870 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3871 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3872 * dired.c (file_name_completion):
3873 Use bool for boolean. (This was missed in an earlier change.)
3874
3875 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3876
3877 * window.c (Fset_window_configuration): Revert first part of
3878 last change.
3879
3880 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3881
3882 * nsterm.h (NSPanel): New class variable dialog_return.
3883
3884 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3885 Initialize dialog_return.
3886 (windowShouldClose:): Use stop instead of stopModalWithCode.
3887 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3888 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3889 event.
3890 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3891 modal loop returns.
3892
3893 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3894
3895 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3896 * composite.c (find_composition, composition_gstring_p)
3897 (composition_reseat_it, find_automatic_composition):
3898 * data.c (let_shadows_buffer_binding_p)
3899 (let_shadows_global_binding_p, set_internal, make_blv)
3900 (Fmake_variable_buffer_local, Fmake_local_variable)
3901 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3902 (cons_to_signed, arith_driver):
3903 * dbusbind.c (xd_in_read_queued_messages):
3904 * dired.c (directory_files_internal, file_name_completion):
3905 Use bool for booleans.
3906 * dired.c (file_name_completion):
3907 * process.h (fd_callback):
3908 Omit int (actually boolean) argument. It wasn't being used.
3909 All uses changed.
3910 * composite.h, lisp.h: Reflect above API changes.
3911
3912 * cmds.c, coding.c: Use bool for booleans.
3913 * cmds.c (move_point, Fself_insert_command):
3914 * coding.h (struct composition status, struct coding_system):
3915 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3916 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3917 (emacs_mule_char, decode_coding_emacs_mule)
3918 (encode_coding_emacs_mule, detect_coding_iso_2022)
3919 (decode_coding_iso_2022, encode_invocation_designation)
3920 (encode_designation_at_bol, encode_coding_iso_2022)
3921 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3922 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3923 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3924 (encode_coding_raw_text, detect_coding_charset)
3925 (decode_coding_charset, encode_coding_charset, detect_eol)
3926 (detect_coding, get_translation_table, produce_chars)
3927 (consume_chars, reused_workbuf_in_use)
3928 (make_conversion_work_buffer, code_conversion_save)
3929 (decode_coding_object, encode_coding_object)
3930 (detect_coding_system, char_encodable_p)
3931 (Funencodable_char_position, code_convert_region)
3932 (code_convert_string, code_convert_string_norecord)
3933 (Fset_coding_system_priority):
3934 * fileio.c (Finsert_file_contents):
3935 Use bool for booleans.
3936 * coding.h, lisp.h: Reflect above API changes.
3937 * coding.c: Remove unnecessary static function decls.
3938 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3939 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3940 not a boolean 'int', since callers never look at the return value.
3941 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3942 * coding.h (decoding_buffer_size, encoding_buffer_size)
3943 (emacs_mule_string_char): Remove unused extern decls.
3944 (struct iso_2022_spec, struct coding_system):
3945 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3946 (struct emacs_mule_spec): Remove unused field 'full_support'.
3947 All initializations removed.
3948 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3949
3950 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3951
3952 Fix spare memory change (Bug#12286).
3953 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3954 (valid_lisp_object_p): Likewise.
3955
3956 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3957
3958 * window.c (Fset_window_configuration): Record any window's old
3959 buffer if it's replaced (see Bug#8789). If the new current
3960 buffer doesn't appear in the selected window, go to its old
3961 point (Bug#12208).
3962
3963 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3964
3965 Special MEM_TYPE_SPARE to denote reserved memory.
3966 * alloc.c (enum mem_type): New memory type.
3967 (refill_memory_reserve): Use new type for spare memory.
3968 This prevents live_cons_p and live_string_p from incorrect
3969 detection of uninitialized objects from spare memory as live.
3970
3971 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3972
3973 Spelling fixes.
3974 * Makefile.in (.PHONY): versioclean -> versionclean.
3975
3976 Remove unused external symbols.
3977 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3978 * window.c (Qwindow_valid_p, decode_valid_window):
3979 Now static, not extern.
3980 * data.c (Qinterval): Remove; unused.
3981 (syms_of_data): Do not define 'interval'.
3982 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3983 * window.h (decode_valid_window):
3984 Remove decls.
3985
3986 * character.c, charset.c, chartab.c: Use bool for booleans.
3987 * character.c (lisp_string_width, string_count_byte8)
3988 (string_escape_byte8):
3989 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3990 (load_charset_map_from_file, map_charset_chars)
3991 (Fdefine_charset_internal, define_charset_internal)
3992 (Fdeclare_equiv_charset, find_charsets_in_text)
3993 (Ffind_charset_region, char_charset, Fiso_charset):
3994 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3995 (sub_char_table_set, sub_char_table_set_range)
3996 (char_table_set_range, optimize_sub_char_table)
3997 (map_sub_char_table):
3998 Use bool for boolean.
3999 * character.c (str_to_unibyte): Omit last boolean argument; it was
4000 always 0. All callers changed.
4001 * character.h, charset.h: Adjust to match previous changes.
4002 * character.h (char_printable_p): Remove decl of nonexistent function.
4003 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4004 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4005 are all boolean, so make them single-bit bitfields.
4006
4007 * lisp.h (ASET): Remove attempt to detect side effects.
4008 It was meant to be temporary and it often doesn't work,
4009 because when IDX has side effects the behavior of IDX==IDX
4010 is undefined. See Stefan Monnier in
4011 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4012
4013 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4014
4015 * lisp.h (functionp): New function (extracted from Ffunctionp).
4016 (FUNCTIONP): Use it.
4017 * eval.c (Ffunctionp): Use it.
4018
4019 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4020
4021 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4022 as that's faster and simpler than static storage. Don't bother
4023 with the g_main_context_query overhead if g_main_context_pending
4024 says no events are pending.
4025 (gfds, gfds_size): Remove these static vars.
4026 (xgselect_initialize): Remove; no longer needed.
4027 All uses and decls removed.
4028
4029 * emacs.c (fatal_error_signal_hook): Remove.
4030 All uses removed. This leftover from old code was always 0.
4031
4032 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4033 * casefiddle.c (casify_object, casify_region):
4034 * casetab.c (set_case_table):
4035 * category.c, category.h (word_boundary_p):
4036 * category.h (CHAR_HAS_CATEGORY):
4037 Use bool for booleans, instead of int.
4038
4039 2012-08-25 Eli Zaretskii <eliz@gnu.org>
4040
4041 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4042
4043 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4044
4045 On assertion failure, print backtrace if available.
4046 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4047 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4048 * Makefile.in (LIB_EXECINFO): New macro.
4049 (LIBES): Use it.
4050
4051 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4052 * bytecode.c (exec_byte_code):
4053 * callint.c (check_mark, Fcall_interactively):
4054 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4055 (getenv_internal, sync_process_alive, call_process_exited):
4056 * lisp.h (USE_SAFE_ALLOCA):
4057 Use bool for booleans, instead of int.
4058 * lisp.h, process.h: Adjust prototypes to match above changes.
4059 * callint.c (Fcall_interactively): Don't assume the mark's
4060 offset fits in 'int'.
4061
4062 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
4063
4064 * buffer.c, buffer.h: Use bool for boolean.
4065 * buffer.c (reset_buffer_local_variables)
4066 (buffer_lisp_local_variables, Fset_buffer_modified_p)
4067 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4068 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4069 (overlay_touches_p, overlay_strings, Foverlay_put)
4070 (report_overlay_modification, call_overlay_mod_hooks):
4071 (mmap_enlarge, mmap_set_vars):
4072 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4073 Use bool for booleans, instead of int.
4074 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4075 since the 1-or-0 return value is always ignored anyway.
4076 (mmap_initialized_p):
4077 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4078 * buffer.h, lisp.h: Adjust prototypes to match above changes.
4079
4080 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4081
4082 * bidi.c: Use bool for boolean.
4083 This is a bit more readable, and makes the text segment of bidi.o
4084 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4085 Presumably it's faster too.
4086 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4087 Now bool.
4088 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4089 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4090 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4091 (bidi_explicit_dir_char, bidi_level_of_next_char)
4092 (bidi_find_other_level_edge, bidi_move_to_visually_next):
4093 Use bool for booleans, instead of int.
4094 * dispextern.h (bidi_init_it, bidi_paragraph_init)
4095 (bidi_unshelve_cache): Adjust decls to match code.
4096
4097 2012-08-23 Martin Rudalics <rudalics@gmx.at>
4098
4099 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4100 argument.
4101
4102 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4103
4104 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4105 * atimer.h: Include <stdbool.h>.
4106
4107 2012-08-22 Dan Nicolaescu <dann@gnu.org>
4108
4109 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4110 compile time tests instead of run time tests on systems that do
4111 not use them.
4112 (FRAME_MAC_P): Remove leftover from deleted code.
4113 * frame.c (syms_of_frame): Remove leftover from deleted code.
4114
4115 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
4116
4117 * nsterm.m (insertText:): Don't clear modifiers if code is space.
4118
4119 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
4120
4121 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4122 Otherwise, the compiler complains about (A?B:C) where B is void
4123 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
4124 (fontset_add): Return void, for FONTSET_ADD.
4125
4126 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4127
4128 * alloc.c: Use bool for booleans.
4129 (gc_in_progress, abort_on_gc)
4130 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4131 (dont_register_blocks) [GC_MALLOC_CHECK]:
4132 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4133 (check_string_bytes, make_specified_string, memory_full)
4134 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4135 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4136 (mark_stack, valid_pointer_p, make_pure_string)
4137 (Fgarbage_collect, survives_gc_p, gc_sweep):
4138 Use bool for booleans, instead of int.
4139 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4140 Remove unused local.
4141 * alloc.c (PURE_POINTER_P):
4142 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4143 * editfns.c (Fformat):
4144 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4145 (Fdo_auto_save):
4146 * fns.c (sweep_weak_table):
4147 * lisp.h (suppress_checking, push_message, survives_gc_p)
4148 (make_pure_string, gc_in_progress, abort_on_gc):
4149 * lread.c (readchar, read1):
4150 * print.c (Fprin1_to_string):
4151 * xdisp.c (push_message):
4152 Use bool for booleans affected directly or indirectly by
4153 alloc.c's changes.
4154
4155 Make recently-introduced setters macros.
4156 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4157 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4158 (set_fontset_default, set_fontset_fallback): Rename from their
4159 upper-case counterparts, and make them functions rather than macros.
4160 This is more consistent with the other recently-introduced setters.
4161 These don't need to be inline, since they're local.
4162
4163 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
4164
4165 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4166 the loop (Bug#12247).
4167
4168 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4169
4170 * lisp.h (vcopy): Use memcpy rather than our own loop.
4171 This fixes a performance regression introduced by the recent
4172 addition of vcopy. This means 'vcopy' will need to be modified
4173 for a copying collector, but that's OK. Also, tighten the
4174 checking in the assertion.
4175
4176 2012-08-21 Eli Zaretskii <eliz@gnu.org>
4177
4178 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4179 components for RTL text (Bug#11860). Adjust X-OFFSET of each
4180 non-base glyph for the width of the base character, according to
4181 what x_draw_composite_glyph_string_foreground expects.
4182 Generate WADJUST value according to composition_gstring_width's
4183 expectations, to produce correct width of the composed character.
4184 Reverse the sign of the DU offset produced by ScriptPlace.
4185
4186 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4187
4188 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4189
4190 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4191
4192 Avoid direct writes to contents member of struct Lisp_Vector.
4193 * lisp.h (vcopy): New function to copy data into vector.
4194 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4195 * fns.c (Ffillarray): Use ASET.
4196 * keyboard.c (timer_check_2): Use AREF and ASET.
4197 (append_tool_bar_item, Frecent_keys): Use vcopy.
4198 * lread.c (read_vector): Use ASET.
4199 * msdos.c (Frecent_doskeys): Use vcopy.
4200 * xface.c (Finternal_copy_lisp_face): Use vcopy.
4201 (Finternal_merge_in_global_face): Use ASET and vcopy.
4202 * xfont.c (xfont_list_pattern): Likewise.
4203
4204 2012-08-21 Martin Rudalics <rudalics@gmx.at>
4205
4206 * window.c (Fwindow_point): For the selected window always return
4207 the position of its buffer's point.
4208 (Fset_window_point): For the selected window always go in its
4209 buffer to the specified position.
4210
4211 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4212
4213 Setter macros for fontsets.
4214 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
4215 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
4216 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
4217 Adjust users.
4218
4219 2012-08-20 Glenn Morris <rgm@gnu.org>
4220
4221 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4222 Don't assume that `ln -f' works.
4223
4224 2012-08-20 Eli Zaretskii <eliz@gnu.org>
4225
4226 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
4227 and later about non-assignments with no effect. See discussion at
4228 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
4229 details.
4230
4231 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4232
4233 Inline setter functions for Lisp_Objects slots of struct specbinding.
4234 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
4235 Adjust users.
4236
4237 2012-08-20 Martin Rudalics <rudalics@gmx.at>
4238
4239 * window.c (select_window): Always make selected window's buffer
4240 current.
4241
4242 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4243
4244 Use AREF and ASET for docstrings of category tables.
4245 * category.h (CATEGORY_DOCSTRING): Use AREF.
4246 (SET_CATEGORY_DOCSTRING): Use ASET.
4247 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
4248
4249 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4250
4251 Inline setter functions for hash table members.
4252 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
4253 (set_hash_hash, set_hash_index): Rename with _slot suffix.
4254 (set_hash_key_and_value, set_hash_index, set_hash_next)
4255 (set_hash_hash): New functions.
4256 * charset.c, fns.c: Adjust users.
4257
4258 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4259
4260 Inline getter and setter functions for per-buffer values.
4261 * buffer.h (per_buffer_default, set_per_buffer_default)
4262 (per_buffer_value, set_per_buffer_value): New functions.
4263 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
4264 * buffer.c, data.c: Adjust users.
4265
4266 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
4267
4268 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
4269
4270 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
4271
4272 Rely on <config.h> + <unistd.h> to declare 'environ',
4273 as gnulib does this if the system doesn't.
4274 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
4275 Remove declaration. MS-Windows declares it on stdlib.h which is
4276 included by conf_post.h.
4277 * emacs.c (environ) [DOUG_LEA_MALLOC]:
4278 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
4279 * vm-limit.c: Include <unistd.h>, for 'environ'.
4280
4281 * unexaix.c, unexcoff.c: Include "mem-limits.h".
4282 (start_of_data): Remove decl; mem-limits.h provides it.
4283
4284 * xdisp.c (handle_invisible_prop): Make it a bit faster
4285 and avoid a gcc -Wmaybe-uninitialized diagnostic.
4286
4287 2012-08-19 Chong Yidong <cyd@gnu.org>
4288
4289 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
4290 ends (Bug#3874).
4291
4292 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
4293
4294 * .gdbinit: Use call instead of set when calling a function in the
4295 inferior.
4296
4297 * data.c (set_internal): Don't use set_blv_found.
4298 (Fkill_local_variable): Likewise.
4299
4300 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
4301
4302 * nsfont.m (ns_ascii_average_width): Ensure the string
4303 ascii_printable is initialized with a null-terminated character
4304 array. Otherwise, it can contain undesired extra characters.
4305
4306 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4307
4308 port new setting code to Sun C 5.8 2005/10/13
4309 * chartab.c, lisp.h (char_table_set, char_table_set_range):
4310 Return void, not Lisp_Object. Otherwise, the compiler
4311 complains about (A?B:C) where B is void and C is Lisp_Object
4312 when compiling CHAR_TABLE_SET, due to the recent change to
4313 the API of sub_char_table_set_contents.
4314
4315 2012-08-18 Chong Yidong <cyd@gnu.org>
4316
4317 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
4318 for the string case (Bug#3874).
4319
4320 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4321
4322 * buffer.h (BSET): Remove (Bug#12215).
4323 Replace all uses with calls to new setter functions.
4324 (bset_bidi_paragraph_direction, bset_case_canon_table)
4325 (bset_case_eqv_table, bset_directory, bset_display_count)
4326 (bset_display_time, bset_downcase_table)
4327 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
4328 (bset_last_selected_window, bset_local_var_alist)
4329 (bset_mark_active, bset_point_before_scroll, bset_read_only)
4330 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
4331 (bset_width_table):
4332 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4333 (bset_auto_fill_function, bset_auto_save_file_format)
4334 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4335 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4336 (bset_cache_long_line_scans, bset_case_fold_search)
4337 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4338 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4339 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4340 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4341 (bset_header_line_format, bset_indicate_buffer_boundaries)
4342 (bset_indicate_empty_lines, bset_invisibility_spec)
4343 (bset_left_fringe_width, bset_major_mode, bset_mark)
4344 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4345 (bset_name, bset_overwrite_mode, bset_pt_marker)
4346 (bset_right_fringe_width, bset_save_length)
4347 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4348 (bset_scroll_up_aggressively, bset_selective_display)
4349 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4350 (bset_word_wrap, bset_zv_marker):
4351 * category.c (bset_category_table):
4352 * syntax.c (bset_syntax_table):
4353 New setter functions.
4354
4355 * process.h (PSET): Remove (Bug#12215).
4356 Replace all uses with calls to new setter functions.
4357 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4358 (PROCESS_INLINE): New macro.
4359 (pset_childp): New setter function.
4360 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4361 * process.c (PROCESS_INLINE):
4362 Define to EXTERN_INLINE, so that the corresponding functions
4363 are compiled into code.
4364 (pset_buffer, pset_command, pset_decode_coding_system)
4365 (pset_decoding_buf, pset_encode_coding_system)
4366 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4367 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4368 (pset_type, pset_write_queue): New setter functions.
4369
4370 * window.h (WSET): Remove (Bug#12215).
4371 Replace all uses with calls to new setter functions.
4372 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4373 (WINDOW_INLINE): New macro.
4374 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4375 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4376 (wset_total_lines, wset_vertical_scroll_bar)
4377 (wset_window_end_pos, wset_window_end_valid)
4378 (wset_window_end_vpos): New setter functions.
4379 * window.c (WINDOW_INLINE):
4380 Define to EXTERN_INLINE, so that the corresponding functions
4381 are compiled into code.
4382 (wset_combination_limit, wset_dedicated, wset_display_table)
4383 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4384 (wset_new_normal, wset_new_total, wset_next_buffers)
4385 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4386 (wset_prev_buffers, wset_right_fringe_width)
4387 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4388 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4389 (wset_window_parameters):
4390 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4391 (wset_column_number_displayed, wset_region_showing):
4392 New setter functions.
4393
4394 * termhooks.h (TSET): Remove (Bug#12215).
4395 Replace all uses with calls to new setter functions.
4396 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4397 (TERMHOOKS_INLINE): New macro.
4398 (tset_charset_list, tset_selection_alist): New setter functions.
4399 * terminal.c (TERMHOOKS_INLINE):
4400 Define to EXTERN_INLINE, so that the corresponding functions
4401 are compiled into code.
4402 (tset_param_alist): New setter function.
4403
4404 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4405
4406 * keyboard.h (KSET): Remove (Bug#12215).
4407 Replace all uses with calls to new setter functions.
4408 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4409 (KEYBOARD_INLINE): New macro.
4410 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4411 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4412 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4413 New setter functions.
4414 * keyboard.c (KEYBOARD_INLINE):
4415 Define to EXTERN_INLINE, so that the corresponding functions
4416 are compiled into code.
4417 (kset_echo_string, kset_kbd_queue)
4418 (kset_keyboard_translate_table, kset_last_prefix_arg)
4419 (kset_last_repeatable_command, kset_local_function_key_map)
4420 (kset_overriding_terminal_local_map, kset_real_last_command)
4421 (kset_system_key_syms): New setter functions.
4422
4423 * frame.h (FSET): Remove (Bug#12215).
4424 Replace all uses with calls to new setter functions.
4425 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4426 (FRAME_INLINE): New macro.
4427 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4428 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4429 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4430 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4431 (fset_param_alist, fset_root_window, fset_scroll_bars)
4432 (fset_selected_window, fset_title, fset_tool_bar_items)
4433 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4434 * frame.c (FRAME_INLINE):
4435 Define to EXTERN_INLINE, so that the corresponding functions
4436 are compiled into code.
4437 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4438
4439 A few more naming-convention fixes for getters and setters.
4440 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4441 and rename from buffer_overlays_set_before.
4442 (set_buffer_overlays_after): Move here from buffer.h, and rename
4443 from buffer_overlays_set_after.
4444 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4445 All uses changed.
4446 (set_buffer_intervals): Rename from buffer_set_intervals.
4447 * intervals.c (set_interval_object): Move here from intervals.h,
4448 and rename from interval_set_object.
4449 (set_interval_left): Move here from intervals.h, and rename from
4450 interval_set_left.
4451 (set_interval_right): Move here from intervals.h, and rename from
4452 interval_set_right.
4453 (copy_interval_parent): Move here from intervals.h, and rename from
4454 interval_copy_parent.
4455 * intervals.h (set_interval_parent): Rename from interval_set_parent.
4456 (set_interval_plist): Rename from interval_set_plist.
4457 Return void, not Lisp_Object, since no caller uses the result.
4458 * lisp.h (string_intervals): Rename from string_get_intervals.
4459 (set_string_intervals): Rename from string_set_intervals.
4460
4461 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4462 (set_char_table_contents): Rename from char_table_set_contents.
4463 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4464 All uses changed. See the end of
4465 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4466
4467 * lisp.h (CSET): Remove (Bug#12215).
4468 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4469 (set_char_table_purpose): New functions,
4470 replacing CSET. All uses changed. For example, replace
4471 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4472 "set_char_table_parent (char_table, parent);".
4473 The old version was confusing because it used the same name
4474 'parent' for two different things.
4475
4476 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4477
4478 Functions to get and set Lisp_Object fields of buffer-local variables.
4479 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4480 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4481 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4482 * data.c, eval.c, frame.c: Adjust users.
4483
4484 2012-08-17 Chong Yidong <cyd@gnu.org>
4485
4486 * xfaces.c (merge_face_vectors): If the target font specfies a
4487 font spec, make the font's attributes take precedence over
4488 directly-specified attributes.
4489 (merge_face_ref): Recognize :font.
4490
4491 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4492
4493 Do not use memcpy for copying intervals.
4494 * intervals.c (reproduce_interval): New function.
4495 (reproduce_tree, reproduce_tree_obj): Use it.
4496 (reproduce_tree_obj): Remove prototype.
4497
4498 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4499
4500 * lisp.h (duration_to_sec_usec): Remove unused decl.
4501
4502 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
4503
4504 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4505 to an allocated instance of NSString, not to the class itself.
4506
4507 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
4508
4509 * makefile.w32-in (C_CTYPE_H): New macro.
4510 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4511 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4512 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4513
4514 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4515
4516 Use ASCII tests for character types.
4517 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4518 * xfns.c, xterm.c:
4519 Don't include <ctype.h>; was not needed.
4520 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4521 * sysdep.c, xfaces.c:
4522 Include <c-ctype.h> instead of <ctype.h>.
4523 * nsterm.m: Include <c-ctype.h>.
4524 * charset.c (read_hex):
4525 * doc.c (Fsnarf_documentation):
4526 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4527 (DRIVE_LETTER) [DOS_NT]:
4528 (Ffile_name_directory, Fexpand_file_name)
4529 (Fsubstitute_in_file_name):
4530 * font.c (font_parse_xlfd, font_parse_fcname):
4531 * frame.c (x_set_font_backend):
4532 * gtkutil.c (xg_get_font):
4533 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4534 * nsimage.m (hexchar):
4535 * nsterm.m (ns_xlfd_to_fontname):
4536 * sysdep.c (system_process_attributes):
4537 * xfaces.c (hash_string_case_insensitive):
4538 Use C-locale tests instead of locale-specific tests for character
4539 types, since we want the ASCII interpretation here, not the
4540 interpretation suitable for whatever happens to be the current locale.
4541
4542 2012-08-16 Martin Rudalics <rudalics@gmx.at>
4543
4544 Consistently check windows for validity/liveness
4545 (Bug#11984, Bug#12025, Bug#12026).
4546 * lisp.h (CHECK_VALID_WINDOW): New macro.
4547 * window.c (decode_window): Rename to decode_live_window.
4548 (decode_valid_window, Fwindow_valid_p): New functions.
4549 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4550 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4551 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4552 (Fwindow_prev_sibling, Fwindow_combination_limit)
4553 (Fset_window_combination_limit, Fwindow_use_time)
4554 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4555 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4556 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4557 (Fwindow_hscroll, Fset_window_hscroll)
4558 (Fwindow_redisplay_end_trigger)
4559 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4560 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4561 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4562 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4563 (Fwindow_end, Fset_window_point, Fset_window_start)
4564 (Fpos_visible_in_window_p, Fwindow_line_height)
4565 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4566 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4567 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4568 (Fset_window_parameter, Fwindow_display_table)
4569 (Fset_window_display_table, Fdelete_other_windows_internal)
4570 (Fset_window_buffer, Fset_window_new_total)
4571 (Fset_window_new_normal, Fdelete_window_internal)
4572 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4573 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4574 (Fwindow_scroll_bars): Check whether argument window is a valid or
4575 live window. Update doc-strings.
4576 (syms_of_window): New symbol Qwindow_valid_p.
4577 * keyboard.c (Fposn_at_x_y): Check whether argument
4578 frame_or_window denotes a valid window.
4579
4580 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4581
4582 Fix previous char table change.
4583 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4584 * chartab.c (optimize_sub_char_table): Likewise.
4585
4586 2012-08-16 Chong Yidong <cyd@gnu.org>
4587
4588 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4589
4590 * xfont.c (xfont_open):
4591 * xftfont.c (xftfont_open): Set the font's max_width field.
4592
4593 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4594 min_width to space_width and average_width to the average over
4595 printable ASCII characters.
4596 (ns_char_width): Code cleanup.
4597 (ns_ascii_average_width): New utility function.
4598
4599 * font.h (struct font): Update comments.
4600
4601 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4602
4603 Simple interface to set Lisp_Object fields of character tables.
4604 * lisp.h (CSET): New macro.
4605 (char_table_set_extras, char_table_set_contents)
4606 (sub_char_table_set_contents): New function.
4607 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4608 * syntax.c: Adjust users.
4609
4610 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4611
4612 * eval.c (eval_sub): Bind lexical-binding.
4613 * lread.c (Qlexical_binding): Make non-static.
4614
4615 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4616
4617 * nsmenu.m (popupSession): Remove.
4618 (pop_down_menu): Remove endModalSession.
4619 (timeout_handler:): New method.
4620 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4621 Call runModalForWindow. Check timer_fired when it returns.
4622 If not set, cancel timer and break out of loop.
4623 Otherwise loop again, with a new timeout.
4624
4625 * nsterm.m: Include fcntl.h if present.
4626 (fd_entry, t_readfds, inNsSelect): Remove.
4627 (select_writefds, select_valid, select_timeout, selfds)
4628 (select_mutex, apploopnr): Add.
4629 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4630 Otherwise call kbd_buffer_store_event.
4631 (ns_send_appdefined): Remove release of fd_entry.
4632 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4633 Increment and decrement apploopnr.
4634 (ns_select): If no file descriptors, just do a NSTimer.
4635 Otherwise copy read/write masks and start select thread (fd_handler).
4636 Start main loop and wait for application defined event.
4637 Inform select thread to stop selecting after main loop is exited.
4638 (ns_term_init): Create selfds pipe and set non-blocking.
4639 Initialize select_mutex. Start the select thread (fd_handler).
4640 (fd_handler:): Loop forever, wait for info from the main thread
4641 to either start or stop selecting. When select returns, send
4642 and appdefined event.
4643 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4644 If not call kbd_buffer_store_event.
4645
4646 * nsterm.h (EmacsApp): fd_handler takes id argument.
4647 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4648
4649 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4650
4651 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4652
4653 * region-cache.c (move_cache_gap): Update gap_len using the actual
4654 growth of the boundaries array. Do not change cache_len.
4655 (Bug#12196)
4656
4657 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4658
4659 Generalize and cleanup font subsystem checks.
4660 * font.h (FONT_DEBUG, font_assert): Remove.
4661 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4662 Change font_assert to eassert. Use eassert where appropriate.
4663
4664 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4665
4666 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4667
4668 2012-08-15 Chong Yidong <cyd@gnu.org>
4669
4670 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4671 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4672 extract the font descriptor instead of just the font name.
4673 In that case, return a font spec instead of a string.
4674 (x_last_font_name): Move to this file from xfns.c.
4675
4676 * xfns.c (Fx_select_font): The return value can also be a font
4677 spec. Move x_last_font_name management to gtkutil.c.
4678
4679 * xfaces.c: Make font weight and style symbols non-static.
4680
4681 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4682
4683 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4684 (bug#12117).
4685
4686 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4687
4688 * alloc.c (Fgarbage_collect): Use plural form consistently.
4689
4690 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4691
4692 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4693 iteration through the command loop. Fixes a problem whereby mouse
4694 movements are ignored until the first mouse click.
4695
4696 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4697
4698 Use bool, not int, for Lisp booleans.
4699 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4700 makes Emacs a bit smaller and presumably a bit faster.
4701 * lisp.h: Include <stdbool.h>.
4702 (struct Lisp_Boolfwd, defvar_bool):
4703 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4704 * regex.c [!emacs]: Include <stdbool.h>.
4705 (false, true): Remove; <stdbool.h> does this for us now.
4706
4707 2012-08-14 Chong Yidong <cyd@gnu.org>
4708
4709 * character.c (Fcharacterp): Doc fix (Bug#12076).
4710
4711 * data.c (Findirect_variable): Doc fix (Bug#11040).
4712
4713 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4714
4715 * editfns.c (Fformat): Doc fix (Bug#12059).
4716 (Fsave_current_buffer): Doc fix (Bug#11542).
4717
4718 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4719
4720 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4721 (bug#12022).
4722
4723 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4724
4725 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4726 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4727 * minibuf.c (choose_minibuf_frame, read_minibuf):
4728 * w32fns.c (x_create_tip_frame):
4729 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4730 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4731
4732 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4733
4734 * intervals.c (offset_intervals): Remove obsolete comment.
4735
4736 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4737
4738 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4739
4740 2012-08-14 Gergely Risko <gergely@risko.hu>
4741
4742 * coding.c (decode_coding): Record buffer modification before
4743 disabling undo_list (Bug#11773).
4744
4745 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4746
4747 Revert and cleanup some recent overlay changes.
4748 * buffer.h (enum overlay_type): Remove.
4749 (buffer_get_overlays, buffer_set_overlays): Likewise.
4750 (buffer_set_overlays_before, buffer_set_overlays_after):
4751 New function. Adjust users.
4752 (unchain_both): Add eassert.
4753
4754 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4755
4756 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4757
4758 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4759
4760 * gtkutil.c (xg_mark_data): Don't assume C99.
4761
4762 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4763
4764 * gtkutil.c (xg_frame_tb_info): New struct.
4765 (TB_INFO_KEY): New define.
4766 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4767 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4768 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4769 if not present.
4770 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4771 is up to date. Otherwise store new data.
4772 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4773
4774 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4775
4776 Use KSET for write access to Lisp_Object members of struct kboard.
4777 * keyboard.h (KSET): New macro.
4778 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4779 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4780 * xterm.c: Adjust users.
4781
4782 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4783
4784 Use BSET for write access to Lisp_Object members of struct buffer.
4785 * buffer.h (BSET): New macro.
4786 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4787 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4788 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4789 * window.c, xdisp.c, xfns.c: Adjust users.
4790
4791 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4792
4793 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4794
4795 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4796
4797 * nsterm.m (not_in_argv): New function.
4798 (application:openFile, application:openTempFile:):
4799 (application:openFileWithoutUI:, application:openFiles:): Open file
4800 if not_in_argv returns non-zero (bug#12171).
4801
4802 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4803 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4804 Define for Gtk+ versions less than 3.2.
4805 (xg_get_font_name): Use those functions/macros here.
4806 Reported by Frans Oilinki <moilinki@gmail.com>.
4807
4808 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4809
4810 * unexmacosx.c (copy_data_segment): Copy initialized data in
4811 statically linked libraries from input file rather than memory.
4812
4813 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4814 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4815 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4816
4817 2012-08-10 Glenn Morris <rgm@gnu.org>
4818
4819 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4820 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4821
4822 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4823
4824 Fix last change to allow compilation with low optimization levels.
4825 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4826 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4827
4828 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4829
4830 Use common inline syntax in intervals.h.
4831 * intervals.h (INTERVALS_INLINE): New macro.
4832 Change all users from LISP_INLINE.
4833
4834 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4835
4836 Define Qnone once for all platforms.
4837 * frame.c (Qnone): Define here.
4838 (syms_of_frame): DEFSYM it.
4839 * lisp.h (Qnone): New declaration.
4840 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4841 * xfns.c: Remove duplication. Adjust users.
4842
4843 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4844
4845 Remove unused macros from intervals.h.
4846 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4847 * intervals.c: Adjust comment.
4848
4849 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4850
4851 * w32fns.c <w32_unicode_gui>: New static variable.
4852 (globals_of_w32fns): Initialize it according to os_subtype.
4853 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4854 testing os_subtype.
4855
4856 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4857 Eli Zaretskii <eliz@gnu.org>
4858
4859 Fix bug #10299 with Unicode characters sent by customized
4860 keyboards created by MSKLC.
4861 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4862 (w32_init_class): Use it to initialize the Emacs class with either
4863 ANSI or Unicode API calls.
4864 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4865 later.
4866 (w32_wnd_proc): If the character code sent by WM_CHAR or
4867 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4868 original message. Call DefWindowProcW on NT and later.
4869
4870 2012-08-10 Glenn Morris <rgm@gnu.org>
4871
4872 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4873
4874 * lisp.h (DIRECTORY_SEP): Let configure set it.
4875
4876 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4877
4878 Use TSET for write access to Lisp_Object slots of struct terminal.
4879 * termhooks.h (TSET): New macro.
4880 * coding.c, terminal.c, xselect.c: Adjust users.
4881
4882 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4883
4884 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4885 the failing expression, include them in the error message.
4886 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4887 * lisp.h (internal_condition_case_n): Update declaration.
4888
4889 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4890
4891 Inline functions to examine and change buffer overlays.
4892 * buffer.c (unchain_both): New function.
4893 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4894 (buffer_has_overlays): New function.
4895 (enum overlay_type): New enum.
4896 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4897 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4898
4899 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4900
4901 Inline functions to examine and change buffer intervals.
4902 * alloc.c (mark_interval_tree): Remove.
4903 (MARK_INTERVAL_TREE): Simplify.
4904 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4905 * intervals.c (buffer_balance_intervals): New function.
4906 (graft_intervals_into_buffer): Adjust indentation.
4907 (set_intervals_multibyte): Simplify.
4908 * buffer.h (BUF_INTERVALS): Remove.
4909 (buffer_get_intervals, buffer_set_intervals): New function.
4910 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4911 * intervals.c, textprop.c: Adjust users.
4912
4913 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4914
4915 Inline functions to examine and change string intervals.
4916 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4917 (string_get_intervals, string_set_intervals): New function.
4918 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4919 * lread.c, print.c, textprop.c: Adjust users.
4920
4921 2012-08-08 Glenn Morris <rgm@gnu.org>
4922
4923 * lisp.mk (lisp): Remove language/persian.elc.
4924
4925 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4926
4927 Cleanup intervals.
4928 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4929 (NULL_INTERVAL_P): Likewise. Adjust users.
4930 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4931 Adjust comment. Move under #if 0.
4932 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4933 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4934
4935 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4936
4937 Check total length of intervals with eassert.
4938 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4939 * intervals.c: Change all users to eassert.
4940
4941 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4942
4943 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4944 Rename fields to match removal of FGET and WGET and disuse of
4945 INTERNAL_FIELD in Lisp_Cons.
4946
4947 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4948
4949 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4950 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4951 name since all xname users are fixed long time ago. Do not
4952 use INTERNAL_FIELD.
4953 (set_symbol_name, set_symbol_function, set_symbol_plist):
4954 (set_symbol_next, set_overlay_plist): New function.
4955 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4956 (struct Lisp_Overlay): Likewise.
4957 (CVAR, MVAR, SVAR): Remove.
4958 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4959 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4960 * xterm.c: Adjust users.
4961 * .gdbinit: Change to use name field of struct Lisp_Symbol
4962 where appropriate.
4963
4964 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4965
4966 Basic functions to set Lisp_Object and pointer slots of intervals.
4967 * intervals.h (interval_set_parent, interval_set_object):
4968 (interval_set_left, interval_set_right, interval_set_plist):
4969 (interval_copy_parent): New function.
4970 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4971 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4972 Adjust indentation.
4973 (INTERVAL_SIZE): Remove. Adjust users.
4974 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4975
4976 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4977
4978 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4979 * process.h (PGET): Remove.
4980 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4981 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4982
4983 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4984
4985 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4986 * window.h (WGET): Remove.
4987 (struct window): Do not use INTERNAL_FIELD.
4988 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4989 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4990 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4991 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4992 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4993 Adjust users.
4994
4995 2012-08-07 Chong Yidong <cyd@gnu.org>
4996
4997 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4998 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4999 (Fdelete_window_internal): Signal an error if the window is not on
5000 a live frame (Bug#12025).
5001
5002 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5003
5004 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5005 * frame.h (FGET): Remove.
5006 (struct frame): Do not use INTERNAL_FIELD.
5007 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5008 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5009 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5010 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5011
5012 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
5013
5014 * w32.c: Silence compiler warnings.
5015 (map_w32_filename): Remove unused variable `is_fat'.
5016 (chase_symlinks): Add parentheses around expression.
5017
5018 2012-08-06 Glenn Morris <rgm@gnu.org>
5019
5020 * sysdep.c: Respect BROKEN_GETWD.
5021
5022 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5023 Let configure handle it.
5024 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5025
5026 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5027
5028 Use GCALIGNMENT where appropriate.
5029 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5030 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5031 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5032
5033 2012-08-06 Eli Zaretskii <eliz@gnu.org>
5034
5035 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5036 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5037
5038 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5039
5040 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5041 that should be sufficient for everyone.
5042
5043 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5044
5045 * keyboard.c (timer_check_2): Add break so timer_check returns next
5046 timeout.
5047
5048 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5049
5050 Fix Windows build errors introduced after converting to WGET and WSET.
5051 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5052 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5053
5054 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5055
5056 * nsterm.m (ns_frame_rehighlight): Use FSET.
5057
5058 * nsmenu.m (ns_update_menubar): Use FSET.
5059
5060 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5061
5062 Separate read and write access to Lisp_Object slots of Lisp_Process.
5063 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5064 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5065
5066 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5067
5068 Separate read and write access to Lisp_Object slots of struct window.
5069 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5070 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5071 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5072 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5073 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5074 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5075 Adjust users.
5076
5077 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5078
5079 Fix Windows build errors introduced after converting to FGET and FSET.
5080 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5081 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5082 (w32_judge_scroll_bars): Change to use FSET.
5083 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5084
5085 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5086
5087 Fix replacement typo.
5088 * window.c (replace_window): Set root_window instead of
5089 selected_window. This fixes a total window subsystem
5090 malfunction reported by Bastien Guerry <bzg@gnu.org>.
5091
5092 2012-08-06 Glenn Morris <rgm@gnu.org>
5093
5094 * lisp.mk (lisp): Add language/persian.elc.
5095
5096 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5097
5098 Separate read and write access to Lisp_Object slots of struct frame.
5099 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5100 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5101 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5102 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5103 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5104
5105 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
5106
5107 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5108
5109 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
5110
5111 Generalize common compile-time constants.
5112 * lisp.h (header_size, bool_header_size, word_size): Now here.
5113 (struct Lisp_Vector): Add comment.
5114 (struct Lisp_Bool_Vector): Move up to define handy constants.
5115 (VECSIZE, PSEUDOVECSIZE): Simplify.
5116 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
5117 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5118 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5119 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5120 * xfont.c, xmenu.c: Use word_size where appropriate.
5121
5122 2012-08-05 Lawrence Mitchell <wence@gmx.li>
5123
5124 * search.c (Freplace_match): Treat \? in the replacement text
5125 literally (Bug#8161).
5126
5127 2012-08-05 Chong Yidong <cyd@gnu.org>
5128
5129 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5130 * frame.c (Vdelete_frame_functions):
5131 * emacs.c (Vkill_emacs_hook): Doc fix.
5132
5133 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5134
5135 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5136 --with-x-toolkit=no builds.
5137 Reported by Carsten Mattner <carstenmattner@gmail.com>.
5138
5139 2012-08-04 Chong Yidong <cyd@gnu.org>
5140
5141 * syntax.c (Fmodify_syntax_entry): Doc fix.
5142
5143 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5144
5145 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
5146 * w32.c (init_environment): Change the default values of many
5147 environment variables in dflt_envvars[] to NULL, to avoid pushing
5148 them into environment when they were not already defined.
5149 Remove the code that deletes site-lisp subdirectories from the default
5150 value of EMACSLOADPATH, as it is no longer needed.
5151 (check_windows_init_file): Now external, not static.
5152 Use Vload_path as is, without adding anything, as this function is now
5153 called when Vload_path is already set up.
5154
5155 * w32.h (check_windows_init_file): Add prototype.
5156
5157 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5158 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5159 compatibility with Posix platforms.
5160 (main): Move the call to check_windows_init_file to here from
5161 w32.c.
5162 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5163 any, in the DEFALT argument into the root of the Emacs build or
5164 installation tree, as appropriate.
5165
5166 * callproc.c (init_callproc_1): Call decode_env_path instead of
5167 doing its equivalent by hand.
5168 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5169 the code that sets Vexec_path run on MS-Windows.
5170
5171 * lread.c (init_lread): Add comments to #ifdef's.
5172
5173 * msdos.c (dos_set_window_size, IT_update_begin)
5174 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5175 instead of direct references.
5176
5177 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
5178
5179 Export DEFAULT_REHASH_* to GDB.
5180 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5181 Now constants, not macros.
5182
5183 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
5184
5185 Remove unnecessary casts involving pointers.
5186 These casts are no longer needed now that we assume C89 or later,
5187 since they involve casting to or from void *.
5188 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5189 (make_pure_float, make_pure_vector):
5190 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5191 * macros.c (Fstart_kbd_macro):
5192 * menu.c (find_and_return_menu_selection):
5193 * minibuf.c (read_minibuf_noninteractive):
5194 * sysdep.c (closedir):
5195 * xdisp.c (x_produce_glyphs):
5196 * xfaces.c (compare_fonts_by_sort_order):
5197 * xfns.c (x_real_positions, select_visual):
5198 * xselect.c (x_stop_queuing_selection_requests)
5199 (x_get_window_property, x_get_window_property_as_lisp_data):
5200 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
5201 Remove unnecessary pointer casts.
5202 * alloc.c (record_xmalloc): New function.
5203 * lisp.h (record_xmalloc): New decl.
5204 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
5205 more like a function. This is because the pointer cast is not
5206 needed. All uses changed.
5207 * print.c (print_string, print_error_message): Avoid length recalc.
5208
5209 Improve fix for macroexp crash with debugging (Bug#12118).
5210 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
5211 ARRAY_MARK_FLAG when checking subscripts, because ASET is
5212 not supposed to be invoked from the garbage collector.
5213 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
5214 (gc_aset): New function, which is like ASET but can be
5215 used in the garbage collector.
5216 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5217 (set_hash_index): Use it instead of ASET.
5218
5219 2012-08-03 Eli Zaretskii <eliz@gnu.org>
5220
5221 Support symlinks on latest versions of MS-Windows.
5222 * w32.c: Include winioctl.h and aclapi.h.
5223 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
5224 (revert_to_self): Forward declarations of static functions.
5225 <static BOOL g_b_init_get_security_info>:
5226 <g_b_init_create_symbolic_link>: New static flags.
5227 (globals_of_w32): Initialize them to zero.
5228 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
5229 (map_w32_filename): Improve commentary. Simplify switch.
5230 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
5231 headers (most versions of MinGW w32api don't).
5232 (get_security_info, create_symbolic_link)
5233 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
5234 New functions.
5235 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
5236 in the argument file name.
5237 (sys_access): Call unc_volume_file_attributes only if
5238 GetFileAttributes fails with network-related error codes.
5239 (sys_rename): Diagnose renaming of a symlink when the user doesn't
5240 have the required privileges.
5241 (get_file_security_desc_by_name): Rename from
5242 get_file_security_desc.
5243 (stat_worker): New function, with most of the guts of 'stat', and
5244 with addition of handling of symlinks and support for 'lstat'.
5245 If possible, get file's attributes and security information by
5246 handle, not by name. Produce S_IFLNK bit for symlinks, when
5247 called from 'lstat'.
5248 (stat, lstat): New functions, call 'stat_worker'.
5249 (symlink, readlink, careadlinkat): Rewritten to create and resolve
5250 symlinks when the underlying filesystem supports them.
5251
5252 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5253
5254 Fix macroexp crash on Windows with debugging (Bug#12118).
5255 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
5256 checking subscripts; problem introduced with the recent
5257 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
5258 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
5259 since it's used in non-static inline functions now.
5260
5261 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
5262 Don't assume buffer size fits in 'int'. Remove unused local.
5263
5264 Use C99-style 'extern inline' if available.
5265 * buffer.h (BUFFER_INLINE):
5266 * category.h (CATEGORY_INLINE):
5267 * character.h (CHARACTER_INLINE):
5268 * charset.h (CHARSET_INLINE):
5269 * composite.h (COMPOSITE_INLINE):
5270 * dispextern.h (DISPEXTERN_INLINE):
5271 * lisp.h (LISP_INLINE):
5272 * systime.h (SYSTIME_INLINE):
5273 New macro, replacing 'static inline' in this header.
5274 * buffer.h, category.h, character.h, charset.h, composite.h:
5275 * dispextern.h, lisp.h, systime.h:
5276 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5277 * alloc.c (LISP_INLINE):
5278 * buffer.c (BUFFER_INLINE):
5279 * category.c (CATEGORY_INLINE):
5280 * character.c (CHARACTER_INLINE):
5281 * charset.c (CHARSET_INLINE):
5282 * composite.c (COMPOSITE_INLINE):
5283 * dispnew.c (DISPEXTERN_INLINE):
5284 * sysdep.c (SYSTIME_INLINE):
5285 Define to EXTERN_INLINE, so that the corresponding functions
5286 are compiled into code.
5287 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
5288 (INLINE_HEADER_END): New macros.
5289 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
5290 since it's used in non-static inline functions now.
5291 (VALMASK) [!USE_LSB_TAG]: Likewise.
5292
5293 2012-08-02 Glenn Morris <rgm@gnu.org>
5294
5295 * s/: Remove empty directory.
5296
5297 * s/ms-w32.h: Move to ../nt/inc.
5298 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
5299 Update for new ms-w32.h location.
5300
5301 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5302
5303 Port to Solaris 8.
5304 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
5305
5306 2012-08-02 Glenn Morris <rgm@gnu.org>
5307
5308 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
5309 hard-coding the path separator.
5310
5311 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5312
5313 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
5314 This how ASET and AREF are supposed to work, and makes
5315 it easier to think about future improvements. See
5316 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
5317 * charset.h (set_charset_attr): New function.
5318 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
5319 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
5320 (aref_addr): New function. All uses of &AREF(...) changed.
5321 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5322 (set_hash_index): New functions. All lvalue-style uses of
5323 HASH_KEY etc. changed.
5324 * keyboard.c (set_prop): New function. All lvalue-style uses
5325 of PROP changed.
5326
5327 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
5328
5329 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
5330 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
5331 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
5332 * nsfns.m (ns_set_name_as_filename): Likewise.
5333 * nsmenu.m (ns_update_menubar): Likewise.
5334 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
5335
5336 2012-08-01 Eli Zaretskii <eliz@gnu.org>
5337
5338 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
5339 Adapt to latest changes in field names of the corresponding Lisp
5340 objects.
5341
5342 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
5343
5344 2012-08-01 Glenn Morris <rgm@gnu.org>
5345
5346 * s/msdos.h: Remove file.
5347 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
5348 * Makefile.in (S_FILE): Remove.
5349 (config_h): Remove S_FILE.
5350
5351 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5352
5353 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5354 Remove; moved to nt/config.nt.
5355
5356 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5357
5358 Use INTERNAL_FIELD for conses and overlays.
5359 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5360 Remove obsolete comment.
5361 (MVAR): New macro.
5362 (struct Lisp_Overlay): Use INTERNAL_FIELD.
5363 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5364
5365 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5366
5367 Use INTERNAL_FIELD for symbols.
5368 * lisp.h (SVAR): New macro. Adjust users.
5369 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5370 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5371
5372 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5373
5374 Use INTERNAL_FIELD for processes.
5375 * process.h (PVAR): New macro. Adjust style.
5376 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5377 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5378
5379 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5380
5381 Use INTERNAL_FIELD for windows.
5382 * window.h (WVAR): New macro.
5383 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5384 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5385 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5386 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5387 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5388 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5389
5390 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5391
5392 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5393
5394 2012-08-01 Glenn Morris <rgm@gnu.org>
5395
5396 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5397 Move to configure.ac.
5398
5399 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5400
5401 * makefile.w32-in (CONFIG_H): Update dependencies.
5402 (CONF_POST_H): New macro.
5403
5404 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5405
5406 2012-07-31 Glenn Morris <rgm@gnu.org>
5407
5408 * Makefile.in (S_FILE): No longer set by configure.
5409
5410 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5411 is available.
5412 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5413
5414 * process.h (NULL_DEVICE):
5415 * emacs.c (SEPCHAR):
5416 * editfns.c (USER_FULL_NAME): Let configure set them.
5417
5418 * s/README, s/template.h: Remove files.
5419
5420 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5421
5422 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5423 Move to configure.ac.
5424
5425 2012-07-31 Eli Zaretskii <eliz@gnu.org>
5426
5427 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5428 resulting renaming of 'struct frame' members.
5429
5430 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5431
5432 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5433 after introduction of FVAR.
5434
5435 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5436
5437 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5438
5439 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5440 instead of compositeToPoint.
5441 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5442
5443 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5444
5445 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5446
5447 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5448 * lisp.h (INTERNAL_FIELD): New macro.
5449 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5450 (BVAR): Change to use INTERNAL_FIELD.
5451 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5452 (KVAR): Change to use INTERNAL_FIELD.
5453 * frame.h (FVAR): New macro.
5454 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5455 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5456 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5457 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5458 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5459
5460 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5461
5462 Miscellaneous fixes for non-default X toolkits.
5463 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5464 * xterm.c (x_frame_of_widget): Remove redundant prototype.
5465 Move under #ifdef USE_LUCID.
5466 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5467 definition and usage to avoid warnings.
5468
5469 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5470
5471 * nsterm.m (openFiles): Fix previous checkin.
5472
5473 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
5474
5475 * indent.c (compute_motion): Remove unused local.
5476
5477 2012-07-31 Glenn Morris <rgm@gnu.org>
5478
5479 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5480
5481 * conf_post.h [USG5_4]:
5482 Move remaining contents of s/usg5-4-common.h here.
5483 * s/usg5-4-common.h: Remove file.
5484
5485 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5486 * s/irix6-5.h: Remove file.
5487
5488 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5489 * s/darwin.h: Remove file.
5490
5491 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5492 * s/hpux10-20.h: Remove file, which is now empty.
5493
5494 2012-07-30 Glenn Morris <rgm@gnu.org>
5495
5496 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5497 * Makefile.in (config_h): Add conf_post.h.
5498 * makefile.w32-in (CONFIG_H): Add conf_post.h.
5499
5500 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
5501
5502 * nsterm.m (ns_do_open_file): New variable.
5503 (ns_term_init): Set ns_do_open_file to YES after run returns.
5504 (openFile, openTempFile, openFileWithoutUI, openFiles):
5505 Open files only if ns_do_open_file.
5506
5507 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5508
5509 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5510 This no-op macro hasn't been needed for many years.
5511 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5512
5513 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5514 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5515 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5516 gdb_make_enums_visible.
5517 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5518 (DIRECTORY_SEP): Now a constant, not a macro.
5519
5520 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5521
5522 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5523 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5524
5525 * w32term.c <w32_keyboard_codepage>: Renamed from
5526 keyboard_codepage and now external. All users changed.
5527
5528 * w32term.h: Add declaration of w32_keyboard_codepage.
5529
5530 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5531 the codepage to translate keys to Unicode. If this argument is
5532 -1, use the value returned by GetConsoleCP. All callers changed.
5533
5534 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5535
5536 Update .PHONY listings in makefiles.
5537 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5538 bootstrap-clean, distclean, maintainer-clean, versioclean,
5539 extraclean, frc.
5540
5541 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5542 This is a bit clearer. Fix some commentary typos.
5543
5544 2012-07-30 Glenn Morris <rgm@gnu.org>
5545
5546 * s/netbsd.h: Let configure include signal.h if needed.
5547 Remove file, which is now empty.
5548
5549 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5550 Let configure set them.
5551 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5552 No more need to undefine.
5553
5554 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5555
5556 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5557 non-single-byte char when adding meta modifier. (Bug#12090)
5558
5559 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5560
5561 Convert safe_call to use variable number of arguments.
5562 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5563 (safe_call2): Fix comment.
5564 * lisp.h (safe_call): Adjust prototype.
5565 * coding.c (encode_coding_object): Change to use safe_call2.
5566 * xfaces.c (merge_face_heights): Change to use safe_call1.
5567
5568 2012-07-30 Glenn Morris <rgm@gnu.org>
5569
5570 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5571 does that unconditionally. Remove file, which is now empty.
5572
5573 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5574 Remove empty files.
5575
5576 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5577
5578 Export to GDB most of lisp.h's remaining object-like macros.
5579 * lisp.h (min, max): Move earlier, because they're used earlier now.
5580 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5581 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5582 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5583 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5584 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5585 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5586 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5587 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5588 Now constants, for GDB. They need not be macros.
5589 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5590 Now constants, for GDB, as well as macros, for static initializers.
5591 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5592 Move to after the definition of struct Lisp_Char_Table,
5593 since the former now needs that type defined.
5594 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5595 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5596 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5597 New enums, for gdb_make_enums_visible.
5598 (GLYPH_MODE_LINE_FACE): Remove; unused.
5599 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5600 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5601 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5602 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5603 enum maxargs, enum MAX_ALLOCA.
5604 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5605 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5606 no longer needed, now that they are done in lisp.h.
5607
5608 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5609
5610 Cleanup string bytes checking.
5611 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5612 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5613 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5614 (check_sblock, compact_small_strings): Simplify.
5615
5616 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5617
5618 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5619 These macros are confusing and no longer need to be defined, as
5620 the enum values now suffice. All uses replaced with definiens.
5621 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5622
5623 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5624
5625 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5626 ($(BLD)/w32console.$(O)): Update dependencies.
5627
5628 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5629
5630 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5631 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5632 time. Adjust users.
5633 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5634
5635 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5636
5637 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5638 setting sitelisp (Bug#12010).
5639
5640 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5641
5642 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5643
5644 * w32heap.c (cache_system_info):
5645 * w32.c (sys_rename):
5646 * w32proc.c (find_child_console, sys_kill): All users changed.
5647
5648 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5649
5650 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5651
5652 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5653
5654 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5655
5656 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5657
5658 Cleanup statistics calculation in Fgarbage_collect.
5659 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5660 Fix zombies percentage calculation. Simplify elapsed time calculation.
5661
5662 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5663
5664 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5665 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5666 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5667 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5668 (replace_range, replace_range_2, del_range_2): Change to eassert.
5669 * marker.c (byte_char_debug_check): Adjust style.
5670
5671 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5672
5673 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5674 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5675 long-ago-commented-out code that talks about "WIN32".
5676 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5677 All uses changed.
5678
5679 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5680
5681 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5682 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5683 Simplify by using alignof.
5684 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5685 * lisp.h: Include <stdalign.h>.
5686 (GCALIGNMENT): New macro and constant.
5687 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5688 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5689 (stdalign): New macro, if not already defined.
5690
5691 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5692
5693 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5694 * w32inevt.c: Include w32inevt.h.
5695 (w32_read_console_input): New inline function, calls either
5696 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5697 w32_console_unicode_input.
5698 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5699 (w32_kbd_patch_key, key_event): Use the codepage returned by
5700 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5701 (key_event): use uChar.UnicodeChar only if
5702 w32_console_unicode_input is non-zero.
5703
5704 * w32console.c: Include w32heap.h.
5705 <w32_console_unicode_input>: New global variable.
5706 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5707 family of Windows, zero otherwise.
5708
5709 * w32inevt.h: Declare w32_console_unicode_input.
5710
5711 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5712 --without-x. (Bug#11742)
5713
5714 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5715
5716 Adjust GDB to reflect pvec_type changes (Bug#12036).
5717 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5718 2012-07-04 changes to pseudovector representation.
5719 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5720
5721 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5722
5723 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5724 bus address.
5725 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5726
5727 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5728
5729 * alloc.c (listn): Fix the order the arguments are consed onto the
5730 list.
5731
5732 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5733 enumeration constants, as PURE and HEAP are too general, and clash
5734 with other headers and sources, such as gmalloc.c and the
5735 MS-Windows system headers. All users changed.
5736
5737 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5738
5739 Revert last save_excursion_save and save_excursion_restore changes.
5740 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5741 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5742
5743 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5744
5745 Fix recently-introduced typos in Windows port.
5746 Reported by Martin Rudalics <rudalics@gmx.at>.
5747 * w32.c (init_environment): Replace comma with semicolon.
5748 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5749
5750 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5751
5752 Improve GDB symbol export (Bug#12036).
5753 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5754 arms of an 'if', not using conditional expressions; otherwise GDB
5755 complains about the types in the unevaluated arm when the argument
5756 is an integer literal.
5757 (xgetint): Simplify expression.
5758 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5759 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5760 Zaretskii in <http://bugs.gnu.org/12036#13>.
5761 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5762 needed now that we have gdb_make_enums_visible.
5763 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5764 (enum enum_USE_LSB_TAG):
5765 New enum types, packaging up enums that need to be exported to GDB.
5766
5767 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5768
5769 Utility function to make a list from specified amount of objects.
5770 * lisp.h (enum constype): New datatype.
5771 (listn): New prototype.
5772 * alloc.c (listn): New function.
5773 (Fmemory_use_count, syms_of_alloc): Use it.
5774 * buffer.c (syms_of_buffer): Likewise.
5775 * callint.c (syms_of_callint): Likewise.
5776 * charset.c (define_charset_internal): Likewise.
5777 * coding.c (syms_of_coding): Likewise.
5778 * keymap.c (syms_of_keymap): Likewise.
5779 * search.c (syms_of_search): Likewise.
5780 * syntax.c (syms_of_syntax): Likewise.
5781 * w32.c (init_environment): Likewise.
5782 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5783 * xdisp.c (syms_of_xdisp): Likewise.
5784 * xfns.c (syms_of_xfns): Likewise.
5785
5786 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5787
5788 Fast save_excursion_save and save_excursion_restore.
5789 * lisp.h (struct Lisp_Excursion): New data type.
5790 (PVEC_EXCURSION): New pseudovector type.
5791 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5792 to deal with it. Adjust comments.
5793 (init_marker, attach_marker): New prototype.
5794 (unchain_marker): Adjust prototype.
5795 * marker.c (attach_marker): Change to global.
5796 (init_marker): New function.
5797 * alloc.c (Fmake_marker, build_marker): Use it.
5798 (build_marker): More easserts.
5799 (mark_object): Handle struct Lisp_Excursion.
5800 * editfns.c (save_excursion_save, save_excursion_restore):
5801 Reimplement to use struct Lisp_Excursion. Add comments.
5802
5803 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5804
5805 Fix export of symbols to GDB (Bug#12036).
5806 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5807 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5808 emacs.c, as this is a more-suitable home. Had this been done earlier
5809 the fix for 12036 would have avoided some of the problems noted in
5810 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5811 would have been more obvious.
5812 * emacs.c: Do not include <verify.h>; no longer needed.
5813 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5814 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5815 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5816 Remove; now done in lisp.h.
5817 * lisp.h (PUBLISH_TO_GDB): New macro.
5818 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5819 (DATA_SEG_BITS): Use it.
5820 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5821 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5822 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5823 not be usable in #if. This simplifies things.
5824
5825 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5826
5827 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5828
5829 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5830
5831 Simplify export of symbols to GDB (Bug#12036).
5832 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5833 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5834 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5835 Adjust to changes in lisp.h and emacs.c, by using
5836 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5837 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5838 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5839 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5840 instead of gdb_valbits.
5841 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5842 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5843 instead of gdb_array_mark_flag.
5844 (xboolvector): Get size from $->size, not $->header.size.
5845 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5846 (xreload, hook-run, hookpost-run): Remove.
5847 * emacs.c: Include <verify.h>.
5848 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5849 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5850 Remove.
5851 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5852 (gdb_USE_LSB_TAG): New enum constants.
5853 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5854 Also define these as enum constants, so they're visible to GDB.
5855 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5856 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5857 as constants, so they're visible to GDB.
5858 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5859 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5860 Now enum constants, not macros, so they're visible to GDB.
5861 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5862 more convenient now. All uses changed.
5863 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5864 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5865
5866 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5867
5868 Explicitly free restriction data that are not needed anymore.
5869 * editfns.c (save_restriction_restore): Free restriction data.
5870
5871 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5872
5873 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5874 add argument, tune behavior, and adjust all callers.
5875
5876 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5877
5878 Use typedef for EMACS_INT, EMACS_UINT.
5879 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5880 than macros. This simplifies debugging in the usual case, since
5881 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5882 and it allows expressions involving EMACS_INT casts.
5883 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5884
5885 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5886
5887 * nsterm.m (ns_read_socket): Return early if there is a modal
5888 window (Bug#12043).
5889
5890 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5891
5892 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5893 that FOCUS-FRAME can be omitted.
5894
5895 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5896
5897 Adjust buffer text indirection counters at the end of Fkill_buffer.
5898 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5899 buffer is definitely dead. This should really fix an issue reported
5900 by Christoph Scholtes again. (Bug#12007).
5901 (init_buffer_once): Initialize indirection counters of
5902 buffer_defaults and buffer_local_symbols (for sanity and safety).
5903
5904 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5905
5906 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5907 and continuation glyphs on tooltip frames, leave them at zero.
5908 Avoids continued lines in tooltips. (Bug#11832)
5909
5910 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5911
5912 Simplify copy_overlay.
5913 * buffer.c (copy_overlay): Simplify. Use build_marker.
5914 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5915
5916 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5917
5918 * print.c (print_object): Don't crash when a frame's name is nil
5919 or invalid. (Bug#12025)
5920
5921 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5922 it signals an error when a tooltip frame is being created.
5923
5924 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5925
5926 Cleanup miscellaneous objects allocation and initialization.
5927 * alloc.c (allocate_misc): Change to static. Add argument to
5928 specify the subtype. Adjust comment and users.
5929 (build_overlay): New function.
5930 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5931 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5932 (allocate_misc): Remove prototype.
5933 (build_overlay): Add prototype.
5934
5935 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5936
5937 Swap buffer text indirection counters in Fbuffer_swap_text.
5938 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5939 This avoids crash reported by Christoph Scholtes at
5940 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5941
5942 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5943
5944 * nsmenu.m (Popdown_data): New struct.
5945 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5946 free Popdown_data.
5947 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5948 (initWithContentRect): Make imgView and contentView non-static
5949 and autorelease them. Also autorelease img and matrix (Bug#12005).
5950 (dealloc): Remove (Bug#12005).
5951
5952 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5953
5954 Adjust consing_since_gc when objects are explicitly freed.
5955 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5956 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5957 (free_cons, free_misc): Subtract object size from consing_since_gc.
5958
5959 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5960
5961 Simplify and cleanup markers positioning code.
5962 * marker.c (attach_marker): More useful eassert.
5963 (live_buffer, set_marker_internal): New function.
5964 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5965 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5966
5967 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5968
5969 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5970 as it's limited by the amount of memory, not by INT_MAX.
5971
5972 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5973
5974 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5975 in special-event-map. See the discussion at
5976 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5977 for the reasons.
5978
5979 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5980 info.dwItemData. Fixes crashes on 64-bit Windows.
5981 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5982
5983 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5984
5985 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5986 (conversationIdentifier): Return value is NSInteger.
5987 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5988
5989 2012-07-21 Chong Yidong <cyd@gnu.org>
5990
5991 * window.c (decode_any_window): Signal an error if the window is
5992 on a dead frame (Bug#11984).
5993
5994 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5995
5996 Add indirection counting to speed up Fkill_buffer.
5997 * buffer.h (struct buffer): New member.
5998 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5999 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6000 base buffer indirection counter.
6001 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6002 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6003 through buffer list if indirection counter is 0.
6004
6005 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6006
6007 Extend the value returned by Fgarbage_collect with heap statistics.
6008 * alloc.c (Qheap): New symbol.
6009 (syms_of_alloc): DEFSYM it.
6010 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6011 (Fmemory_free): Remove.
6012 (syms_of_alloc): Don't defsubr it.
6013 * buffer.c (Fcompact_buffer): Remove.
6014 (syms_of_buffer): Don't defsubr it.
6015
6016 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6017
6018 Make maybe_gc inline.
6019 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6020 * lisp.h (consing_since_gc, gc_relative_threshold)
6021 (memory_full_cons_threshold): Revert declaration.
6022 (maybe_gc): Remove prototype, define as inline.
6023 * alloc.c: Remove old commented-out code.
6024 (consing_since_gc, gc_relative_threshold)
6025 (memory_full_cons_threshold): Revert to global.
6026 (maybe_gc): Remove.
6027
6028 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6029
6030 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6031 * lisp.h (build_unibyte_string): New function.
6032 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6033 * sysdep.c, w32fns.c, xfns.c: Use it.
6034 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6035 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6036 Adjust users accordingly.
6037 * font.h (font_open_by_name): Adjust prototype.
6038
6039 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6040
6041 Cleanup calls to Fgarbage_collect.
6042 * lisp.h (maybe_gc): New prototype.
6043 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6044 Remove declarations.
6045 * alloc.c (maybe_gc): New function.
6046 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6047 Make them static.
6048 * bytecode.c (MAYBE_GC): Use maybe_gc.
6049 * eval.c (eval_sub, Ffuncall): Likewise.
6050 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6051 to avoid dependency from auto-save feature.
6052
6053 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6054
6055 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6056 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6057 'for_each_per_buffer_object_at'.
6058 All uses changed. It's better to use upper-case for macros that
6059 cannot be implemented as functions, to give the reader a clue
6060 that they're special.
6061
6062 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
6063
6064 * alloc.c (Fgarbage_collect): Tweak docstring.
6065
6066 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6067
6068 Tweak the value returned from Fgarbage_collect again.
6069 * alloc.c (Fgarbage_collect): New return value, as confirmed in
6070 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6071 Adjust documentation.
6072 (total_vector_bytes): Rename to total_vector_slots, adjust
6073 accounting.
6074 (total_free_vector_bytes): Rename to total_free_vector_slots,
6075 adjust accounting.
6076 (Qstring_bytes, Qvector_slots): New symbols.
6077 (syms_of_alloc): DEFSYM them.
6078
6079 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6080
6081 Buffer compaction primitive which may be used from Lisp.
6082 * buffer.c (compact_buffer, Fcompact_buffer): New function.
6083 (syms_of_buffer): Register Fcompact_buffer.
6084 * alloc.c (Fgarbage_collect): Use compact_buffer.
6085 * buffer.h (compact_buffer): New prototype.
6086 (struct buffer_text): New member.
6087
6088 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6089
6090 New macro to iterate over all buffers, miscellaneous cleanups.
6091 * lisp.h (all_buffers): Remove declaration.
6092 * buffer.h (all_buffers): Add declaration, with comment.
6093 (for_each_buffer): New macro.
6094 * alloc.c (Fgarbage_collect, mark_object): Use it.
6095 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6096 (init_buffer): Likewise.
6097 * data.c (Fset_default): Likewise.
6098 * coding.c (code_conversion_restore): Remove redundant check
6099 for dead buffer.
6100 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
6101
6102 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6103
6104 Fix bug that created negative-length intervals.
6105 * intervals.c (merge_interval_right, merge_interval_left):
6106 Do not zero out this interval if it is absorbed by its children,
6107 as this interval's total length doesn't change in that case. See
6108 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6109
6110 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
6111
6112 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6113 when invoking (make-bool-vector N t) and N is a positive
6114 multiple of 8 -- the last 8 bits were mistakenly cleared.
6115
6116 Remove some struct layout assumptions in bool vectors.
6117 * alloc.c (bool_header_size): New constant.
6118 (header_size, word_size): Move earlier, as they're now used earlier.
6119 Use 'word_size' in a few more places, where it's appropriate.
6120 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6121 padding before the data member of a bool vector.
6122 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6123 than doing the check by hand with an abort ().
6124
6125 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6126
6127 * eval.c (Fdefvar): Don't check constants since we only set the var if
6128 it's not yet defined anyway (bug#11904).
6129
6130 * lisp.h (last_undo_boundary): Declare new var.
6131 * keyboard.c (command_loop_1): Set it.
6132 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6133 were auto-added by the command loop (bug#11774).
6134
6135 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6136
6137 * w32font.c (Qsymbol): Remove local definition.
6138 (syms_of_w32font): Don't DEFSYM it.
6139
6140 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6141
6142 Fix sweep_vectors to handle large bool vectors correctly.
6143 * alloc.c (sweep_vectors): Account total_vector_bytes for
6144 bool vectors larger than VBLOCK_BYTES_MAX.
6145
6146 2012-07-18 Chong Yidong <cyd@gnu.org>
6147
6148 * frame.c (x_set_frame_parameters): Revert bogus change introduced
6149 in 2012-05-25 commit by Paul Eggert (Bug#11738).
6150
6151 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6152
6153 Return more descriptive data from Fgarbage_collect.
6154 Suggested by Stefan Monnier in
6155 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6156 * alloc.c (bounded_number): New function.
6157 (total_buffers, total_vectors): New variable.
6158 (total_string_size): Rename to total_string_bytes, adjust users.
6159 (total_vector_size): Rename to total_vector_bytes, adjust users.
6160 (sweep_vectors): Account total_vectors and total_vector_bytes.
6161 (Fgarbage_collect): New return value. Adjust documentation.
6162 (gc_sweep): Account total_buffers.
6163 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6164 (VECTOR_SIZE): Remove.
6165 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6166 (Qinterval, Qmisc): New symbols.
6167 (syms_of_data): Initialize them.
6168 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6169 (Qcons, Qbuffer): New declarations.
6170
6171 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6172
6173 * alloc.c (Fmemory_free): Account for memory-free's own storage.
6174 Round up, not down. Improve doc.
6175
6176 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6177
6178 Restore old code in allocate_string_data to avoid Faset breakage.
6179 Reported by Julien Danjou <julien@danjou.info> in
6180 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6181 * alloc.c (allocate_string_data): Restore old code with minor
6182 adjustments, fix comment to explain this subtle issue.
6183
6184 2012-07-17 Eli Zaretskii <eliz@gnu.org>
6185
6186 Remove FILE_SYSTEM_CASE.
6187 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6188
6189 * fileio.c (FILE_SYSTEM_CASE): Don't define.
6190 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6191 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6192 call-process-region passes it through expand-file-name.
6193
6194 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6195
6196 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6197
6198 Fix crash when creating indirect buffer (Bug#11917)
6199 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
6200 Don't handle unbound variables specially if non-zero.
6201 (Fbuffer_local_variables): Pass zero.
6202 (clone_per_buffer_values): Pass non-zero.
6203
6204 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6205
6206 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
6207 to make the loop interruptible.
6208
6209 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6210
6211 * gnutls.c (emacs_gnutls_handshake): Only retry if
6212 GNUTLS_E_INTERRUPTED.
6213
6214 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6215
6216 Cleanup and convert miscellaneous checks to eassert.
6217 * alloc.c (mark_interval): Fix comment, partially rephrase
6218 old comment from intervals.h (see below).
6219 * intervals.c (find_interval, adjust_intervals_for_insertion)
6220 (delete_interval, adjust_intervals_for_deletion)
6221 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
6222 Convert to eassert.
6223 (adjust_intervals_for_insertion, make_new_interval):
6224 Remove obsolete and unused code.
6225 * intervals.h (struct interval): Remove obsolete comment.
6226 * textprotp.c (erase_properties): Remove unused code.
6227 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
6228 (Fremove_list_of_text_properties): Convert to eassert.
6229
6230 2012-07-17 Chong Yidong <cyd@gnu.org>
6231
6232 * editfns.c (Finsert_char): Doc fix.
6233
6234 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6235
6236 Fix previous change to make Fmemory_free always accurate.
6237 * alloc.c (make_interval): Update total_free_intervals.
6238 (make_float): Likewise for total_free_floats.
6239 (free_cons, Fcons): Likewise for total_free_conses.
6240 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
6241 Likewise for total_free_vector_bytes.
6242 (Fmake_symbol): Likewise for total_free_symbols.
6243 (bytes_free): Remove.
6244
6245 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6246
6247 Simple free memory accounting feature.
6248 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
6249 (sweep_vectors): Accumulate size of free vectors.
6250 (Fgarbage_collect): Setup bytes_free.
6251 (Fmemory_free): New function.
6252 (syms_of_alloc): Register it.
6253
6254 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6255
6256 Cleanup overlays checking.
6257 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
6258 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
6259 eassert and OVERLAYP.
6260 (sort_overlays): Change to use OVERLAYP.
6261
6262 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
6263
6264 * editfns.c (Finsert_char): Make it interactive, and make the
6265 second arg optional. Copy interactive spec and docstring from
6266 ucs-insert.
6267
6268 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6269
6270 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
6271 Unlike the other wrapped functions, fabs has an unspecified
6272 effect on errno.
6273
6274 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
6275
6276 * nsterm.m (keyDown): Interpret flags without left/right bits
6277 as the left key (Bug#11670).
6278
6279 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6280
6281 Remove empty and useless init functions.
6282 * lisp.h (init_character_once, init_fns, init_image)
6283 (init_filelock, init_sound): Remove prototype.
6284 * character.c (init_character_once): Remove.
6285 * filelock.c (init_filelock): Likewise.
6286 * fns.c (init_fns): Likewise.
6287 * image.c (init_image): Likewise.
6288 * sound.c (init_sound): Likewise.
6289 * emacs.c (main): Adjust accordingly.
6290
6291 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6292
6293 * gtkutil.h: Tiny cleanups.
6294 (use_old_gtk_file_dialog): Remove useless declaration.
6295 (xg_uses_old_file_dialog): Add suggested const attribute.
6296
6297 2012-07-15 Eli Zaretskii <eliz@gnu.org>
6298
6299 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
6300 (bidi_paragraph_init): Use it to limit search forward for a strong
6301 directional character in abnormally large paragraphs full of
6302 neutral or weak characters. (Bug#11943)
6303
6304 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
6305
6306 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
6307 the toolbar (Bug#9451).
6308 (xg_make_tool_item): Give the widget event box a transparent
6309 background.
6310
6311 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6312
6313 Cleanup basic allocation variables and functions.
6314 * alloc.c (ignore_warnings, init_intervals, init_float)
6315 (init_cons, init_symbol, init_marker): Remove.
6316 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
6317 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
6318 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
6319 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
6320 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
6321 (staticidx, init_alloc_once, init_strings, free_ablock):
6322 Remove redundant initialization.
6323 * fns.c (init_weak_hash_tables): Remove.
6324 * lisp.h (init_weak_hash_tables): Remove prototype.
6325
6326 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6327
6328 Use zero_vector where appropriate.
6329 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
6330 accordingly.
6331 * lisp.h (zero_vector): New declaration.
6332 * font.c (null_vector): Remove.
6333 (syms_of_font): Remove initialization and staticpro.
6334 (font_list_entities, font_find_for_lface): Change to use zero_vector.
6335 * keymap.c (Faccessible_keymaps): Likewise.
6336
6337 2012-07-15 Leo Liu <sdl.web@gmail.com>
6338
6339 * fringe.c: Fix typo in comments.
6340
6341 2012-07-14 Leo Liu <sdl.web@gmail.com>
6342
6343 * fringe.c: Add a new bitmap exclamation-mark.
6344
6345 2012-07-14 Eli Zaretskii <eliz@gnu.org>
6346
6347 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
6348
6349 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
6350 (HAVE_MENUS): Don't define, defined by editing config.in with
6351 msdos/sed2v2.inp.
6352 (GMALLOC_INHIBIT_VALLOC): Don't define.
6353 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6354
6355 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
6356
6357 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6358
6359 2012-07-14 Glenn Morris <rgm@gnu.org>
6360
6361 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6362 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6363 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6364
6365 2012-07-13 Glenn Morris <rgm@gnu.org>
6366
6367 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6368
6369 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6370 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6371
6372 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
6373
6374 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6375 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6376 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6377 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6378 where appropriate.
6379 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6380 as boolean expression.
6381 (x_set_window_size): Remove unused variable toolbar.
6382 (ns_get_color_default, ns_mod_to_lisp): Remove.
6383 (ns_mouse_position): Remove unused variables xchar and ychar.
6384 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6385 (ns_set_vertical_scroll_bar): Remove unused variable count.
6386 (ns_delete_terminal): Remove unused variable i.
6387 (ns_term_init): Remove unused variables r, g and b.
6388 (mouseDown): Remove unused variable window.
6389 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6390 (initFrameFromEmacs): Remove unused variable vbextra.
6391 (mouseEntered): Remove unused variables p and dpyinfo.
6392 (mouseExited): Remove unused variables p and r.
6393 (ns_define_frame_cursor, ns_clear_frame_area)
6394 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6395 (menuDown): Assign [sender tag] to variable and cast the variable.
6396
6397 * nsterm.h (menuDown): Add id as type to argument sender.
6398 (ns_display_info_for_name): Add Lisp_Object argument.
6399 (ns_term_init): Add Lisp_Object argument.
6400 (ns_map_event_to_object): Add void argument.
6401 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6402 prototype with arguments and only declare if __OBJC__.
6403 (nxatoms_of_nsselect): Add void argument.
6404 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6405 (ns_alloc_autorelease_pool): Add void argument.
6406 (ns_release_autorelease_pool): Add void* argument.
6407 (ns_get_defaults_value): Add const char* argument.
6408
6409 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6410 (initFromContents): Use SSDATA where appropriate.
6411 (ns_update_menubar): Add braces to ambigous if-else.
6412 (initWithTitle): Put () around assignment in if statement.
6413 (ns_menu_show): Remove unused variables window and keymap.
6414 (update_frame_tool_bar): Remove unused variable selected_p.
6415 (initWithContentRect): Remove unused variable this_cmd_name.
6416
6417 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6418 appropriate.
6419 (setXBMColor): Remove unused variable len.
6420 (setPixmapData): Put () around assignment in loop statement.
6421
6422 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6423 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6424 where appropriate.
6425 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6426 around assignment in loop statement.
6427 (nsfont_open): Remove unused variable i.
6428 (nsfont_open): Remove unused variable len.
6429 (nsfont_draw): Remove unused variable cs.
6430
6431 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6432 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6433 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6434 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6435 (Fns_font_name, Fns_perform_service)
6436 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6437 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6438 (ns_set_name): Remove unused variable view.
6439 (x_set_menu_bar_lines): Remove unused variable olines.
6440 (x_set_tool_bar_lines): Remove unused variable root_window.
6441 (Fns_list_colors): Put () around assignment in while statement.
6442 (Fns_perform_service): Remove unused variable len.
6443 (Fns_display_usable_bounds): Remove unused variable top.
6444 (syms_of_nsfns): Remove unused variable i.
6445
6446 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6447 memcpy (Bug#11907).
6448
6449 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
6450
6451 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6452 and free it with DestroyExceptionInfo (Bug#11558).
6453
6454 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
6455
6456 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6457 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6458 Set here, not in nt/config.nt.
6459
6460 2012-07-13 Eli Zaretskii <eliz@gnu.org>
6461
6462 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6463 cursor overflow into the last glyph on display line when the right
6464 fringe is off. (Bug#11832)
6465
6466 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
6467
6468 * xdisp.c (produce_special_glyphs): Now static.
6469 * dispextern.h (produce_special_glyphs): Remove decl.
6470
6471 2012-07-13 Glenn Morris <rgm@gnu.org>
6472
6473 * s/bsd-common.h, s/cygwin.h: Remove empty files.
6474 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6475
6476 * s/usg5-4-common.h (USG, USG5):
6477 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6478 * s/sol2-6.h (SOLARIS2):
6479 * s/irix6-5.h (IRIX6_5):
6480 * s/hpux10-20.h (USG, USG5, HPUX):
6481 * s/gnu-linux.h (USG, GNU_LINUX):
6482 * s/freebsd.h (BSD_SYSTEM):
6483 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6484 * s/cygwin.h (CYGWIN):
6485 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6486 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6487
6488 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
6489
6490 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6491
6492 2012-07-13 Glenn Morris <rgm@gnu.org>
6493
6494 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6495
6496 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6497
6498 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6499 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6500
6501 2012-07-12 Glenn Morris <rgm@gnu.org>
6502
6503 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6504
6505 * process.c (init_process_emacs): Rename from init_process.
6506 The old name is also the name of a Mach system call.
6507 * lisp.h, emacs.c: Update for this name change.
6508 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6509 longer needed.
6510
6511 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6512
6513 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6514 memmove call that removes glyphs covered by the left truncation
6515 glyph. Improve commentary.
6516 (display_line): Fix display of continuation glyphs on GUI frames
6517 when the right fringe is turned off and variable-size fonts are
6518 used in the window. Move the code that appends a stretch glyph to
6519 produce_special_glyphs, so that it could be used for truncation
6520 and continuation glyphs alike.
6521 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6522 glyph of a suitably computed width, to align the special glyphs at
6523 the window margin. Code moved from display_line. (Bug#11832)
6524
6525 2012-07-12 Glenn Morris <rgm@gnu.org>
6526
6527 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6528
6529 * s/gnu-linux.h, s/hpux10-20.h:
6530 Do not unconditionally define HAVE_XRMSETDATABASE.
6531
6532 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6533
6534 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6535
6536 Fix typos that broke OS X build.
6537 Reported by Randal L. Schwartz in
6538 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6539 * nsterm.m (ns_timeout): Add missing local decl.
6540 (ns_get_color): snprintf -> sprintf, to fix typo.
6541
6542 2012-07-12 Glenn Morris <rgm@gnu.org>
6543
6544 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6545 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6546 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6547 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6548
6549 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6550 Move PTY_OPEN to configure.
6551
6552 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6553 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6554 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6555
6556 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6557
6558 Use empty_unibyte_string where applicable.
6559 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6560 * lread.c (read1): Likewise.
6561 * xsettings.c (syms_of_xsettings): Likewise.
6562
6563 2012-07-12 Glenn Morris <rgm@gnu.org>
6564
6565 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6566 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6567 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6568 * s/hpux10-20.h (RUN_TIME_REMAP):
6569 * s/bsd-common.h (TABDLY): Move to configure.
6570
6571 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6572
6573 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6574
6575 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6576 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6577
6578 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6579
6580 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6581 * s/template.h: Move NARROWPROTO to configure.
6582
6583 2012-07-11 Glenn Morris <rgm@gnu.org>
6584
6585 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6586 unused since 2011-01-17 change to systty.h.
6587
6588 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6589 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6590 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6591
6592 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6593
6594 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6595
6596 2012-07-11 Glenn Morris <rgm@gnu.org>
6597
6598 * s/darwin.h, s/gnu-linux.h, s/template.h:
6599 Move INTERRUPT_INPUT to configure.
6600
6601 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6602
6603 Minor adjustments to interning code.
6604 * lisp.h (intern, intern_c_string): Redefine as static inline
6605 wrappers for intern_1 and intern_c_string_1, respectively.
6606 (intern_1, intern_c_string_1): Rename prototypes.
6607 * lread.c (intern_1, intern_c_string_1, oblookup):
6608 Simplify Vobarray checking.
6609 * font.c (font_intern_prop): Likewise. Adjust comment.
6610 * w32font.c (intern_font_name): Likewise.
6611
6612 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6613
6614 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6615
6616 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6617 of Fcar/Fcdr if possible.
6618 * font.c (check_otf_features): Likewise.
6619 * fontset.c (Fnew_fontset): Likewise.
6620 * gnutls.c (Fgnutls_boot): Likewise.
6621 * minibuf.c (read_minibuf): Likewise.
6622 * msdos.c (IT_set_frame_parameters): Likewise.
6623 * xmenu.c (Fx_popup_dialog): Likewise.
6624 * w32menu.c (Fx_popup_dialog): Likewise.
6625
6626 2012-07-11 Glenn Morris <rgm@gnu.org>
6627
6628 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6629 since nothing has defined it on these platforms.
6630
6631 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6632 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6633
6634 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6635 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6636 Move CLASH_DETECTION to configure.
6637
6638 * s/gnu.h: Remove file, which is now empty.
6639
6640 * s/gnu.h, s/gnu-linux.h:
6641 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6642
6643 2012-07-11 John Wiegley <johnw@newartisans.com>
6644
6645 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6646 function attribute, so we only use it if it exists in the
6647 compiler.
6648
6649 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6650
6651 Avoid call to strlen in fast_c_string_match_ignore_case.
6652 * search.c (fast_c_string_match_ignore_case): Change to use
6653 length argument. Adjust users accordingly.
6654 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6655
6656 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6657
6658 Assume mkdir, rmdir.
6659 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6660 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6661
6662 Assume rename.
6663 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6664
6665 Assume perror.
6666 * s/hpux10-20.h (HAVE_PERROR): Remove.
6667 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6668 Remove dummy definition, as this problem was obsolete long ago.
6669
6670 Assume strerror.
6671 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6672
6673 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6674
6675 Avoid calls to strlen in font processing functions.
6676 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6677 (font_open_by_name): Change to use length argument.
6678 Adjust users accordingly.
6679 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6680 Adjust prototypes.
6681 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6682 Change to return ptrdiff_t.
6683 (xfont_list_pattern, xfont_match): Use length returned by
6684 xfont_decode_coding_xlfd.
6685 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6686
6687 2012-07-11 Glenn Morris <rgm@gnu.org>
6688
6689 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6690 Move DONT_REOPEN_PTY to configure.
6691
6692 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6693 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6694
6695 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6696
6697 Remove "#define unix" that is no longer needed (Bug#11905).
6698 * s/aix4-2.h (unix): Remove; no longer needed.
6699
6700 EMACS_TIME simplification (Bug#11875).
6701 This replaces macros (which typically do not work in GDB)
6702 with functions, typedefs and enums, making the code easier to debug.
6703 The functional style also makes code easier to read and maintain.
6704 * systime.h: Include <sys/time.h> on all hosts, not just if
6705 WINDOWSNT, since 'struct timeval' is needed in general.
6706 (EMACS_TIME): Now a typedef, not a macro.
6707 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6708 not macros.
6709 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6710 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6711 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6712 (EMACS_TIME_LE): Now functions, not macros.
6713 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6714 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6715 which are not functions. All uses rewritten to use:
6716 (make_emacs_time): New function.
6717 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6718 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6719 not functions. All uses rewritten to use the following, respectively:
6720 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6721 (add_emacs_time, sub_emacs_time): New functions.
6722 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6723 * fileio.c (Fcopy_file):
6724 * xterm.c (XTflash): Get the current time closer to when it's used.
6725 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6726
6727 * bytecode.c (targets): Suppress -Woverride-init warnings.
6728
6729 Simplify by avoiding confusing use of strncpy etc.
6730 * doc.c (Fsnarf_documentation):
6731 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6732 * frame.c (Fmake_terminal_frame):
6733 * gtkutil.c (get_utf8_string):
6734 * lread.c (openp):
6735 * nsmenu.m (ns_update_menubar):
6736 * regex.c (regerror):
6737 Prefer memcpy to strncpy and strncat when either will do.
6738 * fileio.c (Fsubstitute_in_file_name):
6739 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6740 (menu_separator_name_p):
6741 * nsmenu.m (ns_update_menubar):
6742 Prefer memcmp to strncmp when either will do.
6743 * nsterm.m: Include <ftoastr.h>.
6744 (ns_get_color):
6745 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6746 Prefer snprintf to strncpy.
6747 * nsterm.m (ns_term_init):
6748 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6749 * nsterm.m (ns_term_init):
6750 Avoid the need for strncpy, by using build_string or
6751 make_unibyte_string directly. Use dtoastr, not snprintf.
6752 * process.c (Fmake_network_process): Diagnose service names that
6753 are too long, rather than silently truncating them or creating
6754 non-null-terminated names.
6755 (Fnetwork_interface_info): Likewise, for interface names.
6756 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6757 Prefer sprintf to strncat.
6758 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6759 Prefer vsnprintf to vsprintf + strncpy.
6760
6761 2012-07-10 Glenn Morris <rgm@gnu.org>
6762
6763 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6764 Clarify fallback case.
6765
6766 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6767
6768 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6769 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6770 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6771 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6772 where argument type is known to be a Lisp_Cons.
6773
6774 2012-07-10 Tom Tromey <tromey@redhat.com>
6775
6776 * bytecode.c (BYTE_CODE_THREADED): New macro.
6777 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6778 (enum byte_code_op): New type.
6779 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6780 (exec_byte_code): Use them. Use token threading when applicable.
6781
6782 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6783
6784 Optimize pure C strings initialization.
6785 * lisp.h (make_pure_string): Fix prototype.
6786 (build_pure_c_string): New function, defined as static inline. This
6787 provides a better opportunity to optimize away calls to strlen when
6788 the function is called with compile-time constant argument.
6789 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6790 argument, adjust users accordingly. Use build_pure_c_string where
6791 appropriate.
6792 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6793 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6794 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6795
6796 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6797
6798 Avoid calls to strlen in miscellaneous functions.
6799 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6800 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6801 * lread.c (openp): Likewise.
6802
6803 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6804
6805 Avoid calls to strlen in path processing functions.
6806 * fileio.c (file_name_as_directory): Add comment. Change to add
6807 srclen argument and return the length of result. Adjust users
6808 accordingly.
6809 (directory_file_name): Fix comment. Change to add srclen argument,
6810 swap 1st and 2nd arguments to obey the common convention.
6811 Adjust users accordingly.
6812 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6813
6814 2012-07-10 Glenn Morris <rgm@gnu.org>
6815
6816 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6817 Move PENDING_OUTPUT_COUNT definition to configure.
6818
6819 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6820 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6821 * s/gnu.h (DATA_START): Move definitions to configure.
6822
6823 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6824 We include usg5-4-common.h, which defines them both.
6825
6826 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6827 O_RDONLY already includes it).
6828
6829 Stop ns builds setting the EMACSLOADPATH environment variable.
6830 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6831 Now it does not set EMACSLOADPATH, just returns the load-path string.
6832 * nsterm.h: Update accordingly.
6833 * lread.c [HAVE_NS]: Include nsterm.h.
6834 (init_lread) [HAVE_NS]: Use ns_load_path.
6835 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6836
6837 2012-07-09 Glenn Morris <rgm@gnu.org>
6838
6839 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6840 since the included bsd-common.h does so.
6841
6842 Stop ns builds setting the EMACSPATH environment variable.
6843 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6844 (ns_init_paths): Do not set EMACSPATH.
6845 * nsterm.h (ns_exec_path): Add it.
6846 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6847 Use ns_exec_path.
6848
6849 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6850
6851 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6852
6853 * process.c (wait_reading_process_output): 'waitchannels' was unset
6854 when read_kbd || !NILP (wait_for_cell); fix this.
6855
6856 Add GCC-style 'const' attribute to functions that can use it.
6857 * character.h (char_resolve_modifier_mask):
6858 * keyboard.h (make_ctrl_char):
6859 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6860 (init_character_once, next_almost_prime, init_fns, init_image)
6861 (flush_pending_output, init_sound):
6862 * mem-limits.h (start_of_data):
6863 * menu.h (finish_menu_items):
6864 Add ATTRIBUTE_CONST.
6865 * emacs.c (DEFINE_DUMMY_FUNCTION):
6866 Declare the dummy function with ATTRIBUTE_CONST.
6867 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6868 Add decls with ATTRIBUTE_CONST.
6869
6870 Minor improvements to make_formatted_string.
6871 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6872 where int is good enough, as vsprintf returns an int.
6873 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6874
6875 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6876
6877 Use make_formatted_string to avoid double length calculation.
6878 * lisp.h (make_formatted_string): New prototype.
6879 * alloc.c (make_formatted_string): New function.
6880 * buffer.c (Fgenerate_new_buffer_name): Use it.
6881 * dbusbind.c (syms_of_dbusbind): Likewise.
6882 * editfns.c (Fcurrent_time_zone): Likewise.
6883 * filelock.c (get_boot_time): Likewise.
6884 * frame.c (make_terminal_frame, set_term_frame_name)
6885 (x_report_frame_params): Likewise.
6886 * image.c (gs_load): Likewise.
6887 * minibuf.c (get_minibuffer): Likewise.
6888 * msdos.c (dos_set_window_size): Likewise.
6889 * process.c (make_process): Likewise.
6890 * xdisp.c (ensure_echo_area_buffers): Likewise.
6891 * xsettings.c (apply_xft_settings): Likewise.
6892
6893 2012-07-09 Glenn Morris <rgm@gnu.org>
6894
6895 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6896 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6897 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6898 * nsterm.h (ns_etc_directory): Add it.
6899 * callproc.c [HAVE_NS]: Include nsterm.h.
6900 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6901
6902 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6903
6904 Move marker debugging code under MARKER_DEBUG.
6905 * marker.c (MARKER_DEBUG): Move marker debugging code under
6906 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6907 for bootstrap with --enable-checking (~3x slowdown reported
6908 by Juanma Barranquero <lekktu@gmail.com>).
6909 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6910
6911 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6912
6913 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6914 See <http://bugs.gnu.org/11825#29>.
6915
6916 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6917
6918 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6919 has no font, use the frame's font. (Bug#11813)
6920 (display_line): Add commentary about displaying truncation glyphs
6921 on GUI frames.
6922 (produce_special_glyphs): Move here from term.c.
6923
6924 * term.c (produce_special_glyphs): Move to xdisp.c.
6925
6926 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6927 section.
6928
6929 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6930
6931 * xdisp.c (display_line): Avoid warning about implicit declaration
6932 of FRAME_FONT.
6933
6934 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6935
6936 * lisp.h: Remove empty conditional.
6937
6938 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6939
6940 * lread.c (load_path_check): Now static.
6941
6942 Fix some minor --with-ns problems found by static checking.
6943 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6944 (x_set_font) [!HAVE_X_WINDOWS]:
6945 * image.c (xpm_load_image) [HAVE_NS]:
6946 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6947 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6948 Remove unused local.
6949 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6950 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6951 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6952 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6953 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6954 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6955 Fix pointer signedness problem.
6956 * xfaces.c (FRAME_X_FONT_TABLE):
6957 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6958
6959 2012-07-07 Glenn Morris <rgm@gnu.org>
6960
6961 * lread.c (load_path_check): New function, split from init_lread.
6962 (init_lread): Reorganize. Motivation:
6963 If EMACSLOADPATH is set, check/warn about that rather than the
6964 defaults, which we are not going to use. Hence we can remove
6965 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6966 Don't warn if site-lisp directories are missing.
6967 If not installed, start from a blank load-path, since
6968 PATH_LOADSEARCH refers to the eventual installation directories.
6969
6970 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6971
6972 Support truncation and continuation glyphs on GUI frames, when
6973 fringes are disabled. (Bug#11832)
6974 * xdisp.c (init_iterator): Get dimensions of truncation and
6975 continuation glyphs even if on GUI frames.
6976 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6977 or both, are absent.
6978 (start_display, move_it_in_display_line_to): Handle the case of a
6979 GUI frame without a fringe to display continuation or truncation
6980 glyphs.
6981 (insert_left_trunc_glyphs): Support GUI frames: make sure
6982 truncation glyphs overwrite enough glyphs from the current line to
6983 have sufficient space in pixels.
6984 (display_line): Support truncation and continuation glyphs on GUI
6985 frames. If some spare pixels are left on the line after inserting
6986 the truncation glyphs, fill that space with a stretch glyph of a
6987 suitably computed width.
6988
6989 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6990 produce_glyphs, to support GUI sessions.
6991
6992 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6993
6994 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6995
6996 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6997
6998 Do not require float-time's arg to fit in time_t (Bug#11825).
6999 This works better on hosts where time_t is unsigned, and where
7000 float-time is applied to the (negative) difference between two times.
7001 * editfns.c (decode_time_components): Last arg is now double *,
7002 not int *, and means to store all the result as a double, without
7003 worrying about whether the seconds part fits in time_t.
7004 All callers changed.
7005 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7006 All callers changed.
7007 (Ffloat_time): Do not fail merely because the specified time falls
7008 outside of time_t range.
7009
7010 2012-07-07 Glenn Morris <rgm@gnu.org>
7011
7012 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7013 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7014 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7015
7016 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
7017
7018 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7019 Update dependencies.
7020
7021 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7022
7023 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7024
7025 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7026 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7027 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7028 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7029 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7030 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7031
7032 * xfont.c (compare_font_names): Redo to omit the need for casts.
7033
7034 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7035
7036 * xfns.c (Fx_change_window_property): Doc fix.
7037 * w32fns.c (Fx_change_window_property): Doc fix.
7038
7039 * w32fns.c (Fx_window_property): Accept the same arguments as the
7040 X Windows version. Doc fix.
7041 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7042
7043 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
7044 Eli Zaretskii <eliz@gnu.org>
7045
7046 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7047 Windows-specific code from nt/config.nt moved here.
7048 Obsolete settings removed.
7049
7050 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7051
7052 * process.c: Avoid unnecessary calls to gettime.
7053 (wait_reading_process_output): Don't get the time of day
7054 when gobbling data immediately and not waiting, as there's no need
7055 for it in that case. This removes a FIXME.
7056
7057 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
7058
7059 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7060 is defined (Bug#11768).
7061
7062 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7063
7064 Fix marker debugging code.
7065 * marker.c (byte_char_debug_check): Do not perform the check
7066 if buffer is not multibyte.
7067 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7068 Call byte_char_debug_check with correct arguments.
7069
7070 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7071
7072 Compile marker debugging code only if ENABLE_CHECKING is defined.
7073 * marker.c (byte_char_debug_check, count_markers):
7074 Use only if ENABLE_CHECKING is defined.
7075 (byte_debug_flag): Remove.
7076 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7077 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7078
7079 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7080
7081 Avoid code repetition in marker-related functions.
7082 * marker.c (attach_marker): New function.
7083 (Fset_marker, set_marker_restricted, set_marker_both)
7084 (set_marker_restricted_both): Use it.
7085 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7086 Consistently rename charno to charpos.
7087 (marker_position): Add eassert.
7088 (marker_byte_position): Convert to eassert.
7089
7090 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7091
7092 Simplify list operations in unchain_overlay and unchain_marker.
7093 * buffer.c (unchain_overlay): Simplify. Add comment.
7094 * marker.c (unchain_marker): Simplify. Fix comments.
7095
7096 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7097
7098 Introduce fast path for the widely used marker operation.
7099 * alloc.c (build_marker): New function.
7100 * lisp.h (build_marker): New prototype.
7101 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7102 * composite.c (autocmp_chars): Likewise.
7103 * editfns.c (buildmark): Remove.
7104 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7105 (save_restriction_save): Use build_marker.
7106 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7107 * window.c (save_window_save): Likewise.
7108
7109 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7110
7111 Do not use Fdelete_overlay in delete_all_overlays
7112 to avoid redundant calls to unchain_overlay.
7113 * buffer.c (drop_overlay): New function.
7114 (delete_all_overlays, Fdelete_overlay): Use it.
7115 * minibuf.c (get_minibuffer): Fix comment.
7116
7117 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7118
7119 Port to OpenBSD 5.1 amd64.
7120 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7121 This is needed for OpenBSD, and should be harmless on all BSD systems.
7122 Also, include <sys/sysctl.h>, as it should be available on all
7123 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7124 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7125 use p_pid member, not kp_proc.pid.
7126
7127 2012-07-06 Glenn Morris <rgm@gnu.org>
7128
7129 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7130
7131 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7132
7133 More xmalloc and related cleanup.
7134 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7135 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7136 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7137 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7138 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7139 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7140 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7141 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7142 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7143 * xterm.c:
7144 Omit needless casts involving void * pointers and allocation.
7145 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7146 as the former is more robust if P's type is changed.
7147 Prefer xzalloc to xmalloc + memset 0.
7148 Simplify malloc-or-realloc to realloc.
7149 Don't worry about xmalloc returning a null pointer.
7150 Prefer xstrdup to xmalloc + strcpy.
7151 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7152 growing it.
7153 * keyboard.c (apply_modifiers_uncached): Prefer local array to
7154 alloca of a constant.
7155
7156 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7157
7158 * xdisp.c (display_line): Fix horizontal pixel coordinates when
7159 hscroll is larger than the line width. Fixes long and futile
7160 looping inside extend_face_to_end_of_line (on a TTY) producing
7161 glyphs that are not needed and thrown away.
7162
7163 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7164
7165 * marker.c (set_marker_restricted_both): Simplify by using
7166 clip_to_bounds.
7167
7168 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7169
7170 * editfns.c (region_limit): Simplify by using clip_to_bounds.
7171
7172 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
7173
7174 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7175 not defined (Bug#11768).
7176 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7177 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7178 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7179 followed by gtk_box_set_homogeneous (Bug#11768).
7180 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
7181 (update_theme_scrollbar_width, xg_create_scroll_bar):
7182 Use gtk_scrollbar_new (Bug#11768).
7183 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7184 (is_box_type): New function (Bug#11768).
7185 (xg_tool_item_stale_p): Call is_box_type.
7186 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
7187 with default display (Bug#11768).
7188
7189 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7190
7191 * xdisp.c (window_hscroll_limited): New function.
7192 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7193 coordinates when window's hscroll is set to insanely large
7194 values. (Bug#11857)
7195
7196 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
7197
7198 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
7199 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
7200
7201 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7202
7203 Cleanup xmalloc.
7204 * lisp.h (xzalloc): New prototype. Omit needless casts.
7205 * alloc.c (xzalloc): New function. Omit needless casts.
7206 * charset.c: Omit needless casts. Convert all calls to
7207 xmalloc with following memset to xzalloc.
7208 * dispnew.c: Likewise.
7209 * fringe.c: Likewise.
7210 * image.c: Likewise.
7211 * sound.c: Likewise.
7212 * term.c: Likewise.
7213 * w32fns.c: Likewise.
7214 * w32font.c: Likewise.
7215 * w32term.c: Likewise.
7216 * xfaces.c: Likewise.
7217 * xfns.c: Likewise.
7218 * xterm.c: Likewise.
7219 * atimer.c: Omit needless casts.
7220 * buffer.c: Likewise.
7221 * callproc.c: Likewise.
7222 * ccl.c: Likewise.
7223 * coding.c: Likewise.
7224 * composite.c: Likewise.
7225 * doc.c: Likewise.
7226 * doprnt.c: Likewise.
7227 * editfns.c: Likewise.
7228 * emacs.c: Likewise.
7229 * eval.c: Likewise.
7230 * filelock.c: Likewise.
7231 * fns.c: Likewise.
7232 * gtkutil.c: Likewise.
7233 * keyboard.c: Likewise.
7234 * lisp.h: Likewise.
7235 * lread.c: Likewise.
7236 * minibuf.c: Likewise.
7237 * msdos.c: Likewise.
7238 * print.c: Likewise.
7239 * process.c: Likewise.
7240 * region-cache.c: Likewise.
7241 * search.c: Likewise.
7242 * sysdep.c: Likewise.
7243 * termcap.c: Likewise.
7244 * terminal.c: Likewise.
7245 * tparam.c: Likewise.
7246 * w16select.c: Likewise.
7247 * w32.c: Likewise.
7248 * w32reg.c: Likewise.
7249 * w32select.c: Likewise.
7250 * w32uniscribe.c: Likewise.
7251 * widget.c: Likewise.
7252 * xdisp.c: Likewise.
7253 * xmenu.c: Likewise.
7254 * xrdb.c: Likewise.
7255 * xselect.c: Likewise.
7256
7257 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7258
7259 * fileio.c (time_error_value): Check the right error number.
7260 Problem reported by Troels Nielsen in
7261 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
7262
7263 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7264
7265 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
7266 This should be fixed in a better way; see Eli Zaretskii in
7267 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
7268 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
7269
7270 * fileio.c (time_error_value): Rename from special_mtime.
7271 The old name's problems were noted by Eli Zaretskii in
7272 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
7273
7274 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
7275 This variable's comment says Emacs needs at least one GDB-visible
7276 symbol of type enum pvec_type, to work around GDB problems.
7277 The symbol's value doesn't matter.
7278
7279 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
7280 that causes compilation to fail on pre-C99 compilers.
7281
7282 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
7283
7284 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
7285 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
7286
7287 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7288
7289 * buffer.c (init_buffer_once): Fix initialization of
7290 headers for buffer_defaults and buffer_local_symbols.
7291 Reported by Juanma Barranquero <lekktu@gmail.com>.
7292
7293 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7294
7295 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
7296 * lisp.h (enum pvec_type): Use fewer bits.
7297 (PSEUDOVECTOR_SIZE_BITS): New constant.
7298 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
7299 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
7300 change in pvec_type.
7301 (PSEUDOVECTOR_TYPEP): New macro.
7302 (TYPED_PSEUDOVECTORP): Use it.
7303 * fns.c (internal_equal): Adapt code to extract pvectype.
7304 * emacs.c (gdb_pvec_type): Update type.
7305 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
7306 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
7307 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
7308 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
7309 (sweep_vectors): Use it. Use local var `total_bytes' instead of
7310 abusing vector->header.next.nbytes.
7311 (live_vector_p): Use PVEC_TYPE.
7312 (mark_object): Adapt code to extract pvectype. Use switch.
7313
7314 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7315
7316 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
7317 Tighten new eassert a bit.
7318
7319 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7320
7321 Fix compilation with --enable-gcc-warnings and -O1
7322 optimization level.
7323 * doprnt.c (doprnt): Change type of tem to int, initialize
7324 to avoid compiler warning. Add eassert.
7325 * search.c (simple_search): Initialize match_byte to avoid
7326 compiler warning. Add eassert.
7327
7328 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7329
7330 Avoid weird behavior with large horizontal scrolls.
7331 Without this change, for example, large hscroll values would
7332 mess up Emacs's display on Fedora 15 x86, presumably due to
7333 overflows in int calculations in the display code.
7334 Also, if buffers had long lines, Emacs would freeze.
7335 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
7336 (set_window_hscroll): New function, containing the old guts of
7337 Fset_window_hscroll. Return the clipped value.
7338 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
7339 This avoids the need to check against PTRDIFF_MAX.
7340
7341 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
7342
7343 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7344
7345 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
7346
7347 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7348
7349 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
7350 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
7351 since GCC 4.4.6 issues a bogus warning for them.
7352
7353 Fix bugs in file timestamp newness comparisons.
7354 * fileio.c (Ffile_newer_than_file_p):
7355 * lread.c (Fload): Use full timestamp resolution of files,
7356 not just the 1-second resolution, so that files that are only
7357 slightly newer still count as newer.
7358 * fileio.c (Ffile_newer_than_file_p): Don't assume file
7359 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7360
7361 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
7362
7363 * fileio.c: Improve handling of file time marker. (Bug#11852)
7364 (special_mtime): New function.
7365 (Finsert_file_contents, Fverify_visited_file_modtime):
7366 Use it to set special mtime values consistently.
7367
7368 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
7369
7370 * fileio.c (Finsert_file_contents): Properly handle st_mtime
7371 marker for non-existing file. (Bug#11852)
7372
7373 2012-07-03 Glenn Morris <rgm@gnu.org>
7374
7375 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7376 and did not make it into globals.h).
7377
7378 2012-07-03 Tom Tromey <tromey@redhat.com>
7379
7380 * window.c (Fset_window_margins, Fset_window_fringes)
7381 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7382 * textprop.c (Fprevious_property_change): No longer static.
7383 * syntax.c (Fsyntax_table_p): No longer static.
7384 * process.c (Fget_process, Fprocess_datagram_address): No longer
7385 static.
7386 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7387 * keyboard.c (Fcommand_execute): No longer static.
7388 Remove EXFUN.
7389 * insdel.c (Fcombine_after_change_execute): No longer static.
7390 * image.c (Finit_image_library): No longer static.
7391 * fileio.c (Fmake_symbolic_link): No longer static.
7392 * eval.c (Ffetch_bytecode): No longer static.
7393 * editfns.c (Fuser_full_name): No longer static.
7394 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7395 No longer static.
7396 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7397 static.
7398 * dired.c (Ffile_attributes): No longer static.
7399 * composite.c (Fcomposition_get_gstring): No longer static.
7400 * callproc.c (Fgetenv_internal): No longer static.
7401
7402 * ccl.h: Remove EXFUNs.
7403 * buffer.h: Remove EXFUNs.
7404 * dispextern.h: Remove EXFUNs.
7405 * intervals.h: Remove EXFUNs.
7406 * fontset.h: Remove EXFUN.
7407 * font.h: Remove EXFUNs.
7408 * dosfns.c (system_process_attributes): Remove EXFUN.
7409 * keymap.h: Remove EXFUNs.
7410 * lisp.h: Remove EXFUNs.
7411 * w32term.h: Remove EXFUNs.
7412 * window.h: Remove EXFUNs.
7413 * xsettings.h: Remove EXFUN.
7414 * xterm.h: Remove EXFUN.
7415
7416 2012-07-03 Glenn Morris <rgm@gnu.org>
7417
7418 * lisp.h (Frandom): Make it visible to C.
7419 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7420 buffer for invisible buffers. (Bug#1229)
7421
7422 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7423
7424 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7425 values which aren't power of 2.
7426 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7427 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
7428 accordingly.
7429
7430 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7431
7432 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7433
7434 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7435
7436 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7437
7438 * alloc.c (allocate_vector_block): Remove redundant
7439 calls to mallopt if DOUG_LEA_MALLOC is defined.
7440 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7441 avoid calls to mallopt if zero_vector is returned.
7442
7443 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7444
7445 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7446 is enabled, avoid dereferencing NULL current_sblock if
7447 running undumped.
7448
7449 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7450
7451 Cleanup basic buffer management.
7452 * buffer.h (struct buffer): Change layout to use generic vector
7453 marking code. Fix some comments. Change type of 'clip_changed'
7454 to bitfield. Remove unused #ifndef old.
7455 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7456 (GET_OVERLAYS_AT): Fix indentation.
7457 (for_each_per_buffer_object_at): New macro.
7458 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7459 (Fbuffer_local_variables): Use it.
7460 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7461 * alloc.c (allocate_buffer): Adjust to match new layout of
7462 struct buffer. Fix comment.
7463 (mark_overlay): New function.
7464 (mark_buffer): Use it. Use mark_vectorlike to mark normal
7465 Lisp area of struct buffer.
7466 (mark_object): Use it. Adjust marking of misc objects
7467 and related comments.
7468
7469 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
7470
7471 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7472 wrapper that is not needed because the wrapped code is a no-op (zero
7473 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7474 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7475
7476 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
7477
7478 * alloc.c (mark_buffer): Simplify. Remove prototype.
7479 (mark_object): Add comment. Reorganize marking of vector-like
7480 objects. Use CHECK_LIVE for all vector-like objects except buffers
7481 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7482 Avoid redundant calls to mark_vectorlike for bool vectors.
7483
7484 2012-06-30 Glenn Morris <rgm@gnu.org>
7485
7486 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7487
7488 * epaths.in (PATH_SITELOADSEARCH): New.
7489 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7490 This is rather than relying on --enable-locallisppath elements
7491 having "site-lisp" in their names. (Bug#10208#25, 11658)
7492
7493 2012-06-30 Eli Zaretskii <eliz@gnu.org>
7494
7495 * w32proc.c (sys_select): Accept and ignore one more argument.
7496
7497 * w32.c (emacs_gnutls_pull): Call select with one more argument.
7498
7499 * sysselect.h [DOS_NT]: Don't include sys/select.h.
7500 (pselect) [!MS_DOS]: Redirect to sys_select.
7501
7502 * sysdep.c: Don't include dos.h and dosfns.h.
7503
7504 * process.c (sys_select):
7505 * msdos.c (sys_select): Accept one more argument and ignore it.
7506
7507 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7508 adapt data types and code to that.
7509
7510 * dosfns.c:
7511 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7512 which clashes with the gnulib function of the same name.
7513
7514 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7515
7516 * font.c (font_style_to_value, font_style_symbolic)
7517 (font_prop_validate_style): Add type checks for values in
7518 font_style_table.
7519
7520 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7521 argument.
7522 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7523 uses.
7524
7525 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7526
7527 * xdisp.c (try_window_id): Undo last change.
7528
7529 * w32.c (getwd): Adjust commentary about startup_dir.
7530 (init_environment): Always call sys_access, even in non-MSVC
7531 builds. Don't chdir to the directory of the Emacs executable.
7532 This undoes code from 1997 which was justified by the need to
7533 "avoid conflicts when removing and renaming directories". But its
7534 downside was that every relative file name was being interpreted
7535 relative to the directory of the Emacs executable, which can never
7536 be TRT. In particular, it broke sys_access when called with
7537 relative file names.
7538 (sys_access): Map GetLastError to errno.
7539
7540 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7541
7542 * window.h (struct window): Change type of 'fringes_outside_margins'
7543 to bitfield. Fix comment. Adjust users accordingly.
7544 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7545 Adjust comment.
7546 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7547 to ptrdiff_t.
7548
7549 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
7550
7551 * gnutls.c (emacs_gnutls_handshake):
7552 Add QUIT to make the loop interruptible.
7553
7554 2012-06-29 Glenn Morris <rgm@gnu.org>
7555
7556 * charset.c (init_charset): Make lack of etc/charsets fatal.
7557
7558 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7559
7560 * editfns.c (region_limit): Fix type mismatch.
7561
7562 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7563
7564 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7565 undefined. Convert from xassert to eassert.
7566 * nsmenu.m: Convert from xassert to eassert.
7567 * nsterm.m: Likewise.
7568
7569 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7570
7571 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7572
7573 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7574
7575 Avoid integer overflow on scroll-left and scroll-right.
7576 * window.c (HSCROLL_MAX): New macro.
7577 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7578 overflow when requested scroll falls outside ptrdiff_t range.
7579
7580 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7581
7582 * window.h (struct window): Change type of 'hscroll',
7583 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7584 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7585 Adjust users accordingly.
7586 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7587 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7588 from EMACS_INT to ptrdiff_t.
7589 (make_window): Omit redundant initialization.
7590
7591 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
7592
7593 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7594
7595 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7596
7597 * window.h (struct window): Change type of 'use_time' and
7598 'sequence_number' from Lisp_Object to int.
7599 * frame.c (make_frame): Adjust users accordingly.
7600 * print.c (print_object): Likewise.
7601 * window.c (select_window, Fwindow_use_time, make_parent_window)
7602 (make_window): Likewise.
7603
7604 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7605
7606 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7607 enabled with --enable-checking=[all,glyphs] configure option.
7608 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7609 adjust comments accordingly.
7610 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7611 undefined, adjust comments accordingly.
7612 * image.c: Likewise.
7613 * scroll.c: Likewise.
7614 * w32fns.c: Likewise.
7615 * w32term.c: Likewise.
7616 * xdisp.c: Likewise.
7617 * xfaces.c: Likewise.
7618 * xfns.c: Likewise.
7619 * xterm.c: Likewise.
7620
7621 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7622
7623 Generalize run-time debugging checks.
7624 * dispextern.h (XASSERTS): Remove.
7625 * fontset.c (xassert): Remove.
7626 Convert from xassert to eassert.
7627 * alloc.c: Convert from xassert to eassert.
7628 * bidi.c: Likewise.
7629 * dispnew.c: Likewise.
7630 * fns.c: Likewise.
7631 * fringe.c: Likewise.
7632 * ftfont.c: Likewise.
7633 * gtkutil.c: Likewise.
7634 * image.c: Likewise.
7635 * keyboard.c: Likewise.
7636 * menu.c: Likewise.
7637 * process.c: Likewise.
7638 * scroll.c: Likewise.
7639 * sound.c: Likewise.
7640 * term.c: Likewise.
7641 * w32console.c: Likewise.
7642 * w32fns.c: Likewise.
7643 * w32term.c: Likewise.
7644 * window.c: Likewise.
7645 * xdisp.c: Likewise.
7646 * xfaces.c: Likewise.
7647 * xfns.c: Likewise.
7648 * xselect.c: Likewise.
7649 * xterm.c: Likewise.
7650
7651 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7652
7653 * fns.c (maybe_resize_hash_table): Output message when growing the
7654 purify-hashtable.
7655
7656 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7657
7658 * alloc.c (allocate_string_data): Remove dead code.
7659 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7660 avoid GCC warning about unused macro.
7661
7662 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7663
7664 * alloc.c (allocate_string): Omit intervals initialization.
7665 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7666 as in make_pure_string and make_pure_c_string.
7667
7668 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7669
7670 * alloc.c (allocate_string): Fix last change.
7671
7672 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7673
7674 * alloc.c (allocate_string): Remove two redundant calls
7675 to memset, add explicit initialization where appropriate.
7676
7677 2012-06-27 Glenn Morris <rgm@gnu.org>
7678
7679 * lisp.mk (lisp): Remove paths.elc.
7680
7681 2012-06-27 Chong Yidong <cyd@gnu.org>
7682
7683 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7684
7685 2012-06-26 John Wiegley <johnw@newartisans.com>
7686
7687 * unexmacosx.c (copy_data_segment): Add two section names used
7688 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7689
7690 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7691 when building with Clang.
7692
7693 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7694
7695 * eval.c (Fapply): Allow calling it with a single argument.
7696
7697 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7698
7699 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7700 _stricmp and _strnicmp.
7701 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7702
7703 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7704
7705 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7706 allocated window.
7707 (allocate_process): Likewise for new process.
7708 (allocate_terminal): Change to use offsetof.
7709 (allocate_frame): Likewise.
7710 * frame.c (make_frame): Omit redundant initialization.
7711 * window.c (make_parent_window): Use memset.
7712 (make_window): Omit redundant initialization.
7713 * process.c (make_process): Omit redundant initialization.
7714 * terminal.c (create_terminal): Likewise.
7715
7716 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7717
7718 * term.c (delete_tty): Remove redundant call to memset.
7719
7720 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7721
7722 * alloc.c: Remove build_string.
7723 * lisp.h: Define build_string as static inline. This provides
7724 a better opportunity to optimize away calls to strlen when the
7725 function is called with compile-time constant argument.
7726 * image.c (imagemagick_error): Convert to build_string.
7727 * w32proc.c (sys_spawnve): Likewise.
7728 * xterm.c (x_term_init): Likewise.
7729
7730 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7731
7732 Use sprintf return value instead of invoking strlen on result.
7733 In the old days this wasn't portable, since some sprintf
7734 implementations returned char *. But they died out years ago and
7735 Emacs already assumes sprintf returns int.
7736 Similarly for float_to_string.
7737 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7738 * ccl.c (ccl_driver):
7739 * character.c (string_escape_byte8):
7740 * data.c (Fnumber_to_string):
7741 * doprnt.c (doprnt):
7742 * print.c (print_object):
7743 * xdisp.c (message_dolog):
7744 * xfns.c (syms_of_xfns):
7745 Use sprintf or float_to_string result to avoid need to call strlen.
7746 * data.c (Fnumber_to_string):
7747 Use make_unibyte_string, since the string must be ASCII.
7748 * lisp.h, print.c (float_to_string): Now returns int length.
7749 * term.c (produce_glyphless_glyph):
7750 Use sprintf result rather than recomputing it.
7751
7752 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7753 * Makefile.in (ALL_CFLAGS):
7754 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7755 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7756
7757 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7758
7759 * dispextern.h (xstrcasecmp): Define to library function
7760 strcasecmp if available.
7761 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7762
7763 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7764
7765 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7766 Avoid comma operator.
7767 * menu.c (push_submenu_start, push_submenu_end)
7768 (push_left_right_boundary, push_menu_pane): Likewise.
7769 * msdos.c (dos_rawgetc): Likewise.
7770
7771 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7772
7773 * xfns.c (xic_create_fontsetname): Remove redundant calls
7774 to memset.
7775
7776 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7777
7778 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7779 sprintf already null-terminates its output.
7780
7781 * xfns.c (x_window): Remove redundant cast.
7782
7783 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7784
7785 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7786 `const char *' to `char *' to avoid compiler warning.
7787
7788 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7789
7790 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7791 instead of truncating it to 63 (admittedly a generous limit).
7792
7793 * process.c: Fix spelling and caps in comments.
7794
7795 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7796
7797 * emacs.c (setpgrp): Remove definition, unused.
7798 * sysdep.c (setpgrp): Remove definition, not used in this file.
7799
7800 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7801
7802 * makefile.w32-in: Update dependencies.
7803
7804 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7805
7806 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7807 (SYSTIME_H): Add nt/inc/sys/time.h.
7808
7809 * systime.h [WINDOWSNT]: Include sys/time.h.
7810
7811 * s/ms-w32.h (struct timespec): Definition moved from
7812 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7813
7814 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7815
7816 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7817 * buffer.h (buffer_slot_type_mismatch):
7818 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7819 * eval.c (unwind_to_catch):
7820 * image.c (my_png_error, my_error_exit):
7821 * keyboard.c (quit_throw_to_read_char, user_error)
7822 (Fexit_recursive_edit, Fabort_recursive_edit):
7823 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7824 (wrong_type_argument, buffer_overflow, __executable_start)
7825 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7826 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7827 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7828 (fatal):
7829 (child_setup) [!DOS_NT]:
7830 * lread.c (end_of_file_error, invalid_syntax):
7831 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7832 * puresize.h (pure_write_error):
7833 * search.c (matcher_overflow):
7834 * sound.c (sound_perror, alsa_sound_perror):
7835 * sysdep.c, syssignal.h (croak):
7836 * term.c (maybe_fatal, vfatal):
7837 * textprop.c (text_read_only):
7838 * undo.c (user_error):
7839 * unexmacosx.c (unexec_error):
7840 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7841 Use _Noreturn rather than NO_RETURN.
7842 No need for separate decl merely because of _Noreturn.
7843 * sound.c (sound_warning, parse_sound):
7844 Remove unnecessary forward decls.
7845
7846 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7847
7848 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7849 * lisp.h (WAIT_READING_MAX): New macro.
7850 * dispnew.c (Fsleep_for, sit_for):
7851 * keyboard.c (kbd_buffer_get_event):
7852 * process.c (Faccept_process_output):
7853 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7854 This improves on the previous patch, which introduced a bug
7855 when time_t is unsigned and as wide as intmax_t.
7856 See <http://bugs.gnu.org/9000#51>.
7857
7858 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7859
7860 * dispnew.c (sit_for, Fsleep_for):
7861 * keyboard.c (kbd_buffer_get_event):
7862 * process.c (Faccept_process_output): Avoid compiler warnings when
7863 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7864
7865 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7866
7867 * makefile.w32-in: Update dependencies.
7868
7869 * w32.c (ltime): Add return type and declare static.
7870 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7871
7872 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7873
7874 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7875 Privately reported by Herbert J. Skuhra.
7876 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7877 All uses changed.
7878 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7879 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7880
7881 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7882
7883 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7884 last argument of make_unibyte_string.
7885
7886 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7887 language ID in the event parameters.
7888
7889 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7890 event.code, not the obscure "character set ID".
7891
7892 2012-06-23 Chong Yidong <cyd@gnu.org>
7893
7894 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7895
7896 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7897
7898 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7899 * w32.c (fdutimens): New function.
7900
7901 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7902
7903 * s/ms-w32.h (pselect): Redirect to sys_select.
7904
7905 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7906
7907 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7908 in the logic of incrementing and decrementing the value of
7909 use_relocatable_buffers.
7910
7911 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7912
7913 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7914 Privately reported by Herbert J. Skuhra.
7915 [__FreeBSD__]: Remove "*/" typo after "#include".
7916 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7917 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7918 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7919 Don't assume EMACS_TIME and struct timeval are the same type.
7920
7921 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7922
7923 Support higher-resolution time stamps (Bug#9000).
7924 The time stamps are only nanosecond-resolution at the C level,
7925 since that's the best that any real-world system supports now.
7926 But they are picosecond-resolution at the Lisp level, as that's
7927 easy, and leaves room for future OS improvements.
7928
7929 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7930 (LIBES): Use it.
7931
7932 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7933 Don't get current time unless it's needed.
7934
7935 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7936 now provides it if it's absent.
7937 (start_atimer): Port to higher-res time stamps.
7938 Check for time stamp overflow. Don't get current time more
7939 often than is needed.
7940
7941 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7942 Include systime.h, not time.h.
7943 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7944
7945 * dired.c: Include stat-time.h.
7946 (Ffile-attributes): File times now have higher resolution.
7947
7948 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7949 (struct image): Timestamp now has higher resolution.
7950
7951 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7952 has at least microseconds now. All uses removed.
7953 (update_frame, update_single_window, update_window, update_frame_1)
7954 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7955 (duration_to_sec_usec): Remove; no longer needed.
7956
7957 * editfns.c (time_overflow): Now extern.
7958 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7959 (float-time, Fformat_time_string, Fcurrent_time_string)
7960 (Fcurrent_time_zone): Accept and generate higher-resolution
7961 time stamps.
7962 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7963 (decode_time_components, lisp_seconds_argument): New functions.
7964 (make_time): Now static.
7965 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7966 Report an error if the time is invalid, rather than having the caller
7967 do that.
7968
7969 * fileio.c: Include <stat-time.h>
7970 (Fcopy_file): Copy higher-resolution time stamps.
7971 Prefer to set the time stamp via a file descriptor if that works.
7972 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7973 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7974 (Fvisited_file_modtime, Fset_visited_file_modtime):
7975 Support higher-resolution time stamps.
7976
7977 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7978
7979 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7980
7981 * image.c (prepare_image_for_display, clear_image_cache)
7982 (lookup_image): Port to higer-resolution time stamps.
7983
7984 * keyboard.c (start_polling, bind_polling_period):
7985 Check for time stamp overflow.
7986 (read_char, kbd_buffer_get_event, timer_start_idle)
7987 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7988 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7989 Port to higher-resolution time stamps. Do not assume time_t is signed.
7990 (decode_timer): New function. Timers are now vectors of length 9,
7991 not 8, to accommodate the picosecond component.
7992 (timer_check_2): Use it.
7993
7994 * nsterm.m (select_timeout, timeval_subtract): Remove.
7995 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7996 as they're a bit more accurate and handle overflow better.
7997 (ns_select): Change prototype to be compatible with pselect.
7998 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7999 * nsterm.h (ns_select): Adjust prototype.
8000
8001 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8002 us-resolution time stamps.
8003 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8004
8005 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8006
8007 * lisp.h (time_overflow): New decl.
8008 (wait_reading_process_output): First arg is now intmax_t, not int,
8009 to accommodate larger waits.
8010
8011 * process.h (struct Lisp_Process.read_output_delay):
8012 Now counts nanoseconds, not microseconds.
8013 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8014 EMACS_HAS_USECS.
8015 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8016 (wait_reading_process_output):
8017 Port to ns-resolution time stamps.
8018 (Faccept_process_output, wait_reading_process_output):
8019 Check for time stamp overflow. Do not assume time_t is signed.
8020 (select_wrapper): Remove; we now use pselect.
8021 (Fprocess_attributes): Now generates ns-resolution time stamps.
8022
8023 * sysdep.c: Include utimens.h. Don't include utime.h
8024 or worry about struct utimbuf; gnulib does that for us now.
8025 (gettimeofday): Remove; gnulib provides a substitute.
8026 (make_timeval): New function.
8027 (set_file_times): Now sets ns-resolution time stamps.
8028 New arg FD; all uses changed.
8029 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8030 (system_process_attributes):
8031 Now returns ns-resolution time stamp. All uses changed.
8032 Check for time stamp overflow.
8033
8034 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8035 provides a substitute now.
8036
8037 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8038 since it guarantees struct timespec.
8039 (EMACS_TIME): Now struct timespec, so that we can support
8040 ns-resolution time stamps.
8041 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8042 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8043 (EMACS_USECS): Remove.
8044 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8045 so multiply the arg by 1000 before storing it.
8046 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8047 New macros.
8048 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8049 Port to ns-resolution time stamps.
8050 (EMACS_TIME_NEG_P): Remove; replaced by....
8051 (EMACS_TIME_SIGN): New macro.
8052 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8053 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8054 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8055 (make_timeval, make_lisp_time, decode_time_components): New decls.
8056 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
8057 that it mishandled time_t overflow. You can't compare by subtracting!
8058 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8059 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8060
8061 * term.c: Include <sys/time.h>.
8062 (timeval_to_Time): New function, for proper overflow wraparound.
8063 (term_mouse_position, term_mouse_click): Use it.
8064
8065 * undo.c (record_first_change): Support higher-resolution time stamps
8066 in the undo buffer.
8067 (Fprimitive_undo): Use them when restoring time stamps.
8068
8069 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8070 (w32_get_internal_run_time):
8071 Port to higher-resolution Emacs time stamps.
8072 (ltime): Now accepts single 64-bit integer, as that's more convenient
8073 for callers.
8074
8075 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8076
8077 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8078 for compatibility with pselect. Support ns-resolution time stamps.
8079
8080 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8081
8082 * xselect.c (wait_for_property_change, x_get_foreign_selection):
8083 Check for time stamp overflow, and support ns-resolution time stamps.
8084
8085 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8086 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8087 (timeval_subtract): Remove; no longer needed.
8088 (XTflash, XTring_bell, x_wait_for_event):
8089 Port to ns-resolution time stamps. Don't assume time_t is signed.
8090
8091 2012-06-22 Chong Yidong <cyd@gnu.org>
8092
8093 * xdisp.c (x_consider_frame_title): Revert last change.
8094
8095 2012-06-22 Eli Zaretskii <eliz@gnu.org>
8096
8097 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
8098 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8099 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
8100 staticidx goes up to 1597 out of 1600 = 0x640.)
8101
8102 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
8103
8104 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8105 Otherwise, the umask might be mistakenly 0 while handling input signals.
8106
8107 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
8108
8109 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8110
8111 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
8112
8113 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8114 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8115 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8116 access to `contents' member of Lisp_Vector objects with AREF and ASET
8117 where appropriate.
8118
8119 2012-06-19 Chong Yidong <cyd@gnu.org>
8120
8121 * frame.c (delete_frame): When selecting a frame on a different
8122 text terminal, do not alter the terminal's top-frame.
8123
8124 * xdisp.c (format_mode_line_unwind_data): Record the target
8125 frame's selected window and its terminal's top-frame.
8126 (unwind_format_mode_line): Restore them.
8127 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8128 Callers changed.
8129 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8130 since tty frames can be explicitly named.
8131 (prepare_menu_bars): Likewise.
8132
8133 * term.c (Ftty_top_frame): New function.
8134
8135 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8136
8137 Port byte-code-meter to modern targets.
8138 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8139 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8140 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
8141 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8142 (METER_1, METER_2): Simplify.
8143
8144 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
8145
8146 * data.c (Fdefalias): Return `symbol' (bug#11686).
8147
8148 2012-06-18 Martin Rudalics <rudalics@gmx.at>
8149
8150 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
8151 gets killed during executing of this function (Bug#11665).
8152 Try to always return Qt when the buffer has been actually killed.
8153 (Vkill_buffer_query_functions): In doc-string say that functions
8154 run by this hook should not change the current buffer.
8155
8156 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8157
8158 Fix recently-introduced process.c problems found by static checking.
8159 * process.c (write_queue_push, write_queue_pop, send_process):
8160 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8161 (write_queue_pop): Fix pointer signedness problem.
8162 (send_process): Remove unused local.
8163
8164 2012-06-17 Chong Yidong <cyd@gnu.org>
8165
8166 * xdisp.c (redisplay_internal): No need to redisplay terminal
8167 frames that are not on top.
8168
8169 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
8170
8171 * process.c (make_process): Initialize write_queue.
8172 (write_queue_push, write_queue_pop): New functions.
8173 (send_process): Use them to maintain correct ordering of process
8174 writes (Bug#10815).
8175
8176 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
8177
8178 * lisp.h (eassert): Assume C89 or later.
8179 This removes the need for CHECK.
8180 (CHECK): Remove. Its comments about always evaluating its
8181 argument were confusing, as 'eassert' typically does not evaluate
8182 its argument.
8183
8184 * coding.c (produce_chars): Use ptrdiff_t, not int.
8185
8186 * xterm.c (x_draw_underwave): Check for integer overflow.
8187 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8188
8189 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
8190
8191 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8192 referenced (Bug#11583).
8193
8194 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
8195
8196 Implement wave-style variant of underlining.
8197 * dispextern.h (face_underline_type): New enum.
8198 (face): Add field for underline type.
8199 * nsterm.m (ns_draw_underwave): New function.
8200 (ns_draw_text_decoration): Use it.
8201 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
8202 New functions.
8203 (x_draw_glyph_string): Use them.
8204 * xfaces.c (Qline, Qwave): New Lisp objects.
8205 (check_lface_attrs, merge_face_ref)
8206 (Finternal_set_lisp_face_attribute, realize_x_face):
8207 Handle wave-style underline face attributes.
8208 * xterm.c (x_draw_underwave): New function.
8209 (x_draw_glyph_string): Use it.
8210
8211 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
8212
8213 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
8214 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
8215 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
8216 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
8217 ($(BLD)/w32select.$(O)): Update dependencies.
8218
8219 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8220
8221 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
8222 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
8223 * character.c (_fetch_multibyte_char_p): Remove.
8224 * alloc.c: Include "character.h" before "buffer.h".
8225 * bidi.c: Likewise.
8226 * buffer.c: Likewise.
8227 * bytecode.c: Likewise.
8228 * callint.c: Likewise.
8229 * callproc.c: Likewise.
8230 * casefiddle.c: Likewise.
8231 * casetab.c: Likewise.
8232 * category.c: Likewise.
8233 * cmds.c: Likewise.
8234 * coding.c: Likewise.
8235 * composite.c: Likewise.
8236 * dired.c: Likewise.
8237 * dispnew.c: Likewise.
8238 * doc.c: Likewise.
8239 * dosfns.c: Likewise.
8240 * editfns.c: Likewise.
8241 * emacs.c: Likewise.
8242 * fileio.c: Likewise.
8243 * filelock.c: Likewise.
8244 * font.c: Likewise.
8245 * fontset.c: Likewise.
8246 * fringe.c: Likewise.
8247 * indent.c: Likewise.
8248 * insdel.c: Likewise.
8249 * intervals.c: Likewise.
8250 * keyboard.c: Likewise.
8251 * keymap.c: Likewise.
8252 * lread.c: Likewise.
8253 * macros.c: Likewise.
8254 * marker.c: Likewise.
8255 * minibuf.c: Likewise.
8256 * nsfns.m: Likewise.
8257 * nsmenu.m: Likewise.
8258 * print.c: Likewise.
8259 * process.c: Likewise.
8260 * regex.c: Likewise.
8261 * region-cache.c: Likewise.
8262 * search.c: Likewise.
8263 * syntax.c: Likewise.
8264 * term.c: Likewise.
8265 * textprop.c: Likewise.
8266 * undo.c: Likewise.
8267 * unexsol.c: Likewise.
8268 * w16select.c: Likewise.
8269 * w32fns.c: Likewise.
8270 * w32menu.c: Likewise.
8271 * window.c: Likewise.
8272 * xdisp.c: Likewise.
8273 * xfns.c: Likewise.
8274 * xmenu.c: Likewise.
8275 * xml.c: Likewise.
8276 * xselect.c: Likewise.
8277
8278 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8279
8280 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
8281 If all the glyphs of the glyph row came from strings, and we have no
8282 cursor positioning clues, put the cursor on the first glyph of the
8283 row.
8284 (handle_face_prop): Use chunk-relative overlay string index when
8285 indexing into it->string_overlays array. (Bug#11653)
8286 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
8287 the rightmost. (Bug#11720)
8288
8289 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8290
8291 * category.h (CHAR_HAS_CATEGORY): Define as inline.
8292 (CATEGORY_MEMBER): Enforce 1/0 value.
8293 * category.c (_temp_category_set): Remove.
8294
8295 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8296
8297 * window.c (Fdelete_other_windows_internal)
8298 (Fdelete_window_internal): Don't access frame's mouse highlight
8299 info of the initial frame. (Bug#11677)
8300
8301 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
8302
8303 * .gdbinit (xgetint): Fix recently-introduced paren typo.
8304 Assume USE_2_TAGS_FOR_INTS.
8305 (xreload): Adjust $tagmask width to match recent lisp.h change.
8306
8307 Simplify lisp.h in minor ways that should not affect code.
8308 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
8309 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
8310 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
8311 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
8312 (INTTYPEBITS): New macro, for clarity.
8313 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
8314 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
8315 Simplify now that USE_LSB_TAG is always defined.
8316 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
8317 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
8318
8319 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
8320
8321 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
8322
8323 2012-06-13 Glenn Morris <rgm@gnu.org>
8324
8325 * s/bsd-common.h (BSD4_3):
8326 * s/usg5-4-common.h (USG5_4): No longer define; unused.
8327
8328 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
8329
8330 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
8331 instead of union.
8332 (XLI, XIL): Define.
8333 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
8334 Use them.
8335 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
8336 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
8337 * alloc.c (widen_to_Lisp_Object): Remove.
8338 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
8339 * frame.c (delete_frame): Remove outdated comment.
8340 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
8341 USE_LISP_UNION_TYPE.
8342 (Fw32_unregister_hot_key): Likewise.
8343 (Fw32_toggle_lock_key): Likewise.
8344 * w32menu.c (add_menu_item): Likewise.
8345 (w32_menu_display_help): Use XIL instead of checking
8346 USE_LISP_UNION_TYPE.
8347 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
8348 (init_heap): Likewise.
8349 * w32term.c (w32_read_socket): Update comment.
8350
8351 2012-06-13 Glenn Morris <rgm@gnu.org>
8352
8353 * s/usg5-4-common.h, src/s/unixware.h:
8354 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8355
8356 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8357
8358 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
8359
8360 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8361 * alloc.c (make_number) [!defined make_number]:
8362 Remove, as lisp.h always defines this now.
8363 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8364 (roundup_size): Verify that it is a power of 2.
8365 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8366 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8367 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8368 -DUSE_LSB_TAG=0, to override the automatically-selected default.
8369 USE_LSB_TAG now is always defined to be either 0 or 1.
8370 All uses changed.
8371 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8372 code works fine either way, and efficiency is not a concern here,
8373 as the union type is for debugging, not for production.
8374 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8375 Use an inline function on all platforms when using the union type,
8376 since this is simpler and 'static inline' can be used portably
8377 within Emacs now.
8378 (LISP_INITIALLY_ZERO): New macro.
8379 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8380 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8381
8382 2012-06-12 Glenn Morris <rgm@gnu.org>
8383
8384 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8385
8386 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8387
8388 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8389 Move BROKEN_SIGIO to configure.
8390
8391 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8392 Move NO_TERMIO to configure.
8393
8394 2012-06-12 Chong Yidong <cyd@gnu.org>
8395
8396 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8397 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8398 MagickExportImagePixels is undefined.
8399
8400 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8401
8402 * image.c (imagemagick_load_image): Remove unused label.
8403
8404 2012-06-11 Glenn Morris <rgm@gnu.org>
8405
8406 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8407 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8408 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8409 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8410
8411 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8412
8413 * alloc.c (make_byte_code): New function.
8414 (Fmake_byte_code): Use it. Don't purify here.
8415 * lread.c (read1): Use it as well to avoid extra allocation.
8416
8417 2012-06-11 Chong Yidong <cyd@gnu.org>
8418
8419 * image.c (imagemagick_load_image): Implement transparency.
8420
8421 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8422
8423 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8424 account for preceding backslashes. (Bug#11663)
8425
8426 2012-06-09 Chong Yidong <cyd@gnu.org>
8427
8428 * term.c: Support italics in capable terminals (Bug#9652).
8429 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8430 (turn_on_face): Output using TS_enter_italic_mode if available.
8431 Don't handle unused blinking and alt-charset cases.
8432 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8433 and tty_alt_charset_p cases.
8434 (tty_capable_p, init_tty): Support italics.
8435
8436 * termchar.h (struct tty_display_info): Add field for italics.
8437 Remove unused blink field.
8438
8439 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8440 Handle slant.
8441
8442 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8443 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8444 tty_alt_charset_p. Add tty_italic_p.
8445
8446 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
8447
8448 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8449 dbus_type_is_basic if available.
8450 (xd_extract_signed, xd_extract_unsigned): Rename from
8451 extract_signed and extract_unsigned, respectively. Adapt callers.
8452
8453 2012-06-09 Chong Yidong <cyd@gnu.org>
8454
8455 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8456
8457 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8458 case (Bug#9752).
8459
8460 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
8461
8462 * xdisp.c (vmessage): Treat frame message as multibyte.
8463 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8464 would generate the diagnostic "Making \302\247 buffer-local while
8465 let-bound!".
8466
8467 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8468
8469 * dispnew.c (showing_window_margins_p): Undo last change, which
8470 was done due to an inadvertent commit.
8471 (adjust_frame_glyphs_for_frame_redisplay): Do call
8472 showing_window_margins_p.
8473
8474 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8475
8476 * eval.c (Fmake_var_non_special): New primitive.
8477 (syms_of_eval): Defsubr it.
8478 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8479
8480 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
8481
8482 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8483 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8484
8485 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8486
8487 * alloc.c (allocate_vectorlike): Fix last change.
8488
8489 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
8490
8491 Block-based vector allocation of small vectors.
8492 * lisp.h (struct vectorlike_header): New field `nbytes',
8493 adjust comment accordingly.
8494 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8495 to denote vector blocks. Adjust users (live_vector_p,
8496 mark_maybe_pointer, valid_lisp_object_p) accordingly.
8497 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8498 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8499 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8500 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8501 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8502 (roundup_size): New constant.
8503 (struct vector_block): New data type.
8504 (vector_blocks, vector_free_lists, zero_vector): New variables.
8505 (all_vectors): Rename to `large_vectors'.
8506 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8507 (sweep_vectors): New functions.
8508 (allocate_vectorlike): Return `zero_vector' as the only vector of
8509 0 items. Allocate new vector from block if vector size is less than
8510 or equal to VBLOCK_BYTES_MAX.
8511 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8512 (init_alloc_once): Add call to init_vectors.
8513
8514 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8515
8516 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8517
8518 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8519
8520 * doprnt.c (doprnt): Truncate multibyte char correctly.
8521 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8522 would mishandle a string argument "Xc" if X was a multibyte
8523 character of length 2: it would truncate after X's first byte
8524 rather than including all of X.
8525
8526 2012-06-06 Chong Yidong <cyd@gnu.org>
8527
8528 * buffer.c (word_wrap): Doc fix.
8529
8530 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8531
8532 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8533
8534 2012-06-03 Glenn Morris <rgm@gnu.org>
8535
8536 * xdisp.c (tool-bar-style): Doc fix.
8537
8538 2012-06-03 Ulrich Müller <ulm@gentoo.org>
8539
8540 * Makefile.in (PAXCTL): Define.
8541 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8542 binary via PaX flags if the paxctl utility is available.
8543 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8544 Restore PaX flags to their default. (Bug#11398)
8545
8546 2012-06-03 Chong Yidong <cyd@gnu.org>
8547
8548 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8549 buffer (Bug#11226).
8550
8551 2012-06-03 Chong Yidong <cyd@gnu.org>
8552
8553 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8554 (note_mode_line_or_margin_highlight): If there is no help echo,
8555 use mode-line-default-help-echo. Handle the case where the mouse
8556 position is past the end of the mode line string.
8557
8558 * buffer.c (buffer_local_value_1): New function, split from
8559 Fbuffer_local_value; can return Qunbound.
8560 (Fbuffer_local_value): Use it.
8561 (Vmode_line_format): Docstring tweaks.
8562
8563 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8564
8565 * sysdep.c (system_process_attributes): Improve comment.
8566
8567 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8568
8569 * keyboard.c: Export real-this-command to Elisp.
8570 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8571 and DEFVAR it. Update all users.
8572
8573 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8574
8575 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8576
8577 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8578 Convert pctcpu and pctmem to Lisp float properly.
8579 Let the compiler fold better, as 100.0/0x8000 is exact.
8580
8581 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8582
8583 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8584 cons_block.
8585
8586 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8587
8588 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8589
8590 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8591
8592 For a 'struct window', replace some Lisp_Object fields to
8593 bitfields where appropriate, remove unused fields.
8594 * window.h (struct window): Remove unused 'last_mark_x' and
8595 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
8596 change its type from Lisp_Object to bitfield.
8597 Change type of 'force_start', 'optional_new_start',
8598 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8599 fields from Lisp_Object to bitfield. Adjust users accordingly.
8600
8601 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8602
8603 Pacify gcc -Wdouble-precision when using Xaw.
8604 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8605 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8606 Use 'float' consistently, rather than 'float' in most places
8607 and 'double' in a couple of places.
8608
8609 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8610
8611 * xdisp.c (handle_stop): Detect whether we have overlay strings
8612 loaded by testing it->current.overlay_string_index to be
8613 non-negative, instead of checking whether n_overlay_strings is
8614 positive. (Bug#11587)
8615
8616 2012-05-31 Chong Yidong <cyd@gnu.org>
8617
8618 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8619
8620 * doc.c (Fsubstitute_command_keys): Doc fix.
8621
8622 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8623
8624 * search.c (search_buffer): Remove calls to
8625 r_alloc_inhibit_buffer_relocation, as it is now called by
8626 maybe_unify_char, which was the cause of relocation of buffer text
8627 in bug#11519.
8628
8629 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8630
8631 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8632 for the duration of call to load_charset, to avoid problems with
8633 callers of maybe_unify_char that access buffer text through C
8634 pointers.
8635
8636 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8637 decrement the inhibition flag, instead of just setting or
8638 resetting it.
8639
8640 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8641
8642 Remove obsolete '#define static' cruft.
8643 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8644 This #undef was "temporary" in 2000; it is no longer needed
8645 now that '#define static' has gone away.
8646 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8647 (gray_bitmap_bits): Remove; no longer needed.
8648 All uses replaced with definiens.
8649 * xterm.c: Include "bitmaps/gray.xbm".
8650
8651 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8652
8653 Clean up __executable_start, monstartup when --enable-profiling.
8654 The following changes affect the code only when profiling.
8655 * dispnew.c (__executable_start): Rename from safe_bcopy.
8656 Define only on platforms that need it.
8657 * emacs.c: Include <sys/gmon.h> when profiling.
8658 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8659 (__executable_start): Remove decl, since lisp.h does it now.
8660 (safe_bcopy): Remove decl; no longer has that name.
8661 (main): Coalesce #if into single bit of code, for simplicity.
8662 Cast pointers to uintptr_t, since standard libraries want integers
8663 and not pointers.
8664 * lisp.h (__executable_start): New decl.
8665
8666 2012-05-31 Glenn Morris <rgm@gnu.org>
8667
8668 * image.c (Fimagemagick_types): Doc fix.
8669
8670 2012-05-30 Jim Meyering <meyering@redhat.com>
8671
8672 * callproc.c (Fcall_process_region): Include directory component
8673 in mkstemp error message (Bug#11586).
8674
8675 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8676
8677 * alloc.c, lisp.h (make_pure_vector): Now static.
8678
8679 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8680
8681 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8682 Move to byte-run.el.
8683 (Fautoload): Do the hash-doc more carefully.
8684 * data.c (Fdefalias): Purify definition, except for keymaps.
8685 (Qdefun): Move from eval.c.
8686 * lisp.h (Qdefun): Remove.
8687 * lread.c (read1): Tiny simplification.
8688
8689 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8690
8691 Do not create empty overlays with the evaporate property (Bug#9642).
8692 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8693 Bug#9642, but explicitly check that the buffer the overlay would
8694 be moved to is live and rearrange lines to make sure that errors
8695 will not put the overlay in an inconsistent state.
8696 (Fdelete_overlay): Cosmetics.
8697
8698 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8699
8700 * w32term.c (my_bring_window_to_top): New function.
8701 (x_raise_frame): Use handle returned by DeferWindowPos, which
8702 could be different from the original one.
8703 Call my_bring_window_to_top instead of my_set_foreground_window.
8704 (Bug#11513)
8705
8706 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8707 by calling BringWindowToTop.
8708
8709 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8710 (WM_EMACS_END): Increase by one.
8711
8712 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8713
8714 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8715 This avoids undefined behavior that might cause the eassert
8716 to not catch an out-of-range value.
8717
8718 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8719
8720 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8721 Update dependencies.
8722
8723 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8724
8725 * bidi.c (bidi_mirror_char): Fix last change.
8726
8727 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8728
8729 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8730 when referring to sectname field in printf format.
8731
8732 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8733
8734 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8735 Only r_alloc_inhibit_buffer_relocation needed to be added;
8736 the others were already declared.
8737
8738 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8739 before checking whether it's out of range. Put the check inside
8740 eassert. See
8741 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8742
8743 2012-05-27 Ken Brown <kbrown@cornell.edu>
8744
8745 * callproc.c (Fcall_process): Restore a line that was accidentally
8746 commented out in the 2011-02-13 change (bug#11547).
8747
8748 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8749
8750 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8751 defined on ralloc.c.
8752
8753 * buffer.c [REL_ALLOC]: Remove prototypes of
8754 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8755 they are now on lisp.h.
8756
8757 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8758
8759 * search.c (search_buffer): Use it to inhibit relocation of buffer
8760 text while re_search_2 is doing its job, because re_search_2 is
8761 passed C pointers to buffer text. (Bug#11519)
8762
8763 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8764 Update value to 24.
8765
8766 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8767 state after an additional call to move_it_in_display_line_to, keep
8768 the values of it->max_ascent and it->max_descent found for the
8769 entire line.
8770 (pos_visible_p): Revert the comparison against bottom_y to what it
8771 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8772 (Bug#11464)
8773
8774 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8775
8776 Fix coding-related core dumps with gcc -ftrapv.
8777 The code was computing A - B, where A and B are pointers, and B is
8778 random garbage. This can lead to core dumps on platforms that
8779 have special pointer registers, and it also leads to core dumps on
8780 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8781 A - B only when B is initialized properly.
8782 * coding.c (coding_set_source, coding_set_destination): Return void.
8783 (coding_change_source, coding_change_destinations): New functions,
8784 with the old behaviors of coding_set_source and coding_set_destination.
8785 All callers that need an offset changed to use these new functions.
8786
8787 2012-05-26 Glenn Morris <rgm@gnu.org>
8788
8789 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8790
8791 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8792
8793 Extend mouse support on W32 text-mode console.
8794 * xdisp.c (draw_row_with_mouse_face):
8795 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8796
8797 * w32console.c: Include window.h.
8798 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8799 New functions.
8800 (initialize_w32_display): Initialize mouse-highlight data.
8801
8802 * w32inevt.c: Include termchar.h and window.h.
8803 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8804 moves, call note_mouse_highlight. If help_echo changed, call
8805 gen_help_event to produce help-echo message in the echo area.
8806 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8807 highlight info.
8808
8809 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8810
8811 * lread.c (read1): Simplify slightly to avoid an overflow warning
8812 with GCC 4.7.0 on x86-64.
8813
8814 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8815
8816 * bidi.c (bidi_mirror_char): Revert last change: an int is
8817 definitely wide enough here.
8818
8819 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8820
8821 Fix integer width and related bugs (Bug#9874).
8822 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8823 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8824 (string_bytes, check_sblock, allocate_string_data):
8825 (compact_small_strings, Fmake_bool_vector, make_string)
8826 (make_unibyte_string, make_multibyte_string)
8827 (make_string_from_bytes, make_specified_string)
8828 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8829 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8830 (mark_vectorlike):
8831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8832 (allocate_pseudovector):
8833 Use int, not EMACS_INT, where int is wide enough.
8834 (inhibit_garbage_collection, Fgarbage_collect):
8835 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8836 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8837 int might not be wide enough.
8838 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8839 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8840 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8841 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8842 (bidi_level_of_next_char, bidi_move_to_visually_next):
8843 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8844 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8845 (Fkill_buffer, Fset_buffer_major_mode)
8846 (advance_to_char_boundary, Fbuffer_swap_text)
8847 (Fset_buffer_multibyte, overlays_at, overlays_in)
8848 (overlay_touches_p, struct sortvec, record_overlay_string)
8849 (overlay_strings, recenter_overlay_lists)
8850 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8851 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8852 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8853 (Foverlay_recenter, last_overlay_modification_hooks_used)
8854 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8856 (validate_region): Omit unnecessary test for b <= e,
8857 since that's guaranteed by the previous test.
8858 (adjust_overlays_for_delete): Avoid pos + length overflow.
8859 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8860 (report_overlay_modification):
8861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8862 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8863 Omit pointer cast, which isn't needed anyway, and doesn't work
8864 after the EMACS_INT -> ptrdiff_t change.
8865 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8866 * buffer.h: Adjust decls to match defn changes elsewhere.
8867 (struct buffer_text, struct buffer):
8868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8869 Use EMACS_INT, not int, where int might not be wide enough.
8870 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8871 not int, to avoid needless 32-bit limit on 64-bit hosts.
8872 (exec_byte_code): Use tighter memory-full test, one that checks
8873 for alloca overflow. Don't compute the address of the object just
8874 before an array, as that's not portable. Use EMACS_INT, not
8875 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8876 * callint.c (Fcall_interactively):
8877 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8878 * callproc.c (call_process_kill, Fcall_process):
8879 Don't assume pid_t fits into an Emacs fixnum.
8880 (call_process_cleanup, Fcall_process, child_setup):
8881 Don't assume pid_t fits into int.
8882 (call_process_cleanup, Fcall_process, delete_temp_file)
8883 (Fcall_process_region):
8884 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8885 (Fcall_process): Simplify handling of volatile integers.
8886 Use int, not EMACS_INT, where int will do.
8887 * casefiddle.c (casify_object, casify_region, operate_on_word)
8888 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8889 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8890 (casify_object): Avoid integer overflow when overallocating buffer.
8891 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8892 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8893 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8894 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8895 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8896 integers are now checked earlier. All uses replaced with XINT.
8897 (ccl_driver):
8898 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8899 For CCL_MapSingle, check that content and value are in int range.
8900 (ccl_driver, Fregister_code_conversion_map):
8901 Check that Vcode_version_map_vector is a vector.
8902 (resolve_symbol_ccl_program): Check that vector header is in range.
8903 Always copy the vector, so that we can check its contents reliably
8904 now rather than having to recheck each instruction as it's being
8905 executed. Check that vector words fit in 'int'.
8906 (ccl_get_compiled_code, Fregister_ccl_program)
8907 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8908 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8909 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8910 contents are in range.
8911 (Fccl_execute_on_string): Check that status is in range.
8912 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8913 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8914 Accept and return EMACS_INT, not int, because callers can pass values
8915 out of 'int' range.
8916 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8917 (multibyte_chars_in_text, parse_str_as_multibyte)
8918 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8919 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8920 (string_escape_byte8, Fget_byte):
8921 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8922 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8923 avoid mishandling large integers.
8924 * character.h: Adjust decls to match defn changes elsewhere.
8925 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8926 (Ffind_charset_region):
8927 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8928 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8929 (load_charset_map_from_vector, Fdefine_charset_internal):
8930 Don't assume fixnum fits in int.
8931 (load_charset_map_from_vector, Fmap_charset_chars):
8932 Remove now-unnecessary CHECK_NATNUMs.
8933 (Fdefine_charset_internal): Check ranges here, more carefully.
8934 Don't rely on undefined behavior with signed left shift overflow.
8935 Don't assume unsigned int fits into fixnum, or that fixnum fits
8936 into unsigned int. Don't require max_code to be a valid fixnum;
8937 that's not true for gb10830 4-byte on a 32-bit host. Allow
8938 invalid_code to be a cons, for the same reason. Require code_offset
8939 to be a character. Avoid int overflow if max_char is close
8940 to INT_MAX.
8941 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8942 this is intended anyway and avoids some undefined behavior.
8943 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8944 INDEX_TO_CODE_POINT, as that's what it expects.
8945 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8946 * charset.h (DECODE_CHAR): Return int, not unsigned;
8947 this is what was intended anyway, and it avoids undefined behavior.
8948 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8949 integer-overflow issues.
8950 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8951 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8952 where the argument is EMACS_INT, and this behavior is not intended.
8953 * chartab.c (Fmake_char_table, Fset_char_table_range)
8954 (uniprop_get_decoder, uniprop_get_encoder):
8955 Don't assume fixnum fits in int.
8956 * cmds.c (move_point): New function, that does the gist of
8957 Fforward_char and Fbackward_char, but does so while checking
8958 for integer overflow more accurately.
8959 (Fforward_char, Fbackward_char): Use it.
8960 (Fforward_line, Fend_of_line, internal_self_insert)
8961 (internal_self_insert):
8962 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8963 Fix a FIXME, by checking for integer overflow when calculating
8964 target_clm and actual_clm.
8965 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8966 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8967 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8968 (coding_alloc_by_making_gap, alloc_destination)
8969 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8970 (encode_coding_utf_16, detect_coding_emacs_mule)
8971 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8972 (detect_coding_iso_2022, decode_coding_iso_2022)
8973 (encode_invocation_designation, encode_designation_at_bol)
8974 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8975 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8976 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8977 (encode_coding_ccl, encode_coding_raw_text)
8978 (detect_coding_charset, decode_coding_charset)
8979 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8980 (produce_composition, produce_charset, produce_annotation)
8981 (decode_coding, handle_composition_annotation)
8982 (handle_charset_annotation, consume_chars, decode_coding_gap)
8983 (decode_coding_object, encode_coding_object, detect_coding_system)
8984 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8985 (code_convert_region, code_convert_string)
8986 (Fdefine_coding_system_internal)
8987 (coding_set_source, coding_set_destination):
8988 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8989 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8990 (Fdefine_coding_system_internal):
8991 Don't assume fixnums fit in int.
8992 (decode_coding_gap, decode_coding_object, encode_coding_object)
8993 (Fread_coding_system, Fdetect_coding_region)
8994 (Funencodable_char_position, Fcheck_coding_systems_region)
8995 (get_translation, handle_composition_annotation, consume_chars):
8996 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8997 (consume_chars): Rewrite to not calculate an address outside buffer.
8998 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8999 Don't access memory outside of the args array.
9000 (Fdefine_coding_system_internal): Check for charset-id overflow.
9001 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9002 result of ENCODE_CHAR.
9003 * coding.h: Adjust decls to match defn changes elsewhere.
9004 (struct coding_system):
9005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9006 * composite.c (get_composition_id, find_composition)
9007 (run_composition_function, update_compositions)
9008 (compose_text, composition_gstring_put_cache)
9009 (composition_gstring_p, composition_gstring_width)
9010 (fill_gstring_header, fill_gstring_body, autocmp_chars)
9011 (composition_compute_stop_pos, composition_reseat_it)
9012 (composition_update_it, struct position_record)
9013 (find_automatic_composition, composition_adjust_point)
9014 (Fcomposition_get_gstring, Ffind_composition_internal):
9015 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9016 (update_compositions):
9017 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9018 * composite.h: Adjust decls to match defn changes elsewhere.
9019 (struct composition):
9020 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9021 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9022 Do not attempt to compute the address of the object just before a
9023 buffer; this is not portable.
9024 (Faref, Faset):
9025 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9026 (Faset): Use int, not EMACS_INT, where int is wide enough.
9027 (Fstring_to_number): Don't assume fixnums fit in int.
9028 (Frem): Don't assume arg is nonnegative.
9029 * dbusbind.c (xd_append_arg): Check for integers out of range.
9030 (Fdbus_call_method): Don't overflow the timeout int.
9031 (extract_signed, extract_unsigned): New functions.
9032 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9033 (xd_get_connection_references): Return ptrdiff_t, not int.
9034 All uses changed.
9035 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9036 (xd_read_message_1):
9037 Use int, not unsigned, where the dbus API uses int.
9038 (Fdbus_message_internal): Don't overflow mtype.
9039 (syms_of_dbusbind): Allocate right-sized buffer for integers.
9040 * dired.c (directory_files_internal, file_name_completion, scmp)
9041 (file_name_completion_stat):
9042 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9043 (file_name_completion): Don't overflow matchcount.
9044 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9045 * dispextern.h: Adjust decls to match defn changes elsewhere.
9046 (struct text_pos, struct glyph, struct bidi_saved_info)
9047 (struct bidi_string_data, struct bidi_it, struct composition_it)
9048 (struct it):
9049 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9050 (struct display_pos, struct composition_it, struct it):
9051 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9052 * dispnew.c (increment_matrix_positions)
9053 (increment_row_positions, mode_line_string)
9054 (marginal_area_string):
9055 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9056 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9057 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9058 (duration_to_sec_usec): New function, to check for overflow better.
9059 (Fsleep_for, sit_for): Use it.
9060 * doc.c (get_doc_string, store_function_docstring):
9061 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9062 (get_doc_string, Fsnarf_documentation):
9063 Use int, not EMACS_INT, where int is wide enough.
9064 (get_doc_string):
9065 Use SAFE_ALLOCA, not alloca.
9066 Check for overflow when converting EMACS_INT to off_t.
9067 * doprnt.c (doprnt):
9068 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9069 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9070 Don't assume uid_t fits into fixnum.
9071 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9072 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9073 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9074 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9075 (general_insert_function)
9076 (Finsert_char, make_buffer_string, make_buffer_string_both)
9077 (update_buffer_properties, Fbuffer_substring)
9078 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9079 (Fsubst_char_in_region, check_translation)
9080 (Ftranslate_region_internal, save_restriction_restore, Fformat)
9081 (transpose_markers, Ftranspose_regions):
9082 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9083 (clip_to_bounds): Move to lisp.h as an inline function).
9084 (Fconstrain_to_field): Don't assume integers are nonnegative.
9085 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9086 (Fsubst_char_in_region, Fsave_restriction):
9087 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9088 (Femacs_pid): Don't assume pid_t fits into fixnum.
9089 (lo_time): Use int, not EMACS_INT, when int suffices.
9090 (lisp_time_argument): Check for usec out of range.
9091 (Fencode_time): Don't assume fixnum fits in int.
9092 (Fuser_login_name, Fuser_full_name): Signal an error
9093 if a uid argument is out of range, rather than relying on
9094 undefined behavior.
9095 (Fformat_time_string): Remove now-unnecessary check.
9096 lisp_time_argument checks for out-of-range usec now.
9097 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9098 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9099 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9100 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9101 (init_cmdargs, Fdump_emacs):
9102 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9103 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9104 the bottom (typically) 32 bits of the fixnum.
9105 * eval.c (specpdl_size, call_debugger):
9106 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9107 (when_entered_debugger, Fbacktrace_debug):
9108 Don't assume fixnum can fit in int.
9109 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9110 the object just before a buffer; this is not portable.
9111 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9112 (grow_specpdl, unbind_to):
9113 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9114 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9115 (grow_specpdl): Simplify allocation by using xpalloc.
9116 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
9117 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9118 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9119 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9120 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9121 (a_write, e_write):
9122 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9123 (Fcopy_file, non_regular_nbytes, read_non_regular)
9124 (Finsert_file_contents):
9125 Use int, not EMACS_INT, where int is wide enough.
9126 (READ_BUF_SIZE): Verify that it fits in int.
9127 (Finsert_file_contents): Check that counts are in proper range,
9128 rather than assuming fixnums fit into ptrdiff_t etc.
9129 Don't assume fixnums fit into int.
9130 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
9131 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9132 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
9133 (string_char_to_byte, string_byte_to_char)
9134 (string_make_multibyte, string_to_multibyte)
9135 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9136 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9137 (substring_both, Fdelete, internal_equal, Ffillarray)
9138 (Fclear_string, mapcar1)
9139 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9140 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9141 (larger_vector, make_hash_table, maybe_resize_hash_table)
9142 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9143 (Fmaphash, secure_hash):
9144 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9145 (concat): Check for string index and length overflow.
9146 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9147 (Frequire):
9148 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9149 (larger_vector): New API (vec, incr_min, size_max) replaces old
9150 one (vec, new_size, init). This catches size overflow.
9151 INIT was removed because it was always Qnil.
9152 All callers changed.
9153 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9154 the upper bound on a hash table index size.
9155 (make_hash_table, maybe_resize_hash_table): Use it.
9156 (secure_hash): Computer start_byte and end_byte only after
9157 they're known to be in ptrdiff_t range.
9158 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9159 (Ffont_get_glyphs, Ffont_at):
9160 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9161 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9162 (Flist_fonts, Fopen_font):
9163 Don't assume fixnum can fit in int.
9164 (check_gstring): Don't assume index can fit in int.
9165 (font_match_p): Check that fixnum is a character, not a nonnegative
9166 fixnum, since the later code needs to stuff it into an int.
9167 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9168 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9169 conversion overflow issues.
9170 (Fopen_font): Check for integer out of range.
9171 (Ffont_get_glyphs): Don't assume index can fit in int.
9172 * font.h: Adjust decls to match defn changes elsewhere.
9173 * fontset.c (reorder_font_vector): Redo score calculation to avoid
9174 integer overflow.
9175 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9176 printmax_t, where ptrdiff_t is wide enough.
9177 (Finternal_char_font):
9178 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9179 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9180 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9181 (Fset_frame_position, x_set_frame_parameters)
9182 (x_set_line_spacing, x_set_border_width)
9183 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9184 Check that fixnums are in proper range for system types.
9185 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9186 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9187 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9188 Use SAFE_ALLOCA_LISP, not alloca.
9189 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9190 intptr_t is wide enough.
9191 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9192 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9193 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9194 Check for fixnum out of range.
9195 * ftfont.c (ftfont_list): Don't assume index fits in int.
9196 Check that fixnums are in proper range for system types.
9197 (ftfont_shape_by_flt):
9198 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9199 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9200 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9201 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
9202 Check that fixnums are in proper range for system types.
9203 * gnutls.h: Adjust decls to match defn changes elsewhere.
9204 * gtkutil.c (xg_dialog_run):
9205 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9206 (update_frame_tool_bar):
9207 Check that fixnums are in proper range for system types.
9208 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
9209 (lookup_image): Check that fixnums are in range for system types.
9210 * indent.c (last_known_column, last_known_column_point):
9211 (current_column_bol_cache):
9212 (skip_invisible, current_column, check_display_width):
9213 (check_display_width, scan_for_column, current_column_1)
9214 (Findent_to, Fcurrent_indentation, position_indentation)
9215 (indented_beyond_p, Fmove_to_column, compute_motion):
9216 (Fcompute_motion, Fvertical_motion):
9217 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9218 (last_known_column_modified): Use EMACS_INT, not int.
9219 (check_display_width):
9220 (Fcompute_motion):
9221 Check that fixnums and floats are in proper range for system types.
9222 (compute_motion): Don't assume index or fixnum fits in int.
9223 (compute_motion, Fcompute_motion):
9224 Use int, not EMACS_INT, when it is wide enough.
9225 (vmotion): Omit local var start_hpos that is always 0; that way
9226 we don't need to worry about overflow in expressions involving it.
9227 * indent.h: Adjust decls to match defn changes elsewhere.
9228 (struct position):
9229 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9230 Use int, not EMACS_INT, where int is wide enough.
9231 Remove unused members ovstring_chars_done and tab_offset;
9232 all uses removed.
9233 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
9234 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
9235 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
9236 (make_gap, copy_text, insert, insert_and_inherit)
9237 (insert_before_markers, insert_before_markers_and_inherit)
9238 (insert_1, count_combining_before, count_combining_after)
9239 (insert_1_both, insert_from_string)
9240 (insert_from_string_before_markers, insert_from_string_1)
9241 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
9242 (adjust_after_replace, adjust_after_insert, replace_range)
9243 (replace_range_2, del_range, del_range_1, del_range_byte)
9244 (del_range_both, del_range_2, modify_region)
9245 (prepare_to_modify_buffer, signal_before_change)
9246 (signal_after_change, Fcombine_after_change_execute):
9247 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9248 * intervals.c (traverse_intervals, rotate_right, rotate_left)
9249 (balance_an_interval, split_interval_right, split_interval_left)
9250 (find_interval, next_interval, update_interval)
9251 (adjust_intervals_for_insertion, delete_node, delete_interval)
9252 (interval_deletion_adjustment, adjust_intervals_for_deletion)
9253 (static_offset_intervals, offset_intervals)
9254 (merge_interval_right, merge_interval_left, make_new_interval)
9255 (graft_intervals_into_buffer, temp_set_point_both)
9256 (temp_set_point, set_point, adjust_for_invis_intang)
9257 (set_point_both, move_if_not_intangible, get_property_and_range)
9258 (get_local_map, copy_intervals, copy_intervals_to_string)
9259 (compare_string_intervals, set_intervals_multibyte_1):
9260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9261 * intervals.h: Adjust decls to match defn changes elsewhere.
9262 (struct interval):
9263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9264 * keyboard.c (this_command_key_count, this_single_command_key_start)
9265 (before_command_key_count, before_command_echo_length, echo_now)
9266 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
9267 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
9268 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
9269 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
9270 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9271 (last_non_minibuf_size, last_point_position, echo_truncate)
9272 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
9273 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
9274 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
9275 (stuff_buffered_input):
9276 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9277 (last_auto_save, command_loop_1, read_char):
9278 Use EMACS_INT, not int, to avoid integer overflow.
9279 (record_char): Avoid overflow in total_keys computation.
9280 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
9281 * keyboard.h: Adjust decls to match defn changes elsewhere.
9282 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
9283 (Fkey_description, Fdescribe_vector, Flookup_key):
9284 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9285 (click_position): New function, to check that positions are in range.
9286 (Fcurrent_active_maps):
9287 (describe_command):
9288 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9289 (Faccessible_keymaps, Fkey_description):
9290 (preferred_sequence_p):
9291 Don't assume fixnum can fit into int.
9292 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
9293 Check for integer overflow in size calculations.
9294 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
9295 avoid mishandling large integers.
9296 * lisp.h: Adjust decls to match defn changes elsewhere.
9297 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
9298 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
9299 (struct Lisp_Marker):
9300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9301 (clip_to_bounds): Now an inline function, moved here from editfns.c.
9302 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
9303 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
9304 All callers changed.
9305 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
9306 Assume the arg has valid form, since it always does.
9307 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
9308 unsigned integer system type.
9309 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
9310 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
9311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9312 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
9313 (duration_to_sec_usec): New decl.
9314 * lread.c (read_from_string_index, read_from_string_index_byte)
9315 (read_from_string_limit, readchar, unreadchar, openp)
9316 (read_internal_start, read1, oblookup):
9317 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9318 (Fload, readevalloop, Feval_buffer, Feval_region):
9319 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9320 (openp): Check for out-of-range argument to 'access'.
9321 (read1): Use int, not EMACS_INT, where int is wide enough.
9322 Don't assume fixnum fits into int.
9323 Fix off-by-one error that can read outside a buffer.
9324 (read_filtered_event): Use duration_to_sec_usec
9325 to do proper overflow checking on durations.
9326 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
9327 in size calculation.
9328 (Fexecute_kbd_macro):
9329 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9330 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
9331 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
9332 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
9333 (set_marker_both, set_marker_restricted_both, marker_position)
9334 (marker_byte_position, Fbuffer_has_markers_at):
9335 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9336 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
9337 * menu.c (ensure_menu_items): Rename from grow_menu_items.
9338 It now merely ensures that the menu is large enough, without
9339 necessarily growing it, as this avoids some integer overflow issues.
9340 All callers changed.
9341 (keymap_panes, parse_single_submenu, Fx_popup_menu):
9342 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9343 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
9344 Use SAFE_ALLOCA_LISP, not alloca.
9345 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
9346 to EMACS_INT. Check that fixnums are in proper range for system types.
9347 * minibuf.c (minibuf_prompt_width, string_to_object)
9348 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
9349 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
9350 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9351 (get_minibuffer, read_minibuf_unwind):
9352 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9353 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9354 this simplifies overflow checking. All callers changed.
9355 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9356 (Ftest_completion):
9357 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9358 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9359 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9360 Check that fixnums are in proper range for system types.
9361 (Fx_create_frame, Fx_show_tip):
9362 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9363 * nsfont.m (ns_findfonts, nsfont_list_family):
9364 Don't assume fixnum fits in long.
9365 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9366 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9367 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9368 wide enough.
9369 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9370 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9371 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9372 (PRINTDECLARE, PRINTPREPARE):
9373 (strout, print_string):
9374 (print, print_preprocess, print_check_string_charset_prop)
9375 (print_object):
9376 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9377 (PRINTDECLARE):
9378 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9379 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9380 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9381 (printchar, strout): Use xpalloc to catch size calculation overflow.
9382 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9383 (print_error_message): Use SAFE_ALLOCA, not alloca.
9384 (print_object): Use int, not EMACS_INT, where int is wide enough.
9385 (print_depth, new_backquote_output, print_number_index):
9386 Use ptrdiff_t, not int, where int might not be wide enough.
9387 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9388 (Fset_process_window_size, Fformat_network_address)
9389 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9390 (sigchld_handler):
9391 Check that fixnums are in proper range for system types.
9392 (Fsignal_process): Simplify by avoiding a goto.
9393 Check for process-ids out of pid_t range rather than relying on
9394 undefined behavior.
9395 (process_tick, update_tick): Use EMACS_INT, not int.
9396 (Fformat_network_address, read_process_output, send_process)
9397 (Fprocess_send_region, status_notify):
9398 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9399 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9400 (wait_reading_process_output, read_process_output, exec_sentinel):
9401 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9402 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9403 (Faccept_process_output): Use duration_to_sec_usec to do proper
9404 overflow checking on durations.
9405 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9406 Don't assume pid_t fits in int.
9407 * process.h (struct Lisp_Process): Members tick and update_tick
9408 are now of type EMACS_INT, not int.
9409 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9410 configured --with-wide-int.
9411 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9412 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9413 * search.c (looking_at_1, string_match_1):
9414 (fast_string_match, fast_c_string_match_ignore_case)
9415 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9416 (scan_newline, find_before_next_newline, search_command)
9417 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9418 (set_search_regs, wordify):
9419 (Freplace_match):
9420 (Fmatch_data):
9421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9422 (string_match_1, search_buffer, set_search_regs):
9423 (Fmatch_data):
9424 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9425 (wordify): Check for overflow in size calculation.
9426 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9427 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9428 Check that fixnums are in proper range for system types.
9429 * sound.c (struct sound_device)
9430 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9431 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9432 (Fplay_sound_internal):
9433 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9434 * syntax.c (struct lisp_parse_state, find_start_modiff)
9435 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9436 (Fparse_partial_sexp):
9437 Don't assume fixnums can fit in int.
9438 (struct lisp_parse_state, find_start_pos, find_start_value)
9439 (find_start_value_byte, find_start_begv)
9440 (update_syntax_table, char_quoted, dec_bytepos)
9441 (find_defun_start, prev_char_comend_first, back_comment):
9442 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9443 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9444 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9445 (Finternal_describe_syntax_value): Check that match_lisp is a
9446 character, not an integer, since the code stuffs it into int.
9447 (scan_words, scan_sexps_forward):
9448 Check that fixnums are in proper range for system types.
9449 (Fforward_word):
9450 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9451 (scan_sexps_forward):
9452 Use CHARACTERP, not INTEGERP, since the value must fit into int.
9453 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9454 * syntax.h: Adjust decls to match defn changes elsewhere.
9455 (struct gl_state_s):
9456 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9457 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9458 MOST_POSITIVE_FIXNUM.
9459 * sysdep.c (wait_for_termination_1, wait_for_termination)
9460 (interruptible_wait_for_termination, mkdir):
9461 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9462 (emacs_read, emacs_write):
9463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9464 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9465 and double all fit in int.
9466 * term.c (set_tty_color_mode):
9467 Check that fixnums are in proper range for system types.
9468 * termhooks.h (struct input_event):
9469 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9470 * textprop.c (validate_interval_range, interval_of)
9471 (Fadd_text_properties, set_text_properties_1)
9472 (Fremove_text_properties, Fremove_list_of_text_properties)
9473 (Ftext_property_any, Ftext_property_not_all)
9474 (copy_text_properties, text_property_list, extend_property_ranges)
9475 (verify_interval_modification):
9476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9477 (Fnext_single_char_property_change)
9478 (Fprevious_single_char_property_change):
9479 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9480 (copy_text_properties):
9481 Check for integer overflow in index calculation.
9482 * undo.c (last_boundary_position, record_point, record_insert)
9483 (record_delete, record_marker_adjustment, record_change)
9484 (record_property_change):
9485 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9486 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9488 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9489 (Fx_hide_tip, Fx_file_dialog):
9490 * w32menu.c (set_frame_menubar):
9491 Use ptrdiff_t, not int, for consistency with rest of code.
9492 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9493 (select_window, Fdelete_other_windows_internal)
9494 (window_scroll_pixel_based, window_scroll_line_based)
9495 (Frecenter, Fset_window_configuration):
9496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9497 (Fset_window_hscroll, run_window_configuration_change_hook)
9498 (set_window_buffer, temp_output_buffer_show, scroll_command)
9499 (Fscroll_other_window, Frecenter):
9500 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9501 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9502 Don't assume fixnum fits in int.
9503 (Fset_window_scroll_bars):
9504 Check that fixnums are in proper range for system types.
9505 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9506 (string_pos, c_string_pos, number_of_chars, init_iterator)
9507 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9508 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9509 (compute_display_string_end, handle_face_prop)
9510 (face_before_or_after_it_pos, handle_invisible_prop)
9511 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9512 (display_prop_intangible_p, string_buffer_position_lim)
9513 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9514 (get_overlay_strings_1, get_overlay_strings)
9515 (iterate_out_of_display_property, forward_to_next_line_start)
9516 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9517 (get_next_display_element, set_iterator_to_next)
9518 (get_visually_first_element, compute_stop_pos_backwards)
9519 (handle_stop_backwards, next_element_from_buffer)
9520 (move_it_in_display_line_to, move_it_in_display_line)
9521 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9522 (add_to_log, message_dolog, message_log_check_duplicate)
9523 (message2, message2_nolog, message3, message3_nolog
9524 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9525 (current_message_1, truncate_echo_area, truncate_message_1)
9526 (set_message, set_message_1, store_mode_line_noprop)
9527 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9528 (text_outside_line_unchanged_p, check_point_in_composition)
9529 (reconsider_clip_changes)
9530 (redisplay_internal, set_cursor_from_row, try_scrolling)
9531 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9532 (redisplay_window, find_last_unchanged_at_beg_row)
9533 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9534 (trailing_whitespace_p, find_row_edges, display_line)
9535 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9536 (display_mode_element, store_mode_line_string)
9537 (pint2str, pint2hrstr, decode_mode_spec)
9538 (display_count_lines, display_string, draw_glyphs)
9539 (x_produce_glyphs, x_insert_glyphs)
9540 (rows_from_pos_range, mouse_face_from_buffer_pos)
9541 (fast_find_string_pos, mouse_face_from_string_pos)
9542 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9543 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9544 (safe_call, init_from_display_pos, handle_fontified_prop)
9545 (handle_single_display_spec, load_overlay_strings)
9546 (with_echo_area_buffer, setup_echo_area_for_printing)
9547 (display_echo_area, echo_area_display)
9548 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9549 (update_tool_bar, hscroll_window_tree, redisplay_internal)
9550 (redisplay_window, dump_glyph_row, display_mode_line)
9551 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9552 (handle_display_spec, display_prop_string_p):
9553 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9554 (handle_single_display_spec, build_desired_tool_bar_string)
9555 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9556 (get_specified_cursor_type):
9557 Check that fixnums are in proper range for system types.
9558 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9559 (Flookup_image_map):
9560 Don't assume fixnums fit in int.
9561 (compare_overlay_entries):
9562 Avoid mishandling comparisons due to subtraction overflow.
9563 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9564 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9565 (handle_tool_bar_click):
9566 Use int, not unsigned, since we prefer signed and the signedness
9567 doesn't matter here.
9568 (get_next_display_element, next_element_from_display_vector):
9569 Use int, not EMACS_INT, when int is wide enough.
9570 (start_hourglass): Use duration_to_sec_usec to do proper
9571 overflow checking on durations.
9572 * xfaces.c (Fbitmap_spec_p):
9573 Check that fixnums are in proper range for system types.
9574 (compare_fonts_by_sort_order):
9575 Avoid mishandling comparisons due to subtraction overflow.
9576 (Fx_family_fonts, realize_basic_faces):
9577 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9578 (Fx_family_fonts):
9579 Don't assume fixnum fits in int.
9580 Use SAFE_ALLOCA_LISP, not alloca.
9581 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9582 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9583 (face_at_buffer_position, face_for_overlay_string)
9584 (face_at_string_position):
9585 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9586 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9587 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9588 (Fx_show_tip):
9589 Check that fixnums are in proper range for system types.
9590 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9591 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9592 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9593 (Fx_change_window_property): Don't assume fixnums fit in int.
9594 * xfont.c (xfont_chars_supported):
9595 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9596 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9597 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9598 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9599 * xml.c (parse_region):
9600 * xrdb.c (magic_file_p):
9601 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9602 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9603 (x_get_local_selection, x_reply_selection_request)
9604 (x_handle_selection_request, wait_for_property_change):
9605 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9606 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9607 short is wide enough.
9608 (x_send_client_event): Don't assume fixnum fits in int.
9609 * xterm.c (x_x_to_emacs_modifiers):
9610 Don't assume EMACS_INT overflows nicely into int.
9611 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9612 may come from Lisp.
9613 (handle_one_xevent): NATNUMP can eval its arg twice.
9614 (x_connection_closed):
9615 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9616 * xterm.h: Adjust decls to match defn changes elsewhere.
9617 (struct scroll_bar): Use struct vectorlike_header
9618 rather than rolling our own approximation.
9619 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9620
9621 2012-05-25 Glenn Morris <rgm@gnu.org>
9622
9623 * lisp.mk (lisp): Update for more files being compiled now.
9624
9625 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9626
9627 * lread.c: Remove `read_pure' which makes no difference.
9628 (read_pure): Remove var.
9629 (unreadpure): Remove function.
9630 (readevalloop): Don't call read_list with -1 flag.
9631 (read1, read_vector): Don't test read_pure any more.
9632 (read_list): Simplify.
9633
9634 * fileio.c, character.h: Minor style tweaks.
9635
9636 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9637
9638 * window.h (clip_changed): Remove useless declaration.
9639
9640 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9641
9642 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9643 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9644
9645 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9646
9647 Remove src/m/*.
9648 This directory predates autoconf and is no longer needed nowadays.
9649 Move its few remaining bits of functionality to where they're needed.
9650 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9651 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9652 * m/template.h: Remove.
9653 * Makefile.in (M_FILE): Remove. All uses removed.
9654 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9655 * lisp.h (USE_LSB_TAG):
9656 * mem-limits.h (EXCEEDS_LISP_PTR):
9657 Use VAL_MAX, not VALBITS, in #if.
9658 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9659 (EMACS_UINT): Define unconditionally now.
9660 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9661 (BITS_PER_EMACS_INT): New constants, replacing
9662 what used to be in config.h, but not useful in #if.
9663 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9664 define them any more.
9665 (VAL_MAX): New macro.
9666 (VALMASK): Use it.
9667 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9668 BITS_PER_EMACS_INT, in #if.
9669 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9670 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9671 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9672 * s/ms-w32.h (DATA_START):
9673 Move here from removed file m/intel386.h.
9674 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9675 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9676
9677 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9678
9679 Assume C89 or later.
9680 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9681 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9682 (xrealloc):
9683 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9684 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9685 * textprop.c, tparam.c (NULL): Remove.
9686 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9687 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9688 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9689 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9690 * xterm.c (input_signal_count): Assume volatile works.
9691
9692 2012-05-21 Ken Brown <kbrown@cornell.edu>
9693
9694 * xgselect.c (xg_select): Fix first argument in call to 'select'
9695 (bug#11508).
9696
9697 2012-05-20 Ken Brown <kbrown@cornell.edu>
9698
9699 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9700 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9701
9702 2012-05-19 Ken Brown <kbrown@cornell.edu>
9703
9704 * xfns.c (x_in_use): Remove `static' qualifier.
9705 * xterm.h (x_in_use): Declare.
9706 * xgselect.c: Include xterm.h.
9707 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9708 and `display_arg' (bug#9754).
9709
9710 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9711
9712 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9713
9714 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9715 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9716
9717 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9718
9719 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9720
9721 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9722 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9723
9724 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9725 reference to image_cache->refcount.
9726 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9727
9728 2012-05-17 Juri Linkov <juri@jurta.org>
9729
9730 * search.c (Fword_search_regexp, Fword_search_backward)
9731 (Fword_search_forward, Fword_search_backward_lax)
9732 (Fword_search_forward_lax): Move functions to isearch.el
9733 (bug#10145, bug#11381).
9734
9735 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9736
9737 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9738
9739 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9740
9741 * lread.c (init_obarray): Declare Qt and Qnil as special.
9742
9743 2012-05-14 Glenn Morris <rgm@gnu.org>
9744
9745 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9746 Put "libexec" before "bin", for the sake of init_callproc_1.
9747
9748 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9749
9750 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9751
9752 * unexaix.c: Port to more-recent AIX compilers.
9753 (report_error, report_error_1, make_hdr, copy_sym)
9754 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9755 Make arguments const char *, not char *, to avoid violations of C
9756 standard and to fix some AIX warnings reported by Gilles Pion.
9757
9758 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9759
9760 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9761 already have overlays loaded.
9762 (handle_single_display_spec): Before returning without displaying
9763 fringe bitmap, synchronize the bidi iterator with the main display
9764 iterator, by calling iterate_out_of_display_property.
9765 (iterate_out_of_display_property): Detect buffer iteration by
9766 testing that it->string is a Lisp string.
9767 (get_next_display_element): When the current object is exhausted,
9768 and there's something on it->stack, call set_iterator_to_next to
9769 proceed with what's on the stack, instead of returning zero.
9770 (set_iterator_to_next): If called at the end of a Lisp string,
9771 proceed to consider_string_end without incrementing string
9772 position. Don't increment display vector index past the end of
9773 the display vector. (Bug#11417)
9774 (pos_visible_p): Don't report a position visible when move_it_to
9775 stopped at the last line of window, which happens to be scanned
9776 backwards by the bidi iteration. (Bug#11464)
9777
9778 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9779
9780 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9781 and right-margin display specs even if the spec is invalid or we
9782 are on a TTY, and thus unable to display on the fringes.
9783 That's because the text with the property will not be displayed anyway,
9784 so we need to signal to the caller that this is a "replacing"
9785 display spec. This fixes display when the spec is invalid or we
9786 are on a TTY.
9787
9788 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9789
9790 * unexaix.c (make_hdr): Fix typo in prototype.
9791 This bug broke the build on AIX. Problem reported by Gilles Pion.
9792
9793 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9794
9795 * keyboard.c (kbd_buffer_get_event): Read special events also in
9796 batch mode. (Bug#11415)
9797
9798 2012-05-12 Glenn Morris <rgm@gnu.org>
9799
9800 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9801
9802 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9803
9804 * lisp.mk (lisp): Add newcomment.elc.
9805
9806 2012-05-12 Glenn Morris <rgm@gnu.org>
9807
9808 * Makefile.in (MKDIR_P): New, set by configure.
9809 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9810
9811 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9812
9813 Remove unused function hourglass_started.
9814 * dispextern.h (hourglass_started):
9815 * w32fns.c (hourglass_started):
9816 * xdisp.c (hourglass_started): Remove.
9817
9818 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9819
9820 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9821 Update dependencies.
9822
9823 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9824
9825 * xgselect.c (xg_select): Put maxfds+1 into a var.
9826 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9827
9828 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9829
9830 2012-05-10 Dave Abrahams <dave@boostpro.com>
9831
9832 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9833 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9834
9835 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9836
9837 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9838 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9839 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9840 Initialize xd_registered_buses.
9841
9842 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9843
9844 Untag more efficiently if USE_LSB_TAG.
9845 This is based on a proposal by YAMAMOTO Mitsuharu in
9846 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9847 For an admittedly artificial (nth 8000 longlist) benchmark on
9848 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9849 Emacs's overall text size by 1%.
9850 * lisp.h (XUNTAG): New macro.
9851 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9852 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9853 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9854 * eval.c (Fautoload):
9855 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9856 * frame.h (XFRAME): Use XUNTAG.
9857
9858 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9859 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9860 Remove unportable assumptions about print widths of types like
9861 dbus_uint32_t.
9862 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9863 intptr_t when converting between pointer and integer, to avoid GCC
9864 warnings about wrong width.
9865
9866 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9867
9868 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9869 stack for each reader_thread, instead of defaulting to 8MB
9870 determined by the linker. This avoids failures in creating
9871 subprocesses on Windows 7, see the discussion in this thread:
9872 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9873
9874 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9875
9876 Fix up display of the *Minibuf-0* buffer in the mini window.
9877 * keyboard.c (read_char): Don't clear the echo area if there's no
9878 message to clear.
9879 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9880 contents of *Minibuf-0*) if there's no message displayed in its stead.
9881
9882 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9883
9884 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9885 batch mode.
9886
9887 2012-05-06 Chong Yidong <cyd@gnu.org>
9888
9889 * lisp.mk (lisp): Update.
9890
9891 2012-05-05 Jim Meyering <meyering@redhat.com>
9892
9893 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9894
9895 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9896
9897 * data.c (PUT_ERROR): New macro.
9898 (syms_of_data): Use it. Add new error type `user-error'.
9899 * undo.c (user_error): New function.
9900 (Fprimitive_undo): Use it.
9901 * print.c (print_error_message): Adjust print style for `user-error'.
9902 * keyboard.c (user_error): New function.
9903 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9904
9905 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9906
9907 Do not limit current-time-string to years 1000..9999.
9908 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9909 (Fcurrent_time_string): Support any year that is supported by the
9910 underlying localtime representation. Don't use asctime, as it
9911 has undefined behavior for years outside the range -999..9999.
9912
9913 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9914
9915 Fix race conditions involving setenv, gmtime, localtime, asctime.
9916 Without this fix, interrupts could mess up code that uses these
9917 nonreentrant functions, since setting TZ invalidates existing
9918 tm_zone or tzname values, and since most of these functions return
9919 pointers to static storage.
9920 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9921 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9922 Grow the critical sections to include not just invoking
9923 localtime/gmtime, but also accessing these functions' results
9924 including their tm_zone values if any, and any related TZ setting.
9925 (format_time_string): Last arg is now struct tm *, not struct tm **,
9926 so that the struct tm is saved in the critical section.
9927 All callers changed. Simplify allocation of initial buffer, partly
9928 motivated by the fact that memory allocation needs to be outside
9929 the critical section.
9930
9931 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9932
9933 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9934 with RESET_INTERVAL.
9935
9936 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9937 Remove duplicated buffer name initialization.
9938
9939 2012-05-02 Jim Meyering <jim@meyering.net>
9940
9941 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9942
9943 * xfns.c (x_window): Use xstrdup (Bug#11375).
9944
9945 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9946
9947 * xdisp.c (pos_visible_p): If already at a newline from the
9948 display string before the 'while' loop, don't walk back the glyphs
9949 from it3.glyph_row. Solves assertion violation when the display
9950 string begins with a newline (egg.el). (Bug#11367)
9951
9952 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9953
9954 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9955 Move to simple.el.
9956
9957 2012-05-01 Glenn Morris <rgm@gnu.org>
9958
9959 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9960 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9961 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9962 All were removed before 23.1.
9963
9964 * dispnew.c: Remove HAVE_LIBNCURSES test;
9965 it is always true on relevant platforms.
9966
9967 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9968 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9969
9970 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9971
9972 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9973
9974 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9975 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9976 Remove.
9977
9978 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9979
9980 Do not avoid creating empty evaporating overlays (Bug#9642).
9981 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9982 That is, do not delete an evaporating overlay if it becomes
9983 empty after its bounds are adjusted to fit within its buffer.
9984 This fix caused other problems, and I'm reverting it until we get
9985 to the bottom of them.
9986
9987 2012-04-27 Chong Yidong <cyd@gnu.org>
9988
9989 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9990
9991 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9992
9993 * xdisp.c (pos_visible_p): If the window start position is beyond
9994 ZV, start the display from buffer beginning. Prevents assertion
9995 violation in init_iterator when the minibuffer window is scrolled
9996 via the scroll bar.
9997
9998 * window.c (window_scroll_pixel_based): Likewise.
9999
10000 2012-04-27 Chong Yidong <cyd@gnu.org>
10001
10002 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10003
10004 2012-04-27 Glenn Morris <rgm@gnu.org>
10005
10006 * fileio.c (Fcopy_file, Fset_file_selinux_context):
10007 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
10008
10009 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10010
10011 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10012 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
10013
10014 2012-04-26 Eli Zaretskii <eliz@gnu.org>
10015
10016 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10017 display element, check also the underlying string or buffer
10018 character. (Bug#11341)
10019
10020 * w32menu.c: Include w32heap.h.
10021 (add_menu_item): If the call to AppendMenuW (via
10022 unicode_append_menu) fails, disable Unicode menus only if we are
10023 running on Windows 9X/Me.
10024
10025 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10026
10027 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10028 (xgetint): Add missing shift for LSB tags.
10029
10030 2012-04-24 Martin Rudalics <rudalics@gmx.at>
10031
10032 * keyboard.c (read_char): Don't wipe echo area for select window
10033 events: These might get delayed via `mouse-autoselect-window'
10034 (Bug#11304).
10035
10036 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
10037
10038 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10039 manipulation of :loaded-from data.
10040
10041 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
10042
10043 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10044 now a cons (bug#11311).
10045
10046 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10047
10048 Do not create empty overlays with the evaporate property (Bug#9642).
10049 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10050 if it becomes empty after its bounds are adjusted to fit within
10051 its buffer. Without this fix, in a nonempty buffer (let ((o
10052 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10053 yields an empty overlay that has the evaporate property, which is
10054 not supposed to happen.
10055
10056 Fix minor GTK3 problems found by static checking.
10057 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10058 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10059 (struct _EmacsFixedClass, emacs_fixed_get_type):
10060 Move decls here from emacsgtkfixed.h, since they needn't be public.
10061 (emacs_fixed_get_type): Now static.
10062 (emacs_fixed_class_init): Omit unused local.
10063 (emacs_fixed_child_type): Remove; unused.
10064 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10065 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10066 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10067 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10068 (EMACS_FIXED_GET_CLASS): Remove; unused.
10069 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10070
10071 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10072 Problem reported by Juanma Barranquero for Windows -Wunused-function.
10073
10074 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10075
10076 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10077 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10078 (__malloc_size_t, __malloc_ptrdiff_t):
10079 Remove. All uses removed, replaced by the definiens if needed,
10080 since we can assume C89 or better now.
10081 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10082 (protect_malloc_state, align, get_contiguous_space)
10083 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10084 (malloc_atfork_handler_child, malloc_enable_thread)
10085 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10086 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10087 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10088 (special_realloc, _realloc_internal_nolock, _realloc_internal)
10089 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10090 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10091 Define using prototypes, not old style.
10092 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10093 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10094 (align): Don't assume that signed integer overflow wraps around.
10095 Omit unused local var.
10096 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10097 (_free_internal_nolock, memalign, mallochook, reallochook):
10098 Omit no-longer-needed casts.
10099 (valloc): Use getpagesize, not __getpagesize.
10100 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10101 (struct hdr): The 'magic' member is now size_t, not unsigned long.
10102
10103 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10104
10105 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
10106
10107 Move functions from C to Lisp. Make non-blocking method calls
10108 the default. Implement further D-Bus standard interfaces.
10109
10110 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10111 (QCdbus_request_name_allow_replacement)
10112 (QCdbus_request_name_replace_existing)
10113 (QCdbus_request_name_do_not_queue)
10114 (QCdbus_request_name_reply_primary_owner)
10115 (QCdbus_request_name_reply_in_queue)
10116 (QCdbus_request_name_reply_exists)
10117 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10118 (QCdbus_registered_serial, QCdbus_registered_method)
10119 (QCdbus_registered_signal): New Lisp objects.
10120 (XD_DEBUG_MESSAGE): Use sizeof.
10121 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10122 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10123 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10124 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10125 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10126 (xd_signature, xd_append_arg): Allow float for integer types.
10127 (xd_get_connection_references): New function.
10128 (xd_get_connection_address): Rename from xd_initialize.
10129 Return cached address.
10130 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10131 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
10132 level.
10133 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
10134 Return number of refcounts.
10135 (Fdbus_get_unique_name): Make stronger parameter check.
10136 (Fdbus_message_internal): New defun.
10137 (Fdbus_call_method, Fdbus_call_method_asynchronously)
10138 (Fdbus_method_return_internal, Fdbus_method_error_internal)
10139 (Fdbus_send_signal, Fdbus_register_service)
10140 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10141 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10142 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10143 (Vdbus_compiled_version, Vdbus_runtime_version)
10144 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10145 (Vdbus_message_type_method_return, Vdbus_message_type_error)
10146 (Vdbus_message_type_signal): New defvars.
10147 (Vdbus_registered_buses, Vdbus_registered_objects_table):
10148 Adapt docstring.
10149
10150 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10151
10152 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10153 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10154 Do not assume ptrdiff_t is the same width as 'int'.
10155
10156 * alloc.c: Handle unusual debugging option combinations.
10157 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10158 since the two debugging options are incompatible.
10159 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10160 is defined.
10161 (mem_init, mem_insert, mem_insert_fixup):
10162 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10163 (NEED_MEM_INSERT): Remove; no longer needed.
10164
10165 2012-04-22 Leo Liu <sdl.web@gmail.com>
10166
10167 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10168
10169 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10170
10171 * sysdep.c [__FreeBSD__]: Minor cleanups.
10172 (list_system_processes, system_process_attributes) [__FreeBSD__]:
10173 Use Emacs indenting style more consistently. Avoid some casts.
10174 Use 'double' consistently rather than mixing 'float' and 'double'.
10175
10176 2012-04-21 Eduard Wiebe <usenet@pusto.de>
10177
10178 * sysdep.c (list_system_processes, system_process_attributes):
10179 Add implementation for FreeBSD (Bug#5243).
10180
10181 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
10182
10183 * lisp.mk (lisp): Update.
10184
10185 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
10186
10187 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10188 It is never used otherwise.
10189
10190 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
10191
10192 * print.c (print_preprocess): Only check print_depth if print-circle
10193 is nil.
10194 (print_object): Check for cycles even when print-circle is nil and
10195 print-gensym is t, but only check print_depth if print-circle is nil.
10196
10197 2012-04-20 Chong Yidong <cyd@gnu.org>
10198
10199 * process.c (wait_reading_process_output): If EIO occurs on a pty,
10200 set the status to "failed" and ensure that sentinel is run.
10201
10202 2012-04-20 Glenn Morris <rgm@gnu.org>
10203
10204 * process.c (Fset_process_inherit_coding_system_flag)
10205 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
10206 (Fmake_network_process, Fmake_serial_process): Doc fix.
10207
10208 2012-04-20 Eli Zaretskii <eliz@gnu.org>
10209
10210 * xdisp.c (string_buffer_position_lim): Limit starting position to
10211 BEGV.
10212 (set_cursor_from_row): If called for a mode-line or header-line
10213 row, return zero immediately.
10214 (try_cursor_movement): If inside continuation line, don't back up
10215 farther than the first row after the header line, if any.
10216 Don't consider the header-line row as "partially visible", even if
10217 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
10218
10219 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10220
10221 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
10222 (bug#11238).
10223
10224 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
10225 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
10226
10227 configure: new option --enable-gcc-warnings (Bug#11207)
10228 * Makefile.in (C_WARNINGS_SWITCH): Remove.
10229 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
10230 (ALL_CFLAGS): Use new macros rather than old.
10231 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
10232 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
10233 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
10234 -Wunused-result, -Wunused-variable. This should go away once
10235 the Emacs and Gnulib regex code is merged.
10236 (xmalloc, xrealloc): Now static.
10237
10238 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
10239
10240 * dired.c (Fsystem_groups): Remove unused local.
10241
10242 2012-04-17 Glenn Morris <rgm@gnu.org>
10243
10244 * dired.c (Fsystem_users): Doc fix.
10245
10246 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
10247
10248 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
10249 (syms_of_dired): Add them.
10250
10251 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
10252
10253 Fix minor alloc.c problems found by static checking.
10254 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
10255 New extern decls, to avoid calling undeclared functions.
10256 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
10257 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
10258 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
10259 (NEED_MEM_INSERT): New macro.
10260 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
10261 Remove one incorrect comment and fix another.
10262
10263 Fix minor ralloc.c problems found by static checking.
10264 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10265 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
10266 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
10267 (r_alloc_sbrk): Now static.
10268
10269 Improve ralloc.c interface checking.
10270 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10271 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
10272 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
10273 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
10274 [REL_ALLOC]: ... to here, to check interface.
10275 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
10276 Remove decls. This fixes an "It stinks!".
10277
10278 * alloc.c (which_symbols): Fix alignment issue / type clash.
10279
10280 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
10281
10282 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
10283 (struct Lisp_Misc_Any): Likewise.
10284 (struct Lisp_Free): Likewise.
10285 * alloc.c (union aligned_Lisp_Symbol): Define.
10286 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
10287 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
10288 (union aligned_Lisp_Misc): Define.
10289 (MARKER_BLOCK_SIZE, struct marker_block): Use union
10290 aligned_Lisp_Misc instead of union Lisp_Misc.
10291 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
10292
10293 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
10294
10295 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
10296 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
10297 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
10298 * s/netbsd.h, s/sol2-6.h:
10299 Remove definition of GC_MARK_STACK, since the default now works.
10300 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
10301 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
10302 no longer the default.
10303 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
10304
10305 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10306
10307 * lread.c (lisp_file_lexically_bound_p):
10308 Fix hang at ";-*-\n" (bug#11238).
10309
10310 2012-04-14 Eli Zaretskii <eliz@gnu.org>
10311
10312 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
10313 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
10314
10315 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
10316
10317 * nsterm.m (constrainFrameRect): Always constrain when there is only
10318 one screen (Bug#10962).
10319
10320 2012-04-13 Ken Brown <kbrown@cornell.edu>
10321
10322 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
10323
10324 2012-04-13 Reuben Thomas <rrt@sc3d.org>
10325
10326 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
10327
10328 2012-04-11 Daniel Colascione <dancol@dancol.org>
10329
10330 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
10331 against is gone. It's better to use vfork now so that when Cygwin
10332 gains a new, working vfork, we use it automatically (bug#10398).
10333
10334 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10335
10336 * window.c (save_window_save): Obey window-point-insertion-type.
10337
10338 2012-04-11 Glenn Morris <rgm@gnu.org>
10339
10340 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
10341
10342 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10343
10344 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
10345
10346 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
10347
10348 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
10349 (force_quit_count): New var.
10350 (handle_interrupt): Use it.
10351
10352 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
10353
10354 * w32.c (w32_delayed_load): Record the full path of the library
10355 being loaded (bug#10424).
10356
10357 2012-04-09 Glenn Morris <rgm@gnu.org>
10358
10359 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10360 not just in the obarray, before snarfing them. (Bug#11036)
10361
10362 * Makefile.in ($(leimdir)/leim-list.el):
10363 Pass EMACS rather than BUILT_EMACS.
10364
10365 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
10366
10367 * process.c (make_process):
10368 * process.h: Add integer `gnutls_handshakes_tried' member to
10369 process struct.
10370
10371 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10372 Add convenience `GNUTLS_LOG2i' macro.
10373
10374 * gnutls.c (gnutls_log_function2i): Convenience log function.
10375 (emacs_gnutls_read): Use new log functions,
10376 `gnutls_handshakes_tried' process member, and
10377 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10378 attempts per process (connection).
10379
10380 2012-04-09 Chong Yidong <cyd@gnu.org>
10381
10382 * eval.c (Fuser_variable_p, user_variable_p_eh)
10383 (lisp_indirect_variable): Functions deleted.
10384 (Fdefvar): Caller changed.
10385
10386 * callint.c (Finteractive, Fcall_interactively):
10387 * minibuf.c (Fread_variable): Callers changed.
10388
10389 2012-04-09 Eli Zaretskii <eliz@gnu.org>
10390
10391 * xdisp.c (set_cursor_from_row): If the display string appears in
10392 the buffer at position that is closer to point than the position
10393 after the display string, display the cursor on the first glyph of
10394 the display string. Fixes cursor display when a 'display' text
10395 property immediately follows invisible text. (Bug#11094)
10396
10397 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10398
10399 composite.c: use 'double' consistently
10400 * composite.c (get_composition_id): Use 'double' consistently
10401 instead of converting 'float' to 'double' and vice versa; this is
10402 easier to understand and avoids a GCC warning.
10403
10404 2012-04-09 Glenn Morris <rgm@gnu.org>
10405
10406 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10407 preparation for dumping it with emacs. (Bug#4789)
10408 (leimdir): New variable.
10409 ($(leimdir)/leim-list.el): New rule.
10410 (emacs$(EXEEXT)): Depend on leim-list.el.
10411
10412 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10413 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10414 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10415
10416 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10417
10418 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10419 proper alignment.
10420
10421 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
10422
10423 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10424 Remove unused local variable.
10425
10426 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10427
10428 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10429 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10430 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10431 objects, as mark_maybe_pointer will catch them otherwise.
10432 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10433 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10434
10435 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10436
10437 Fix typo that broke non-Windows builds.
10438 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10439
10440 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10441
10442 Support building on MS-Windows with libxml2.
10443
10444 * makefile.w32-in (OBJ2): Add xml.$(O).
10445 (GLOBAL_SOURCES): Add xml.c.
10446 ($(BLD)/xml.$(O)): New dependency list.
10447
10448 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10449 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10450 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10451 [!WINDOWSNT]: New macros.
10452 (init_libxml2_functions, libxml2_loaded_p): New functions.
10453 (parse_region): Call fn_xmlCheckVersion instead of using the macro
10454 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
10455 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10456 Calls xmlCleanupParser only if libxml2 was loaded (or statically
10457 linked in).
10458 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10459 Call init_libxml2_functions before calling libxml2 functions.
10460 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10461
10462 * emacs.c: Don't include libxml/parser.h.
10463 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10464 xmlCleanupParser directly.
10465
10466 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10467
10468 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10469
10470 * indent.c (Fvertical_motion): If there is a display string at
10471 point, use it.vpos to compute how many lines to backtrack after
10472 move_it_to point. (Bug#11133)
10473
10474 2012-04-06 Eli Zaretskii <eliz@gnu.org>
10475
10476 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10477 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10478 about subtle differences between FETCH_CHAR* and STRING_CHAR*
10479 macros related to unification of CJK characters. For the details,
10480 see the discussion following the message here:
10481 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10482
10483 2012-04-04 Chong Yidong <cyd@gnu.org>
10484
10485 * keyboard.c (Vdelayed_warnings_list): Doc fix.
10486
10487 2012-04-01 Eli Zaretskii <eliz@gnu.org>
10488
10489 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10490 instead of alloca. (Bug#11138)
10491
10492 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
10493
10494 * w32menu.c (is_simple_dialog): Properly check lisp types.
10495 (Bug#11141)
10496
10497 2012-03-31 Eli Zaretskii <eliz@gnu.org>
10498
10499 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10500 position we get to after a call to move_it_to fails the
10501 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10502 only if we wind up in a string from display property. (Bug#11063)
10503
10504 * window.c (Fdelete_other_windows_internal): Invalidate the row
10505 and column information about mouse highlight, so that redisplay
10506 restores it after reallocating the glyph matrices. (Bug#7464)
10507
10508 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10509 string comes from a `display' text property, use the buffer
10510 position of that property as if we actually saw that position in
10511 the row's glyphs.
10512 (move_it_by_lines): Remove the assertion that
10513 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10514 violated when there's a before-string at the beginning of a line.
10515 (Bug#11063)
10516
10517 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10518
10519 * xdisp.c (append_space_for_newline): If the default face was
10520 remapped, use the remapped face for the appended newline.
10521 (extend_face_to_end_of_line): Use the remapped default face for
10522 extending the face to the end of the line.
10523 (display_line): Call extend_face_to_end_of_line when the default
10524 face was remapped. (Bug#11068)
10525
10526 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10527
10528 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10529
10530 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10531
10532 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10533
10534 2012-03-27 Glenn Morris <rgm@gnu.org>
10535
10536 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10537 Doc fixes.
10538
10539 2012-03-26 Kenichi Handa <handa@m17n.org>
10540
10541 * dispextern.h (struct glyph): Fix previous change. Change the
10542 bit length of glyphless.ch to 25 (Bug#11082).
10543
10544 2012-03-26 Chong Yidong <cyd@gnu.org>
10545
10546 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10547 (command_loop_1): Use it; inhibit selection update for
10548 handle-select-window too (Bug#8996).
10549
10550 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10551
10552 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10553
10554 2012-03-25 Kenichi Handa <handa@m17n.org>
10555
10556 * dispextern.h (struct glyph): Change the bit length of
10557 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10558
10559 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10560
10561 * s/ms-w32.h (tzname): Include time.h before redirecting to
10562 _tzname. Fixes the MSVC build. (Bug#9960)
10563
10564 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10565
10566 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10567 characters.
10568
10569 * xterm.c (XTread_socket): Only modify handling_signal if
10570 !SYNC_INPUT. (Bug#11080)
10571
10572 2012-03-23 Eli Zaretskii <eliz@gnu.org>
10573
10574 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10575 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10576 when fetching a multibyte character consumes more bytes than
10577 CHAR_BYTES returns, due to unification of CJK characters in
10578 string_char. (Bug#11073)
10579
10580 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10581
10582 * process.c (wait_reading_process_output): Handle pty disconnect
10583 by refraining from sending oneself a SIGCHLD (bug#10933).
10584
10585 2012-03-22 Chong Yidong <cyd@gnu.org>
10586
10587 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10588
10589 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10590 Mark string as coming from a prefix property.
10591 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10592 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10593
10594 2012-03-21 Chong Yidong <cyd@gnu.org>
10595
10596 * xfaces.c (Vface_remapping_alist): Doc fix.
10597
10598 2012-03-20 Eli Zaretskii <eliz@gnu.org>
10599
10600 * w32proc.c (Fw32_set_console_codepage)
10601 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10602 Doc fixes.
10603
10604 2012-03-20 Chong Yidong <cyd@gnu.org>
10605
10606 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10607 to reflect default non-nil value of redisplay-dont-pause.
10608
10609 2012-03-19 Kenichi Handa <handa@m17n.org>
10610
10611 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10612 it fit in a valid range (Bug#11003).
10613
10614 2012-03-18 Eli Zaretskii <eliz@gnu.org>
10615
10616 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10617 that is not from display property, accept the row as a "cursor
10618 row" if one of the string's character has a non-nil `cursor'
10619 property. Fixes cursor positioning when there are newlines in
10620 overlay strings, e.g. in icomplete.el. (Bug#11035)
10621
10622 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10623
10624 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10625
10626 2012-03-12 Chong Yidong <cyd@gnu.org>
10627
10628 * eval.c (inhibit_lisp_code): Rename from
10629 inhibit_window_configuration_change_hook; move from window.c.
10630
10631 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10632 * window.c (run_window_configuration_change_hook)
10633 (syms_of_window): Callers changed.
10634
10635 2012-03-11 Chong Yidong <cyd@gnu.org>
10636
10637 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10638
10639 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10640
10641 2012-03-10 Chong Yidong <cyd@gnu.org>
10642
10643 * frame.c (other_visible_frames): Don't assume the selected frame
10644 is visible (Bug#10955).
10645
10646 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10647
10648 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10649
10650 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10651
10652 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10653 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10654 zero (Bug#10954).
10655
10656 2012-03-03 Glenn Morris <rgm@gnu.org>
10657
10658 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10659
10660 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10661
10662 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10663 position past the first glyph_row that ends at ZV. (Bug#10902)
10664 (redisplay_window, next_element_from_string): Fix typos in
10665 comments.
10666 (redisplay_window): Pass to move_it_vertically the margin in
10667 pixels, not in screen lines.
10668
10669 2012-03-02 Glenn Morris <rgm@gnu.org>
10670
10671 * buffer.c (buffer-list-update-hook): Doc fix.
10672
10673 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10674
10675 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10676 push_it before setting up the iterator for the first overlay
10677 string, even if we have an empty string loaded.
10678 (next_overlay_string): If there's an empty string on the iterator
10679 stack, pop the stack. (Bug#10903)
10680
10681 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10682
10683 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10684 Suggested by Stefan Monnier in
10685 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10686 * alloc.c (widen_to_Lisp_Object): New static function.
10687 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10688 and widening them to Lisp_Objects. This would work even if
10689 USE_LSB_TAG is defined and wide integers are used, which might
10690 happen in a future version of Emacs.
10691
10692 2012-02-25 Chong Yidong <cyd@gnu.org>
10693
10694 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10695 Doc fix.
10696
10697 * xselect.c (Fx_selection_exists_p): Doc fix.
10698 (x_clipboard_manager_save_all): Print an informative message
10699 before saving to clipboard manager.
10700
10701 2012-02-24 Chong Yidong <cyd@gnu.org>
10702
10703 * keyboard.c (process_special_events): Handle all X selection
10704 requests in kbd_buffer, not just the next one (Bug#8869).
10705
10706 2012-02-23 Chong Yidong <cyd@gnu.org>
10707
10708 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10709 call when setting menu-bar-lines and tool-bar-lines parameters.
10710 (unwind_create_frame_1): New helper function.
10711
10712 * window.c (inhibit_window_configuration_change_hook): New var.
10713 (run_window_configuration_change_hook): Obey it.
10714 (syms_of_window): Initialize it.
10715
10716 2012-02-22 Chong Yidong <cyd@gnu.org>
10717
10718 * xterm.c (x_draw_image_relief): Add missing type check for
10719 Vtool_bar_button_margin (Bug#10743).
10720
10721 2012-02-21 Chong Yidong <cyd@gnu.org>
10722
10723 * fileio.c (Vfile_name_handler_alist): Doc fix.
10724
10725 * buffer.c (Fget_file_buffer): Protect against invalid file
10726 handler return value.
10727
10728 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10729
10730 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10731 when computing $valmask.
10732
10733 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10734 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10735 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10736 It's useless in that case, and it can cause problems on hosts
10737 that allocate halves of EMACS_INT values separately.
10738 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10739 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10740 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10741 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10742 it avoids undefined behavior on hosts where shifting right by more
10743 than the word width has undefined behavior.
10744
10745 2012-02-19 Chong Yidong <cyd@gnu.org>
10746
10747 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10748 (Funhandled_file_name_directory, Ffile_name_as_directory)
10749 (Fdirectory_file_name, Fexpand_file_name)
10750 (Fsubstitute_in_file_name): Protect against invalid file handler
10751 return values (Bug#10845).
10752
10753 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10754
10755 * .gdbinit (pitx): Fix incorrect references to fields of the
10756 iterator stack.
10757
10758 2012-02-17 Chong Yidong <cyd@gnu.org>
10759
10760 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10761
10762 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10763
10764 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10765 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10766
10767 2012-02-15 Chong Yidong <cyd@gnu.org>
10768
10769 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10770 marked as special. Also, starting docstrings with * is obsolete.
10771
10772 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10773
10774 * gnutls.c (emacs_gnutls_write): Fix last change.
10775
10776 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10777
10778 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10779 send_process.
10780
10781 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10782
10783 * keymap.c (Fsingle_key_description): Handle char ranges.
10784
10785 2012-02-12 Chong Yidong <cyd@gnu.org>
10786
10787 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10788 as that creates a dangerous corner case.
10789
10790 * window.c (Fdelete_window_internal): Invalidate the mouse
10791 highlight (Bug#9904).
10792
10793 2012-02-12 Glenn Morris <rgm@gnu.org>
10794
10795 * xselect.c (Fx_own_selection_internal)
10796 (Fx_get_selection_internal, Fx_disown_selection_internal)
10797 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10798 * nsselect.m (Fx_own_selection_internal)
10799 (Fx_disown_selection_internal, Fx_selection_exists_p)
10800 (Fx_selection_owner_p, Fx_get_selection_internal):
10801 Sync docs and argument specs with the xselect.c versions.
10802
10803 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10804
10805 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10806
10807 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10808
10809 * w32select.c (Fx_selection_exists_p): Sync doc string and
10810 argument list with xselect.c. (Bug#10783)
10811
10812 * w16select.c (Fx_selection_exists_p): Sync doc string and
10813 argument list with xselect.c. (Bug#10783)
10814
10815 2012-02-10 Glenn Morris <rgm@gnu.org>
10816
10817 * fns.c (Fsecure_hash): Doc fix.
10818
10819 2012-02-09 Kenichi Handa <handa@m17n.org>
10820
10821 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10822
10823 2012-02-07 Chong Yidong <cyd@gnu.org>
10824
10825 * buffer.c (Fbuffer_local_variables)
10826 (buffer_lisp_local_variables): Handle unbound vars correctly;
10827 don't let Qunbound leak into Lisp.
10828
10829 2012-02-07 Glenn Morris <rgm@gnu.org>
10830
10831 * image.c (Fimagemagick_types): Doc fix.
10832
10833 * image.c (imagemagick-render-type): Change it from a lisp object
10834 to an integer. Move the doc here from the lisp manual.
10835 Treat all values not equal to 0 the same.
10836
10837 2012-02-06 Chong Yidong <cyd@gnu.org>
10838
10839 * doc.c (store_function_docstring): Avoid applying docstring of
10840 alias to base function (Bug#2603).
10841
10842 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10843
10844 * .gdbinit (pp1, pv1): Remove redundant defines.
10845 (pr): Use pp.
10846
10847 2012-02-04 Chong Yidong <cyd@gnu.org>
10848
10849 * nsterm.m: Declare a global (Bug#10694).
10850
10851 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10852
10853 * w32.c (get_emacs_configuration_options):
10854 Include --enable-checking, if specified, in the return value.
10855
10856 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10857
10858 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10859 after rounding frame sizes. (Bug#9723)
10860
10861 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10862
10863 * keyboard.c (adjust_point_for_property): Don't position point
10864 before BEGV. (Bug#10696)
10865
10866 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10867
10868 Handle overflow when computing char display width (Bug#9496).
10869 * character.c (char_width): Return EMACS_INT, not int.
10870 (char_width, c_string_width): Check for overflow when
10871 computing the width; this is possible now that individual
10872 characters can have unbounded width. Problem introduced
10873 by merge from Emacs 23 on 2012-01-19.
10874
10875 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10876
10877 * dbusbind.c (Fdbus_register_method): Mention the return value
10878 :ignore in the docstring.
10879
10880 2012-02-02 Glenn Morris <rgm@gnu.org>
10881
10882 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10883
10884 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10885 Unconditionally set to t. (Bug#10673)
10886 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10887 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10888 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10889
10890 2012-02-02 Kenichi Handa <handa@m17n.org>
10891
10892 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10893 0, do not call append_composite_glyph.
10894
10895 2012-02-02 Kenichi Handa <handa@m17n.org>
10896
10897 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10898 NULL (Bug#6988).
10899 (x_produce_glyphs): If the component of a composition is a null
10900 string, set it->pixel_width to 1 to avoid zero-width glyph.
10901
10902 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10903
10904 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10905 first 2 arguments are identical. This makes inserting large
10906 output from a subprocess an order of magnitude faster on
10907 MS-Windows, where all sbrk'ed memory is always contiguous.
10908
10909 2012-01-31 Glenn Morris <rgm@gnu.org>
10910
10911 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10912 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10913 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10914
10915 2012-01-29 Glenn Morris <rgm@gnu.org>
10916
10917 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10918
10919 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10920
10921 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10922
10923 2012-01-28 Chong Yidong <cyd@gnu.org>
10924
10925 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10926
10927 2012-01-26 Chong Yidong <cyd@gnu.org>
10928
10929 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10930
10931 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10932 repeat counts (Bug#10507).
10933
10934 2012-01-26 Glenn Morris <rgm@gnu.org>
10935
10936 * lread.c (syms_of_lread): Doc fix.
10937
10938 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10939
10940 * coding.c (encode_designation_at_bol): Change return value to
10941 EMACS_INT.
10942
10943 2012-01-25 Chong Yidong <cyd@gnu.org>
10944
10945 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10946
10947 2012-01-21 Chong Yidong <cyd@gnu.org>
10948
10949 * floatfns.c (Fcopysign): Make the second argument non-optional,
10950 since nil is not allowed anyway.
10951
10952 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10953
10954 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10955 (send_process): Likewise.
10956
10957 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10958
10959 * window.c (save_window_save, Fcurrent_window_configuration)
10960 (Vwindow_persistent_parameters): Do not use Qstate.
10961 Rewrite doc-strings.
10962
10963 2012-01-19 Kenichi Handa <handa@m17n.org>
10964
10965 * character.c (char_width): New function.
10966 (Fchar_width, c_string_width, lisp_string_width):
10967 Use char_width (Bug#9496).
10968
10969 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10970
10971 * window.c (Vwindow_persistent_parameters): New variable.
10972 (Fset_window_configuration, save_window_save): Handle persistent
10973 window parameters.
10974
10975 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10976
10977 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10978 thrashing the stack of the thread. (Bug#9087)
10979
10980 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10981
10982 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10983
10984 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10985
10986 * xdisp.c (rows_from_pos_range): Handle the case where the
10987 highlight ends on a newline. (Bug#10464)
10988 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10989 he end column for display of highlight that ends on a newline
10990 before a R2L line.
10991
10992 2012-01-11 Glenn Morris <rgm@gnu.org>
10993
10994 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10995 from load-path also when installation-directory is nil. (Bug#10208)
10996
10997 2012-01-10 Glenn Morris <rgm@gnu.org>
10998
10999 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11000
11001 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11002 Update template values to be closer to their typical values these days.
11003
11004 2012-01-09 Eli Zaretskii <eliz@gnu.org>
11005
11006 * xdisp.c (rows_from_pos_range): Accept additional argument
11007 DISP_STRING, and accept any glyph in a row whose object is that
11008 string as eligible for mouse highlight. Fixes mouse highlight of
11009 display strings from overlays. (Bug#10464)
11010
11011 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
11012
11013 emacs: fix an auto-save permissions race condition (Bug#10400)
11014 * fileio.c (auto_saving_dir_umask): New static var.
11015 (Fmake_directory_internal): Use it.
11016 (do_auto_save_make_dir): Set it, instead of invoking chmod after
11017 creating the directory. The old code temporarily assigns
11018 too-generous permissions to the directory.
11019 (do_auto_save_eh): Clear it.
11020 (Fdo_auto_save): Catch all errors, not just file errors, so
11021 that the var is always cleared.
11022
11023 2012-01-07 Eli Zaretskii <eliz@gnu.org>
11024
11025 * search.c (scan_buffer): Pass character positions to
11026 know_region_cache, not byte positions. (Bug#6540)
11027
11028 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
11029
11030 * w32.c (sys_rename): Report EXDEV when rename of a directory
11031 fails because the target is on another logical disk. (Bug#10284)
11032
11033 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11034
11035 * xterm.c (x_embed_request_focus): New function.
11036
11037 * xterm.h: Add prototype.
11038
11039 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11040
11041 2012-01-05 Glenn Morris <rgm@gnu.org>
11042
11043 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11044
11045 2012-01-01 Eli Zaretskii <eliz@gnu.org>
11046
11047 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11048 Load gnutls_transport_set_lowat only if GnuTLS version is below
11049 2.11.1.
11050 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11051 GnuTLS versions below 2.11.1.
11052
11053 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11054
11055 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11056 to the doc string advising against its use for altering the way
11057 windows are scrolled.
11058
11059 2011-12-28 Kenichi Handa <handa@m17n.org>
11060
11061 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11062 coding-system ASCII compatible only when it does not produce BOM
11063 on encoding (Bug#10383).
11064
11065 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
11066
11067 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11068 can scroll.
11069 (create_and_show_popup_menu): Always use menu_position_func for
11070 Gtk3 (Bug#10361).
11071
11072 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
11073
11074 * callint.c (Fcall_interactively): Don't truncate prompt string.
11075
11076 2011-12-23 Eli Zaretskii <eliz@gnu.org>
11077
11078 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11079 property that ends at ZV, so that the bidi iteration could be
11080 resumed from there (after widening). (Bug#10360)
11081
11082 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
11083
11084 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11085
11086 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
11087
11088 * nsterm.m (x_free_frame_resources):
11089 Release f->output_data.ns->miniimage.
11090 (ns_index_color): Fix indentation. Do not retain
11091 color_table->colors[i].
11092
11093 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11094 before returning.
11095
11096 * nsfns.m (x_set_background_color): Assign return value from
11097 ns_index_color to face-background instead of NSColor*.
11098 (ns_implicitly_set_icon_type): Fix indentation.
11099 Change assignment in for loop to comparison.
11100
11101 * emacs.c (ns_pool): New variable.
11102 (main): Assign ns_pool.
11103 (Fkill_emacs): Call ns_release_autorelease_pool.
11104
11105 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11106 autorelease fdesc, release fdAttrs and tdict.
11107 (ns_get_covering_families): Release charset.
11108 (ns_findfonts): Release NSFontDescriptor created with new.
11109 (ns_uni_to_glyphs): Fix indentation.
11110 (setString): Release attrStr before assigning new value.
11111
11112 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11113
11114 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11115 and NS_IMPL_COCOA.
11116 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11117 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11118
11119 2011-12-18 David Reitter <reitter@cmu.edu>
11120
11121 * nsterm.m (ns_term_init): Subscribe for notifications
11122 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11123 to method trackingNotification in EmacsMenu.
11124
11125 * nsmenu.m (trackingMenu): New variable.
11126 (trackingNotification): New method (from Aquamacs).
11127 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
11128 from Aquamacs (Bug#7030).
11129
11130 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11131
11132 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11133 (symbol_to_nsstring): Fix indentation.
11134 (ns_symbol_to_pb): New function.
11135 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11136 (Fns_rotate_cut_buffers_internal): Remove.
11137 (Fns_store_selection_internal): Rename from
11138 Fns_store_cut_buffer_internal.
11139 (ns_get_foreign_selection, Fx_own_selection_internal)
11140 (Fx_disown_selection_internal, Fx_selection_exists_p)
11141 (Fns_get_selection_internal, Fns_store_selection_internal):
11142 Use ns_symbol_to_pb and check if return value is nil.
11143 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
11144 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
11145 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11146 renamed to Sns_store_selection_internal.
11147 (ns_handle_selection_request): Move code to Fx_own_selection_internal
11148 and remove this function.
11149 (ns_handle_selection_clear): Remove, never used.
11150 (Fx_own_selection_internal): Move code from ns_handle_selection_request
11151 here.
11152
11153 2011-12-17 Ken Brown <kbrown@cornell.edu>
11154
11155 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11156 GID is unknown (Bug#10257).
11157
11158 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
11159
11160 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11161 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11162 which caused a build failure on GNU/Linux IA-64. This problem was
11163 introduced by my 2011-10-07 patch.
11164
11165 2011-12-15 Juri Linkov <juri@jurta.org>
11166
11167 * image.c (imagemagick_error): New function. (Bug#10112)
11168 (imagemagick_load_image): Comment out `MagickSetResolution' call.
11169 Use `imagemagick_error' where ImageMagick functions return
11170 `MagickFalse'.
11171 (Fimagemagick_types): Add `Fnreverse' to return the list in the
11172 proper order.
11173
11174 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11175
11176 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11177 fill background (Bug#8992).
11178
11179 2011-12-13 Martin Rudalics <rudalics@gmx.at>
11180
11181 * window.c (Vwindow_combination_resize)
11182 (Vwindow_combination_limit): Use t instead of non-nil in
11183 doc-strings.
11184 (Vrecenter_redisplay): Add first sentence of doc-string on
11185 separate line.
11186 (Frecenter): Fix doc-string typo.
11187
11188 2011-12-11 Kenichi Handa <handa@m17n.org>
11189
11190 * coding.c (Funencodable_char_position): Pay attention to the
11191 buffer text relocation (Bug#9389).
11192
11193 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11194
11195 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11196 gtk_init (Bug#10100).
11197
11198 2011-12-10 Eli Zaretskii <eliz@gnu.org>
11199
11200 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
11201 IT->string is nil. (Bug#10263)
11202
11203 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11204
11205 * nsterm.h (x_free_frame_resources): Declare.
11206
11207 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
11208 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
11209
11210 * nsterm.h (ns_get_defaults_value): Declare.
11211
11212 * nsterm.m (ns_default): Call ns_get_defaults_value.
11213
11214 2011-12-09 Eli Zaretskii <eliz@gnu.org>
11215
11216 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
11217 (Bug#10170)
11218
11219 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11220
11221 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
11222 that where the value of an _OBJC_* symbol points to is in the .bss
11223 section (Bug#10240).
11224
11225 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11226
11227 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
11228 after the loop to call ccl_driver at least once (Bug#8619).
11229
11230 2011-12-08 Kenichi Handa <handa@m17n.org>
11231
11232 * ftfont.c (get_adstyle_property): Fix previous change
11233 (Bug#10233).
11234
11235 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
11236
11237 * w32.c (init_environment): If no_site_lisp, remove site-lisp
11238 dirs from the default value of EMACSLOADPATH (bug#10208).
11239
11240 2011-12-07 Glenn Morris <rgm@gnu.org>
11241
11242 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
11243 installation and source directories as well. (Bug#10208)
11244
11245 2011-12-06 Chong Yidong <cyd@gnu.org>
11246
11247 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
11248
11249 2011-12-06 Glenn Morris <rgm@gnu.org>
11250
11251 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
11252 as an error, not just -1. (Bug#10217)
11253
11254 2011-12-05 Chong Yidong <cyd@gnu.org>
11255
11256 * keyboard.c (process_special_events): New function.
11257 (swallow_events, Finput_pending_p): Use it (Bug#10195).
11258
11259 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
11260
11261 * coding.c (encode_designation_at_bol): Don't use uninitialized
11262 local variable (Bug#9318).
11263
11264 2011-12-05 Kenichi Handa <handa@m17n.org>
11265
11266 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
11267 return Qnil (Bug#8046, Bug#10193).
11268
11269 2011-12-05 Kenichi Handa <handa@m17n.org>
11270
11271 * coding.c (encode_designation_at_bol): New args charbuf_end and
11272 dst. Return the number of produced bytes. Callers changed.
11273 (coding_set_source): Return how many bytes coding->source was
11274 relocated.
11275 (coding_set_destination): Return how many bytes
11276 coding->destination was relocated.
11277 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
11278 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
11279
11280 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11281
11282 * coding.c (CODING_CHAR_CHARSET_P): New macro.
11283 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
11284 macro (Bug#9318).
11285
11286 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
11287
11288 The following changes are to fix Bug#9318.
11289
11290 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
11291 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
11292 (encode_coding_iso_2022, encode_coding_sjis)
11293 (encode_coding_big5, encode_coding_charset): Use the above macros.
11294
11295 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
11296
11297 * lisp.h (process_quit_flag): Fix external declaration.
11298
11299 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
11300
11301 Don't macro-inline non-performance-critical code.
11302 * eval.c (process_quit_flag): New function.
11303 * lisp.h (QUIT): Use it.
11304
11305 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
11306
11307 * nsfns.m (get_geometry_from_preferences): New function.
11308 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
11309
11310 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
11311
11312 * emacs.c (Qkill_emacs): Define.
11313 (syms_of_emacs): Initialize it.
11314 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
11315 Qquit_flag to `kill-emacs' instead.
11316 (quit_throw_to_read_char): Add parameter `from_signal'.
11317 All callers changed. Call Fkill_emacs if requested and safe.
11318 * lisp.h (QUIT): Call Fkill_emacs if requested.
11319
11320 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
11321
11322 * widget.c (update_wm_hints): Return if wmshell is null.
11323 (widget_update_wm_size_hints): New function.
11324
11325 * widget.h (widget_update_wm_size_hints): Declare.
11326
11327 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
11328 widget_update_wm_size_hints (Bug#10104).
11329
11330 2011-12-03 Eli Zaretskii <eliz@gnu.org>
11331
11332 * xdisp.c (handle_invisible_prop): If the invisible text ends just
11333 before a newline, prepare the bidi iterator for consuming the
11334 newline, and keep the current paragraph direction. (Bug#10183)
11335 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
11336
11337 2011-12-02 Juri Linkov <juri@jurta.org>
11338
11339 * search.c (Fword_search_regexp): New Lisp function created from
11340 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
11341 (Fword_search_backward, Fword_search_forward)
11342 (Fword_search_backward_lax, Fword_search_forward_lax):
11343 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
11344 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
11345
11346 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
11347
11348 * fileio.c (Finsert_file_contents): Move after-change-function call
11349 to before the "handled:" label, since all "goto handled" appear in
11350 cases where the *-change-functions have already been properly called
11351 (bug#10117).
11352
11353 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
11354
11355 * keyboard.c (interrupt_signal): Don't call kill-emacs when
11356 waiting for input. (Bug#10169)
11357
11358 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11359
11360 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11361 verifies glyph row's hash code--we have just reallocated the
11362 glyphs, so their contents can be complete garbage. (Bug#10164)
11363
11364 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
11365
11366 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11367
11368 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11369
11370 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11371 attributes are tested _before_ calling verify_row_hash, to protect
11372 against GCC re-ordering of the tests. (Bug#10164)
11373
11374 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
11375
11376 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11377
11378 * xterm.c (handle_one_xevent): Only set async_visible and friends
11379 if net_wm_state_hidden_seen is non-zero (Bug#10002)
11380 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11381 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11382
11383 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11384
11385 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11386 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11387 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11388 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11389 All uses changed to use GCPRO1 etc.
11390 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11391 Revert to old implementation (i.e., before 2011-03-11).
11392
11393 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11394
11395 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11396 of scroll runs so as to avoid assigning disabled bogus rows and
11397 unnecessary graphics copy operations.
11398
11399 2011-11-27 Eli Zaretskii <eliz@gnu.org>
11400
11401 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11402 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11403 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11404 (malloc, free, realloc, calloc): Redirect to e_* only when
11405 compiling Emacs.
11406
11407 * lisp.h (GCTYPEBITS): Move before first use.
11408 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11409 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11410 this macro definition.
11411
11412 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11413 _MSC_VER.
11414
11415 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11416
11417 * gtkutil.c (xg_create_frame_widgets):
11418 Call gtk_window_set_has_resize_grip (FALSE) if that function is
11419 present with Gtk+ 2.0.
11420
11421 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11422
11423 * fileio.c (Finsert_file_contents): Undo previous change; see
11424 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11425
11426 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11427
11428 Rename locals to avoid shadowing.
11429 * fileio.c (Finsert_file_contents):
11430 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11431 * process.c (wait_reading_process_output):
11432 Rename inner 'proc' to 'p' to avoid shadowing.
11433 Indent for consistency with usual Emacs style.
11434
11435 2011-11-25 Eli Zaretskii <eliz@gnu.org>
11436
11437 * xdisp.c (redisplay_window): If cursor row is not fully visible
11438 after recentering, and scroll-conservatively is set to a large
11439 number, scroll window by a few more lines to make the cursor fully
11440 visible and out of scroll-margin. (Bug#10105)
11441 (start_display): Don't move to the next line if the display should
11442 start at a newline that is part of a display vector or an overlay
11443 string. (Bug#10119)
11444
11445 2011-11-24 Juri Linkov <juri@jurta.org>
11446
11447 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11448 after the `MagickPingImage' call. (Bug#10112)
11449
11450 2011-11-23 Chong Yidong <cyd@gnu.org>
11451
11452 * window.c (Fcoordinates_in_window_p): Accept only live windows.
11453
11454 2011-11-23 Martin Rudalics <rudalics@gmx.at>
11455
11456 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11457 making another buffer current. (Bug#10114)
11458
11459 2011-11-23 Glenn Morris <rgm@gnu.org>
11460
11461 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
11462
11463 2011-11-23 Chong Yidong <cyd@gnu.org>
11464
11465 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11466 using it (Bug#5984).
11467
11468 2011-11-22 Eli Zaretskii <eliz@gnu.org>
11469
11470 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11471 and header-lines, as they don't have one computed for them.
11472 (Bug#10098)
11473
11474 * .gdbinit (prow): Make displayed values more self-explaining.
11475 Add row's hash code.
11476
11477 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
11478
11479 * process.c (wait_reading_process_output): Fix asynchrounous
11480 GnuTLS socket handling on some versions of the GnuTLS library.
11481 (wait_reading_process_output): Add comment and URL.
11482
11483 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
11484
11485 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11486
11487 2011-11-21 Chong Yidong <cyd@gnu.org>
11488
11489 * window.c (Fnext_window, Fprevious_window): Doc fix.
11490
11491 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11492
11493 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11494
11495 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11496
11497 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11498
11499 2011-11-20 Martin Rudalics <rudalics@gmx.at>
11500
11501 * window.c (Fset_window_combination_limit): Rename argument
11502 STATUS to LIMIT.
11503 (Vwindow_combination_limit): Remove "status" from doc-string.
11504
11505 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11506
11507 * m/ibms390.h: Remove.
11508 * m/ibms390x.h: Don't include "ibms390.h".
11509
11510 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11511
11512 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11513 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11514
11515 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11516
11517 * casetab.c (Fset_case_table):
11518 * charset.c (Fcharset_after): Fix typos.
11519
11520 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11521
11522 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11523 Otherwise, valgrind does not work on some platforms.
11524 Problem reported by Andreas Schwab in
11525 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11526 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11527 is set, removing the need for VIRT_ADDRESS_VARIES.
11528 (PURE_P): Use a more-efficient implementation that needs just one
11529 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11530 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11531 to 4 (xorl, subq, cmpq, setbe).
11532 * alloc.c (pure): Always extern now, since that's the
11533 VIRT_ADDR_VARIES behavior.
11534 (PURE_POINTER_P): Use a single comparison, not two, for
11535 consistency with the new puresize.h.
11536 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11537 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11538 Remove VIRT_ADDR_VARIES no longer needed.
11539
11540 2011-11-19 Eli Zaretskii <eliz@gnu.org>
11541
11542 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11543 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11544 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11545 behave as if the cursor position were at the window margin.
11546
11547 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11548 and the cursor position is out of bounds, behave as if the cursor
11549 position were at the window margin. (Bug#10075)
11550
11551 2011-11-18 Chong Yidong <cyd@gnu.org>
11552
11553 * window.c (Fwindow_combination_limit): Make first argument
11554 non-optional, since it is meaningless for live windows like the
11555 selected window.
11556
11557 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11558
11559 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11560
11561 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11562
11563 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11564 (graft_intervals_into_buffer): Simplify.
11565
11566 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11567
11568 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11569 hash values of the two rows.
11570 (copy_row_except_pointers): Preserve the used[] arrays and the
11571 hash values of the two rows. (Bug#10035)
11572 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11573
11574 * xdisp.c (row_hash): New function, body extracted from
11575 compute_line_metrics.
11576 (compute_line_metrics): Call row_hash, instead of computing the
11577 hash code inline.
11578
11579 * dispnew.c (verify_row_hash): Call row_hash for computing the
11580 hash code of a row, instead of duplicating code from xdisp.c.
11581
11582 * dispextern.h (row_hash): Add prototype.
11583
11584 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11585
11586 * frame.c (delete_frame): Don't delete the terminal when the last
11587 X frame is closed if emacs is built with GTK toolkit.
11588
11589 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
11590
11591 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11592
11593 2011-11-17 Martin Rudalics <rudalics@gmx.at>
11594
11595 * window.c (Vwindow_splits): Rename to
11596 Vwindow_combination_resize. Suggested by Juri Linkov.
11597 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11598 of Vwindow_splits.
11599
11600 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
11601
11602 * nsfns.m (Fns_font_name):
11603 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11604
11605 2011-11-16 Martin Rudalics <rudalics@gmx.at>
11606
11607 * window.h (window): Rename slot "nest" to "combination_limit".
11608 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11609 (Fset_window_nest): Rename to Fset_window_combination_limit.
11610 (Vwindow_nest): Rename to Vwindow_combination_limit.
11611 (recombine_windows, make_parent_window, make_window)
11612 (Fsplit_window_internal, saved_window)
11613 (Fset_window_configuration, save_window_save): Rename all
11614 occurrences of window_nest to window_combination_limit.
11615
11616 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
11617
11618 * image.c (imagemagick_load_image): Fix typo.
11619
11620 2011-11-14 Eli Zaretskii <eliz@gnu.org>
11621
11622 * xdisp.c (display_line): Move the call to
11623 highlight_trailing_whitespace before the call to
11624 compute_line_metrics, since the latter needs to see the final
11625 faces of all the glyphs to compute ROW's hash value.
11626 Fixes assertion violations in row_equal_p. (Bug#10035)
11627
11628 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11629
11630 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11631 just return (bug#10044).
11632
11633 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11634
11635 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11636 with user-defined heap size. Bump the default size of the temacs
11637 heap to 27MB, to avoid memory warning when running temacs.
11638 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11639
11640 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11641 current_matrix and desired_matrix. (Bug#9990)
11642 (verify_row_hash) [XASSERTS]: New function.
11643 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11644 that the hash value of glyph rows is correct.
11645
11646 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11647
11648 * window.h (window): Remove splits slot.
11649 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11650 (Fdelete_other_windows_internal, make_parent_window)
11651 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11652 (Fset_window_configuration, save_window_save): Don't deal with
11653 split status of windows.
11654 (saved_window): Remove splits slot.
11655 (Vwindow_splits): Rewrite doc-string.
11656
11657 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11658
11659 * xfns.c (unwind_create_frame):
11660 * nsfns.m (unwind_create_frame):
11661 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11662 Vframe_list (Bug#9999).
11663
11664 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11665
11666 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11667
11668 2011-11-11 Kenichi Handa <handa@m17n.org>
11669
11670 * callproc.c (Fcall_process): Set the member dst_multibyte of
11671 process_coding.
11672
11673 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11674
11675 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11676 avoid a crash (bug#9496).
11677
11678 2011-11-09 Chong Yidong <cyd@gnu.org>
11679
11680 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11681 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11682
11683 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11684
11685 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11686
11687 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11688
11689 Avoid some portability problems by eschewing 'extern inline' functions.
11690 The trivial performance wins aren't worth the portability hassles; see
11691 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11692 et seq.
11693 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11694 (window_box_width, window_box_left, window_box_left_offset)
11695 (window_box_right, window_box_right_offset): Undo previous change,
11696 by removing the "extern"s.
11697 * intervals.c (adjust_intervals_for_insertion)
11698 (adjust_intervals_for_deletion): Undo previous change,
11699 making these static again.
11700 (offset_intervals, temp_set_point_both, temp_set_point)
11701 (copy_intervals_to_string): No longer inline.
11702 * xdisp.c (window_text_bottom_y, window_box_width)
11703 (window_box_height, window_box_left_offset)
11704 (window_box_right_offset, window_box_left, window_box_right)
11705 (window_box): No longer inline.
11706
11707 2011-11-08 Chong Yidong <cyd@gnu.org>
11708
11709 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11710 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11711 Signal an error if not a live window.
11712 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11713 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11714
11715 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11716
11717 * lisp.h (syms_of_abbrev): Remove declaration.
11718 Reported by CHENG Gao <chenggao@royau.me>.
11719
11720 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11721
11722 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11723 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11724 of temacs in GUI mode.
11725
11726 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11727
11728 * window.h: Declare delete_all_child_windows instead of
11729 delete_all_subwindows.
11730 * window.c (Fwindow_nest, Fset_window_nest)
11731 (Fset_window_new_total, Fset_window_new_normal)
11732 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11733 (delete_all_subwindows): Rename to delete_all_child_windows.
11734 (Fdelete_other_windows_internal, Fset_window_configuration):
11735 Call delete_all_child_windows instead of delete_all_subwindows.
11736 * frame.c (delete_frame): Call delete_all_child_windows instead
11737 of delete_all_subwindows.
11738
11739 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11740
11741 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11742 This is also needed for porting to any host where GC_MARK_STACK is
11743 not GC_MAKE_GCPROS_NOOPS.
11744 (which_symbols): Use it.
11745
11746 2011-11-07 Kenichi Handa <handa@m17n.org>
11747
11748 * coding.c (coding_set_destination): Check coding->src_pos only
11749 when coding->src_object is a buffer (bug#9910).
11750
11751 * process.c (send_process): Set the member src_multibyte of coding
11752 to 0 (bug#9911) when sending a unibyte text.
11753
11754 * callproc.c (Fcall_process): Set the member src_multibyte of
11755 process_coding to 0 (bug#9912).
11756
11757 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11758
11759 * xmenu.c (cleanup_widget_value_tree): New function.
11760 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11761 calling free_menubar_widget_value_tree directly (Bug#9830).
11762
11763 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11764
11765 Fix some portability problems with 'inline'.
11766 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11767 (window_box_width, window_box_left, window_box_left_offset)
11768 (window_box_right, window_box_right_offset): Declare extern.
11769 Otherwise, these inline functions do not conform to C99 and
11770 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11771 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11772 * intervals.c (adjust_intervals_for_insertion)
11773 (adjust_intervals_for_deletion): Now extern, because otherwise the
11774 extern inline functions 'offset_intervals' couldn't refer to it.
11775 (static_offset_intervals): Remove.
11776 (offset_intervals): Rewrite using the old contents of
11777 static_offset_intervals. The old version didn't conform to C99
11778 because an extern inline function contained a reference to an
11779 identifier with static linkage.
11780
11781 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11782
11783 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11784 GC.
11785
11786 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11787
11788 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11789 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11790 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11791 return Qleft_to_right.
11792
11793 2011-11-06 Chong Yidong <cyd@gnu.org>
11794
11795 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11796 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11797 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11798 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11799 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11800 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11801 (Fwindow_vscroll): Doc fix.
11802 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11803 argument, since it makes no sense to pass a live window and for
11804 consistency with window-child.
11805
11806 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11807
11808 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11809 support MSVC.
11810
11811 2011-11-05 Jason Rumney <jasonr@gnu.org>
11812
11813 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11814 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11815 fonts (Bug#6029).
11816 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11817 bitwise arithmetic preventing use of unicode-sip and non-truetype
11818 opentype fonts.
11819
11820 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11821
11822 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11823 "emacs"-only part.
11824
11825 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11826 initialization code to keep similarity to xfns.c after changes
11827 from 2011-11-05.
11828
11829 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11830
11831 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11832 (unwind_create_frame): New function (Bug#9943).
11833 (Fx_create_frame): Restructure code to be more similar to the one in
11834 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11835 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11836 Move terminal->reference_count++ just before making the frame official
11837 (Bug#9943).
11838
11839 * nsterm.m (x_free_frame_resources): New function.
11840 (x_destroy_window): Move code to x_free_frame_resources.
11841
11842 * xfns.c (unwind_create_frame): Fix comment.
11843 (Fx_create_frame, x_create_tip_frame):
11844 Move terminal->reference_count++ just before making the frame
11845 official. Move initialization of image_cache_refcount and
11846 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11847
11848 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11849
11850 Support MSVC build with newer versions of Visual Studio.
11851 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11852 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11853 nt/gmake.defs.
11854
11855 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11856 which are not supported by MSVC.
11857 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11858 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11859 bitfields.
11860 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11861 types in bitfields.
11862 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11863
11864 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11865
11866 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11867
11868 Support MSVC build with newer versions of Visual Studio.
11869 * w32.c: Don't include w32api.h for MSVC.
11870 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11871
11872 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11873 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11874 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11875 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11876 e_* cousins.
11877 (alloca) [_MSC_VER]: Define to _alloca.
11878
11879 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11880
11881 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11882
11883 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11884
11885 * xdisp.c (note_mouse_highlight): If either of
11886 previous/next-single-property-change returns nil, treat that as
11887 the beginning or the end of the buffer. (Bug#9955)
11888
11889 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11890
11891 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11892 label is not null (Bug#9951).
11893 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11894 may be NULL.
11895
11896 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11897
11898 * window.c (Fwindow_body_size): Mention in the doc string that the
11899 return value is in frame's canonical units. (Bug#9949)
11900
11901 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11902
11903 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11904
11905 * w32fns.c (unwind_create_frame): If needed, free the glyph
11906 matrices of the partially constructed frame. (Bug#9943)
11907 * xfns.c (unwind_create_frame): Likewise.
11908
11909 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11910
11911 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11912 Don't stop backward scan on the continuation glyph, even though
11913 its CHARPOS is positive.
11914 (mouse_face_from_buffer_pos, note_mouse_highlight):
11915 Rename cover_string to disp_string.
11916
11917 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11918
11919 * window.c (temp_output_buffer_show): Don't use
11920 Vtemp_buffer_show_specifiers.
11921 (Vtemp_buffer_show_specifiers): Remove unused variable.
11922
11923 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11924
11925 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11926 past the beginning of the current glyph matrix.
11927
11928 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11929
11930 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11931 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11932 HAVE_GTK3 (Bug#9869).
11933
11934 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11935 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11936
11937 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11938
11939 * xterm.c: Declare x_handle_net_wm_state to return int.
11940 (handle_one_xevent): Check if we are iconified but don't have
11941 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11942 (get_current_wm_state): Return non-zero if not hidden,
11943 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11944 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11945 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11946 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11947
11948 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11949
11950 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11951 so that this new function doesn't get optimized away by a
11952 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11953
11954 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11955
11956 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11957
11958 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11959
11960 Fix the `xbytecode' command.
11961 * .gdbinit (xprintbytestr): New command.
11962 (xwhichsymbols): Rename from `which'; all callers changed.
11963 (xbytecode): Print the byte-code string as well.
11964
11965 2011-10-29 Kim Storm <storm@cua.dk>
11966
11967 * alloc.c (which_symbols): New function.
11968
11969 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11970
11971 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11972 line. (Bug#9903)
11973
11974 2011-10-29 Glenn Morris <rgm@gnu.org>
11975
11976 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11977 Not clear what it was for, and it causes various bugs. (Bug#9839)
11978
11979 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11980
11981 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11982 possible random value that matches one of those tested as
11983 condition to clear the mouse face.
11984
11985 2011-10-28 Chong Yidong <cyd@gnu.org>
11986
11987 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11988
11989 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11990
11991 * window.c (make_window): Initialize phys_cursor_on_p.
11992
11993 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11994
11995 * lisp.h (struct Lisp_Symbol): Update comments.
11996
11997 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11998
11999 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12000
12001 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12002
12003 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
12004 <oslsachem@gmail.com> for helping to debug this.
12005
12006 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12007 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12008 (g_b_init_get_glyph_outline_w): New static variables.
12009 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12010 (GetGlyphOutlineW_Proc): New typedefs.
12011 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12012 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12013 New functions.
12014 (w32font_open_internal, compute_metrics):
12015 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12016 instead of calling the "wide" APIs directly.
12017
12018 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12019
12020 * w32.h (syms_of_w32font): Add prototype.
12021
12022 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12023
12024 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12025 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12026 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12027 (Fmove_to_window_line): Doc fix.
12028
12029 2011-10-27 Chong Yidong <cyd@gnu.org>
12030
12031 * process.c (make_process): Set gnutls_state to NULL.
12032
12033 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12034 non-NULL, regardless of GNUTLS_INITSTAGE.
12035 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12036 an error. Set process slots as soon as we allocate them.
12037
12038 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12039
12040 2011-10-27 Chong Yidong <cyd@gnu.org>
12041
12042 * gnutls.c (emacs_gnutls_deinit): New function.
12043 Deallocate credentials structures as well as calling gnutls_deinit.
12044 (Fgnutls_deinit, Fgnutls_boot): Use it.
12045
12046 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12047 (deactivate_process): Call emacs_gnutls_deinit.
12048
12049 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12050
12051 * image.c (x_create_x_image_and_pixmap):
12052 * w32.c (sys_rename, w32_delayed_load):
12053 * w32font.c (fill_in_logfont):
12054 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12055
12056 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
12057
12058 * w32fns.c (w32_default_color_map): New function,
12059 extracted from Fw32_default_color_map.
12060 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
12061
12062 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
12063
12064 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12065
12066 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
12067
12068 * keyboard.c (test_undefined): New function (bug#9751).
12069 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12070
12071 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
12072
12073 * sysdep.c (init_sys_modes): Fix the check for the controlling
12074 terminal (Bug#6649).
12075
12076 2011-10-20 Eli Zaretskii <eliz@gnu.org>
12077
12078 * dispextern.h (struct bidi_it): New member next_en_type.
12079
12080 * bidi.c (bidi_line_init): Initialize the next_en_type member.
12081 (bidi_resolve_explicit_1): When next_en_pos is valid for the
12082 current character, check also for next_en_type being WEAK_EN.
12083 (bidi_resolve_weak): Don't enter the expensive loop if the current
12084 position is before next_en_pos. Record the bidi type of the first
12085 non-ET, non-BN character we find, in addition to its position.
12086 (bidi_level_of_next_char): Invalidate next_en_type when
12087 next_en_pos is over-stepped.
12088
12089 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
12090
12091 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12092 * editfns.c: Rewrite current-time-zone so that it invokes
12093 the equivalent of (format-time-string "%Z") to get the time zone name.
12094 This fixes a bug when the time zone name contains characters that
12095 need converting from the system time locale to Emacs internal format.
12096 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12097 that patch fixed format-time-string to do the conversion, but
12098 I forgot to fix current-time-zone.
12099 (format_time_string): New function, containing most of
12100 what Fformat_time_string used to contain.
12101 (Fformat_time_string): Rewrite in terms of format_time_string.
12102 This doesn't change this function's behavior.
12103 (current-time-zone): Rewrite to use format_time_string.
12104 This fixes the bug reported by Michael Schierl in
12105 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12106 Jason Rumney's 2007-06-07 change worked around this bug, but
12107 didn't fix it.
12108 * systime.h (tzname, timezone): Remove no-longer-used declarations.
12109
12110 2011-10-19 Eli Zaretskii <eliz@gnu.org>
12111
12112 * xdisp.c (start_display): If the character at POS is displayed
12113 via a display vector, reset IT->current.dpvec_index to zero.
12114 (try_window_reusing_current_matrix): If a line ends in a display
12115 vector or the next line starts in a display vector, continue
12116 redrawing the window even though the character position of
12117 start_row was reached.
12118 (Bug#9771, part 2)
12119
12120 2011-10-18 Chong Yidong <cyd@gnu.org>
12121
12122 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12123 with nobreak-char-display too.
12124
12125 2011-10-18 Eli Zaretskii <eliz@gnu.org>
12126
12127 Fix part 3 of bug#9771.
12128 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12129 (bidi_resolve_neutral): Don't enter the expensive loop looking for
12130 non-neutral characters if the current character is a paragraph
12131 separator (a.k.a. Newline). This avoids running the same
12132 expensive loop twice, once when we consume the preceding newline
12133 and the other time when the line actually needs to be displayed.
12134 Avoid the loop when we see neutrals on the base embedding level
12135 following a character whose directionality is the same as the
12136 paragraph's. This avoids running the expensive loop when a line
12137 ends in a long sequence of neutrals, like control characters.
12138 Add assertion against STRONG_AL type. Slightly rearrange code
12139 that determines the type of a neutral given the first non-neutral
12140 that follows it.
12141 (bidi_level_of_next_char): Set next_en_pos to zero when
12142 invalidating its info.
12143
12144 2011-10-17 Eli Zaretskii <eliz@gnu.org>
12145
12146 * xdisp.c (push_display_prop): Determine whether to record string
12147 or buffer position by IT->string, not by IT->method. Allow
12148 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
12149 (move_it_vertically_backward): Don't look for character position
12150 immediately after the newline when in a continuation line.
12151 (Bug#9771, part 1)
12152
12153 2011-10-15 Martin Rudalics <rudalics@gmx.at>
12154
12155 * window.c (coordinates_in_window): Rewrite and delabelize
12156 vertical border check. (Bug#5357) (Bug#9618)
12157
12158 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
12159
12160 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12161 errors in XSetWindowBorder (bug#9310).
12162
12163 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
12164
12165 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12166 avoid crash when xmalloc overrun checking is enabled.
12167
12168 2011-10-13 Eli Zaretskii <eliz@gnu.org>
12169
12170 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12171 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
12172 cursor motion with <left> and <right> arrow keys.
12173
12174 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12175 some callers set that themselves.
12176
12177 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12178
12179 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12180 display string and the previous row comes from the same string and
12181 is empty. (Bug#9739) (Bug#9738)
12182
12183 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
12184
12185 * doc.c (get_doc_string): Encode file name (bug#9735).
12186
12187 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12188
12189 * bidi.c (bidi_level_of_next_char):
12190 * xdisp.c (get_visually_first_element): Remove old incorrect
12191 comments regarding the Unicode Line Separator character.
12192
12193 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12194
12195 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
12196
12197 * alloc.c (Fgc_status): Do not access beyond zombies array
12198 boundary if nzombies > MAX_ZOMBIES.
12199 * alloc.c (dump_zombies): Add missing format specifier.
12200
12201 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
12202
12203 * xdisp.c (set_cursor_from_row): Simplify conditionals,
12204 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
12205
12206 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
12207 Some packages use them to denote characters with modifiers.
12208
12209 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
12210
12211 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
12212 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
12213 matching a pp-number. Rename parameter var to var1.
12214
12215 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
12216
12217 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
12218
12219 2011-10-08 Glenn Morris <rgm@gnu.org>
12220
12221 * callint.c (Fcall_interactively): Give a more explicit error for the
12222 'c' case with a non-character input. (Bug#8479)
12223
12224 2011-10-08 Eli Zaretskii <eliz@gnu.org>
12225
12226 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
12227 lines.
12228 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
12229 lines that are hscrolled on the left.
12230
12231 * dispnew.c (buffer_posn_from_coords): Account for a possible
12232 presence of header-line. (Bug#4426)
12233
12234 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
12235
12236 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
12237 Don't advertise functionality which we discourage or doesn't work.
12238
12239 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
12240
12241 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
12242 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
12243 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
12244 this makes Emacs dump core during garbage collection on rare
12245 occasions. sizeof is obviously inferior to offsetof here, so
12246 stick with offsetof.
12247 (GC_POINTER_ALIGNMENT): New macro.
12248 (mark_memory): Omit 3rd (offset) arg; caller changed.
12249 Don't assume EMACS_INT alignment is the same as pointer alignment.
12250
12251 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
12252
12253 * keyboard.c (read_key_sequence_remapped): New var.
12254 (read_key_sequence): Compute remapping in the right buffer.
12255 (command_loop_1): Use read_key_sequence's remapping directly.
12256
12257 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
12258
12259 * dired.c (file_name_completion): Don't expand file name.
12260 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
12261 before checking file name handler.
12262
12263 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
12264 they've been requested explicitly (bug#9591).
12265
12266 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
12267
12268 * keymap.c (Fsingle_key_description): Use make_specified_string
12269 instead of build_string to build string from push_key_description.
12270 (Bug#5193)
12271
12272 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12273
12274 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
12275 This fixes a Y2038 bug on 64-bit hosts.
12276 * buffer.c (reset_buffer):
12277 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
12278 (Fclear_buffer_auto_save_failure):
12279 Use 0, not -1, to represent an unset failure time, since time_t
12280 might not be signed.
12281
12282 Remove dependency on glibc malloc internals.
12283 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12284 Move back here from lisp.h, but with their new implementations.
12285 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12286 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
12287 * charset.c (charset_table_init): New static var.
12288 (syms_of_charset): Use it instead of xmalloc. This removes a
12289 dependency on glibc malloc internals. See Eli Zaretskii's comment in
12290 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
12291 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12292 Move back to alloc.c.
12293 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12294 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
12295
12296 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
12297
12298 * nsterm.m (windowDidResize): Call x_set_window_size only when
12299 ns_in_resize is true. Otherwise set pixelwidth/height and
12300 call change_frame_size (Bug#9628).
12301
12302 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12303
12304 Port --enable-checking=all to Fedora 14 x86-64.
12305 * charset.c (syms_of_charset): Also account for glibc malloc's
12306 internal overhead when calculating the initial malloc maximum.
12307
12308 Port --enable-checking=all to Fedora 14 x86.
12309 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12310 Move to lisp.h.
12311 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
12312 (overrun_check_realloc, overrun_check_free):
12313 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
12314 That way, xmalloc returns a properly-aligned pointer even if
12315 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
12316 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
12317 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
12318 into account when calculating the initial malloc maximum.
12319 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12320 Move here from alloc.c, so that charset.c can use it too.
12321 Properly align; the old code wasn't right for common 32-bit hosts
12322 when configured with --enable-checking=all.
12323 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12324 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
12325
12326 2011-09-29 Eli Zaretskii <eliz@gnu.org>
12327
12328 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
12329 use EDOM.
12330
12331 2011-09-28 Eli Zaretskii <eliz@gnu.org>
12332
12333 * xdisp.c (compute_display_string_end): If there's no display
12334 string at CHARPOS, return -1.
12335
12336 * bidi.c (bidi_fetch_char): When compute_display_string_end
12337 returns a negative value, treat the character as a normal
12338 character not covered by a display string. (Bug#9624)
12339
12340 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
12341
12342 * lread.c (Fread_from_string): Fix typo in docstring.
12343
12344 2011-09-27 Eli Zaretskii <eliz@gnu.org>
12345
12346 * xdisp.c (handle_invisible_prop): If invisible text ends on a
12347 newline, reseat the iterator instead of bidi-iterating there one
12348 character at a time. (Bug#9610)
12349 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
12350 TO_CHARPOS if the bidi iterator is at base embedding level.
12351
12352 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
12353
12354 * lread.c (readevalloop): Use correct code for NBSP.
12355 (read1): Likewise. (Bug#9608)
12356
12357 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
12358
12359 * dbusbind.c (Fdbus_register_signal): When service is not
12360 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
12361
12362 2011-09-25 Glenn Morris <rgm@gnu.org>
12363
12364 * buffer.c (truncate-lines): Doc fix.
12365
12366 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
12367
12368 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12369 (Fset_window_next_buffers): Doc fix.
12370
12371 2011-09-24 Glenn Morris <rgm@gnu.org>
12372
12373 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
12374
12375 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
12376
12377 Fix minor problems found by static checking.
12378 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12379 * indent.c (Fvertical_motion): Fix == vs = typo.
12380
12381 2011-09-24 Eli Zaretskii <eliz@gnu.org>
12382
12383 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12384 Default value is now t. Doc fix.
12385
12386 * indent.c (Fvertical_motion): Compute and apply the overshoot
12387 logic when moving up, not only when moving down. Fix the
12388 confusing name and values of the it_overshoot_expected variable;
12389 logic changes accordingly. (Bug#9254) (Bug#9549)
12390
12391 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12392 CHARPOS is covered by a display string which includes newlines.
12393 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12394 is covered by a display string with embedded newlines.
12395
12396 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
12397
12398 * dbusbind.c (Fdbus_register_signal): Add match rule to
12399 Vdbus_registered_objects_table. (Bug#9581)
12400 (Fdbus_register_method, Vdbus_registered_objects_table):
12401 Fix docstring.
12402
12403 2011-09-24 Jim Meyering <meyering@redhat.com>
12404
12405 do not ignore write error for any output size
12406 The previous change was incomplete.
12407 While it makes emacs --batch detect the vast majority of stdout
12408 write failures, errors were still ignored whenever the output size is
12409 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12410 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12411 && echo FAIL: ignored write error
12412 FAIL: ignored write error
12413 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12414 && echo FAIL: ignored write error
12415 FAIL: ignored write error
12416 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12417
12418 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12419
12420 * emacs.c (Fkill_emacs): In noninteractive mode exit
12421 non-successfully if a write error occurred on stdout. (Bug#9574)
12422
12423 2011-09-21 Eli Zaretskii <eliz@gnu.org>
12424
12425 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12426 the xassert test.
12427
12428 * dispextern.h (struct it): Update the comment documenting what
12429 can it->OBJECT be.
12430
12431 2011-09-20 Eli Zaretskii <eliz@gnu.org>
12432
12433 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12434 a display string, extend search for cursor position to end of row.
12435 (find_row_edges): If the row ends in a newline from a display
12436 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12437 Handle the case of a display string with multiple newlines.
12438 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12439 non-empty line. Fixes confusing cursor motion with arrow keys at
12440 the beginning of a line that starts with whitespace.
12441
12442 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12443
12444 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12445 (bug#9493).
12446
12447 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
12448
12449 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12450 boolean (Bug#9154).
12451
12452 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12453
12454 * xdisp.c (display_line): Record maximum and minimum buffer
12455 positions even if no glyphs were produced (e.g., by a zero-width
12456 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
12457 buffer positions that will be removed from the glyph row because
12458 they don't fit.
12459 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12460 column is beyond frame width: don't subtract 1 "pixel" when
12461 computing width of the stretch.
12462 (reseat_at_next_visible_line_start): Undo the change made on
12463 2011-09-17 that saved paragraph information and restored it after
12464 the call to `reseat'. (Bug#9545)
12465
12466 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12467
12468 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12469 and turn window cursor on if cleared (Bug#9415).
12470
12471 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
12472
12473 * search.c (boyer_moore): Take unibyte characters from pattern
12474 literally. (Bug#9458)
12475
12476 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12477
12478 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12479
12480 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
12481
12482 Fix minor problem found by static checking.
12483 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12484 initialized, to pacify gcc -Wuninitialized.
12485
12486 * fileio.c: Report proper errno when syscall falls.
12487 (Finsert_file_contents): Save and restore errno,
12488 so that report_file_error outputs the correct diagnostic.
12489 (Fwrite_region) [CLASH_DETECTION]: Likewise.
12490
12491 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12492
12493 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12494
12495 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12496
12497 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12498 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
12499
12500 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12501
12502 * xdisp.c (reseat_at_next_visible_line_start): Keep information
12503 about the current paragraph and restore it after the call to reseat.
12504
12505 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12506 (bidi_find_paragraph_start): Search back for paragraph beginning
12507 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12508 (bidi_move_to_visually_next): Only trigger paragraph-related
12509 computations when the last character is a newline or at EOB, not
12510 just any NEUTRAL_B. (Bug#9470)
12511
12512 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12513 truncated lines if point is covered by a display string. (Bug#9524)
12514
12515 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12516
12517 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12518 (cons_to_x_long): New function.
12519 (lisp_data_to_selection_data): Use it. Correct the test for
12520 short-versus-long data; it was negated. Break out of vector
12521 loop, for efficiency, when a long datum is discovered.
12522
12523 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12524
12525 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12526
12527 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12528
12529 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12530 GCC PR/17406) by declaring this function with external scope.
12531
12532 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12533
12534 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12535 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12536
12537 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12538
12539 * editfns.c (Fformat): Correctly handle text properties on "%%".
12540
12541 2011-09-15 Eli Zaretskii <eliz@gnu.org>
12542
12543 * xterm.c (x_draw_composite_glyph_string_foreground):
12544 * w32term.c (x_draw_composite_glyph_string_foreground):
12545 * term.c (encode_terminal_code):
12546 * composite.c (composition_update_it, get_composition_id):
12547 * xdisp.c (get_next_display_element)
12548 (fill_composite_glyph_string): Add comments about special meaning
12549 of TAB characters in a composition.
12550
12551 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12552
12553 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12554 This occurs when processing a multibyte format.
12555 Problem reported by Wolfgang Jenker.
12556
12557 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12558
12559 * xdisp.c (try_cursor_movement): Only check for exact match if
12560 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12561
12562 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12563
12564 Remove unused external symbols.
12565 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12566 * xdisp.c (calc_pixel_width_or_height): Now static.
12567 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12568 * indent.c (check_display_width):
12569 * w32term.c: Fix comment to match code.
12570 * xterm.c, xterm.h (x_catching_errors): Remove.
12571
12572 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12573
12574 * xselect.c: Use signed conversions more consistently (Bug#9498).
12575 (selection_data_to_lisp_data): Assume incoming selection data are
12576 signed integers, not unsigned. This is to be consistent with
12577 outgoing selection data, which was modified to use signed integers
12578 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12579 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12580 expects long, not unsigned long.
12581
12582 2011-09-14 Eli Zaretskii <eliz@gnu.org>
12583
12584 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12585 computation of loop end. Reported by Johan Bockgård
12586 <bojohan@gnu.org>.
12587
12588 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
12589
12590 * frame.c (Fother_visible_frames_p): Function deleted.
12591
12592 2011-09-12 Eli Zaretskii <eliz@gnu.org>
12593
12594 * indent.c (compute_motion): Process display vector front to back
12595 rather than the other way around. (Bug#2496)
12596
12597 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12598
12599 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12600
12601 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
12602
12603 * minibuf.c (Fread_from_minibuffer): Doc fix.
12604
12605 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12606
12607 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12608 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12609
12610 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12611
12612 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12613 value for non-existent files.
12614
12615 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12616
12617 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12618 set its "size" to -1. This will set the modtime_size field of
12619 the corresponding buffer to -1, which is what
12620 verify-visited-file-modtime expects for files that do not exist.
12621 (Bug#9139)
12622
12623 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12624
12625 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12626 here ...
12627 * lisp.h: ... from here. push_key_description is no longer
12628 defined in keyboard.c, so its declaration should not be in
12629 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12630 logically belongs with push_key_description.
12631
12632 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12633
12634 * buffer.h: Include <sys/types.h> instead of <time.h>.
12635 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12636 Problem reported by Herbert J. Skuhra.
12637
12638 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12639
12640 * xml.c (parse_region): Make the parsing work for
12641 non-comment-starting XML files again (bug#9144).
12642
12643 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12644
12645 * image.c (gif_load): Fix calculation of bottom and right corner.
12646 (Bug#9468)
12647
12648 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12649
12650 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12651 redisplay in small windows.
12652
12653 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12654
12655 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12656
12657 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12658
12659 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12660 Operate on live windows only.
12661
12662 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12663
12664 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12665
12666 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12667
12668 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12669 only under bidi iteration.
12670
12671 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12672
12673 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12674
12675 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12676
12677 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12678 Without this fix, the command to link temacs failed due to an
12679 undefined symbol __builtin_isnan. This is because
12680 /usr/include/iso/math_c99.h #defines isnan(x) to
12681 __builtin_isnan(x), but the bundled gcc, which identifies itself
12682 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12683 a __builtin_isnan.
12684 * floatfns.c (isnan): #undef, and then #define to a clone of
12685 what's in data.c.
12686 (Fisnan): Always define, since it's always available now.
12687 (syms_of_floatfns): Always define isnan at the Lisp level.
12688
12689 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12690
12691 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12692
12693 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12694
12695 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12696 The previous code assumed that file offsets (off_t values) fit in
12697 EMACS_INT variables, which is not true on typical 32-bit hosts.
12698 The code messed up by falsely reporting buffer overflow in cases
12699 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12700 when "big" contains more than 2**29 bytes, even though this
12701 inserts just one byte and does not overflow the buffer.
12702 (Finsert_file_contents): Store file offsets as off_t
12703 values, not as EMACS_INT values. Check for overflow when
12704 converting between EMACS_INT and off_t. When checking for
12705 buffer overflow or for overlap, take the offsets into account.
12706 Don't use EMACS_INT for small values where int suffices.
12707 When checking for overlap, fix a typo: ZV was used where
12708 ZV_BYTE was intended.
12709 (Fwrite_region): Don't assume off_t fits into 'long'.
12710 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12711
12712 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12713
12714 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12715
12716 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12717
12718 sprintf-related integer and memory overflow issues (Bug#9412).
12719
12720 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12721 (esprintf, exprintf, evxprintf): New functions.
12722 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12723 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12724 (modify_event_symbol): Do not assume that the length of
12725 name_alist_or_stem is safe to alloca and fits in int.
12726 (Fexecute_extended_command): Likewise for function name and binding.
12727 (Frecursion_depth): Wrap around reliably on integer overflow.
12728 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12729 since some callers pass EMACS_INT values.
12730 (Fsingle_key_description): Don't crash if symbol name contains more
12731 than MAX_ALLOCA bytes.
12732 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12733 (get_minibuffer): Arg is now EMACS_INT, not int.
12734 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12735 (esprintf, exprintf, evxprintf): New decls.
12736 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12737
12738 * dbusbind.c (signature_cat): New function.
12739 (xd_signature, Fdbus_register_signal):
12740 Do not overrun buffer; instead, report string overflow.
12741
12742 * dispnew.c (add_window_display_history): Don't overrun buffer.
12743 Truncate instead; this is OK since it's just a log.
12744
12745 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12746 even if the time zone offset is outlandishly large.
12747 Don't mishandle offset == INT_MIN.
12748
12749 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12750 when creating daemon; the previous buffer-overflow check was incorrect.
12751
12752 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12753 which has the guts of the old verror function.
12754
12755 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12756 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12757
12758 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12759 (font_unparse_xlfd): Don't blindly alloca long strings.
12760 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12761 fits in int, when using sprintf. Use single snprintf to count
12762 length of string rather than counting it via multiple sprintfs;
12763 that's simpler and more reliable.
12764 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12765 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12766 sprintf, in case result does not fit in int.
12767
12768 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12769 (fontset_from_font): Print it.
12770
12771 * frame.c (tty_frame_count): Now printmax_t, not int.
12772 (make_terminal_frame, set_term_frame_name): Print it.
12773 (x_report_frame_params): In X, window IDs are unsigned long,
12774 not signed long, so print them as unsigned.
12775 (validate_x_resource_name): Check for implausibly long names,
12776 and don't assume name length fits in 'int'.
12777 (x_get_resource_string): Don't blindly alloca invocation name;
12778 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12779 not fit in int.
12780
12781 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12782 (xg_check_special_colors, xg_set_geometry):
12783 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12784
12785 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12786 Use esprintf, not sprintf, in case result does not fit in int.
12787
12788 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12789 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12790 it as a large positive number.
12791 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12792 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12793
12794 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12795 in case result does not fit in int.
12796
12797 * print.c (float_to_string): Detect width overflow more reliably.
12798 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12799 buffer overrun. Don't assume list length fits in 'int'. Treat
12800 print length of 0 as 0, not as infinity; to be consistent with other
12801 uses of print length in this function. Don't overflow print length
12802 index. Don't assume hash table size fits in 'long', or that
12803 vectorlike size fits in 'unsigned long'.
12804
12805 * process.c (make_process): Use printmax_t, not int, to format
12806 process-name gensyms.
12807
12808 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12809
12810 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12811 to avoid potential buffer overrun.
12812
12813 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12814 if X resource line is longer than 512 bytes.
12815
12816 * xfns.c (x_window): Make sprintf buffer a bit bigger
12817 to avoid potential buffer overrun.
12818
12819 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12820
12821 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12822
12823 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12824
12825 Integer overflow fixes for scrolling, etc.
12826 Without these, Emacs silently mishandles large integers sometimes.
12827 For example, "C-u 4294967297 M-x recenter" was treated as if
12828 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12829
12830 * xdisp.c (try_window_id): Check Emacs fixnum range before
12831 converting to 'int'.
12832
12833 * window.c (window_scroll_line_based, Frecenter):
12834 Check that an Emacs fixnum is in range before assigning it to 'int'.
12835 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12836 values converted from Emacs fixnums.
12837 (Frecenter): Don't wrap around a line count if it is out of 'int'
12838 range; instead, treat it as an extreme value.
12839 (Fset_window_configuration, compare_window_configurations):
12840 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12841
12842 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12843 that can exceed INT_MAX. Check that EMACS_INT value is in range
12844 before assigning it to the (possibly-narrower) index.
12845 (match_limit): Don't assume that a fixnum can fit in 'int'.
12846
12847 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12848 exceed INT_MAX.
12849
12850 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12851 (Fvertical_motion): Don't wrap around LINES values that don't fit
12852 in 'int'. Instead, treat them as extreme values. This is good
12853 enough for windows, which can't have more than INT_MAX lines anyway.
12854
12855 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12856
12857 * Require libxml/parser.h to avoid compilation warning.
12858
12859 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12860
12861 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12862 since this reportedly can destroy thread storage.
12863
12864 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12865
12866 * syntax.c (find_defun_start): Update all cache variables if
12867 exiting early (Bug#9401).
12868
12869 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12870
12871 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12872
12873 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12874 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12875 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12876
12877 * term.c (tty_append_glyph): New function.
12878 (produce_stretch_glyph): Static function and its prototype deleted.
12879
12880 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12881 Add prototypes.
12882
12883 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12884
12885 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12886 when checking :margin (Bug#9390).
12887 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12888 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12889 so that the name doesn't mislead. All uses changed.
12890
12891 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12892
12893 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12894 set_tty_hooks.
12895
12896 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12897
12898 * xdisp.c (move_it_to): Don't bail out early when reaching
12899 position beyond to_charpos, if we are scanning backwards.
12900 (move_it_vertically_backward): When DY == 0, make sure we get to
12901 the first character in the line after the newline.
12902
12903 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12904
12905 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12906 (ccl_driver): Do not generate an out-of-range pointer.
12907 (Fccl_execute_on_string): Remove unnecessary check for
12908 integer overflow, noted by Stefan Monnier in
12909 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12910 Remove a FIXME that didn't need fixing.
12911 Simplify the newly-introduced buffer reallocation code.
12912
12913 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12914
12915 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12916
12917 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12918
12919 Integer and memory overflow issues (Bug#9196).
12920
12921 * doc.c (get_doc_string): Rework so that
12922 get_doc_string_buffer_size is the actual buffer size, rather than
12923 being 1 less than the actual buffer size; this makes xpalloc more
12924 convenient.
12925
12926 * image.c (x_allocate_bitmap_record, cache_image):
12927 * xselect.c (Fx_register_dnd_atom):
12928 Simplify previous changes by using xpalloc.
12929
12930 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12931 since either will do and ptrdiff_t is convenient with xpalloc.
12932
12933 * charset.c (charset_table_size)
12934 (struct charset_sort_data.priority): Now ptrdiff_t.
12935 (charset_compare): Don't overflow if priorities differ greatly.
12936 (Fsort_charsets): Don't assume list length fits in int.
12937 Check for size-calculation overflow when allocating sort data.
12938 (syms_of_charset): Allocate an initial charset table that is
12939 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12940
12941 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12942
12943 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12944 The actual value is always <= INT_MAX, and leaving it unsigned made
12945 overflow checking harder.
12946
12947 * dispextern.h (struct glyph_matrix.rows_allocated)
12948 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12949 with xpalloc. The values are still always <= INT_MAX.
12950
12951 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12952
12953 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12954 (SAFE_NALLOCA): New macro.
12955
12956 * region-cache.c (struct boundary.pos, find_cache_boundary)
12957 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12958 (set_cache_region, invalidate_region_cache)
12959 (revalidate_region_cache, know_region_cache, region_cache_forward)
12960 (region_cache_backward, pp_cache):
12961 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12962 so that ptrdiff_t * can be passed to xpalloc.
12963 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12964 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12965 (pp_cache): Don't assume cache_len fits in int.
12966 * region-cache.h: Adjust extern decls to match.
12967
12968 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12969 EMACS_INT, since either will do, for xpalloc.
12970
12971 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12972 (xnmalloc, xnrealloc, xpalloc): New functions.
12973
12974 * bidi.c (bidi_shelve_header_size): New constant.
12975 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12976 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12977
12978 * bidi.c (bidi_cache_shrink):
12979 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12980 (overlay_strings):
12981 Don't update size of array until after memory allocation succeeds,
12982 because xmalloc/xrealloc may not return.
12983 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12984 now that we have proper integer overflow checking.
12985 (record_overlay_string, overlay_strings): Catch overflows when
12986 calculating size of overlay_str_buf.
12987
12988 * callproc.c (Fcall_process): Check for size overflow when
12989 calculating size of args2.
12990 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12991 Normally we prefer signed values, but sticking with ptrdiff_t would
12992 require adding more-complicated checks.
12993
12994 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12995 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12996 Redo buffer-overflow calculations to avoid integer overflow.
12997 Add a FIXME comment where memory seems to be over-allocated.
12998
12999 * character.c (Fstring): Check for size-calculation overflow.
13000
13001 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13002 unnecessary integer overflow. Check for size overflow.
13003 (encode_coding_object): Don't update size until xmalloc succeeds.
13004
13005 * composite.c (get_composition_id): Check for overflow in glyph
13006 length calculations.
13007
13008 Integer and memory overflow fixes for display code.
13009 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13010 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13011 (scrolling_window): Check for overflow in size calculations.
13012 (line_draw_cost, realloc_glyph_pool, add_row_entry):
13013 Don't assume glyph table len fits in int.
13014 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13015 (row_table_size): Now ptrdiff_t, not int.
13016 (scrolling_window): Avoid overflow in size calculations.
13017 Don't update size until allocation succeeds.
13018 * fns.c (concat): Check for overflow in size calculations.
13019 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13020 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13021 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13022
13023 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13024 (get_doc_string): Check for size calculation overflow.
13025 Don't update size until allocation succeeds.
13026 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13027 EMACS_INT, where ptrdiff_t will do.
13028 (Fsubstitute_command_keys): Check for string overflow.
13029
13030 * editfns.c (set_time_zone_rule): Don't assume environment length
13031 fits in int.
13032 (message_length): Now ptrdiff_t, not int.
13033 (Fmessage_box): Don't update size until allocation succeeds.
13034 Don't assume message length fits in int.
13035 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13036
13037 * emacs.c (main): Do not reallocate argv, since there is a null at
13038 the end that can be overwritten, and this way there's no need to
13039 worry about size-calculation overflow.
13040 (sort_args): Check for size-calculation overflow.
13041
13042 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13043 alloc succeeds.
13044 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13045
13046 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13047 (x_set_scroll_bar_width, x_figure_window_size):
13048 Check for integer overflow.
13049 (x_set_alpha): Do not assume XINT fits in int.
13050
13051 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13052 This is for the members text_lines, text_cols, total_lines, total_cols,
13053 where the system imposes an 'int' limit.
13054
13055 * fringe.c (Fdefine_fringe_bitmap):
13056 Don't update size until alloc works.
13057
13058 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13059 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13060
13061 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13062 Check for size-calculation overflow.
13063 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13064 do, as we prefer signed integers.
13065 (id_to_widget.max_size, id_to_widget.used)
13066 (xg_store_widget_in_map, xg_remove_widget_from_map)
13067 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13068 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13069 Use and return ptrdiff_t, not int.
13070 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13071 * gtkutil.h: Change prototypes to match the above.
13072
13073 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13074 are duplicate now that they've been promoted to lisp.h.
13075 (x_allocate_bitmap_record, x_alloc_image_color)
13076 (make_image_cache, cache_image, xpm_load):
13077 Don't update size until alloc is done.
13078 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13079 (x_detect_edges):
13080 Check for size calculation overflow.
13081 (ct_colors_allocated_max): New constant.
13082 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13083 overflow.
13084
13085 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13086 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13087 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13088 Use ptrdiff_t, not int, to count maps.
13089 (read_char_minibuf_menu_prompt): Check for overflow in size
13090 calculations. Don't update size until allocation succeeds.
13091 Redo calculations to avoid overflow.
13092 * keyboard.h: Change prototypes to match the above.
13093
13094 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13095 to count maps.
13096 (current_minor_maps): Check for size calculation overflow.
13097 * keymap.h: Change prototypes to match the above.
13098
13099 * lread.c (read1, init_obarray): Don't update size until alloc done.
13100
13101 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13102 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13103
13104 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13105 Now ptrdiff_t, not int.
13106 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13107 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13108
13109 * process.c (Fnetwork_interface_list): Check for overflow
13110 in size calculation.
13111
13112 * region-cache.c (move_cache_gap): Check for size calculation overflow.
13113
13114 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13115 overflow. Don't bother calling xmalloc when xrealloc will do.
13116
13117 * search.c (Freplace_match): Check for size calculation overflow.
13118 (Fset_match_data): Don't assume list lengths fit in 'int'.
13119
13120 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13121 for command line length. Do not attempt to address one before the
13122 beginning of an array, as that's not portable.
13123
13124 * term.c (max_frame_lines): Remove; unused.
13125 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13126 not int.
13127 (encode_terminal_code, calculate_costs): Check for size
13128 calculation overflow.
13129 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13130 table lengths and related sizes. Don't update size until alloc
13131 done. Redo calculations to avoid overflow.
13132 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13133
13134 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13135 subtracting pointers.
13136 (gobble_line): Check for overflow more carefully. Don't update size
13137 until alloc done.
13138
13139 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13140 Don't update size until alloc done.
13141 Redo size calculations to avoid overflow.
13142 Check for size calculation overflow.
13143 (main) [DEBUG]: Fix typo in invoking tparam1.
13144
13145 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13146 Use ptrdiff_t, not int, for sizes.
13147 (store_mode_line_noprop_char): Don't update size until alloc done.
13148
13149 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13150 Use ptrdiff_t, not int, for sizes.
13151 (Finternal_make_lisp_face, cache_face):
13152 Check for size calculation overflow.
13153 (cache_face): Treat size calculation overflows as if they were
13154 memory exhaustion (the usual treatment), rather than aborting.
13155
13156 * xfns.c (x_encode_text, x_set_name_internal)
13157 (Fx_change_window_property): Use ptrdiff_t, not int, to count
13158 sizes, since they can exceed INT_MAX in size. Check for size
13159 calculation overflow.
13160
13161 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13162 (xg_select): Check for size calculation overflow.
13163 Don't update size until alloc done.
13164
13165 * xrdb.c (get_environ_db): Don't assume path length fits in int,
13166 as sprintf is limited to int lengths.
13167
13168 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13169 (X_LONG_MIN): New macros.
13170 Use them to make the following changes clearer.
13171 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13172 This change doesn't affect the value now, but it may help remind
13173 future maintainers not to raise the value too much later.
13174 (SELECTION_QUANTUM): Remove, replacing with ...
13175 (selection_quantum): ... new function, which avoids overflow.
13176 All uses changed.
13177 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13178 assumption that selection length fits in 'int'.
13179 (x_reply_selection_request, x_handle_selection_request)
13180 (x_get_window_property, receive_incremental_selection)
13181 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13182 (lisp_data_to_selection_data, clean_local_selection_data):
13183 Use ptrdiff_t, not int, to record length of selection.
13184 (x_reply_selection_request, x_get_window_property)
13185 (receive_incremental_selection, x_property_data_to_lisp):
13186 Redo calculations to avoid overflow.
13187 (x_reply_selection_request): When sending hint, ceiling it at
13188 X_LONG_MAX rather than relying on wraparound overflow to send
13189 something.
13190 (x_get_window_property, receive_incremental_selection)
13191 (lisp_data_to_selection_data, x_property_data_to_lisp):
13192 Check for size-calculation overflow.
13193 (x_get_window_property, receive_incremental_selection)
13194 (lisp_data_to_selection_data, Fx_register_dnd_atom):
13195 Don't store size until memory allocation succeeds.
13196 (x_get_window_property): Plug memory leak on memory exhaustion.
13197 Don't double-block input; malloc is safe here. Don't assume 2**34
13198 - 4 fits in unsigned long. Add an xassert to check
13199 XGetWindowProperty overflow. Be more careful about overflow
13200 calculations, and distinguish size from memory overflow better.
13201 (receive_incremental_selection): When tracing, don't assume
13202 unsigned int is less than INT_MAX.
13203 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
13204 harmful) conversions of unsigned short to int.
13205 (lisp_data_to_selection_data): Don't assume that integers
13206 in the range -65535 through -1 fit in an X unsigned short.
13207 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
13208 result parameters unless successful. Rely on cons_to_unsigned
13209 to report problems with elements; the old code wasn't right anyway.
13210 (x_check_property_data): Check for int overflow; we cannot use
13211 a wider type due to X limits.
13212 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
13213
13214 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
13215
13216 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
13217 (x_term_init): Check for size calculation overflow.
13218 (x_color_cells): Don't store size until memory allocation succeeds.
13219 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
13220 Don't assume alloca size is less than MAX_ALLOCA.
13221 (x_term_init): Don't assume length fits in int (sprintf is limited
13222 to int size).
13223
13224 Use ptrdiff_t for composition IDs.
13225 * character.c (lisp_string_width):
13226 * composite.c (composition_table_size, n_compositions)
13227 (get_composition_id, composition_gstring_from_id):
13228 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
13229 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
13230 * window.c (Frecenter):
13231 Use ptrdiff_t, not int, for composition IDs.
13232 * composite.c (get_composition_id): Check for integer overflow.
13233 * composite.h: Adjust prototypes to match the above changes.
13234
13235 Use ptrdiff_t for hash table indexes.
13236 * category.c (hash_get_category_set):
13237 * ccl.c (ccl_driver):
13238 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
13239 * coding.c (coding_system_charset_list, detect_coding_system):
13240 * coding.h (struct coding_system.id):
13241 * composite.c (get_composition_id, gstring_lookup_cache):
13242 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
13243 * image.c (xpm_get_color_table_h):
13244 * lisp.h (hash_lookup, hash_put):
13245 * minibuf.c (Ftest_completion):
13246 Use ptrdiff_t for hash table indexes, not int (which is too
13247 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
13248 32-bit --with-wide-int hosts).
13249
13250 * charset.c (Fdefine_charset_internal): Check for integer overflow.
13251 Add a FIXME comment about memory leaks.
13252 (syms_of_charset): Don't assume xmalloc returns.
13253
13254 Don't assume that stated character widths fit in int.
13255 * character.c (Fchar_width, c_string_width, lisp_string_width):
13256 * character.h (CHAR_WIDTH):
13257 * indent.c (MULTIBYTE_BYTES_WIDTH):
13258 Use sanitize_char_width to avoid undefined and/or bad behavior
13259 with outlandish widths.
13260 * character.h (sanitize_tab_width): Rename from sanitize_width,
13261 now that we have two such functions. All uses changed.
13262 (sanitize_char_width): New inline function.
13263
13264 Don't assume that tab-width fits in int.
13265 * character.h (sanitize_width): New inline function.
13266 (SANE_TAB_WIDTH): New macro.
13267 (ASCII_CHAR_WIDTH): Use it.
13268 * indent.c (sane_tab_width): Remove. All uses replaced by
13269 SANE_TAB_WIDTH (current_buffer).
13270 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
13271
13272 * fileio.c: Integer overflow issues with file modes.
13273 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
13274
13275 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
13276 Remove unreachable code.
13277 (read_hex, load_charset_map_from_file): Check for integer overflow.
13278
13279 * xterm.c: Don't go over XClientMessageEvent limit.
13280 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
13281 (x_send_scroll_bar_event): Likewise. Check that the size does not
13282 exceed limits imposed by XClientMessageEvent, as well as the usual
13283 ptrdiff_t and size_t limits.
13284
13285 * keyboard.c: Overflow, signedness and related fixes.
13286 (make_lispy_movement): Use same integer type in forward decl
13287 that is used in the definition.
13288 (read_key_sequence, keyremap_step):
13289 Change bufsize argument back to int, undoing my 2011-03-30 change.
13290 We prefer signed types, and int is wide enough here.
13291 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
13292 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
13293 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
13294 length, not size_t. Use ptrdiff_t for index, not int.
13295 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
13296 possibility of integer overflow.
13297
13298 Overflow, signedness and related fixes for images.
13299
13300 * dispextern.h (struct it.stack[0].u.image.image_id)
13301 (struct_it.image_id, struct image.id, struct image_cache.size)
13302 (struct image_cache.used, struct image_cache.ref_count):
13303 * gtkutil.c (update_frame_tool_bar):
13304 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
13305 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
13306 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
13307 * nsmenu.m (update_frame_tool_bar):
13308 * xdisp.c (calc_pixel_width_or_height):
13309 * xfns.c (image_cache_refcount):
13310 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
13311 on typical 64-bit hosts.
13312
13313 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13314 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
13315 Omit unnecessary casts to int.
13316 (parse_image_spec): Check that integers fall into 'int' range
13317 when the callers expect that.
13318 (image_ascent): Redo ascent calculation to avoid int overflow.
13319 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
13320 (lookup_image): Remove unnecessary tests.
13321 (xbm_image_p): Locals are now of int, not EMACS_INT,
13322 since parse_image_check makes sure they fit into int.
13323 (png_load, gif_load, svg_load_image):
13324 Prefer int to unsigned where either will do.
13325 (tiff_handler): New function, combining the cores of the
13326 old tiff_error_handler and tiff_warning_handler.
13327 This function is rewritten to use vsnprintf and thereby avoid
13328 stack buffer overflows. It uses only the features of vsnprintf
13329 that are common to both POSIX and native Microsoft.
13330 (tiff_error_handler, tiff_warning_handler): Use it.
13331 (tiff_load, gif_load, imagemagick_load_image):
13332 Don't assume :index value fits in 'int'.
13333 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
13334 (imagemagick_load_image): Check that crop parameters fit into
13335 the integer types that MagickCropImage accepts. Don't assume
13336 Vimagemagick_render_type has a nonnegative value. Don't assume
13337 size_t fits in 'long'.
13338 (gs_load): Use printmax_t to print the widest integers possible.
13339 Check for integer overflow when computing image height and width.
13340
13341 2011-08-26 Eli Zaretskii <eliz@gnu.org>
13342
13343 * xdisp.c (redisplay_window): Don't force window start if point
13344 will be invisible in the resulting window. (Bug#9324)
13345
13346 2011-08-25 Eli Zaretskii <eliz@gnu.org>
13347
13348 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
13349 the display spec is of the form `(space ...)'.
13350 (handle_display_spec): Return the value returned by
13351 handle_single_display_spec, not just 1 or zero.
13352 (handle_single_display_spec): If the display spec is of the form
13353 `(space ...)', and specifies display in the text area, return 2
13354 rather than 1.
13355 (try_cursor_movement): Check for the need to scroll more
13356 accurately, and prefer exact match for point under bidi.
13357 Don't advance `row' beyond the last row of the window.
13358
13359 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13360 into disp_prop; all users changed.
13361
13362 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13363 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13364 for the text covered by the display property.
13365
13366 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
13367
13368 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13369 Change return value to nil.
13370 (Frecord_buffer): Delete unused function.
13371
13372 2011-08-24 Eli Zaretskii <eliz@gnu.org>
13373
13374 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13375 buffers, return left-to-right.
13376 (set_cursor_from_row): Consider candidate row a win if its glyph
13377 represents a newline and point is on that newline. Fixes cursor
13378 positioning on the newline at EOL of R2L text within L2R
13379 paragraph, and vice versa.
13380 (try_cursor_movement): Check continued rows, in addition to
13381 continuation rows. Fixes unwarranted scroll when point enters a
13382 continued line of R2L text within an L2R paragraph, or vice versa.
13383 (cursor_row_p): Consider the case of point being equal to
13384 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13385 from the end of a short line to the beginning of a continued line
13386 of R2L text within L2R paragraph.
13387 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13388 composed characters.
13389
13390 * bidi.c (bidi_check_type): Use xassert.
13391 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13392 members.
13393
13394 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13395
13396 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13397 a character.
13398
13399 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
13400
13401 * nsfont.m (ns_otf_to_script): Fix typo.
13402
13403 2011-08-22 Kenichi Handa <handa@m17n.org>
13404
13405 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13406 extra slot even if the purpose is char-code-property-table.
13407
13408 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13409
13410 * xdisp.c (redisplay_window): When computing centering_position,
13411 account for the height of the header line. (Bug#8874)
13412
13413 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13414 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13415 candidate is selected by the mouse, and that candidate has a
13416 composed character under the mouse.
13417
13418 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13419 coordinates reported by pos-visible-in-window-p for a composed
13420 character in column zero.
13421
13422 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13423
13424 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13425
13426 2011-08-22 Eli Zaretskii <eliz@gnu.org>
13427
13428 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13429 consider it a hit if to_charpos is anywhere in the range of the
13430 composed buffer positions.
13431
13432 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
13433
13434 * image.c (gif_load): Don't assume that each subimage has the same
13435 dimensions as the base image. Handle disposal method that is
13436 "undefined" by the gif spec (Bug#9335).
13437
13438 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
13439
13440 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13441 (Fcondition_case): Document `debug' symbol in error handler.
13442
13443 2011-08-19 Eli Zaretskii <eliz@gnu.org>
13444
13445 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13446 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13447 from an Org mode buffer to a Speedbar frame.
13448
13449 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13450 a composition, take its buffer position from IT->cmp_it.charpos.
13451 Fixes cursor positioning at the beginning of a line that begins
13452 with a composed character.
13453
13454 2011-08-18 Eli Zaretskii <eliz@gnu.org>
13455
13456 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13457 character bidirectional type, use STRONG_L instead. Fixes crashes
13458 in a buffer produced by `describe-categories'.
13459
13460 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13461 members before the level stack, so they would be saved and
13462 restored when copying iterator state. Fixes incorrect reordering
13463 around TABs covered by display properties.
13464
13465 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
13466
13467 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13468
13469 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
13470
13471 * eval.c (internal_condition_case, internal_condition_case_1)
13472 (internal_condition_case_2, internal_condition_case_n):
13473 Remove unnecessary aborts (Bug#9081).
13474
13475 2011-08-17 Eli Zaretskii <eliz@gnu.org>
13476
13477 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13478 has no `load' handler, try opening the file locally. (Bug#9311)
13479
13480 2011-08-16 Ken Brown <kbrown@cornell.edu>
13481
13482 * gmalloc.c: Expand comment.
13483
13484 2011-08-16 Eli Zaretskii <eliz@gnu.org>
13485
13486 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13487 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
13488
13489 2011-08-16 Ken Brown <kbrown@cornell.edu>
13490
13491 Fix memory allocation problems in Cygwin build (Bug#9273).
13492
13493 * unexcw.c ( __malloc_initialized): Declare external variable.
13494 (fixup_executable): Force the dumped emacs to reinitialize malloc.
13495
13496 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13497 New variables.
13498 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13499 dumped emacs.
13500 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13501 in the static heap.
13502 [CYGWIN] (special_realloc): New function.
13503 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13504 requests to realloc storage in the static heap.
13505
13506 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13507
13508 * bidi.c (bidi_initialize): Remove unused local.
13509
13510 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13511
13512 * bidimirror.h:
13513 * biditype.h: Remove file.
13514 * makefile.w32-in ($(BLD)/bidi.$(O)):
13515 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13516
13517 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13518
13519 * chartab.c: Improve commentary for the uniprop_table API.
13520
13521 * bidi.c (bidi_paragraph_init): Support zero value of
13522 bidi_ignore_explicit_marks_for_paragraph_level.
13523 (bidi_initialize): Use uniprop_table instead of including
13524 biditype.h and bidimirror.h.
13525
13526 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13527 coordinates of the iterator when restoring from ppos_it.
13528 (Bug#9296)
13529
13530 2011-08-14 Kenichi Handa <handa@m17n.org>
13531
13532 * process.c (create_process): Call setup_process_coding_systems
13533 after the pid of the process is set to -1 (Bug#8162).
13534
13535 2011-08-14 Eli Zaretskii <eliz@gnu.org>
13536
13537 * xdisp.c (move_it_in_display_line_to): Don't invoke
13538 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13539 ppos_it. Fixes vertical cursor motion when line beginning is
13540 covered by an image. (Bug#9296)
13541
13542 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13543
13544 * nsterm.h (ns_run_ascript): Declare.
13545 (NSAPP_DATA2_RUNASSCRIPT): Define.
13546
13547 * nsfns.m (as_script, as_result, as_status): New static variables.
13548 (ns_run_ascript): New function.
13549 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
13550 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13551 the event loop. Get status from as_status (Bug#7276).
13552
13553 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13554 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13555 the event loop (Bug#7276).
13556
13557 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13558
13559 * gnutls.c (QCgnutls_bootprop_priority)
13560 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13561 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13562 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13563 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13564 (QCgnutls_bootprop_verify_hostname_error)
13565 (QCgnutls_bootprop_callbacks_verify): Rename from
13566 Qgnutls_bootprop_..., all uses changed.
13567
13568 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13569 uses changed.
13570
13571 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13572
13573 * xfaces.c (Qframe_set_background_mode): Now static.
13574 * dispextern.h (Qframe_set_background_mode): Remove decl.
13575
13576 * process.c (Fnetwork_interface_info): Declare local only if needed.
13577
13578 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13579
13580 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13581 (Fnetwork_interface_list): Allocate in increments of bytes instead
13582 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13583 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13584 sockaddr.
13585 (struct ifflag_def): notrailers is smart on OSX.
13586 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13587 Get hardware address with getifaddrs if available.
13588
13589 2011-08-12 Eli Zaretskii <eliz@gnu.org>
13590
13591 * xdisp.c (iterate_out_of_display_property): xassert that
13592 IT->position is set to within IT->object's boundaries. Break from
13593 the loop as soon as EOB is reached; avoids infloops in redisplay
13594 when IT->position is set up wrongly due to some bug.
13595 Set IT->current to match the bidi iterator unconditionally.
13596 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13597 entry. Force push_it to save on the stack the current
13598 buffer/string position, to be restored by pop_it. Fix flags in
13599 the iterator structure wrt the object coming from a display
13600 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13601 properties. (Bug#9284)
13602
13603 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
13604
13605 * fontset.c (fontset_get_font_group): Add proper type checks.
13606 (Bug#9172)
13607
13608 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13609
13610 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13611 and LC_VERSION_MIN_MACOSX.
13612 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13613 (dump_it) [LC_FUNCTION_STARTS]: Use it.
13614
13615 2011-08-08 Eli Zaretskii <eliz@gnu.org>
13616
13617 * xdisp.c (forward_to_next_line_start): Allow to use the
13618 no-display-properties-and-no-overlays under bidi display.
13619 Set disp_pos in the bidi iterator to avoid searches for display
13620 properties and overlays.
13621
13622 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
13623
13624 * editfns.c (Fset_time_zone_rule): Document relationship with the
13625 setenv function.
13626
13627 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13628 the font entity extracted from the cache (Bug#8109).
13629
13630 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13631
13632 * composite.c (autocmp_chars): Don't reset point. That is done by
13633 restore_point_unwind (Bug#5984).
13634
13635 2011-08-07 Juri Linkov <juri@jurta.org>
13636
13637 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13638 to show the arg `TIME' instead of `TIMEVAL'.
13639
13640 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13641
13642 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13643 display property strides EOL and includes a newline, as in
13644 longlines-mode. (Bug#9254)
13645 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13646 word-wrap under bidirectional display. (Bug#9224)
13647
13648 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13649 is non-zero, even if the data buffer is NULL. Fixes a crash in
13650 vertical-motion with longlines-mode. (Bug#9254)
13651
13652 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13653
13654 * bidi.c <bidi_cache_total_alloc>: Now static.
13655 (bidi_initialize): Initialize bidi_cache_total_alloc.
13656
13657 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13658 cache. (Bug#9221)
13659
13660 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13661 amount allocated this far in `bidi_cache_total_alloc'.
13662 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13663 non-zero, only free the data buffer without restoring the cache
13664 contents. All callers changed.
13665
13666 * dispextern.h (bidi_unshelve_cache): Update prototype.
13667
13668 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13669 (move_it_in_display_line, move_it_to)
13670 (move_it_vertically_backward, move_it_by_lines): Replace the call
13671 to xfree to an equivalent call to bidi_unshelve_cache.
13672 (move_it_in_display_line_to): Fix logic of returning
13673 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13674
13675 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13676
13677 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13678 came from a string character with a `cursor' property. (Bug#9229)
13679
13680 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13681
13682 * Makefile.in (LIB_PTHREAD): New variable.
13683 (LIBES): Add LIB_PTHREAD (Bug#9216).
13684
13685 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13686 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13687
13688 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13689
13690 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13691
13692 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13693
13694 * xterm.c (x_find_topmost_parent): New function.
13695 (x_set_frame_alpha): Find topmost parent window with
13696 x_find_topmost_parent and set the property there also (bug#9181).
13697 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13698
13699 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13700
13701 * callproc.c (Fcall_process): Avoid vfork clobbering
13702 the local vars buffer, coding_systems, current_dir.
13703
13704 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13705
13706 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13707
13708 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13709
13710 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13711 so that it is not optimized away.
13712
13713 * xdisp.c (compute_display_string_pos): Remove unused local.
13714
13715 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13716
13717 Fix slow cursor motion and scrolling in large buffers with
13718 selective display, like Org Mode buffers. (Bug#9218)
13719
13720 * dispextern.h (struct bidi_it): New member disp_prop_p.
13721
13722 * xdisp.c: Remove one-slot cache of display string positions.
13723 (compute_display_string_pos): Accept an additional argument
13724 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13725 for a display string or property. If found, set DISP_PROP_P
13726 non-zero.
13727
13728 * bidi.c (bidi_fetch_char): Accept an additional argument
13729 DISP_PROP_P, and pass it to compute_display_string_pos.
13730 Only handle text covered by a display string if DISP_PROP_P is returned
13731 non-zero. All callers of bidi_fetch_char changed.
13732
13733 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13734
13735 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13736
13737 2010-12-03 Don March <don@ohspite.net>
13738
13739 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13740 last character M-[char] is translated to ESC [char] (bug#7541).
13741
13742 2011-08-02 Kenichi Handa <handa@m17n.org>
13743
13744 * lisp.h (uniprop_table): Extern it.
13745
13746 * chartab.c (uniprop_table): Make it non-static.
13747
13748 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13749
13750 * xdisp.c (forward_to_next_line_start): Accept additional argument
13751 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13752 on the newline.
13753 (reseat_at_next_visible_line_start): Use the bidi iterator state
13754 returned by forward_to_next_line_start to restore the state of
13755 it->bidi_it after backing up to previous newline. (Bug#9212)
13756
13757 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13758
13759 * regex.c (re_comp): Protoize.
13760 (re_exec): Fix return type.
13761 (regexec): Fix type of `ret'. (Bug#9203)
13762
13763 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13764
13765 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13766 This is needed if max-image-size is a floating-point number.
13767
13768 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13769
13770 * print.c (print_object): Print empty symbol as ##.
13771
13772 * lread.c (read1): Read ## as empty symbol.
13773
13774 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13775
13776 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13777 setting frame foreground color (Bug#9175).
13778 (x_set_background_color): Likewise.
13779
13780 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13781 contents (Bug#9176).
13782 (EmacsTooltip -init): Remove bezels and add shadows to
13783 tooltip windows.
13784
13785 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13786 or scroll bar (Bug#8470).
13787
13788 * nsfont.m (nsfont_open): Remove assignment to voffset and
13789 unnecessary vars hshink, expand, hd, full_height, min_height.
13790 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13791
13792 * nsterm.h (nsfont_info): Remove voffset field.
13793
13794 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13795
13796 Implement strike-through and overline on NextStep (Bug#8863).
13797
13798 * nsfont.m (nsfont_open): Use underline position provided by font,
13799 instead of hard-coded value of 2.
13800 (nsfont_draw): Call ns_draw_text_decoration instead.
13801
13802 * nsterm.h: Add declaration for ns_draw_text_decoration.
13803
13804 * nsterm.m (ns_draw_text_decoration): New function for drawing
13805 underline, overline, and strike-through.
13806 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13807 ns_draw_text_decoration. Change treatment of cursor drawing to
13808 accommodate underlining, etc.
13809
13810 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13811
13812 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13813 default.
13814
13815 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13816
13817 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13818 Without this fix, if a signal arrives just after memory fills up,
13819 'malloc' might be invoked reentrantly.
13820
13821 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13822 In other words, assume that every image size is allowed, on non-X
13823 hosts. This assumption is probably wrong, but it lets Emacs compile.
13824
13825 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13826
13827 * regex.c (re_iswctype): Convert return values to boolean.
13828
13829 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13830
13831 * xdisp.c (compute_display_string_pos): Don't use cached display
13832 string position if the buffer had its restriction changed.
13833 (Bug#9184)
13834
13835 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13836
13837 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13838
13839 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13840
13841 Integer signedness and overflow and related fixes. (Bug#9079)
13842
13843 * bidi.c: Integer size and overflow fixes.
13844 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13845 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13846 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13847 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13848 (bidi_find_other_level_edge):
13849 Use ptrdiff_t instead of EMACS_INT where either will do.
13850 This works better on 32-bit hosts configured --with-wide-int.
13851 (bidi_cache_ensure_space): Check for size-calculation overflow.
13852 Use % rather than repeated addition, for better worst-case speed.
13853 Don't set bidi_cache_size until after xrealloc returns, because it
13854 might not return.
13855 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13856 (bidi_cache_ensure_space): Also check that the bidi cache size
13857 does not exceed that of the largest Lisp string or buffer. See Eli
13858 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13859
13860 * alloc.c (__malloc_size_t): Remove.
13861 All uses replaced by size_t. See Andreas Schwab's note
13862 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13863
13864 * image.c: Improve checking for integer overflow.
13865 (check_image_size): Assume that f is nonnull, since
13866 it is always nonnull in practice. This is one less thing to
13867 worry about when checking for integer overflow later.
13868 (x_check_image_size): New function, which checks for integer
13869 overflow issues inside X.
13870 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13871 This removes the need for a memory_full check.
13872 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13873 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13874 (xbm_read_bitmap_data): Change locals back to 'int', since
13875 their values must fit in 'int'.
13876 (xpm_load_image, png_load, tiff_load):
13877 Invoke x_create_x_image_and_pixmap earlier,
13878 to avoid much needless work if the image is too large.
13879 (tiff_load): Treat overly large images as if
13880 x_create_x_image_and_pixmap failed, not as malloc failures.
13881 (gs_load): Use x_check_image_size.
13882
13883 * gtkutil.c: Omit integer casts.
13884 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13885 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13886
13887 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13888
13889 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13890 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13891 would wrongly return t on a 64-bit host.
13892
13893 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13894 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13895 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13896 and therefore cause GCC to emit a bogus diagnostic in some cases.
13897
13898 * image.c: Integer signedness and overflow and related fixes.
13899 This is not an exhaustive set of fixes, but it's time to
13900 record what I've got.
13901 (lookup_pixel_color, check_image_size): Remove redundant decls.
13902 (check_image_size): Don't assume that arbitrary EMACS_INT values
13903 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13904 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13905 (tiff_load, imagemagick_load_image):
13906 Check for overflow in size calculations.
13907 (x_create_x_image_and_pixmap): Remove unnecessary test for
13908 xmalloc returning NULL; that can't happen.
13909 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13910 (xpm_color_bucket): Use better integer hashing function.
13911 (xpm_cache_color): Don't possibly over-allocate memory.
13912 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13913 (gif_memory_source):
13914 Use ptrdiff_t, not int or size_t, to record sizes.
13915 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13916 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13917 either works, as we prefer signed integers.
13918 (tiff_read_from_memory, tiff_write_from_memory):
13919 Return tsize_t, not size_t, since that's what the TIFF API wants.
13920 (tiff_read_from_memory): Don't fail simply because the read would
13921 go past EOF; instead, return a short read.
13922 (tiff_load): Omit no-longer-needed casts.
13923 (Fimagemagick_types): Don't assume size fits into 'int'.
13924
13925 Improve hashing quality when configured --with-wide-int.
13926 * fns.c (hash_string): New function, taken from sxhash_string.
13927 Do not discard information about ASCII character case; this
13928 discarding is no longer needed.
13929 (sxhash-string): Use it. Change sig to match it. Caller changed.
13930 * lisp.h: Declare it.
13931 * lread.c (hash_string): Remove, since we now use fns.c's version.
13932 The fns.c version returns a wider integer if --with-wide-int is
13933 specified, so this should help the quality of the hashing a bit.
13934
13935 * emacs.c: Integer overflow minor fix.
13936 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13937 Define only if GNU_LINUX.
13938 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13939
13940 * dispnew.c: Integer signedness and overflow fixes.
13941 Remove unnecessary forward decls, that were a maintenance hassle.
13942 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13943 All uses changed.
13944 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13945 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13946 (prepare_desired_row, line_draw_cost):
13947 Use int, not unsigned, where either works.
13948 (save_current_matrix, restore_current_matrix):
13949 Use ptrdiff_t, not size_t, where either works.
13950 (init_display): Check for overflow more accurately, and without
13951 relying on undefined behavior.
13952
13953 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13954 Remove, replacing with the new symbols in lisp.h. All uses changed.
13955 * fileio.c (make_temp_name):
13956 * filelock.c (lock_file_1, lock_file):
13957 * xdisp.c (message_dolog):
13958 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13959 Use pMd etc. instead.
13960 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13961 replacing the pWIDE etc. symbols removed from editfns.c.
13962
13963 * keyboard.h (num_input_events): Now uintmax_t.
13964 This is (very slightly) less likely to mess up due to wraparound.
13965 All uses changed.
13966
13967 * buffer.c: Integer signedness fixes.
13968 (alloc_buffer_text, enlarge_buffer_text):
13969 Use ptrdiff_t rather than size_t when either will do, as we prefer
13970 signed integers.
13971
13972 * alloc.c: Integer signedness and overflow fixes.
13973 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13974 (__malloc_size_t): Default to size_t, not to int.
13975 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13976 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13977 Prefer ptrdiff_t to size_t when either would do, as we prefer
13978 signed integers.
13979 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13980 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13981 Now const. Initialize with values that are in range even if char
13982 is signed.
13983 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13984 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13985 These functions do the right thing with sizes > 2**32.
13986 (check_depth): Now ptrdiff_t, not int.
13987 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13988 Adjust to new way of storing sizes. Check for size overflow bugs
13989 in rest of code.
13990 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13991 slightly wrong anyway, as it missed one instance of
13992 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13993 (refill_memory_reserve): Omit needless cast to size_t.
13994 (mark_object_loop_halt): Mark as externally visible.
13995
13996 * xselect.c: Integer signedness and overflow fixes.
13997 (Fx_register_dnd_atom, x_handle_dnd_message):
13998 Use ptrdiff_t, not size_t, since we prefer signed.
13999 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14000 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14001 x_dnd_atoms_size and x_dnd_atoms_length.
14002
14003 * doprnt.c: Prefer signed to unsigned when either works.
14004 * eval.c (verror):
14005 * doprnt.c (doprnt):
14006 * lisp.h (doprnt):
14007 * xdisp.c (vmessage):
14008 Use ptrdiff_t, not size_t, when using or implementing doprnt,
14009 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14010 prefer signed arithmetic to avoid comparison confusion.
14011 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14012 but is a bit tricky.
14013
14014 Assume freestanding C89 headers, string.h, stdlib.h.
14015 * data.c, doprnt.c, floatfns.c, print.c:
14016 Include float.h unconditionally.
14017 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14018 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
14019 * regex.c: Likewise for stddef.h, string.h.
14020 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
14021 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14022 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14023 (STDC_HEADERS): Remove obsolete defines.
14024 * sysdep.c: Include limits.h unconditionally.
14025
14026 Assume support for memcmp, memcpy, memmove, memset.
14027 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14028 * regex.c (memcmp, memcpy):
14029 Remove; we assume C89 now.
14030
14031 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14032 (__malloc_safe_bcopy): Remove; no longer needed.
14033
14034 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14035 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14036 well either way, and we prefer signed to unsigned.
14037
14038 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14039
14040 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14041 closes the connection while we're reading (bug#9182).
14042
14043 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
14044
14045 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14046 are specified (Bug#9168).
14047
14048 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14049
14050 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14051 Found by GCC static checking and --with-wide-int on a 32-bit host.
14052
14053 2011-07-25 Eli Zaretskii <eliz@gnu.org>
14054
14055 * xdisp.c (compute_display_string_pos): Fix logic of caching
14056 previous display string position. Initialize cached_prev_pos to
14057 -1. Fixes slow-down at the beginning of a buffer.
14058
14059 2011-07-24 Eli Zaretskii <eliz@gnu.org>
14060
14061 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14062 for attrs[LFACE_FONTSET_INDEX].
14063
14064 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
14065
14066 * xml.c (parse_region): Remove unused local
14067 that was recently introduced.
14068
14069 2011-07-23 Eli Zaretskii <eliz@gnu.org>
14070
14071 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14072 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14073
14074 * xdisp.c (move_it_in_display_line_to): Record the best matching
14075 position for TO_CHARPOS while scanning the line, and restore it on
14076 exit if none of the characters scanned was an exact match.
14077 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14078 when exact match is impossible due to invisible text, and the
14079 lines are truncated.
14080
14081 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
14082
14083 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14084 for OSX >= 10.7.
14085
14086 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14087
14088 Fix a significant slow-down of cursor motion with C-n, C-p,
14089 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14090 auto-repeat under bidi redisplay in fontified buffers.
14091 * xdisp.c (compute_stop_pos_backwards): New function.
14092 (next_element_from_buffer): Call compute_stop_pos_backwards to
14093 find a suitable prev_stop when we find ourselves before
14094 base_level_stop.
14095 (reseat): Don't look for prev_stop, as that could mean a very long
14096 run.
14097 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14098 <cached_disp_overlay_modiff>: Cache for last found display string
14099 position.
14100 (compute_display_string_pos): Return the cached position if asked
14101 about the same buffer in the same area of character positions, and
14102 the buffer wasn't changed since the time the display string
14103 position was cached.
14104
14105 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14106
14107 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14108 is an integer, which is important for empty lines. (Bug#9149)
14109
14110 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
14111
14112 * frame.c (Fmodify_frame_parameters): In tty case, update the
14113 default face if necessary (Bug#4238).
14114
14115 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
14116
14117 * editfns.c (Fstring_to_char): No need to explain what a character
14118 is in the docstring (Bug#6576).
14119
14120 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14121
14122 * xml.c (parse_region): Make sure we always return a tree.
14123
14124 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
14125
14126 * xml.c (parse_region): If a document contains only comments,
14127 return that, too.
14128
14129 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14130
14131 * xml.c (make_dom): Return comments, too.
14132
14133 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
14134
14135 Port to OpenBSD.
14136 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14137 and the surrounding thread.
14138 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14139 rather than fgets, and retry after EINTR. Otherwise, 'emacs
14140 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14141 timer goes off.
14142 * s/openbsd.h (BROKEN_SIGIO): Define.
14143 * unexelf.c (unexec) [__OpenBSD__]:
14144 Don't update the .mdebug section of the Alpha COFF symbol table.
14145
14146 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14147
14148 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14149 (bug#8460).
14150
14151 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
14152
14153 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14154 This fixes some race conditions on the permissions of any newly
14155 created file.
14156
14157 * alloc.c (valid_pointer_p): Use pipe, not open.
14158 This fixes some permissions issues when debugging.
14159
14160 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
14161 If fchown fails to set both uid and gid, try to set just gid,
14162 as that is sometimes allowed. Adjust the file's mode to eliminate
14163 setuid or setgid bits that are inappropriate if fchown fails.
14164
14165 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
14166
14167 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14168 to compare Lisp_Objects.
14169 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14170 global_gnutls_log_level, don't mistake it for a Lisp_Object.
14171 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14172
14173 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
14174
14175 * lread.c (read_integer): Unread even EOF character.
14176 (read1): Likewise. Properly record start position of symbol.
14177
14178 * lread.c (read1): Read `#:' as empty uninterned symbol if no
14179 symbol character follows.
14180
14181 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
14182
14183 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
14184 This works around a problem with the previous change to Fcopy_file.
14185 Recent glibc declares fchown with __attribute__((warn_unused_result)),
14186 and without this change, GCC might complain about discarding
14187 fchown's return value.
14188
14189 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
14190
14191 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14192
14193 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
14194
14195 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
14196
14197 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
14198
14199 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
14200 it's used from the C level.
14201
14202 * process.c: Use the same condition for POLL_FOR_INPUT in both
14203 keyboard.c and process.c (bug#1858).
14204
14205 2011-07-09 Lawrence Mitchell <wence@gmx.li>
14206
14207 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
14208 (Fgnutls_boot): Use it.
14209
14210 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
14211
14212 * doc.c (Fsubstitute_command_keys): Revert last change.
14213
14214 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
14215
14216 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
14217 quotes the next character, and doesn't affect other longer
14218 sequences (bug#8935).
14219
14220 * lread.c (syms_of_lread): Clarify that is isn't only
14221 `eval-buffer' and `eval-defun' that's affected by
14222 `lexical-binding' (bug#8460).
14223
14224 2011-07-15 Eli Zaretskii <eliz@gnu.org>
14225
14226 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
14227 bidi redisplay when a line includes both an image and is truncated.
14228
14229 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
14230
14231 Fix minor problems found by static checking.
14232 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
14233 (elsz): Now a signed constant, not a size_t var. We prefer signed
14234 types to unsigned, to avoid integer comparison confusion. Without
14235 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
14236 "cannot optimize loop, the loop counter may overflow", a symptom
14237 of the confusion.
14238 * indent.c (Fvertical_motion): Mark locals as initialized.
14239 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
14240
14241 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14242
14243 * search.c (Fre_search_backward): Mention `case-fold-search' in
14244 all the re_search_* functions (bug#8138).
14245
14246 * keyboard.c (Fopen_dribble_file): Document when the file is
14247 closed (bug#8056).
14248
14249 2011-07-14 Eli Zaretskii <eliz@gnu.org>
14250
14251 * bidi.c (bidi_dump_cached_states): Fix format of displaying
14252 bidi_cache_idx.
14253
14254 Support bidi reordering of display and overlay strings.
14255 * xdisp.c (compute_display_string_pos)
14256 (compute_display_string_end): Accept additional argument STRING.
14257 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
14258 (reseat_to_string): Initialize bidi_it->string.s and
14259 bidi_it->string.schars.
14260 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
14261 NULL (avoids a crash in bidi_paragraph_init).
14262 Initialize itb.string.lstring.
14263 (init_iterator): Call bidi_init_it only of a valid
14264 buffer position was specified. Initialize paragraph_embedding to
14265 L2R.
14266 (reseat_to_string): Initialize the bidi iterator.
14267 (display_string): If we need to ignore text properties of
14268 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
14269 original value of -1 will not work with bidi.)
14270 (compute_display_string_pos): First arg is now struct
14271 `text_pos *'; all callers changed. Support display properties on
14272 Lisp strings.
14273 (compute_display_string_end): Support display properties on Lisp
14274 strings.
14275 (init_iterator, reseat_1, reseat_to_string): Initialize the
14276 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
14277 when iterating on a string not from display properties).
14278 (compute_display_string_pos, compute_display_string_end):
14279 Fix calculation of the object to scan. Fixes an error when using
14280 arrow keys.
14281 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
14282 base_level_stop; instead, set base_level_stop to BEGV.
14283 Fixes crashes in vertical-motion.
14284 (next_element_from_buffer): Improve commentary for when
14285 the iterator is before prev_stop.
14286 (init_iterator): Initialize bidi_p from the default value of
14287 bidi-display-reordering, not from buffer-local value. Use the
14288 buffer-local value only if initializing for buffer iteration.
14289 (handle_invisible_prop): Support invisible properties on strings
14290 that are being bidi-reordered.
14291 (set_iterator_to_next): Support bidi reordering of C strings and
14292 Lisp strings.
14293 (next_element_from_string): Support bidi reordering of Lisp
14294 strings.
14295 (handle_stop_backwards): Support Lisp strings as well.
14296 (display_string): Support display of R2L glyph rows.
14297 Use IT_STRING_CHARPOS when displaying from a Lisp string.
14298 (init_iterator): Don't initialize it->bidi_p for strings
14299 here.
14300 (reseat_to_string): Initialize it->bidi_p for strings here.
14301 (next_element_from_string, next_element_from_c_string)
14302 (next_element_from_buffer): Add xassert's for correspondence
14303 between IT's object being iterated and it->bidi_it.string
14304 structure.
14305 (face_before_or_after_it_pos): Support bidi iteration.
14306 (next_element_from_c_string): Handle the case of the first string
14307 character that is not the first one in the visual order.
14308 (get_visually_first_element): New function, refactored from common
14309 parts of next_element_from_buffer, next_element_from_string, and
14310 next_element_from_c_string.
14311 (tool_bar_lines_needed, redisplay_tool_bar)
14312 (display_menu_bar): Force left-to-right direction. Add a FIXME
14313 comment for making that be controlled by a user option.
14314 (push_it, pop_it): Save and restore the state of the
14315 bidi iterator. Save and restore the bidi_p flag.
14316 (pop_it): Iterate out of display property for string iteration as
14317 well.
14318 (iterate_out_of_display_property): Support iteration over strings.
14319 (handle_single_display_spec): Set up it->bidi_it for iteration
14320 over a display string, and call bidi_init_it.
14321 (handle_single_display_spec, next_overlay_string)
14322 (get_overlay_strings_1, push_display_prop): Set up the bidi
14323 iterator for displaying display or overlay strings.
14324 (forward_to_next_line_start): Don't use the shortcut if
14325 bidi-iterating.
14326 (back_to_previous_visible_line_start): If handle_display_prop
14327 pushed the iterator stack, restore the internal state of the bidi
14328 iterator by calling bidi_pop_it same number of times.
14329 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
14330 and we are bidi-iterating, don't decrement the iterator position;
14331 instead, set the first_elt flag in the bidi iterator, to produce
14332 the same effect.
14333 (reseat_1): Remove redundant setting of string_from_display_prop_p.
14334 (push_display_prop): xassert that we are iterating a buffer.
14335 (push_it, pop_it): Save and restore paragraph_embedding member.
14336 (handle_single_display_spec, next_overlay_string)
14337 (get_overlay_strings_1, reseat_1, reseat_to_string)
14338 (push_display_prop): Set up the `unibyte' member of bidi_it.string
14339 correctly. Don't assume unibyte strings are not bidi-reordered.
14340 (compute_display_string_pos)
14341 (compute_display_string_end): Fix handling the case of C string.
14342 (push_it, pop_it): Save and restore from_disp_prop_p.
14343 (handle_single_display_spec, push_display_prop): Set the
14344 from_disp_prop_p flag.
14345 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
14346 (pop_it): Call iterate_out_of_display_property only if we are
14347 popping after iteration over a string that came from a display
14348 property. Fix a typo in popping stretch info. Add an assertion
14349 for verifying that the iterator position is in sync with the bidi
14350 iterator.
14351 (handle_single_display_spec, get_overlay_strings_1)
14352 (push_display_prop): Fix initialization of paragraph direction for
14353 string when that of the parent object is not yet determined.
14354 (reseat_1): Call bidi_init_it to resync the bidi
14355 iterator with IT's position. (Bug#7616)
14356 (find_row_edges): If ROW->start.pos gives position
14357 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
14358 (handle_stop, back_to_previous_visible_line_start, reseat_1):
14359 Reset the from_disp_prop_p flag.
14360 (SAVE_IT, RESTORE_IT): New macros.
14361 (pos_visible_p, face_before_or_after_it_pos)
14362 (back_to_previous_visible_line_start)
14363 (move_it_in_display_line_to, move_it_in_display_line)
14364 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14365 (try_scrolling, redisplay_window, display_line): Use them when
14366 saving a temporary copy of the iterator and restoring it back.
14367 (back_to_previous_visible_line_start, reseat_1)
14368 (init_iterator): Empty the bidi cache "stack".
14369 (move_it_in_display_line_to): If iterator ended up at
14370 EOL, but we never saw any buffer positions smaller than
14371 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
14372 motion in bidi-reordered lines.
14373 (move_it_in_display_line_to): Record prev_method and prev_pos
14374 immediately before the call to set_iterator_to_next. Fixes cursor
14375 motion in bidi-reordered lines with stretch glyphs and strings
14376 displayed in margins. (Bug#8133) (Bug#8867)
14377 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14378 TO_CHARPOS.
14379 (pos_visible_p): Support positions in bidi-reordered lines.
14380 Save and restore bidi cache.
14381
14382 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14383 (bidi_paragraph_info): Delete unused struct.
14384 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14385 (bidi_cache_start): New variable.
14386 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14387 to zero.
14388 (bidi_cache_fetch_state, bidi_cache_search)
14389 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14390 (bidi_cache_find, bidi_peek_at_next_level)
14391 (bidi_level_of_next_char, bidi_find_other_level_edge)
14392 (bidi_move_to_visually_next): Compare cache index with
14393 bidi_cache_start rather than with zero.
14394 (bidi_fetch_char): Accept new argument STRING; all callers
14395 changed. Support iteration over a string. Support strings with
14396 display properties. Support unibyte strings. Fix the type of
14397 `len' according to what STRING_CHAR_AND_LENGTH expects.
14398 (bidi_paragraph_init, bidi_resolve_explicit_1)
14399 (bidi_resolve_explicit, bidi_resolve_weak)
14400 (bidi_level_of_next_char, bidi_move_to_visually_next):
14401 Support iteration over a string.
14402 (bidi_set_sor_type, bidi_resolve_explicit_1)
14403 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14404 can now be zero (for strings); special values 0 and -1 were
14405 changed to -1 and -2, respectively.
14406 (bidi_char_at_pos): New function.
14407 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14408 Call it instead of FETCH_MULTIBYTE_CHAR.
14409 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14410 initialized to valid values.
14411 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14412 values.
14413 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14414 the test for valid cached positions. Fix the logic for looking up
14415 the sentinel state in the cache. GCPRO the Lisp string we are
14416 iterating.
14417 (bidi_push_it, bidi_pop_it): New functions.
14418 (bidi_initialize): Initialize the bidi cache start stack pointer.
14419 (bidi_cache_ensure_space): New function, refactored from part of
14420 bidi_cache_iterator_state. Don't assume the required size is just
14421 one BIDI_CACHE_CHUNK away.
14422 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14423 (bidi_count_bytes, bidi_char_at_pos): New functions.
14424 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14425 always valid if bidi_cache_idx is valid.
14426 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14427 is valid if it's going to be used.
14428 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14429 (bidi_cache_fetch_state, bidi_cache_search)
14430 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14431 (bidi_cache_iterator_state, bidi_cache_find)
14432 (bidi_find_other_level_edge, bidi_cache_start_stack):
14433 All variables related to cache indices are now EMACS_INT.
14434
14435 * dispextern.h (struct bidi_string_data): New structure.
14436 (struct bidi_it): New member `string'. Make flag members be 1-bit
14437 fields, and put them last in the struct.
14438 (compute_display_string_pos, compute_display_string_end):
14439 Update prototypes.
14440 (bidi_push_it, bidi_pop_it): Add prototypes.
14441 (struct iterator_stack_entry): New members bidi_p,
14442 paragraph_embedding, and from_disp_prop_p.
14443 (struct it): Member bidi_p is now a bit field 1 bit wide.
14444 (bidi_shelve_cache, bidi_unshelve_cache):
14445 Declare prototypes.
14446
14447 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14448 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14449 and vector-like objects.
14450
14451 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14452 cache around display iteration.
14453
14454 * window.c (Fwindow_end, window_scroll_pixel_based)
14455 (displayed_window_lines, Frecenter): Save and restore the bidi
14456 cache around display iteration.
14457
14458 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14459
14460 * editfns.c (Fdelete_region): Clarify the use of the named
14461 parameters (bug#6788).
14462
14463 2011-07-14 Martin Rudalics <rudalics@gmx.at>
14464
14465 * indent.c (Fvertical_motion): Set and restore w->pointm when
14466 saving and restoring the window's buffer (Bug#9006).
14467
14468 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
14469
14470 * editfns.c (Fstring_to_char): Clarify just what is returned
14471 (bug#6576). Text by Eli Zaretskii.
14472
14473 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
14474
14475 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14476
14477 2011-07-13 Eli Zaretskii <eliz@gnu.org>
14478
14479 * buffer.c (mmap_find): Fix a typo.
14480
14481 2011-07-13 Johan Bockgård <bojohan@gnu.org>
14482
14483 Fix execution of x selection hooks.
14484 * xselect.c (Qx_lost_selection_functions)
14485 (Qx_sent_selection_functions): New vars.
14486 (syms_of_xselect): DEFSYM them.
14487 (x_handle_selection_request): Pass Qx_sent_selection_functions
14488 rather than Vx_sent_selection_functions to Frun_hook_with_args.
14489 (x_handle_selection_clear,x_clear_frame_selections):
14490 Pass Qx_lost_selection_functions rather than
14491 Vx_lost_selection_functions to Frun_hook_with_args.
14492
14493 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
14494
14495 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14496 The old code sometimes used this field without initializing it.
14497
14498 * alloc.c (gc_sweep): Don't read past end of array.
14499 In theory, the old code could also have corrupted Emacs internals,
14500 though it'd be very unlikely.
14501
14502 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
14503
14504 * character.c (Fcharacterp): Don't advertise optional ignored
14505 argument. (Bug#4026)
14506
14507 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14508
14509 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14510 key" (bug#4257).
14511
14512 * window.c (Fset_window_start): Doc fix (bug#4199).
14513 (Fset_window_hscroll): Ditto.
14514
14515 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14516
14517 Fix minor new problems caught by GCC 4.6.1.
14518 * term.c (init_tty): Remove unused local.
14519 * xsettings.c (store_monospaced_changed): Define this function only
14520 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14521 not used otherwise.
14522
14523 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14524
14525 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14526
14527 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14528
14529 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14530 are the mini-buffer and the echo area (bug#3320).
14531
14532 * term.c (init_tty): Remove support for supdup, c10 and perq
14533 terminals, which are no longer supported (bug#1482).
14534
14535 2011-07-10 Johan Bockgård <bojohan@gnu.org>
14536
14537 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14538
14539 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14540
14541 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14542 for non-popups (Bug#3642).
14543
14544 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14545
14546 * alloc.c (reset_malloc_hooks): Protoize.
14547 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14548 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14549 * cm.c (losecursor): Likewise.
14550 * data.c (fmod): Likewise.
14551 * dispnew.c (swap_glyphs_in_rows): Likewise.
14552 * emacs.c (memory_warning_signal): Likewise.
14553 * floatfns.c (float_error): Likewise.
14554 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14555 (otf_open, font_otf_capability, generate_otf_features)
14556 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14557 Likewise.
14558 * image.c (pbm_read_file): Likewise.
14559 * indent.c (string_display_width): Likewise.
14560 * intervals.c (check_for_interval, search_for_interval)
14561 (inc_interval_count, count_intervals, root_interval)
14562 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14563 * lread.c (defalias): Likewise.
14564 * ralloc.c (r_alloc_check): Likewise.
14565 * regex.c (set_image_of_range_1, set_image_of_range)
14566 (regex_grow_registers): Likewise.
14567 * sysdep.c (strerror): Likewise.
14568 * termcap.c (valid_filename_p, tprint, main): Likewise.
14569 * tparam.c (main): Likewise.
14570 * unexhp9k800.c (run_time_remap, save_data_space)
14571 (update_file_ptrs, read_header, write_header, calculate_checksum)
14572 (copy_file, copy_rest, display_header): Likewise.
14573 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14574 Likewise.
14575 * xdisp.c (check_it): Likewise.
14576 * xfaces.c (register_color, unregister_color, unregister_colors):
14577 Likewise.
14578 * xfns.c (print_fontset_result): Likewise.
14579 * xrdb.c (member, fatal, main): Likewise.
14580
14581 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14582
14583 Fix minor problems found by static checking (Bug#9031).
14584 * chartab.c (char_table_set_range, map_sub_char_table):
14585 Remove unused locals.
14586 (uniprop_table): Now static.
14587 * composite.c (_work_char): Remove unused static var.
14588
14589 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
14590
14591 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14592
14593 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14594
14595 * gtkutil.c (qttip_cb): Remove code without function.
14596
14597 2011-07-09 Eli Zaretskii <eliz@gnu.org>
14598
14599 * w32.c (pthread_sigmask): New stub.
14600
14601 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
14602
14603 Use pthread_sigmask, not sigprocmask (Bug#9010).
14604 sigprocmask is portable only for single-threaded applications, and
14605 Emacs can be multi-threaded when it uses GTK.
14606 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14607 (LIBES): Use it.
14608 * callproc.c (Fcall_process):
14609 * process.c (create_process):
14610 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14611 Use pthread_sigmask, not sigprocmask.
14612
14613 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14614
14615 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14616 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14617 wrong (Bug#8591).
14618
14619 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14620
14621 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14622 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14623 (xg_hide_tooltip): Fix comment.
14624
14625 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14626 in registerServicesMenuSendTypes.
14627 (validRequestorForSendType): Don't check ns_return_types.
14628
14629 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14630 ns_return_type.
14631
14632 2011-07-08 Jason Rumney <jasonr@gnu.org>
14633
14634 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14635 SH_SHOW for hidden windows (Bug#5482).
14636
14637 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14638 frame struct members of non-existent frames (Bug#6284).
14639
14640 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14641
14642 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14643 variable firstTime not needed on OSX >= 10.6.
14644 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14645 >= 10.5. Use setKnobProportion, setDoubleValue.
14646
14647 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14648 (MAC_OS_X_VERSION_10_5): Define if not defined.
14649 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14650 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14651 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14652
14653 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14654 cString and lossyCString on OSX >= 10.4.
14655
14656 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14657 sizeToFit on OSX >= 10.2.
14658
14659 * nsimage.m (allocInitFromFile): Don't use deprecated method
14660 bestRepresentationForDevice on OSX >= 10.6.
14661
14662 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14663 to avoid warning.
14664
14665 * emacs.c: Declare unexec_init_emacs_zone.
14666
14667 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14668
14669 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14670
14671 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14672 on svcsMenu (Bug#8842).
14673
14674 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14675 ns_return_types.
14676 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14677
14678 * nsterm.m (QUTF8_STRING): Declare.
14679 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14680 (validRequestorForSendType): Return type is (id).
14681 Change indexOfObjectIdenticalTo to indexOfObject.
14682 Check if we have local selection before returning self (Bug#8842).
14683 (writeSelectionToPasteboard): Put local selection into paste board
14684 if we have a local selection (Bug#8842).
14685 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14686
14687 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14688 (ns_get_local_selection): Declare.
14689
14690 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14691
14692 * keymap.c (describe_map_tree): Don't insert a double newline at
14693 the end of the buffer (bug#1169) and return whether we inserted
14694 something.
14695
14696 * callint.c (Fcall_interactively): Change "reading args" to
14697 "providing args" to try to clarify what it does (bug#1010).
14698
14699 2011-07-07 Kenichi Handa <handa@m17n.org>
14700
14701 * composite.c (composition_compute_stop_pos): Ignore a static
14702 composition starting before CHARPOS (Bug#8915).
14703
14704 * xdisp.c (handle_composition_prop): Likewise.
14705
14706 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14707
14708 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14709 (Bug#9015)
14710
14711 2011-07-07 Kenichi Handa <handa@m17n.org>
14712
14713 * character.h (unicode_category_t): New enum type.
14714
14715 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14716 (Qchar_code_property_table): New variable.
14717 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14718 (UNIPROP_COMPRESSED_FORM_P): New macros.
14719 (char_table_ascii): Uncompress the compressed values.
14720 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14721 Uncompress the compressed values.
14722 (sub_char_table_ref_and_range): Likewise.
14723 (char_table_ref_and_range): Uncompress the compressed values.
14724 (sub_char_table_set): New arg is_uniprop. Callers changed.
14725 Uncompress the compressed values.
14726 (sub_char_table_set_range): Args changed. Callers changed.
14727 (char_table_set_range): Adjuted for the above change.
14728 (map_sub_char_table): Delete args default_val and parent. Add arg
14729 top. Give decoded values to a Lisp function.
14730 (map_char_table): Adjust for the above change. Give decoded
14731 values to a Lisp function. Gcpro more variables.
14732 (uniprop_table_uncompress)
14733 (uniprop_decode_value_run_length): New functions.
14734 (uniprop_decoder, uniprop_decoder_count): New variables.
14735 (uniprop_get_decoder, uniprop_encode_value_character)
14736 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14737 New functions.
14738 (uniprop_encoder, uniprop_encoder_count): New variables.
14739 (uniprop_get_encoder, uniprop_table)
14740 (Funicode_property_table_internal, Fget_unicode_property_internal)
14741 (Fput_unicode_property_internal): New functions.
14742 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14743 Sunicode_property_table_internal, Sget_unicode_property_internal,
14744 and Sput_unicode_property_internal. Defvar_lisp
14745 char-code-property-alist.
14746
14747 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14748 Vunicode_category_table.
14749
14750 * font.c (font_range): Adjust for the change of
14751 Vunicode_category_table.
14752
14753 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14754
14755 * m/iris4d.h: Remove file, move contents ...
14756 * s/irix6-5.h: ... here.
14757
14758 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14759
14760 Remove unportable assumption about struct layout (Bug#8884).
14761 * alloc.c (mark_buffer):
14762 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14763 (clone_per_buffer_values): Don't assume that
14764 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14765 This isn't true in general, and it's particularly not true
14766 if Emacs is configured with --with-wide-int.
14767 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14768 New macros, used in the buffer.c change.
14769
14770 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14771
14772 * xsettings.c: Use both GConf and GSettings if both are available.
14773 (store_config_changed_event): Add comment.
14774 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14775 (store_tool_bar_style_changed): New functions.
14776 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14777 (struct xsettings): Move font inside HAVE_XFT.
14778 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14779 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14780 Move inside HAVE_XFT.
14781 (something_changed_gsettingsCB): Rename from something_changedCB.
14782 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14783 also.
14784 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14785 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14786 (something_changed_gconfCB): Rename from something_changedCB.
14787 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14788 (parse_settings): Move check for font inside HAVE_XFT.
14789 (read_settings, apply_xft_settings): Add comment.
14790 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14791 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14792 call store_font_name_changed.
14793 (xft_settings_event): Add comment.
14794 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14795 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14796 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14797 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14798 (xsettings_initialize): Call init_gsettings last.
14799 (xsettings_get_system_font, xsettings_get_system_normal_font):
14800 Add comment.
14801
14802 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14803
14804 Random fixes. E.g., (random) never returned negative values.
14805 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14806 subseconds part to the entropy, as that's a bit more random.
14807 Prefer signed to unsigned, since the signedness doesn't matter and
14808 in general we prefer signed. When given a limit, use a
14809 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14810 latter isn't right if USE_2_TAGS_FOR_INTS.
14811 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14812 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14813
14814 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14815
14816 * textprop.c (text_property_stickiness):
14817 Obey Vtext_property_default_nonsticky.
14818 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14819 * w32fns.c (syms_of_w32fns):
14820 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14821
14822 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14823
14824 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14825 This is more efficient than Ffile_directory_p and avoids a minor race.
14826
14827 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14828
14829 * buffer.c (Foverlay_put): Say what the return value is
14830 (bug#7835).
14831
14832 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14833 is a directory before asking whether to use the file name
14834 (bug#7564).
14835 (barf_or_query_if_file_exists): Make the "File is a directory"
14836 error be more correct.
14837
14838 * fns.c (Frequire): Remove the mention of the .gz files, since
14839 that's installation-specific, but keep the mention of
14840 `get-load-suffixes'.
14841
14842 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14843
14844 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14845 Report string overflow if the output is too long.
14846
14847 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14848
14849 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14850 (syms_of_gnutls): Remove duplicate DEFSYM for
14851 Qgnutls_bootprop_verify_hostname_error, an error for
14852 Qgnutls_bootprop_verify_error (which is no longer used).
14853
14854 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14855 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14856 Also (re)move comments that are misplaced or no longer relevant.
14857
14858 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14859
14860 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14861
14862 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14863
14864 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14865 and background color parameters if they have been changed.
14866
14867 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14868
14869 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14870
14871 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14872
14873 * xsettings.c (SYSTEM_FONT): Define only when used.
14874 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14875
14876 * keymap.c (access_keymap_1): Now static.
14877
14878 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14879
14880 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14881 leave any prefix arg for the up event (Bug#1586).
14882
14883 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14884
14885 * lread.c (syms_of_lread): Mention single symbols defined by
14886 `defvar' or `defconst' (bug#7154).
14887
14888 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14889 (Frequire): Mention get-load-suffixes.
14890
14891 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14892
14893 * window.h (window): Remove clone_number slot.
14894 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14895 Remove.
14896 (make_parent_window, make_window, saved_window)
14897 (Fset_window_configuration, save_window_save): Don't deal with
14898 clone numbers.
14899 * buffer.c (Qclone_number): Remove declaration.
14900 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14901
14902 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14903
14904 Add multiple inheritance to keymaps.
14905 * keymap.c (Fmake_composed_keymap): New function.
14906 (Fset_keymap_parent): Simplify.
14907 (fix_submap_inheritance): Remove.
14908 (access_keymap_1): New function extracted from access_keymap to handle
14909 embedded parents and handle lists of maps.
14910 (access_keymap): Use it.
14911 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14912 (Fcopy_keymap): Handle embedded parents.
14913 (Fcommand_remapping, define_as_prefix): Simplify.
14914 (Fkey_binding): Simplify.
14915 (syms_of_keymap): Move minibuffer-local-completion-map,
14916 minibuffer-local-filename-completion-map,
14917 minibuffer-local-must-match-map, and
14918 minibuffer-local-filename-must-match-map to Elisp.
14919 (syms_of_keymap): Defsubr make-composed-keymap.
14920 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14921 (parse_menu_item): Trivial simplification.
14922
14923 2011-07-01 Glenn Morris <rgm@gnu.org>
14924
14925 * Makefile.in (SETTINGS_LIBS): Fix typo.
14926
14927 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14928
14929 * coding.c (Fencode_coding_string): Record the last coding system
14930 used, as the function doc string says (bug#8738).
14931
14932 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14933
14934 * xsettings.c (store_monospaced_changed): Take new font as arg and
14935 check for change against current_mono_font.
14936 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14937 (emacs_settings_constructor, emacs_settings_get_property)
14938 (emacs_settings_set_property, emacs_settings_class_init)
14939 (emacs_settings_init, gsettings_obj): Remove.
14940 (something_changedCB): New function for HAVE_GSETTINGS.
14941 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14942 with value as argument.
14943 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14944 g_settings_new (Bug#8967). Do not create gsettings_obj.
14945 Remove calls to g_settings_bind. Connect something_changedCB to
14946 "changed".
14947
14948 * xgselect.c: Add defined (HAVE_GSETTINGS).
14949 (xgselect_initialize): Ditto.
14950
14951 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14952 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14953 xg_select.
14954
14955 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14956
14957 * eval.c (struct backtrace): Simplify and port the data structure.
14958 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14959 signed bit field, as this assumption is not portable and it makes
14960 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14961 "char debug_on_exit : 1" as this is not portable either; instead,
14962 use the portable "unsigned int debug_on_exit : 1". Remove unused
14963 member evalargs. Remove obsolete comments about cc bombing out.
14964
14965 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14966
14967 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14968 Let HAVE_GSETTINGS override HAVE_GCONF.
14969 (store_monospaced_changed): New function.
14970 (EMACS_SETTINGS): A new type derived from GObject to handle
14971 GSettings notifications.
14972 (emacs_settings_constructor, emacs_settings_get_property)
14973 (emacs_settings_set_property, emacs_settings_class_init):
14974 New functions.
14975 (gsettings_client, gsettings_obj): New variables.
14976 (GSETTINGS_SCHEMA): New define.
14977 (something_changedCB): Call store_monospaced_changed.
14978 (init_gsettings): New function.
14979 (xsettings_initialize): Call init_gsettings.
14980 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14981 to NULL.
14982
14983 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14984 GCONF_CFLAGS/LIBS.
14985
14986 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14987
14988 * window.c (resize_root_window, grow_mini_window)
14989 (shrink_mini_window): Rename Qresize_root_window to
14990 Qwindow_resize_root_window and Qresize_root_window_vertically to
14991 Qwindow_resize_root_window_vertically.
14992
14993 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14994
14995 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14996
14997 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14998
14999 * makefile.w32-in: Redesign dependencies so they reflect more
15000 clearly which files are directly included by each source file,
15001 and not through other includes.
15002
15003 2011-06-27 Martin Rudalics <rudalics@gmx.at>
15004
15005 * buffer.c (Qclone_number): Declare static and DEFSYM it.
15006 (sort_overlays, overlay_strings): When an overlay's clone number
15007 matches the window's clone number process the overlay even if
15008 the overlay's window property doesn't match the current window.
15009
15010 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15011 (Fwindow_hchild): Rename to Fwindow_left_child.
15012 (Fwindow_next): Rename to Fwindow_next_sibling.
15013 (Fwindow_prev): Rename to Fwindow_prev_sibling.
15014 (resize_window_check): Rename to window_resize_check.
15015 (resize_window_apply): Rename to window_resize_apply.
15016 (Fresize_window_apply): Rename to Fwindow_resize_apply.
15017 (Fdelete_other_windows_internal, resize_frame_windows)
15018 (Fsplit_window_internal, Fdelete_window_internal)
15019 (grow_mini_window, shrink_mini_window)
15020 (Fresize_mini_window_internal): Fix callers accordingly.
15021
15022 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15023
15024 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15025 (emacs_fixed_set_min_size): Remove.
15026 (emacs_fixed_new): Take frame as argument.
15027
15028 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15029 (_EmacsFixedPrivate): Remove minwidth/height.
15030 Add struct frame *f.
15031 (emacs_fixed_init): Initialize priv->f.
15032 (get_parent_class, emacs_fixed_set_min_size): Remove.
15033 (emacs_fixed_new): Set priv->f to argument.
15034 (emacs_fixed_get_preferred_width)
15035 (emacs_fixed_get_preferred_height): Use min_width/height from
15036 frames size_hint to set minimum and natural (Bug#8919).
15037 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15038 and use min_width/height from frames size_hint to set
15039 min_width/height (Bug#8919).
15040
15041 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15042 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15043 Fix indentation.
15044
15045 2011-06-26 Eli Zaretskii <eliz@gnu.org>
15046
15047 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15048 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15049 called at ZV.
15050
15051 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
15052
15053 * process.c (wait_reading_process_output): Bypass select if
15054 waiting for a cell while ignoring keyboard input, and input is
15055 pending. Suggested by Jan Djärv (Bug#8869).
15056
15057 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
15058
15059 Use gnulib's dup2 module instead of rolling our own.
15060 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15061
15062 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15063
15064 * dispnew.c (scrolling_window): Before scrolling, turn off a
15065 mouse-highlight in the window being scrolled.
15066
15067 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
15068
15069 Move DEFSYM to lisp.h and use everywhere.
15070
15071 * character.h (DEFSYM): Move declaration...
15072 * lisp.h (DEFSYM): ...here.
15073
15074 * gnutls.c:
15075 * minibuf.c:
15076 * w32menu.c:
15077 * w32proc.c:
15078 * w32select.c: Don't include character.h.
15079
15080 * alloc.c (syms_of_alloc):
15081 * buffer.c (syms_of_buffer):
15082 * bytecode.c (syms_of_bytecode):
15083 * callint.c (syms_of_callint):
15084 * casefiddle.c (syms_of_casefiddle):
15085 * casetab.c (init_casetab_once):
15086 * category.c (init_category_once, syms_of_category):
15087 * ccl.c (syms_of_ccl):
15088 * cmds.c (syms_of_cmds):
15089 * composite.c (syms_of_composite):
15090 * dbusbind.c (syms_of_dbusbind):
15091 * dired.c (syms_of_dired):
15092 * dispnew.c (syms_of_display):
15093 * doc.c (syms_of_doc):
15094 * editfns.c (syms_of_editfns):
15095 * emacs.c (syms_of_emacs):
15096 * eval.c (syms_of_eval):
15097 * fileio.c (syms_of_fileio):
15098 * fns.c (syms_of_fns):
15099 * frame.c (syms_of_frame):
15100 * fringe.c (syms_of_fringe):
15101 * insdel.c (syms_of_insdel):
15102 * keymap.c (syms_of_keymap):
15103 * lread.c (init_obarray, syms_of_lread):
15104 * macros.c (syms_of_macros):
15105 * msdos.c (syms_of_msdos):
15106 * print.c (syms_of_print):
15107 * process.c (syms_of_process):
15108 * search.c (syms_of_search):
15109 * sound.c (syms_of_sound):
15110 * syntax.c (init_syntax_once, syms_of_syntax):
15111 * terminal.c (syms_of_terminal):
15112 * textprop.c (syms_of_textprop):
15113 * undo.c (syms_of_undo):
15114 * w32.c (globals_of_w32):
15115 * window.c (syms_of_window):
15116 * xdisp.c (syms_of_xdisp):
15117 * xfaces.c (syms_of_xfaces):
15118 * xfns.c (syms_of_xfns):
15119 * xmenu.c (syms_of_xmenu):
15120 * xsettings.c (syms_of_xsettings):
15121 * xterm.c (syms_of_xterm): Use DEFSYM.
15122
15123 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
15124
15125 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
15126
15127 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
15128
15129 Integer and buffer overflow fixes (Bug#8873).
15130
15131 * print.c (printchar, strout): Check for string overflow.
15132 (PRINTPREPARE, printchar, strout):
15133 Don't set size unless allocation succeeds.
15134
15135 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15136 for sizes. Check for string overflow more accurately.
15137 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15138
15139 * macros.c: Integer and buffer overflow fixes.
15140 * keyboard.h (struct keyboard.kbd_macro_bufsize):
15141 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15142 Use ptrdiff_t, not int, for sizes.
15143 Don't increment bufsize until after realloc succeeds.
15144 Check for size-calculation overflow.
15145 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15146
15147 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15148
15149 * lread.c: Integer overflow fixes.
15150 (read_integer): Radix is now EMACS_INT, not int,
15151 to improve quality of diagnostics for out-of-range radices.
15152 Calculate buffer size correctly for out-of-range radices.
15153 (read1): Check for integer overflow in radices, and in
15154 read-circle numbers.
15155 (read_escape): Avoid int overflow.
15156 (Fload, openp, read_buffer_size, read1)
15157 (substitute_object_recurse, read_vector, read_list, map_obarray):
15158 Use ptrdiff_t, not int, for sizes.
15159 (read1): Use EMACS_INT, not int, for sizes.
15160 Check for size overflow.
15161
15162 * image.c (cache_image): Check for size arithmetic overflow.
15163
15164 * lread.c: Integer overflow issues.
15165 (saved_doc_string_size, saved_doc_string_length)
15166 (prev_saved_doc_string_size, prev_saved_doc_string_length):
15167 Now ptrdiff_t, not int.
15168 (read1): Don't assume doc string length fits in int. Check for
15169 out-of-range doc string lengths.
15170 (read_list): Don't assume file position fits in int.
15171 (read_escape): Check for hex character overflow.
15172
15173 2011-06-22 Leo Liu <sdl.web@gmail.com>
15174
15175 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15176 Move to minibuffer.el.
15177
15178 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15179
15180 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
15181 The following patches are for when GLYPH_DEBUG && !XASSERT.
15182 * dispextern.h (trace_redisplay_p, dump_glyph_string):
15183 * dispnew.c (flush_stdout):
15184 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15185 Mark as externally visible.
15186 * dispnew.c (check_window_matrix_pointers): Now static.
15187 * dispnew.c (window_to_frame_vpos):
15188 * xfns.c (unwind_create_frame):
15189 * xterm.c (x_check_font): Remove unused local.
15190 * scroll.c (CHECK_BOUNDS):
15191 * xfaces.c (cache_fache): Rename local to avoid shadowing.
15192 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15193 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15194 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15195 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15196 Now static.
15197 (debug_method_add): Use va_list and vsprintf rather than relying
15198 on undefined behavior with wrong number of arguments.
15199 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
15200 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
15201 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
15202 since we're not interested in debugging glyphs with old libraries.
15203 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
15204 GCC 4.6.0's static checking.
15205
15206 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15207
15208 Integer overflow and signedness fixes (Bug#8873).
15209 A few related buffer overrun fixes, too.
15210
15211 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
15212
15213 * dispextern.h (struct face.stipple):
15214 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
15215 (x_bitmap_mask, x_allocate_bitmap_record)
15216 (x_create_bitmap_from_data, x_create_bitmap_from_file)
15217 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
15218 (x_create_bitmap_from_xpm_data):
15219 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
15220 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
15221 (.bitmaps_last):
15222 * xfaces.c (load_pixmap):
15223 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
15224 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
15225 (.bitmaps_last, struct x_output.icon_bitmap):
15226 Use ptrdiff_t, not int, for bitmap indexes.
15227 (x_allocate_bitmap_record): Check for size overflow.
15228 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
15229
15230 Use ptrdiff_t, not int, for overlay counts.
15231 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
15232 * editfns.c (overlays_around, get_pos_property):
15233 * textprop.c (get_char_property_and_overlay):
15234 * xdisp.c (next_overlay_change, note_mouse_highlight):
15235 * xfaces.c (face_at_buffer_position):
15236 * buffer.c (OVERLAY_COUNT_MAX): New macro.
15237 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
15238 (Fnext_overlay_change, Fprevious_overlay_change)
15239 (mouse_face_overlay_overlaps, Foverlays_in):
15240 Use ptrdiff_t, not int, for sizes.
15241 (overlays_at, overlays_in): Check for size-calculation overflow.
15242
15243 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
15244
15245 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
15246 (x_session_initialize): Do not assume string length fits in int.
15247
15248 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
15249 This is unlikely, but can occur if DPI is outlandish.
15250
15251 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
15252 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
15253
15254 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
15255 * xrdb.c (magic_file_p, search_magic_path):
15256 Omit last arg SUFFIX; it was always 0. All callers changed.
15257 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
15258
15259 * xfont.c (xfont_match): Avoid need for strlen.
15260
15261 * xfns.c: Don't assume strlen fits in int.
15262 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
15263
15264 * xdisp.c (message_log_check_duplicate): Return intmax_t,
15265 not unsigned long, as we prefer signed integers. All callers changed.
15266 Detect integer overflow in repeat count.
15267 (message_dolog): Don't assume print length fits in 39 bytes.
15268 (display_mode_element): Don't assume strlen fits in int.
15269
15270 * termcap.c: Don't assume sizes fit in int and never overflow.
15271 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
15272 (gobble_line): Check for size-calculation overflow.
15273
15274 * minibuf.c (Fread_buffer):
15275 * lread.c (intern, intern_c_string):
15276 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
15277 Don't assume string length fits in int.
15278
15279 * keyboard.c (parse_tool_bar_item):
15280 * gtkutil.c (style_changed_cb): Avoid need for strlen.
15281
15282 * font.c: Don't assume string length fits in int.
15283 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
15284 Use ptrdiff_t, not int.
15285 (font_intern_prop): Don't assume string length fits in int.
15286 Don't assume integer property fits in fixnum.
15287 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
15288
15289 * filelock.c: Fix some buffer overrun and integer overflow issues.
15290 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
15291 Reformulate so as not to need the command string.
15292 Invoke gzip -cd rather than gunzip, as it's more portable.
15293 (lock_info_type, lock_file_1, lock_file):
15294 Don't assume pid_t and time_t fit in unsigned long.
15295 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
15296 (current_lock_owner): Prefer signed type for sizes.
15297 Use memcpy, not strncpy, where memcpy is what is really wanted.
15298 Don't assume (via atoi) that time_t and pid_t fit in int.
15299 Check for time_t and/or pid_t out of range, e.g., via a network share.
15300 Don't alloca where an auto var works fine.
15301
15302 * fileio.c: Fix some integer overflow issues.
15303 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
15304 Don't assume string length fits in int.
15305 (directory_file_name): Don't assume string length fits in long.
15306 (make_temp_name): Don't assume pid fits in int, or that its print
15307 length is less than 20.
15308
15309 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
15310
15311 * coding.c (make_subsidiaries): Don't assume string length fits in int.
15312
15313 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
15314
15315 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
15316 We prefer signed integers, even for size calculations.
15317
15318 * emacs.c: Don't assume string length fits in 'int'.
15319 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
15320 (main): Don't invoke strlen when not needed.
15321
15322 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
15323 (XD_DEBUG_MESSAGE): Don't waste a byte.
15324
15325 * callproc.c (getenv_internal_1, getenv_internal)
15326 (Fgetenv_internal):
15327 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
15328
15329 * lread.c (invalid_syntax): Omit length argument.
15330 All uses changed. This doesn't fix a bug, but it simplifies the
15331 code away from its former Hollerith-constant appearance, and it's
15332 one less 'int' to worry about when looking at integer-overflow issues.
15333 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
15334
15335 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
15336 This didn't break anything, but it didn't help either.
15337 It's confusing to put a bogus integer in a place where the actual
15338 value does not matter.
15339 (LIST_END_P): Remove unused macro and its bogus comment.
15340 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
15341
15342 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
15343 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
15344 implementation.
15345 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
15346 We prefer signed types, and the value cannot exceed the EMACS_INT
15347 range anyway (because otherwise the length would not be representable).
15348 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
15349 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
15350 This avoids a GCC warning when WIDE_EMACS_INT.
15351
15352 * indent.c (sane_tab_width): New function.
15353 (current_column, scan_for_column, Findent_to, position_indentation)
15354 (compute_motion): Use it. This is just for clarity.
15355 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
15356
15357 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
15358
15359 * lisp.h (lint_assume): New macro.
15360 * composite.c (composition_gstring_put_cache):
15361 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15362
15363 * editfns.c, insdel.c:
15364 Omit unnecessary forward decls, to simplify future changes.
15365
15366 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15367
15368 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15369
15370 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15371 Use much-faster test for byte-length change.
15372 Don't assume string byte-length fits in 'int'.
15373 Check that character arg fits in 'int'.
15374 (mapcar1): Declare byte as byte, for clarity.
15375
15376 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15377
15378 * fns.c (concat): Catch string overflow earlier.
15379 Do not rely on integer wraparound.
15380
15381 * dispextern.h (struct it.overlay_strings_charpos)
15382 (struct it.selective): Now EMACS_INT, not int.
15383 * xdisp.c (forward_to_next_line_start)
15384 (back_to_previous_visible_line_start)
15385 (reseat_at_next_visible_line_start, next_element_from_buffer):
15386 Don't arbitrarily truncate the value of 'selective' to int.
15387
15388 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15389
15390 * composite.c: Don't truncate sizes to 'int'.
15391 (composition_gstring_p, composition_reseat_it)
15392 (composition_adjust_point): Use EMACS_INT, not int.
15393 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15394 not EMACS_UINT, for indexes.
15395
15396 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15397
15398 * buffer.c: Include <verify.h>.
15399 (struct sortvec.priority, struct sortstr.priority):
15400 Now EMACS_INT, not int.
15401 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15402 (struct sortstr.size, record_overlay_string)
15403 (struct sortstrlist.size, struct sortlist.used):
15404 Don't truncate size to int.
15405 (record_overlay_string): Check for size-calculation overflow.
15406 (init_buffer_once): Check at compile-time, not run-time.
15407
15408 2011-06-22 Jim Meyering <meyering@redhat.com>
15409
15410 Don't leak an XBM-image-sized buffer
15411 * image.c (xbm_load): Free the image buffer after using it.
15412
15413 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15414
15415 Port to Sun C.
15416 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15417 that Sun C diagnosed.
15418 * fns.c (secure_hash): Fix pointer signedness issue.
15419 * intervals.c (static_offset_intervals): New function.
15420 (offset_intervals): Use it.
15421
15422 2011-06-21 Leo Liu <sdl.web@gmail.com>
15423
15424 * deps.mk (fns.o):
15425 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15426 sha512.h.
15427
15428 * fns.c (secure_hash): Rename from crypto_hash_function and change
15429 the first arg to accept symbols.
15430 (Fsecure_hash): New primitive.
15431 (syms_of_fns): New symbols.
15432
15433 2011-06-20 Deniz Dogan <deniz@dogan.se>
15434
15435 * process.c (Fset_process_buffer): Clarify return value in
15436 docstring.
15437
15438 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
15439
15440 * dispnew.c (add_window_display_history): Use BVAR.
15441
15442 * xdisp.c (debug_method_add): Use BVAR.
15443 (check_window_end, dump_glyph_matrix, dump_glyph)
15444 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15445
15446 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15447 Likewise.
15448
15449 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15450 check till after the cache is created in init_frame_faces.
15451
15452 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
15453
15454 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15455
15456 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
15457
15458 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15459 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15460 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15461
15462 Improve buffer-overflow checking (Bug#8873).
15463 * fileio.c (Finsert_file_contents):
15464 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15465 Remove the old (too-loose) buffer overflow checks.
15466 They weren't needed, since make_gap checks for buffer overflow.
15467 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15468 The old code merely checked for Emacs fixnum overflow, and relied
15469 on undefined (wraparound) behavior. The new code avoids undefined
15470 behavior, and also checks for ptrdiff_t and/or size_t overflow.
15471
15472 * editfns.c (Finsert_char): Don't dump core with very negative counts.
15473 Tune. Don't use wider integers than needed. Don't use alloca.
15474 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
15475
15476 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15477
15478 * insdel.c, lisp.h (buffer_overflow): New function.
15479 (insert_from_buffer_1, replace_range, replace_range_2):
15480 * insdel.c (make_gap_larger):
15481 * editfns.c (Finsert_char):
15482 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15483
15484 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15485
15486 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
15487
15488 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15489
15490 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15491 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15492
15493 * fileio.c: Don't assume EMACS_INT fits in off_t.
15494 (emacs_lseek): New static function.
15495 (Finsert_file_contents, Fwrite_region): Use it.
15496 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15497
15498 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15499
15500 * fns.c: Don't overflow int when computing a list length.
15501 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15502 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15503 truncation on 64-bit hosts. Check for QUIT every
15504 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15505 faster and is responsive enough.
15506 (Flength): Report an error instead of overflowing an integer.
15507 (Fsafe_length): Return a float if the value is not representable
15508 as a fixnum. This shouldn't happen except in contrived situations.
15509 (Fnthcdr, Fsort): Don't assume list length fits in int.
15510 (Fcopy_sequence): Don't assume vector length fits in int.
15511
15512 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15513 (header_size, word_size): New constants.
15514 (allocate_vectorlike): Don't check size overflow here.
15515 (allocate_vector): Check it here instead, since this is the only
15516 caller of allocate_vectorlike that could cause overflow.
15517 Check that the new vector's length is representable as a fixnum.
15518
15519 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15520 The previous code was bogus. For example, next_almost_prime (32)
15521 returned 39, which is undesirable as it is a multiple of 3; and
15522 next_almost_prime (24) returned 25, which is a multiple of 5 so
15523 why was the code bothering to check for multiples of 7?
15524
15525 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15526
15527 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15528
15529 Variadic C functions now count arguments with ptrdiff_t.
15530 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15531 Back then I didn't know that the Emacs coding style prefers signed int.
15532 Also, in the meantime I found a few more instances where arguments
15533 were being counted with int, which may truncate counts on 64-bit
15534 machines, or EMACS_INT, which may be unnecessarily wide.
15535 * lisp.h (struct Lisp_Subr.function.aMANY)
15536 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15537 Arg counts are now ptrdiff_t, not size_t.
15538 All variadic functions and their callers changed accordingly.
15539 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15540 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15541 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15542 * callint.c (Fcall_interactively): Check arg count for overflow,
15543 to avoid potential buffer overrun. Use signed char, not 'int',
15544 for 'varies' array, so that we needn't bother to check its size
15545 calculation for overflow.
15546 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15547 * eval.c (apply_lambda):
15548 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15549 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15550 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15551
15552 * callint.c (Fcall_interactively): Don't use index var as event count.
15553
15554 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15555 * mem-limits.h (SIZE): Remove; no longer used.
15556
15557 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15558
15559 Remove unnecessary casts.
15560 * xterm.c (x_term_init):
15561 * xfns.c (x_set_border_pixel):
15562 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15563 These aren't needed now that we assume ANSI C.
15564
15565 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15566 It's more likely to cause problems (due to unsigned overflow)
15567 than to cure them.
15568
15569 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15570
15571 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15572
15573 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15574
15575 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15576
15577 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15578
15579 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15580
15581 GLYPH_CODE_FACE returns EMACS_INT, not int.
15582 * dispextern.h (merge_faces):
15583 * xfaces.c (merge_faces):
15584 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15585 Don't assume EMACS_INT fits in int.
15586
15587 * character.h (CHAR_VALID_P): Remove unused parameter.
15588 * fontset.c, lisp.h, xdisp.c: All uses changed.
15589
15590 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15591
15592 * fns.c (concat): Minor tuning based on overflow analysis.
15593 This doesn't fix any bugs. Use int to hold character, instead
15594 of constantly refetching from Emacs object. Use XFASTINT, not
15595 XINT, for value known to be a character. Don't bother comparing
15596 a single byte to 0400, as it's always less.
15597
15598 * floatfns.c (Fexpt):
15599 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15600
15601 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15602 for characters.
15603
15604 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15605
15606 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15607 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15608 incorrectly succeed when S was a string, because 4294967386 was
15609 truncated before it was used.
15610
15611 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15612 Otherwise, an out-of-range integer could cause undefined behavior
15613 on a 64-bit host.
15614
15615 * composite.c: Use int, not EMACS_INT, for characters.
15616 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15617 EMACS_INT, for values that are known to be in character range.
15618 This doesn't fix any bugs but is the usual style inside Emacs and
15619 may generate better code on 32-bit machines.
15620
15621 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15622 This is for reasons similar to the recent CHAR_STRING fix.
15623 * charset.c (Fencode_char): Check that character arg is actually
15624 a character. Pass an int to ENCODE_CHAR.
15625 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15626 wider than 'int', as a compile-time check to prevent future regressions
15627 in this area.
15628
15629 * character.c (char_string): Remove unnecessary casts.
15630
15631 Make sure a 64-bit char is never passed to CHAR_STRING.
15632 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15633 by silently ignoring the top 32 bits, allowing some values
15634 that were far too large to be valid characters.
15635 * character.h: Include <verify.h>.
15636 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15637 arguments are no wider than unsigned, as a compile-time check
15638 to prevent future regressions in this area.
15639 * data.c (Faset):
15640 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15641 (Fsubst_char_in_region):
15642 * fns.c (concat):
15643 * xdisp.c (decode_mode_spec_coding):
15644 Adjust to CHAR_STRING's new requirement.
15645 * editfns.c (Finsert_char, Fsubst_char_in_region):
15646 * fns.c (concat): Check that character args are actually
15647 characters. Without this test, these functions did the wrong
15648 thing with wildly out-of-range values on 64-bit hosts.
15649
15650 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15651 These casts should not be needed on 32-bit hosts, either.
15652 * keyboard.c (read_char):
15653 * lread.c (Fload): Remove casts to unsigned.
15654
15655 * lisp.h (UNSIGNED_CMP): New macro.
15656 This fixes comparison bugs on 64-bit hosts.
15657 (ASCII_CHAR_P): Use it.
15658 * casefiddle.c (casify_object):
15659 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15660 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15661 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15662 * dispextern.h (FACE_FROM_ID):
15663 * keyboard.c (read_char): Use UNSIGNED_CMP.
15664
15665 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15666 not to EMACS_INT, to avoid GCC warning.
15667
15668 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15669
15670 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15671 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15672 isn't needed on 32-bit machines.
15673
15674 * buffer.c (Fgenerate_new_buffer_name):
15675 Use EMACS_INT for count, not int.
15676 (advance_to_char_boundary): Return EMACS_INT, not int.
15677
15678 * data.c (Qcompiled_function): Now static.
15679
15680 * window.c (window_body_lines): Now static.
15681
15682 * image.c (gif_load): Rename local to avoid shadowing.
15683
15684 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15685 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15686 * alloc.c (make_save_value): Integer argument is now of type
15687 ptrdiff_t, not int.
15688 (mark_object): Use ptrdiff_t, not int.
15689 * lisp.h (pD): New macro.
15690 * print.c (print_object): Use it.
15691
15692 * alloc.c: Use EMACS_INT, not int, to count objects.
15693 (total_conses, total_markers, total_symbols, total_vector_size)
15694 (total_free_conses, total_free_markers, total_free_symbols)
15695 (total_free_floats, total_floats, total_free_intervals)
15696 (total_intervals, total_strings, total_free_strings):
15697 Now EMACS_INT, not int. All uses changed.
15698 (Fgarbage_collect): Compute overall total using a double, so that
15699 integer overflow is less likely to be a problem. Check for overflow
15700 when converting back to an integer.
15701 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15702 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15703 These were 'int' variables that could overflow on 64-bit hosts;
15704 they were never used, so remove them instead of repairing them.
15705 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15706 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15707 Previously, this ceilinged at INT_MAX, but that doesn't work on
15708 64-bit machines.
15709 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15710
15711 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15712 (allocate_vectorlike): Check for ptrdiff_t overflow.
15713 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15714 when a (possibly-narrower) signed value would do just as well.
15715 We prefer using signed arithmetic, to avoid comparison confusion.
15716
15717 * alloc.c: Catch some string size overflows that we were missing.
15718 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15719 for convenience in STRING_BYTES_MAX.
15720 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15721 The definition here is exact; the one in lisp.h was approximate.
15722 (allocate_string_data): Check for string overflow. This catches
15723 some instances we weren't catching before. Also, it catches
15724 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15725 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15726 and ptrdiff_t and EMACS_INT are both 64 bits.
15727
15728 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15729 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15730 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15731
15732 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15733
15734 * alloc.c (Fmake_string): Check for out-of-range init.
15735
15736 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15737
15738 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15739
15740 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15741
15742 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15743 xg_get_default_scrollbar_width.
15744
15745 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15746 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15747 (style_changed_cb): Call update_theme_scrollbar_width and call
15748 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15749 all frames (Bug#8505).
15750 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15751 Call gtk_window_set_resizable if HAVE_GTK3.
15752 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15753 and height if HAVE_GTK3 (Bug#8505).
15754 (scroll_bar_width_for_theme): New variable.
15755 (update_theme_scrollbar_width): New function.
15756 (xg_get_default_scrollbar_width): Move code to
15757 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15758 (xg_initialize): Call update_theme_scrollbar_width.
15759
15760 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15761
15762 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15763
15764 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15765
15766 * frame.c (make_frame): Call other_buffer_safely instead of
15767 other_buffer.
15768
15769 * window.c (temp_output_buffer_show): Call display_buffer with
15770 second argument Vtemp_buffer_show_specifiers and reset latter
15771 immediately after the call.
15772 (Vtemp_buffer_show_specifiers): New variable.
15773 (auto_window_vscroll_p, next_screen_context_lines)
15774 (Vscroll_preserve_screen_position): Remove leading asterisks from
15775 doc-strings.
15776
15777 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15778
15779 Fix minor problems found by GCC 4.6.0 static checking.
15780 * buffer.c (Qclone_number): Remove for now, as it's unused.
15781 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15782 (record_buffer): Remove unused local.
15783 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15784 (set_frame_buffer_list): Remove; unused.
15785 * frame.h (other_visible_frames): Remove decl.
15786 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15787 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15788 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15789 if HAVE_GPM.
15790 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15791 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15792 Define only if HAVE_GPM.
15793 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15794 (update_hints_inhibit): Remove; never set. All uses removed.
15795 * widgetprv.h (emacsFrameClassRec): Remove decl.
15796 * window.c (delete_deletable_window): Now returns void, since it
15797 wasn't returning anything.
15798 (compare_window_configurations): Remove unused locals.
15799 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15800 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15801 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15802 the same widths as pointers. This follows up on the 2011-05-06 patch.
15803 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15804 * xterm.h: Likewise.
15805 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15806
15807 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15808
15809 * makefile.w32-in: Update dependencies.
15810 (LISP_H): Add lib/intprops.h.
15811
15812 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15813
15814 * image.c (gif_load): Add animation frame delay to the metadata.
15815 (syms_of_image): Use DEFSYM. New symbol `delay'.
15816
15817 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15818
15819 * window.c (delete_deletable_window): Re-add.
15820 (Fset_window_configuration): Rewrite to handle dead buffers and
15821 consequently deletable windows.
15822 (window_tree, Fwindow_tree): Remove. Supply functionality in
15823 window.el.
15824 (compare_window_configurations): Simplify code.
15825
15826 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15827
15828 * image.c (imagemagick_load_image): Fix type mismatch.
15829 (Fimagemagick_types): Likewise.
15830
15831 * window.h (replace_buffer_in_windows): Declare.
15832
15833 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15834
15835 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15836 Qclone_number. Remove external declaration of Qdelete_window.
15837 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15838 code.
15839 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15840 Run Qbuffer_list_update_hook if allowed.
15841 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15842 buffer list implementation.
15843 (other_buffer_safely): New function.
15844 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15845 calls to replace_buffer_in_windows and
15846 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15847 if allowed.
15848 (record_buffer): Inhibit quitting and rewrite using quittable
15849 functions. Run Qbuffer_list_update_hook if allowed.
15850 (Frecord_buffer, Funrecord_buffer): New functions.
15851 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15852 Move switch-to-buffer to window.el.
15853 (bury-buffer): Move to window.el.
15854 (Vbuffer_list_update_hook): New variable.
15855
15856 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15857 section.
15858
15859 * window.h (resize_frame_windows): Move up in code.
15860 (Fwindow_frame): Remove EXFUN.
15861 (replace_buffer_in_all_windows): Remove prototype.
15862 (replace_buffer_in_windows_safely): Add prototype.
15863
15864 * window.c: Declare Qdelete_window static again. Move down
15865 declaration of select_count.
15866 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15867 (Fother_window): Move to window.el.
15868 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15869 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15870 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15871 window.el.
15872 (replace_buffer_in_windows): Implement by calling
15873 Qreplace_buffer_in_windows.
15874 (replace_buffer_in_all_windows): Remove with some functionality
15875 moved into replace_buffer_in_windows_safely.
15876 (replace_buffer_in_windows_safely): New function.
15877 (select_window_norecord, select_frame_norecord): Move in front
15878 of run_window_configuration_change_hook. Remove now obsolete
15879 declarations.
15880 (Fset_window_buffer): Rewrite doc-string.
15881 Call Qrecord_window_buffer.
15882 (keys_of_window): Move binding for other-window to window.el.
15883
15884 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15885
15886 * dispextern.h (struct image): Replace data member, whose int_val
15887 and ptr_val fields were not used by anything, with a single
15888 lisp_val object.
15889
15890 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15891 (gif_clear_image, gif_load, imagemagick_load_image)
15892 (gs_clear_image, gs_load): Callers changed.
15893
15894 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15895
15896 * buffer.h: Include <time.h>, for time_t.
15897 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15898
15899 Fix minor problems found by static checking.
15900
15901 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15902
15903 Make identifiers static if they are not used in other modules.
15904 * data.c (Qcompiled_function, Qframe, Qvector):
15905 * image.c (QimageMagick, Qsvg):
15906 * minibuf.c (Qmetadata):
15907 * window.c (resize_window_check, resize_root_window): Now static.
15908 * window.h (resize_window_check, resize_root_window): Remove decls.
15909
15910 * window.c (window_deletion_count, delete_deletable_window):
15911 Remove; unused.
15912 (window_body_lines): Now static.
15913 (Fdelete_other_windows_internal): Mark vars as initialized.
15914 Make sure 'resize_failed' is initialized.
15915 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15916 (resize_window_apply): Remove unused local.
15917 * window.h (delete_deletable_window): Remove decl.
15918
15919 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15920 (imagemagick_load_image): Fix pointer signedness problem by changing
15921 last arg from unsigned char * to char *. All uses changed.
15922 Also, fix a local for similar reasons.
15923 Remove unused locals. Remove locals to avoid shadowing.
15924 (fn_rsvg_handle_free): Remove; unused.
15925 (svg_load, svg_load_image): Fix pointer signedness problem.
15926 (imagemagick_load_image): Don't use garbage pointer image_wand.
15927
15928 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15929
15930 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15931
15932 * image.c (gif_load): Fix omitted cast error introduced by
15933 2011-06-06 change.
15934
15935 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15936
15937 * window.h (resize_proportionally, orig_total_lines)
15938 (orig_top_line): Remove from window structure.
15939 (set_window_height, set_window_width, change_window_heights)
15940 (Fdelete_window): Remove prototypes.
15941 (resize_frame_windows): Remove duplicate declaration.
15942
15943 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15944
15945 * window.h (resize_frame_windows, resize_window_check)
15946 (delete_deletable_window, resize_root_window)
15947 (resize_frame_windows): Declare prototypes.
15948
15949 * window.c (resize_window_apply): Make definition be "static" to
15950 match the prototype.
15951
15952 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15953
15954 * window.c: Remove declarations of Qwindow_size_fixed,
15955 window_min_size_1, window_min_size_2, window_min_size,
15956 size_window, window_fixed_size_p, enlarge_window, delete_window.
15957 Remove static from declaration of Qdelete_window, it's
15958 temporarily needed by Fbury_buffer.
15959 (replace_window): Don't assign orig_top_line and
15960 orig_total_lines.
15961 (Fdelete_window, delete_window): Remove. Window deletion is
15962 handled by window.el.
15963 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15964 Replace Fdelete_window calls with calls to Qdelete_window.
15965 (Fdelete_other_windows): Remove. Deleting other windows is
15966 handled by window.el.
15967 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15968 handled in window.el.
15969 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15970 Window minimum sizes are handled in window.el.
15971 (shrink_windows, size_window, set_window_height)
15972 (set_window_width, change_window_heights, window_height)
15973 (window_width, CURBEG, CURSIZE, enlarge_window)
15974 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15975 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15976 handled in window.el.
15977 (make_dummy_parent): Rename to make_parent_window and give it a
15978 second argument horflag.
15979 (make_window): Don't set resize_proportionally any more.
15980 (Fsplit_window): Remove. Windows are split in window.el.
15981 (save_restore_action, save_restore_orig_size)
15982 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15983 Resize mini windows in window.el.
15984 (grow_mini_window, shrink_mini_window): Implement by calling
15985 Qresize_root_window_vertically, resize_window_check and
15986 resize_window_apply.
15987 (saved_window, Fset_window_configuration, save_window_save):
15988 Do not handle orig_top_line, orig_total_lines, and
15989 resize_proportionally.
15990 (window_min_height, window_min_width): Move to window.el.
15991 (keys_of_window): Move bindings for delete-other-windows,
15992 split-window, delete-window and enlarge-window to window.el.
15993
15994 * buffer.c: Temporarily extern Qdelete_window.
15995 (Fbury_buffer): Temporarily call Qdelete_window instead of
15996 Fdelete_window (Fbury_buffer will move to window.el soon).
15997
15998 * frame.c (set_menu_bar_lines_1): Remove code handling
15999 orig_top_line and orig_total_lines.
16000
16001 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16002 set_window_height but set heights directly.
16003 (change_frame_size_1): Use resize_frame_windows.
16004
16005 * xdisp.c (init_xdisp): Don't use set_window_height but set
16006 heights directly.
16007
16008 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16009 Use resize_frame_windows instead of change_window_heights and run
16010 run_window_configuration_change_hook.
16011
16012 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16013 instead of change_window_heights and run
16014 run_window_configuration_change_hook.
16015
16016 2011-06-09 Martin Rudalics <rudalics@gmx.at>
16017
16018 * window.c (replace_window): Rename second argument REPLACEMENT to
16019 NEW. New third argument SETFLAG. Rewrite.
16020 (delete_window, make_dummy_parent): Call replace_window with
16021 third argument 1.
16022 (window_list_1): Move down in code.
16023 (run_window_configuration_change_hook): Move set_buffer part
16024 before select_frame_norecord part in order to unwind correctly.
16025 Rename count1 to count.
16026 (recombine_windows, delete_deletable_window, resize_root_window)
16027 (Fdelete_other_windows_internal)
16028 (Frun_window_configuration_change_hook, make_parent_window)
16029 (resize_window_check, resize_window_apply, Fresize_window_apply)
16030 (resize_frame_windows, Fsplit_window_internal)
16031 (Fdelete_window_internal, Fresize_mini_window_internal):
16032 New functions.
16033 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16034
16035 2011-06-08 Martin Rudalics <rudalics@gmx.at>
16036
16037 * window.h (window): Add some new members to window structure -
16038 normal_lines, normal_cols, new_total, new_normal, clone_number,
16039 splits, nest, prev_buffers, next_buffers.
16040 (WINDOW_TOTAL_SIZE): Move here from window.c.
16041 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16042
16043 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16044 Remove.
16045 (make_dummy_parent): Set new members of windows structure.
16046 (make_window): Move down in code. Handle new members of window
16047 structure.
16048 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16049 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16050 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16051 (Fset_window_prev_buffers, Fwindow_next_buffers)
16052 (Fset_window_next_buffers, Fset_window_clone_number):
16053 New functions.
16054 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16055 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16056 Doc-string fixes.
16057 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16058 Argument WINDOW can be now internal window too.
16059 (Fwindow_use_time): Move up in code.
16060 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16061 Rewrite doc-string.
16062 (Fset_window_configuration, saved_window)
16063 (Fcurrent_window_configuration, save_window_save): Handle new
16064 members of window structure.
16065 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16066 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16067 (syms_of_window): New Lisp objects Qrecord_window_buffer,
16068 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16069 Qget_mru_window, Qresize_root_window,
16070 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16071 Qauto_buffer_name; staticpro them.
16072
16073 2011-06-07 Martin Rudalics <rudalics@gmx.at>
16074
16075 * window.c (Fwindow_total_size, Fwindow_left_column)
16076 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16077 (Fwindow_list_1): New functions.
16078 (window_box_text_cols): Replace with window_body_cols.
16079 (Fwindow_width, Fscroll_left, Fscroll_right):
16080 Use window_body_cols instead of window_box_text_cols.
16081 (delete_window, Fset_window_configuration):
16082 Call delete_all_subwindows with window as argument.
16083 (delete_all_subwindows): Take a window as argument and not a
16084 structure. Rewrite.
16085 (window_loop): Remove handling of GET_LRU_WINDOW and
16086 GET_LARGEST_WINDOW.
16087 (Fget_lru_window, Fget_largest_window): Move to window.el.
16088
16089 * window.h: Extern window_body_cols instead of
16090 window_box_text_cols. delete_all_subwindows now takes a
16091 Lisp_Object as argument.
16092
16093 * indent.c (compute_motion, Fcompute_motion):
16094 Use window_body_cols instead of window_box_text_cols.
16095
16096 * frame.c (delete_frame): Call delete_all_subwindows with root
16097 window as argument.
16098
16099 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
16100
16101 * fns.c (Fputhash): Document return value.
16102
16103 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
16104
16105 * image.c (gif_load): Implement gif89a spec "no disposal" method.
16106
16107 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16108
16109 Cons<->int and similar integer overflow fixes (Bug#8794).
16110
16111 Check for overflow when converting integer to cons and back.
16112 * charset.c (Fdefine_charset_internal, Fdecode_char):
16113 Use cons_to_unsigned to catch overflow.
16114 (Fencode_char): Use INTEGER_TO_CONS.
16115 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16116 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16117 * data.c (long_to_cons, cons_to_long): Remove.
16118 (cons_to_unsigned, cons_to_signed): New functions.
16119 These signal an error for invalid or out-of-range values.
16120 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16121 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16122 * font.c (Ffont_variation_glyphs):
16123 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16124 * lisp.h: Include <intprops.h>.
16125 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16126 (cons_to_signed, cons_to_unsigned): New decls.
16127 (long_to_cons, cons_to_long): Remove decls.
16128 * undo.c (record_first_change): Use INTEGER_TO_CONS.
16129 (Fprimitive_undo): Use CONS_TO_INTEGER.
16130 * xfns.c (Fx_window_property): Likewise.
16131 * xselect.c: Include <limits.h>.
16132 (x_own_selection, selection_data_to_lisp_data):
16133 Use INTEGER_TO_CONS.
16134 (x_handle_selection_request, x_handle_selection_clear)
16135 (x_get_foreign_selection, Fx_disown_selection_internal)
16136 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16137 (lisp_data_to_selection_data): Use cons_to_unsigned.
16138 (x_fill_property_data): Use cons_to_signed.
16139 Report values out of range.
16140
16141 Check for buffer and string overflow more precisely.
16142 * buffer.h (BUF_BYTES_MAX): New macro.
16143 * lisp.h (STRING_BYTES_MAX): New macro.
16144 * alloc.c (Fmake_string):
16145 * character.c (string_escape_byte8):
16146 * coding.c (coding_alloc_by_realloc):
16147 * doprnt.c (doprnt):
16148 * editfns.c (Fformat):
16149 * eval.c (verror):
16150 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16151 since they may not be the same number.
16152 * editfns.c (Finsert_char):
16153 * fileio.c (Finsert_file_contents):
16154 Likewise for BUF_BYTES_MAX.
16155
16156 * image.c: Use ptrdiff_t, not int, for sizes.
16157 (slurp_file): Switch from int to ptrdiff_t.
16158 All uses changed.
16159 (slurp_file): Check that file size fits in both size_t (for
16160 malloc) and ptrdiff_t (for sanity and safety).
16161
16162 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16163 if b->modtime has its maximal value.
16164
16165 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16166
16167 Don't assume time_t can fit into int.
16168 * buffer.h (struct buffer.modtime): Now time_t, not int.
16169 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16170 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16171
16172 Minor fixes for signed vs unsigned integers.
16173 * character.h (MAYBE_UNIFY_CHAR):
16174 * charset.c (maybe_unify_char):
16175 * keyboard.c (read_char, reorder_modifiers):
16176 XINT -> XFASTINT, since the integer must be nonnegative.
16177 * ftfont.c (ftfont_spec_pattern):
16178 * keymap.c (access_keymap, silly_event_symbol_error):
16179 XUINT -> XFASTINT, since the integer must be nonnegative.
16180 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16181 since it makes no difference and we prefer signed.
16182 * keyboard.c (record_char): Use XUINT when all the neighbors do.
16183 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16184 nonnegative.
16185
16186 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
16187
16188 * window.h (Fwindow_frame): Declare.
16189
16190 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16191
16192 * alloc.c: Simplify handling of large-request failures (Bug#8800).
16193 (SPARE_MEMORY): Always define.
16194 (LARGE_REQUEST): Remove.
16195 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16196
16197 2011-06-06 Martin Rudalics <rudalics@gmx.at>
16198
16199 * lisp.h: Move EXFUNS for Fframe_root_window,
16200 Fframe_first_window and Fset_frame_selected_window to window.h.
16201
16202 * window.h: Move EXFUNS for Fframe_root_window,
16203 Fframe_first_window and Fset_frame_selected_window here from
16204 lisp.h.
16205
16206 * frame.c (Fwindow_frame, Fframe_first_window)
16207 (Fframe_root_window, Fframe_selected_window)
16208 (Fset_frame_selected_window): Move to window.c.
16209 (Factive_minibuffer_window): Move to minibuf.c.
16210 (Fother_visible_frames_p): New function.
16211
16212 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
16213
16214 * window.c (decode_window, decode_any_window): Move up in code.
16215 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
16216 (inhibit_frame_unsplittable): Remove unused variable.
16217 (Fwindow_buffer): Move up and rewrite doc-string.
16218 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
16219 (Fwindow_prev): New functions.
16220 (Fwindow_frame): Move here from frame.c. Accept any window as
16221 argument.
16222 (Fframe_root_window, Fframe_first_window)
16223 (Fframe_selected_window): Move here from frame.c. Accept frame
16224 or arbitrary window as argument. Update doc-strings.
16225 (Fminibuffer_window): Move up in code.
16226 (Fwindow_minibuffer_p): Move up in code and simplify.
16227 (Fset_frame_selected_window): Move here from frame.c.
16228 Marginal rewrite.
16229 (Fselected_window, select_window, Fselect_window): Move up in
16230 code. Minor doc-string fixes.
16231
16232 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16233
16234 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
16235 Do not assume that spare memory exists; that assumption is valid
16236 only if SYSTEM_MALLOC.
16237 (LARGE_REQUEST): New macro, so that the issue of large requests
16238 is separated from the issue of spare memory.
16239
16240 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
16241
16242 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
16243 format. (Bug#8806)
16244
16245 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
16246
16247 * xfns.c (x_set_scroll_bar_default_width): Move declarations
16248 before statements.
16249
16250 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
16251
16252 * gtkutil.c (xg_get_default_scrollbar_width): New function.
16253
16254 * gtkutil.h: Declare xg_get_default_scrollbar_width.
16255
16256 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
16257 min width by calling x_set_scroll_bar_default_width (Bug#8505).
16258
16259 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
16260
16261 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
16262
16263 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
16264
16265 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
16266 (x_clipboard_manager_save): Add return value.
16267 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
16268 New error handlers.
16269 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
16270 Obey Vx_select_enable_clipboard_manager. Catch errors in
16271 x_clipboard_manager_save (Bug#8779).
16272 (Vx_select_enable_clipboard_manager): New variable.
16273 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
16274
16275 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
16276
16277 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
16278
16279 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16280
16281 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
16282 in the current matrix if keep_current_p is non-zero.
16283
16284 2011-06-04 Eli Zaretskii <eliz@gnu.org>
16285
16286 * bidi.c (bidi_level_of_next_char): Fix last change.
16287
16288 2011-06-03 Eli Zaretskii <eliz@gnu.org>
16289
16290 Support bidi reordering of text covered by display properties.
16291
16292 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
16293 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
16294 (bidi_cache_search, bidi_cache_iterator_state)
16295 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
16296 (bidi_level_of_next_char, bidi_move_to_visually_next):
16297 Support character positions inside a run of characters covered by a
16298 display string.
16299 (bidi_paragraph_init, bidi_resolve_explicit_1)
16300 (bidi_level_of_next_char): Call bidi_fetch_char and
16301 bidi_fetch_char_advance instead of FETCH_CHAR and
16302 FETCH_CHAR_ADVANCE.
16303 (bidi_init_it): Initialize new members.
16304 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
16305 definitions.
16306 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
16307 instead of using explicit *_CHAR codes.
16308 (bidi_resolve_explicit, bidi_resolve_weak):
16309 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
16310 bidirectional text is supported only in multibyte buffers.
16311 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
16312 it to initialize the frame_window_p member of struct bidi_it.
16313 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
16314 (bidi_resolve_explicit, bidi_resolve_weak)
16315 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
16316 bidi_it->nchars is non-positive.
16317 (bidi_level_of_next_char): Don't try to lookup the cache for the
16318 next/previous character if nothing is cached there yet, or if we
16319 were just reseat()'ed to a new position.
16320
16321 * xdisp.c (set_cursor_from_row): Set start and stop points
16322 according to the row's direction when priming the loop that looks
16323 for the glyph on which to display cursor.
16324 (single_display_spec_intangible_p): Function deleted.
16325 (display_prop_intangible_p): Reimplement to call
16326 handle_display_spec instead of single_display_spec_intangible_p.
16327 Accept 3 additional arguments needed by handle_display_spec.
16328 This fixes incorrect cursor motion across display property with complex
16329 values: lists, `(when COND...)' forms, etc.
16330 (single_display_spec_string_p): Support property values that are
16331 lists with the argument STRING its top-level element.
16332 (display_prop_string_p): Fix the condition for processing a
16333 property that is a list to be consistent with handle_display_spec.
16334 (handle_display_spec): New function, refactored from the
16335 last portion of handle_display_prop.
16336 (compute_display_string_pos): Accept additional argument
16337 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
16338 value of a `display' property is a "replacing spec".
16339 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
16340 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
16341 the display property, but just return a value indicating whether
16342 the display property will replace the characters it covers.
16343 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
16344 frame_window_p members of struct bidi_it.
16345 (compute_display_string_pos, compute_display_string_end):
16346 New functions.
16347 (push_it): Accept second argument POSITION, where pop_it should
16348 jump to continue iteration.
16349 (reseat_1): Initialize bidi_it.disp_pos.
16350
16351 * keyboard.c (adjust_point_for_property): Adjust the call to
16352 display_prop_intangible_p to its new signature.
16353
16354 * dispextern.h (struct bidi_it): New member frame_window_p.
16355 (bidi_init_it): Update prototypes.
16356 (display_prop_intangible_p): Update prototype.
16357 (compute_display_string_pos, compute_display_string_end):
16358 Declare prototypes.
16359 (struct bidi_it): New members nchars and disp_pos. ch_len is now
16360 EMACS_INT.
16361
16362 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
16363
16364 Malloc failure behavior now depends on size of allocation.
16365 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16366 * lisp.h: Change signatures accordingly.
16367 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16368 All callers changed. (Bug#8762)
16369
16370 * gnutls.c: Use Emacs's memory allocators.
16371 Without this change, the gnutls library would invoke malloc etc.
16372 directly, which causes problems on non-SYNC_INPUT hosts, and which
16373 runs afoul of improving memory_full behavior. (Bug#8761)
16374 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16375 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16376 xfree instead of the default malloc, realloc, free.
16377 (Fgnutls_boot): No need to check for memory allocation failure,
16378 since xmalloc does that for us.
16379
16380 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
16381 * category.c (hash_get_category_set):
16382 * ccl.c (ccl_driver):
16383 * charset.c (Fdefine_charset_internal):
16384 * charset.h (struct charset.hash_index):
16385 * composite.c (get_composition_id, gstring_lookup_cache)
16386 (composition_gstring_put_cache):
16387 * composite.h (struct composition.hash_index):
16388 * dispextern.h (struct image.hash):
16389 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16390 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16391 (hashfn_equal, hashfn_user_defined, make_hash_table)
16392 (maybe_resize_hash_table, hash_lookup, hash_put)
16393 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16394 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16395 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16396 * image.c (make_image, search_image_cache, lookup_image)
16397 (xpm_put_color_table_h):
16398 * lisp.h (struct Lisp_Hash_Table):
16399 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16400 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16401 for hashes and hash indexes, instead of 'unsigned' and 'int'.
16402 * alloc.c (allocate_vectorlike):
16403 Check for overflow in vector size calculations.
16404 * ccl.c (ccl_driver):
16405 Check for overflow when converting EMACS_INT to int.
16406 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16407 need to be updated by these changes.
16408 * fns.c (make_hash_table, maybe_resize_hash_table):
16409 Check for integer overflow with large hash tables.
16410 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16411 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16412 (SXHASH_REDUCE): New macro.
16413 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16414 Use it instead of discarding useful hash info with large hash values.
16415 (sxhash_float): New function.
16416 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16417 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16418 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16419 Rewrite to use FIXNUM_BITS, as this simplifies things.
16420 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16421 Adjust signatures to match updated version of code.
16422 (consing_since_gc): Now EMACS_INT, since a single hash table can
16423 use more than INT_MAX bytes.
16424
16425 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16426
16427 Make it possible to build with GCC-4.6+ -O2 -flto.
16428
16429 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16430
16431 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16432
16433 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16434 Call minibuffer-inactive-mode.
16435
16436 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
16437
16438 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16439 Update dependencies.
16440
16441 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16442
16443 * data.c (init_data): Remove code for UTS, this system is not
16444 supported anymore.
16445
16446 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16447
16448 Don't force ./temacs to start in terminal mode.
16449
16450 * frame.c (make_initial_frame): Initialize faces in all cases, not
16451 only when CANNOT_DUMP is defined.
16452 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16453
16454 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16455
16456 * dispnew.c (add_window_display_history): Use const for the string
16457 pointer. Remove declaration, not needed.
16458
16459 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16460
16461 Use 'inline', not 'INLINE'.
16462 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16463 * alloc.c, fontset.c (INLINE): Remove.
16464 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16465 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16466 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16467 * gmalloc.c (register_heapinfo): Use inline unconditionally.
16468 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16469
16470 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16471
16472 Make it possible to run ./temacs.
16473
16474 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16475 syms_of_callproc does the same thing. Remove test for
16476 "initialized", do it in the caller.
16477 * emacs.c (main): Avoid calling set_initial_environment when dumping.
16478
16479 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
16480
16481 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16482 (read_minibuf): Use get_minibuffer.
16483 (syms_of_minibuf): Use DEFSYM.
16484 (Qmetadata): New var.
16485 * data.c (Qbuffer): Don't make it static.
16486 (syms_of_data): Use DEFSYM.
16487
16488 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16489
16490 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
16491 (CCL_CODE_MIN): New macro.
16492
16493 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
16494
16495 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16496
16497 * eval.c (Qdebug): Now static.
16498 * lisp.h (Qdebug): Remove decl. This reverts a part of the
16499 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16500 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16501
16502 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16503
16504 * image.c: Various fixes to ImageMagick code comments.
16505 (Fimagemagick_types): Doc fix.
16506
16507 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16508
16509 Minor fixes prompted by GCC 4.6.0 warnings.
16510
16511 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16512
16513 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16514 (x_clipboard_manager_save_all): Move extern decl to ...
16515 * xterm.h: ... here, so that it can be checked for consistency.
16516
16517 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16518
16519 * xselect.c (x_clipboard_manager_save_frame)
16520 (x_clipboard_manager_save_all): New functions.
16521 (Fx_clipboard_manager_save): Lisp function deleted.
16522
16523 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16524 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16525
16526 * xterm.h: Update prototype.
16527
16528 2011-05-28 William Xu <william.xwl@gmail.com>
16529
16530 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16531 exiting (Bug#8239).
16532
16533 2011-05-28 Jim Meyering <meyering@redhat.com>
16534
16535 Avoid a sign-extension bug in crypto_hash_function.
16536 * fns.c (to_uchar): Define.
16537 (crypto_hash_function): Use it to convert some newly-signed
16538 variables to unsigned, to avoid sign-extension bugs. For example,
16539 without this change, (md5 "truc") would evaluate to
16540 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16541 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
16542 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16543
16544 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16545
16546 Integer overflow fixes.
16547
16548 * dbusbind.c: Serial number integer overflow fixes.
16549 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16550 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16551 to hold a serial number that is too large for a fixnum.
16552 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16553 Check for serial numbers out of range. Decode any serial number
16554 that was so large that it became a float. (Bug#8722)
16555
16556 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16557 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16558 Use XFASTINT rather than XUINT when numbers are nonnegative.
16559 (xd_append_arg, Fdbus_method_return_internal):
16560 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16561 arguments, check that Lisp number is nonnegative, rather than
16562 silently wrapping negative numbers around. (Bug#8722)
16563 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16564 (Bug#8722)
16565
16566 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16567
16568 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16569
16570 ccl: Add integer overflow checks.
16571 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16572 (IN_INT_RANGE): New macros.
16573 (ccl_driver): Use them to check for integer overflow when
16574 decoding a CCL program. Many of the new checks are whether XINT (x)
16575 fits in int; it doesn't always, on 64-bit hosts. The new version
16576 doesn't catch all possible integer overflows, but it's an
16577 improvement. (Bug#8719)
16578
16579 * alloc.c (make_event_array): Use XINT, not XUINT.
16580 There's no need for unsigned here.
16581
16582 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16583 This follows up to the 2011-05-06 change that substituted uintptr_t
16584 for EMACS_INT. This case wasn't caught back then.
16585
16586 Rework Fformat to avoid integer overflow issues.
16587 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16588 now (part of C89). Include <verify.h>.
16589 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16590 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16591 (Fformat): Avoid the prepass trying to compute sizes; it was only
16592 approximate and thus did not catch overflow reliably. Instead, walk
16593 through the format just once, formatting and computing sizes as we go,
16594 checking for integer overflow at every step, and allocating a larger
16595 buffer as needed. Keep track separately whether the format is
16596 multibyte. Keep only the most-recently calculated precision, rather
16597 than them all. Record whether each argument has been converted to
16598 string. Use EMACS_INT, not int, for byte and char and arg counts.
16599 Support field widths and precisions larger than INT_MAX. Avoid
16600 sprintf's undefined behavior with conversion specifications such as %#d
16601 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16602 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16603 formatting out-of-range floating point numbers with int
16604 formats. (Bug#8668)
16605
16606 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16607
16608 * data.c: Avoid integer truncation in expressions involving floats.
16609 * data.c: Include <intprops.h>.
16610 (arith_driver): When there's an integer overflow in an expression
16611 involving floating point, convert the integers to floating point
16612 so that the resulting value does not suffer from catastrophic
16613 integer truncation. For example, on a 64-bit host (* 4
16614 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16615 Do not rely on undefined behavior after integer overflow.
16616
16617 merge count_size_as_multibyte, parse_str_to_multibyte
16618 * character.c, character.h (count_size_as_multibyte):
16619 Rename from parse_str_to_multibyte; all uses changed.
16620 Check for integer overflow.
16621 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16622 since it's now a duplicate of the other. This is more of
16623 a character than a buffer op, so better that it's in character.c.
16624 * fns.c, print.c: Adjust to above changes.
16625
16626 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16627
16628 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16629
16630 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16631
16632 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16633 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16634 (x_clipboard_manager_save): Now static.
16635 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16636
16637 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16638 (crypto_hash_function): Now static.
16639 Fix pointer signedness problems. Avoid unnecessary initializations.
16640
16641 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16642
16643 * termhooks.h (Vselection_alist): Make it terminal-local.
16644
16645 * terminal.c (create_terminal): Initialize it.
16646
16647 * xselect.c: Support for clipboard managers.
16648 (Vselection_alist): Move to termhooks.h as terminal-local var.
16649 (LOCAL_SELECTION): New macro.
16650 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16651 (symbol_to_x_atom): Remove gratuitous arg.
16652 (x_handle_selection_request, lisp_data_to_selection_data)
16653 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16654 (x_own_selection, x_get_local_selection, x_convert_selection):
16655 New arg, specifying work frame. Use terminal-local Vselection_alist.
16656 (some_frame_on_display): Delete unused function.
16657 (Fx_own_selection_internal, Fx_get_selection_internal)
16658 (Fx_disown_selection_internal, Fx_selection_owner_p)
16659 (Fx_selection_exists_p): New optional frame arg.
16660 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16661 (x_handle_selection_clear): Don't treat other terminals with the
16662 same keyboard specially. Use the terminal-local Vselection_alist.
16663 (x_clear_frame_selections): Use Frun_hook_with_args.
16664
16665 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16666
16667 * xterm.h: Add support for those atoms.
16668
16669 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16670
16671 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16672 (converted_selections, conversion_fail_tag): New global variables.
16673 (x_selection_request_lisp_error): Free the above.
16674 (x_get_local_selection): Remove unnecessary code.
16675 (x_reply_selection_request): Args changed; handle arbitrary array
16676 of converted selections stored in converted_selections.
16677 Separate the XChangeProperty and SelectionNotify steps.
16678 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16679 (x_convert_selection): New function.
16680 (x_handle_selection_event): Simplify.
16681 (x_get_foreign_selection): Don't ignore incoming requests while
16682 waiting for an answer; this will fail when we implement
16683 SAVE_TARGETS, and seems unnecessary anyway.
16684 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16685 (Vx_sent_selection_functions): Doc fix.
16686
16687 2011-05-26 Leo Liu <sdl.web@gmail.com>
16688
16689 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16690
16691 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16692
16693 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16694
16695 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16696 for fringe update if it has periodic bitmap.
16697 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16698 and fringe_bitmap_periodic_p.
16699
16700 * fringe.c (get_fringe_bitmap_data): New function.
16701 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16702 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16703 row. Mark glyph row for fringe update if periodicity changed.
16704
16705 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16706 for fringe update unless it has periodic bitmap.
16707
16708 2011-05-25 Kenichi Handa <handa@m17n.org>
16709
16710 * xdisp.c (get_next_display_element): Set correct it->face_id for
16711 a static composition.
16712
16713 2011-05-24 Leo Liu <sdl.web@gmail.com>
16714
16715 * deps.mk (fns.o):
16716 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16717
16718 * fns.c (crypto_hash_function, Fsha1): New function.
16719 (Fmd5): Use crypto_hash_function.
16720 (syms_of_fns): Add Ssha1.
16721
16722 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16723
16724 * gnutls.c: Remove unused macros.
16725 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16726 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16727 Remove macros that are defined and never used.
16728 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16729
16730 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16731
16732 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16733 (Fx_get_selection_internal): Minor cleanup.
16734 (Fx_own_selection_internal): Rename arguments for consistency with
16735 select.el.
16736
16737 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16738
16739 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16740
16741 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16742
16743 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16744
16745 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16746
16747 * dispnew.c (scrolling_window): Don't exclude the case that the
16748 last enabled row in the desired matrix touches the bottom boundary.
16749
16750 2011-05-21 Glenn Morris <rgm@gnu.org>
16751
16752 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16753 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16754 and add some more files.
16755
16756 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16757
16758 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16759 report_file_error introduced by the change from 2011-05-07.
16760
16761 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16762
16763 * systime.h (Time): Define only if emacs is defined.
16764 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16765 where the include path doesn't have X11/X.h by default. See
16766 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16767
16768 2011-05-20 Kenichi Handa <handa@m17n.org>
16769
16770 * composite.c (find_automatic_composition): Fix previous change.
16771
16772 2011-05-20 Glenn Morris <rgm@gnu.org>
16773
16774 * lisp.mk: New file, split from Makefile.in.
16775 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16776 (shortlisp): Remove.
16777 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16778
16779 2011-05-19 Glenn Morris <rgm@gnu.org>
16780
16781 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16782 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16783 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16784 (lisp): Set the order to that of loadup.el.
16785 (shortlisp): Make it a copy of $lisp.
16786 (SOME_MACHINE_LISP): Remove.
16787 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16788 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16789
16790 2011-05-18 Kenichi Handa <handa@m17n.org>
16791
16792 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16793 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16794 (find_automatic_composition): Mostly rewrite for efficiency.
16795
16796 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16797
16798 * makefile.w32-in: Update dependencies.
16799
16800 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16801
16802 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16803 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16804
16805 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16806
16807 Fix some integer overflow issues, such as string length overflow.
16808
16809 * insdel.c (count_size_as_multibyte): Check for string overflow.
16810
16811 * character.c (lisp_string_width): Check for string overflow.
16812 Use EMACS_INT, not int, for string indexes and lengths; in
16813 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16814 the resulting string length overflows an EMACS_INT; instead,
16815 report a string overflow if no precision given. When checking for
16816 precision exhaustion, use a check that cannot possibly have
16817 integer overflow. (Bug#8675)
16818 * character.h (lisp_string_width): Adjust to new signature.
16819
16820 * alloc.c (string_overflow): New function.
16821 (Fmake_string): Use it. This doesn't change behavior, but saves
16822 a few bytes and will simplify future changes.
16823 * character.c (string_escape_byte8): Likewise.
16824 * lisp.h (string_overflow): New decl.
16825
16826 Fixups, following up to the user-interface timestamp change.
16827 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16828 for UI timestamps, instead of unsigned long.
16829 * msdos.c (mouse_get_pos): Likewise.
16830 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16831 * w32gui.h (Time): Define by including "systime.h" rather than by
16832 declaring it ourselves. (Bug#8664)
16833
16834 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16835 * image.c (clear_image_cache): Likewise.
16836
16837 * term.c (term_mouse_position): Don't assume time_t wraparound.
16838
16839 Be more systematic about user-interface timestamps.
16840 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16841 and sometimes 'EMACS_UINT', to represent these timestamps.
16842 This change causes it to use 'Time' uniformly, as that's what X uses.
16843 This makes the code easier to follow, and makes it easier to catch
16844 integer overflow bugs such as Bug#8664.
16845 * frame.c (Fmouse_position, Fmouse_pixel_position):
16846 Use Time, not unsigned long, for user-interface timestamps.
16847 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16848 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16849 * keyboard.h (last_event_timestamp): Likewise.
16850 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16851 * menu.h (xmenu_show): Likewise.
16852 * term.c (term_mouse_position): Likewise.
16853 * termhooks.h (struct input_event.timestamp): Likewise.
16854 (struct terminal.mouse_position_hook): Likewise.
16855 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16856 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16857 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16858 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16859 what it was before.
16860 * menu.h, termhooks.h: Include "systime.h", for Time.
16861
16862 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16863 Don't assume that the difference between two unsigned long values
16864 can fit into an integer. At this point, we know button_down_time
16865 <= event->timestamp, so the difference must be nonnegative, so
16866 there's no need to cast the result if double-click-time is
16867 nonnegative, as it should be; check that it's nonnegative, just in
16868 case. This bug is triggered when events are more than 2**31 ms
16869 apart (about 25 days). (Bug#8664)
16870
16871 * xselect.c (last_event_timestamp): Remove duplicate decl.
16872 (x_own_selection): Remove needless cast to unsigned long.
16873
16874 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16875 that always fit in int. Use a sentinel instead of a counter, to
16876 avoid a temp and to allay GCC's concerns about possible int overflow.
16877 * frame.h (struct frame): Use int for menu_bar_items_used
16878 instead of EMACS_INT, since it always fits in int.
16879
16880 * menu.c (grow_menu_items): Check for int overflow.
16881
16882 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16883
16884 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16885 Before, the code was not consistent. These values cannot exceed
16886 2**31 - 1 so there's no need to make them unsigned.
16887 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16888 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16889 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16890 as modifiers.
16891 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16892
16893 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16894 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16895 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16896 presumably because the widths might not match.
16897
16898 * window.c (size_window): Avoid needless test at loop start.
16899
16900 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16901
16902 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16903
16904 2011-05-12 Drew Adams <drew.adams@oracle.com>
16905
16906 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16907
16908 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16909
16910 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16911 `width' to `bar_area_x' and `bar_area_width', respectively.
16912 (x_scroll_run): Take account of fringe background extension.
16913
16914 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16915 Rename local vars `left' and `width' to `bar_area_x' and
16916 `bar_area_width', respectively.
16917 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16918 background extension.
16919
16920 2011-05-10 Jim Meyering <meyering@redhat.com>
16921
16922 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16923
16924 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16925
16926 * image.c (Finit_image_library): Return t for built-in image types,
16927 like pbm and xbm. (Bug#8640)
16928
16929 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16930
16931 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16932
16933 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16934
16935 * w32console.c (Fset_screen_color): Doc fix.
16936 (Fget_screen_color): New function.
16937 (syms_of_ntterm): Defsubr it.
16938
16939 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16940 unlink the temporary file if Fcall_process didn't create it in the
16941 first place.
16942 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16943 child process will be redirected to a file specified with `:file'.
16944 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16945 cue to call_process_cleanup not to close that handle.
16946
16947 2011-05-07 Ben Key <bkey76@gmail.com>
16948
16949 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16950 one of two shell specific rules, either bootstrap-temacs-CMD or
16951 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16952 to the previous implementation of the bootstrap-temacs rule.
16953 The bootstrap-temacs-CMD rule is similar to the previous
16954 implementation of the bootstrap-temacs rule except that it
16955 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16956 variable.
16957
16958 These changes, along with some changes to nt/configure.bat,
16959 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16960 earlier fix to add support for --cflags and --ldflags options
16961 that include quotes so that it works whether make uses cmd or
16962 sh as the shell.
16963
16964 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16965
16966 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16967 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16968 is a constant.
16969 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16970 a string. Handle both cases.
16971 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16972 (Fdbus_register_method): Use Qinvalid_function.
16973
16974 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16975
16976 * makefile.w32-in: Update dependencies.
16977 (LISP_H): Add inttypes.h and stdin.h.
16978 (PROCESS_H): Add unistd.h.
16979
16980 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16981
16982 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16983 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16984
16985 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16986
16987 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16988
16989 * term.c (vfatal): Remove stray call to va_end.
16990 It's not needed and the C Standard doesn't allow it here anyway.
16991
16992 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16993 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16994
16995 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16996 bytes.
16997
16998 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16999
17000 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17001
17002 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17003
17004 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17005
17006 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17007
17008 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17009 * charset.c (Fdefine_charset_internal): Don't initialize
17010 charset.code_space[15]. The value was garbage, on hosts with
17011 32-bit int (Bug#8600).
17012
17013 * lread.c (read_integer): Be more consistent with string-to-number.
17014 Use string_to_number to do the actual conversion; this avoids
17015 rounding errors and fixes some other screwups. Without this fix,
17016 for example, #x1fffffffffffffff was misread as -2305843009213693952.
17017 (digit_to_number): Move earlier, for benefit of read_integer.
17018 Return -1 if the digit is out of range for the base, -2 if it is
17019 not a digit in any supported base. (Bug#8602)
17020
17021 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17022
17023 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17024 to match comment at start of function. This also removes a
17025 GCC warning about overflow in a 32+64-bit port.
17026
17027 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17028
17029 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17030 Reported by Stefan Monnier in
17031 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17032 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17033 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17034
17035 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17036 (EMACS_UINTPTR): Likewise, with uintptr_t.
17037
17038 * lisp.h: Prefer 64-bit EMACS_INT if available.
17039 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17040 on 32-bit hosts that have 64-bit int, so that they can access
17041 large files.
17042 However, temporarily disable this change unless the temporary
17043 symbol WIDE_EMACS_INT is defined.
17044
17045 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17046
17047 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17048 This removes an assumption that EMACS_INT and long are the same
17049 width as pointers. The assumption is true for Emacs porting targets
17050 now, but we want to make other targets possible.
17051 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17052 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17053 In the rest of the code, change types of integers that hold casted
17054 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17055 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17056 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17057 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17058 No need to cast type when ORing.
17059 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17060 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17061 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17062 assume EMACS_INT is the same width as char *.
17063 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17064 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17065 Remove no-longer-needed casts.
17066 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17067 (xg_tool_bar_help_callback, xg_make_tool_item):
17068 Use EMACS_INTPTR to hold an integer
17069 that will be cast to void *; this can avoid a GCC warning
17070 if EMACS_INT is not the same width as void *.
17071 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17072 * xdisp.c (display_echo_area_1, resize_mini_window_1):
17073 (current_message_1, set_message_1):
17074 Use a local to convert to proper width without a cast.
17075 * xmenu.c (dialog_selection_callback): Likewise.
17076
17077 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17078 Also, don't assume VALBITS / RAND_BITS is less than 5,
17079 and don't rely on undefined behavior when shifting a 1 left into
17080 the sign bit.
17081 * lisp.h (get_random): Change signature to match.
17082
17083 * lread.c (hash_string): Use size_t, not int, for hash computation.
17084 Normally we prefer signed values; but hashing is special, because
17085 it's better to use unsigned division on hash table sizes so that
17086 the remainder is nonnegative. Also, size_t is the natural width
17087 for hashing into memory. The previous code used 'int', which doesn't
17088 retain enough info to hash well into very large tables.
17089 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17090
17091 * dbusbind.c: Don't possibly lose pointer info when converting.
17092 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17093 Use XPNTR rather than XHASH, so that the high-order bits of
17094 the pointer aren't lost when converting through void *.
17095
17096 * eval.c (Fautoload): Don't double-shift a pointer.
17097
17098 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17099
17100 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17101
17102 * gnutls.c (DEF_GNUTLS_FN):
17103 * image.c (DEF_IMGLIB_FN): Make function pointers static.
17104
17105 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
17106
17107 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17108 marker. (Bug#8610)
17109
17110 2011-05-05 Eli Zaretskii <eliz@gnu.org>
17111
17112 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17113 New version that can reserve upto 2GB of heap space.
17114
17115 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
17116
17117 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17118
17119 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
17120
17121 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17122 `gnutls_certificate_set_x509_key_file'.
17123
17124 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
17125
17126 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17127 Update dependencies.
17128
17129 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17130
17131 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17132 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17133 Remove unused parameter `fildes'.
17134 * process.c (read_process_output, send_process): Don't pass it.
17135
17136 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17137
17138 Fix previous change: the library cache is defined in w32.c.
17139 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17140 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17141
17142 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17143
17144 Implement dynamic loading of GnuTLS on Windows.
17145
17146 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17147 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17148 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17149 Declare.
17150
17151 * gnutls.c (Qgnutls_dll): Define.
17152 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17153 (gnutls_*): Declare function pointers.
17154 (init_gnutls_functions): New function to initialize function pointers.
17155 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17156 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17157 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17158 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17159 (emacs_gnutls_write, emacs_gnutls_read)
17160 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17161 (Fgnutls_available_p): New function.
17162 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
17163 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17164 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17165
17166 * image.c: Include w32.h.
17167 (Vimage_type_cache): Delete.
17168 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17169 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17170 (w32_delayed_load): Move to w32.c.
17171
17172 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17173
17174 * w32.c (QCloaded_from, Vlibrary_cache): Define.
17175 (w32_delayed_load): Move from image.c. When loading a library, record
17176 its filename in the :loaded-from property of the library id.
17177 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17178 Initialize and staticpro them.
17179 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17180
17181 * process.c: Include lisp.h before w32.h, not after.
17182 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17183 instead of gnutls_record_check_pending.
17184
17185 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17186
17187 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
17188
17189 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17190 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
17191 as passed in.
17192
17193 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
17194
17195 * xterm.c (x_set_frame_alpha): Do not set property on anything
17196 else than FRAME_X_OUTER_WINDOW (Bug#8608).
17197
17198 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17199
17200 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
17201
17202 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17203
17204 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
17205 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
17206 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
17207 (gnutls_global_initialized, Qgnutls_bootprop_priority)
17208 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
17209 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
17210 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
17211 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
17212 (Qgnutls_bootprop_callbacks_verify): Make static.
17213
17214 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
17215
17216 * callproc.c: Indentation fixup.
17217
17218 * sysdep.c (wait_for_termination_1): Make static.
17219 (wait_for_termination, interruptible_wait_for_termination):
17220 Move after wait_for_termination_1.
17221
17222 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
17223
17224 * sysdep.c (interruptible_wait_for_termination): New function
17225 which is like wait_for_termination, but allows keyboard
17226 interruptions.
17227
17228 * callproc.c (Fcall_process): Add (:file "file") as an option for
17229 the STDOUT buffer.
17230 (Fcall_process_region): Ditto.
17231
17232 2011-04-30 Eli Zaretskii <eliz@gnu.org>
17233
17234 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
17235 rather than `XVECTOR (FOO)->size'.
17236
17237 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
17238 inttypes.h, as a gnulib replacement is used if it not available in
17239 system headers.
17240
17241 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17242
17243 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
17244 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
17245 of MOST_POSITIVE_FIXNUM. (Bug#8528)
17246
17247 * coding.c (coding_alloc_by_realloc): Error out if destination
17248 will grow beyond MOST_POSITIVE_FIXNUM.
17249 (decode_coding_emacs_mule): Abort if there isn't enough place in
17250 charbuf for the composition carryover bytes. Reserve an extra
17251 space for up to 2 characters produced in a loop.
17252 (decode_coding_iso_2022): Abort if there isn't enough place in
17253 charbuf for the composition carryover bytes.
17254
17255 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17256
17257 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
17258 aborting when %lld or %lll format is passed.
17259 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
17260 %llo or %llx format is passed. (Bug#8545)
17261
17262 * window.c (window_scroll_line_based): Use a marker instead of
17263 simple variables to record original value of point. (Bug#7952)
17264
17265 * doprnt.c (doprnt): Fix the case where a multibyte sequence
17266 produced by %s or %c overflows available buffer space. (Bug#8545)
17267
17268 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
17269
17270 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
17271 (SIZE_MAX): Move defn after all includes, as they might #define it.
17272
17273 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17274
17275 * w32.c (init_environment): Warn about defaulting HOME to C:\.
17276
17277 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17278
17279 * keyboard.c (Qdelayed_warnings_hook): Define.
17280 (command_loop_1): Run `delayed-warnings-hook'
17281 if Vdelayed_warnings_list is non-nil.
17282 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
17283 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
17284
17285 2011-04-28 Eli Zaretskii <eliz@gnu.org>
17286
17287 * doprnt.c (doprnt): Don't return value smaller than the buffer
17288 size if the message was truncated. (Bug#8545).
17289
17290 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17291
17292 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
17293 (Fx_window_property): #if-0 the whole functions, not just the bodies.
17294
17295 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17296
17297 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
17298
17299 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
17300
17301 * makefile.w32-in: Update dependencies.
17302
17303 2011-04-27 Eli Zaretskii <eliz@gnu.org>
17304
17305 Improve `doprnt' and its usage. (Bug#8545)
17306 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
17307 `format_end'. Remove support for %l as a conversion specifier.
17308 Don't use xrealloc. Improve diagnostics when the %l size modifier
17309 is used. Update the commentary.
17310
17311 * eval.c (verror): Simplify calculation of size_t.
17312
17313 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
17314 messages.
17315
17316 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
17317
17318 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
17319 change.
17320
17321 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17322
17323 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
17324 This makes this file independent of the recent pseudovector change.
17325
17326 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
17327
17328 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
17329
17330 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
17331 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
17332 Remove unused local.
17333 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
17334
17335 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
17336 GCC 4.6.0 optimizes based on type-based alias analysis.
17337 For example, if b is of type struct buffer * and v of type struct
17338 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
17339 != &v->size, and therefore "v->size = 1; b->size = 2; return
17340 v->size;" must therefore return 1. This assumption is incorrect
17341 for Emacs, since it type-puns struct Lisp_Vector * with many other
17342 types. To fix this problem, this patch adds a new type struct
17343 vectorlike_header that documents the constraints on layout of vectors
17344 and pseudovectors, and helps optimizing compilers not get fooled
17345 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
17346 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
17347 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
17348 the size member.
17349 (XSETPVECTYPE): Rewrite in terms of new macro.
17350 (XSETPVECTYPESIZE): New macro, specifying both type and size.
17351 This is a bit clearer, and further avoids the possibility of
17352 undesirable aliasing.
17353 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
17354 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
17355 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17356 since Lisp_Subr is a special case (no "next" field).
17357 (ASIZE): Now uses header.size rather than size.
17358 All previous uses of XVECTOR (foo)->size replaced to use this macro,
17359 to avoid the hassle of writing XVECTOR (foo)->header.size.
17360 (struct vectorlike_header): New type.
17361 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17362 object, to help avoid aliasing.
17363 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17364 (SUBRP): Likewise, since Lisp_Subr is a special case.
17365 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17366 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17367 (struct Lisp_Hash_Table): Combine first two members into a single
17368 struct vectorlike_header member. All uses of "size" and "next" members
17369 changed to be "header.size" and "header.next".
17370 * buffer.h (struct buffer): Likewise.
17371 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17372 * frame.h (struct frame): Likewise.
17373 * process.h (struct Lisp_Process): Likewise.
17374 * termhooks.h (struct terminal): Likewise.
17375 * window.c (struct save_window_data, struct saved_window): Likewise.
17376 * window.h (struct window): Likewise.
17377 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17378 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17379 * buffer.c (init_buffer_once): Likewise.
17380 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17381 special case.
17382 * process.c (Fformat_network_address): Use local var for size,
17383 for brevity.
17384
17385 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17386
17387 Make the Lisp reader and string-to-float more consistent (Bug#8525)
17388 * data.c (atof): Remove decl; no longer used or needed.
17389 (digit_to_number): Move to lread.c.
17390 (Fstring_to_number): Use new string_to_number function, to be
17391 consistent with how the Lisp reader treats infinities and NaNs.
17392 Do not assume that floating-point numbers represent EMACS_INT
17393 without losing information; this is not true on most 64-bit hosts.
17394 Avoid double-rounding errors, by insisting on integers when
17395 parsing non-base-10 numbers, as the documentation specifies.
17396 * lisp.h (string_to_number): New decl, replacing ...
17397 (isfloat_string): Remove.
17398 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17399 (read1): Do not accept +. and -. as integers; this
17400 appears to have been a coding error. Similarly, do not accept
17401 strings like +-1e0 as floating point numbers. Do not report
17402 overflow for integer overflows unless the base is not 10 which
17403 means we have no simple and reliable way to continue.
17404 Break out the floating-point parsing into a new
17405 function string_to_number, so that Fstring_to_number parses
17406 floating point numbers consistently with the Lisp reader.
17407 (digit_to_number): Move here from data.c. Make it static inline.
17408 (E_CHAR, EXP_INT): Remove, replacing with ...
17409 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17410 (string_to_number): New function, replacing isfloat_string.
17411 This function checks for valid syntax and produces the resulting
17412 Lisp float number too. Rework it so that string-to-number
17413 no longer mishandles examples like "1.0e+". Use strtoumax,
17414 so that overflow for non-base-10 numbers is reported only when
17415 there's no portable and simple way to convert to floating point.
17416
17417 * textprop.c (set_text_properties_1): Rewrite for clarity,
17418 and to avoid GCC warning about integer overflow.
17419
17420 * intervals.h (struct interval): Use EMACS_INT for members
17421 where EMACS_UINT might cause problems. See
17422 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17423 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17424 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17425 All uses changed.
17426 (offset_intervals): Tell GCC not to worry about length overflow
17427 when negating a negative length.
17428
17429 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17430 (overrun_check_free): Likewise.
17431
17432 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17433 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17434 word size.
17435
17436 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17437 (gnutls_make_error): Rename local to avoid shadowing.
17438 (gnutls_emacs_global_deinit): ifdef out; not used.
17439 (Fgnutls_boot): Use const for pointer to readonly storage.
17440 Comment out unused local. Fix pointer signedness problems.
17441
17442 * lread.c (openp): Don't stuff size_t into an 'int'.
17443 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17444 about possible signed overflow.
17445
17446 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17447 (GDK_KEY_g): Don't define if already defined.
17448 (xg_prepare_tooltip): Avoid pointer signedness problem.
17449 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17450
17451 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17452 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
17453
17454 * xfns.c (Fx_window_property): Simplify a bit,
17455 to make a bit faster and to avoid GCC 4.6.0 warning.
17456 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17457
17458 * fns.c (internal_equal): Don't assume size_t fits in int.
17459
17460 * alloc.c (compact_small_strings): Tighten assertion a little.
17461
17462 Replace pEd with more-general pI, and fix some printf arg casts.
17463 * lisp.h (pI): New macro, generalizing old pEd macro to other
17464 conversion specifiers. For example, use "...%"pI"d..." rather
17465 than "...%"pEd"...".
17466 (pEd): Remove. All uses replaced with similar uses of pI.
17467 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17468 * alloc.c (check_pure_size): Don't overflow by converting size to int.
17469 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17470 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17471 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17472 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17473 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17474 64-bit hosts.
17475 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17476 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17477 * print.c (safe_debug_print, print_object): Likewise.
17478 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17479 to int.
17480 Use pI instead of if-then-else-abort. Use %p to avoid casts,
17481 avoiding the 0 flag, which is not portable.
17482 * process.c (Fmake_network_process): Use pI to avoid cast.
17483 * region-cache.c (pp_cache): Likewise.
17484 * xdisp.c (decode_mode_spec): Likewise.
17485 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17486 behavior on 64-bit hosts with printf arg.
17487 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17488 (x_stop_queuing_selection_requests): Likewise.
17489 (x_get_window_property): Don't truncate byte count to an 'int'
17490 when tracing.
17491
17492 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17493 here, since it parses constructs like leading '-' and spaces,
17494 which are not wanted; and it overflows with large numbers.
17495 Instead, simply match F[0-9]+, which is what is wanted anyway.
17496
17497 * alloc.c: Remove unportable assumptions about struct layout.
17498 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17499 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17500 (allocate_vectorlike, make_pure_vector): Use the new macros,
17501 plus offsetof, to remove unportable assumptions about struct layout.
17502 These assumptions hold on all porting targets that I know of, but
17503 they are not guaranteed, they're easy to remove, and removing them
17504 makes further changes easier.
17505
17506 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17507 This doesn't fix a bug but makes the code clearer.
17508 (string_overrun_cookie): Now const. Use initializers that
17509 don't formally overflow signed char, to avoid warnings.
17510 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17511 can cause Emacs to crash when string overrun checking is enabled.
17512 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17513 multiple of sizeof (EMACS_INT); it need not be, if
17514 alignof(EMACS_INT) < sizeof (EMACS_INT).
17515 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17516
17517 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17518
17519 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17520
17521 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17522
17523 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17524 supposed to be handshaking. (Bug#8556)
17525 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17526
17527 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17528
17529 * lisp.h (Qdebug): List symbol.
17530 * eval.c (Qdebug): Restore global linkage.
17531 * keyboard.c (debug-on-event): New variable.
17532 (handle_user_signal): Break into debugger when debug-on-event
17533 matches the current signal symbol.
17534
17535 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17536
17537 * alloc.c (check_sblock, check_string_bytes)
17538 (check_string_free_list): Convert to standard C.
17539
17540 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17541
17542 * w32.c (emacs_gnutls_push): Fix typo.
17543
17544 2011-04-25 Eli Zaretskii <eliz@gnu.org>
17545
17546 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17547 "cast to pointer from integer of different size".
17548
17549 Improve doprnt and its use in verror. (Bug#8545)
17550 * doprnt.c (doprnt): Document the set of format control sequences
17551 supported by the function. Use SAFE_ALLOCA instead of always
17552 using `alloca'.
17553
17554 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17555 is one byte too soon. Don't use xrealloc; instead xfree and
17556 xmalloc anew.
17557
17558 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17559
17560 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17561 callbacks stage.
17562
17563 * gnutls.c: Renamed global_initialized to
17564 gnutls_global_initialized. Added internals for the
17565 :verify-hostname-error, :verify-error, and :verify-flags
17566 parameters of `gnutls-boot' and documented those parameters in the
17567 docstring. Start callback support.
17568 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17569 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17570 on error. Return error code.
17571 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17572 (emacs_gnutls_read): Likewise.
17573 (Fgnutls_boot): Return handshake error code.
17574 (emacs_gnutls_handle_error): New function.
17575 (wsaerror_to_errno): Likewise.
17576
17577 * w32.h (emacs_gnutls_pull): Add prototype.
17578 (emacs_gnutls_push): Likewise.
17579
17580 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17581 (emacs_gnutls_push): Likewise.
17582
17583 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17584
17585 * process.c (wait_reading_process_output): Check if GnuTLS
17586 buffered some data internally if no FDs are set for TLS
17587 connections.
17588
17589 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17590 (LIBS): Link to USER_LIBS.
17591 ($(BLD)/gnutls.$(0)): New target.
17592
17593 2011-04-24 Eli Zaretskii <eliz@gnu.org>
17594
17595 * xdisp.c (handle_single_display_spec): Rename the
17596 display_replaced_before_p argument into display_replaced_p, to
17597 make it consistent with the commentary. Fix typos in the
17598 commentary.
17599
17600 * textprop.c (syms_of_textprop): Remove dead code.
17601 (copy_text_properties): Delete obsolete commentary about an
17602 interface that was deleted long ago. Fix typos in the description
17603 of arguments.
17604
17605 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17606 to changes in oldXMenu/XMenu.h from 2011-04-16.
17607 <menu_help_message, prev_menu_help_message>: Constify.
17608 (IT_menu_make_room): menu->help_text is now `const char **';
17609 adjust.
17610
17611 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17612 to changes in oldXMenu/XMenu.h from 2011-04-16.
17613 (struct XMenu): Declare `help_text' `const char **'.
17614
17615 * xfaces.c <Qunspecified>: Make extern again.
17616
17617 * syntax.c: Include sys/types.h before including regex.h, as
17618 required by POSIX.
17619
17620 * doc.c (get_doc_string): Improve the format passed to `error'.
17621
17622 * doprnt.c (doprnt): Improve commentary.
17623
17624 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17625
17626 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17627 them with etags.
17628
17629 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17630 changes in globals.h immediately force recompilation.
17631 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17632 $(CURDIR)/s/ms-w32.h.
17633 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17634
17635 * character.c (Fchar_direction): Function deleted.
17636 (syms_of_character): Don't defsubr it.
17637 <char-direction-table>: Deleted.
17638
17639 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17640
17641 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17642 * doprnt.c: Include limits.h.
17643 (SIZE_MAX): New macro.
17644 (doprnt): Return a size_t value. 2nd arg is now size_t.
17645 Many local variables are now size_t instead of int or unsigned.
17646 Improve overflow protection. Support `l' modifier for integer
17647 conversions. Support %l conversion. Don't assume an EMACS_INT
17648 argument for integer conversions and for %c.
17649
17650 * lisp.h (doprnt): Restore prototype.
17651
17652 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17653 $(SRC)/character.h.
17654
17655 * Makefile.in (base_obj): Add back doprnt.o.
17656
17657 * deps.mk (doprnt.o): Add back prerequisites.
17658 (callint.o): Depend on character.h.
17659
17660 * eval.c (internal_lisp_condition_case): Include the handler
17661 representation in the error message.
17662 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17663 when breaking from the loop.
17664
17665 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17666
17667 * callint.c (Fcall_interactively): When displaying error message
17668 about invalid control letter, pass the character's codepoint, not
17669 a pointer to its multibyte form. Improve display of the character
17670 in octal and display also its hex code.
17671
17672 * character.c (char_string): Use %x to display the (unsigned)
17673 codepoint of an invalid character, to avoid displaying a bogus
17674 negative value.
17675
17676 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17677 `error', not SYMBOL_NAME itself.
17678
17679 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17680 character arguments to `error'.
17681
17682 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17683 to `error' in error message about FINAL_CHAR argument. Make sure
17684 FINAL_CHAR is a character, and use %c when it is passed as
17685 argument to `error'.
17686
17687 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17688
17689 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17690
17691 * w32.c: Include <time.h>.
17692 (sys_localtime): New function.
17693
17694 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17695
17696 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17697
17698 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17699
17700 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17701
17702 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17703 zombies (Bug#8467).
17704
17705 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17706
17707 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17708 gl_state.e_property when gl_state.object is Qt.
17709
17710 * insdel.c (make_gap_larger): Remove limitation of buffer size
17711 to <= INT_MAX.
17712
17713 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17714
17715 * xdisp.c (lookup_glyphless_char_display)
17716 (produce_glyphless_glyph): Handle cons cell entry in
17717 glyphless-char-display.
17718 (Vglyphless_char_display): Document it.
17719
17720 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17721 glyphless-char-display.
17722
17723 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17724
17725 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17726
17727 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17728
17729 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17730 definition for no-X builds.
17731
17732 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17733
17734 Static checks with GCC 4.6.0 and non-default toolkits.
17735
17736 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17737
17738 * process.c (keyboard_bit_set): Define only if SIGIO.
17739 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17740 (send_process): Repair possible setjmp clobbering.
17741
17742 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17743
17744 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17745
17746 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17747
17748 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17749 Define only if needed.
17750
17751 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17752 by pacifying GCC about it. Maybe it's time to retire it?
17753 * xfaces.c (USG, __TIMEVAL__): Likewise.
17754
17755 * dispextern.h (struct redisplay_interface): Rename param
17756 to avoid shadowing.
17757 * termhooks.h (struct terminal): Likewise.
17758 * xterm.c (xembed_send_message): Likewise.
17759
17760 * insdel.c (make_gap_smaller): Define only if
17761 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17762
17763 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17764 it.
17765
17766 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17767 so that we aren't warned about unused symbols.
17768
17769 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17770
17771 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17772
17773 * xfns.c (x_real_positions): Mark locals as initialized.
17774
17775 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17776
17777 * xterm.c: Fix problems found by static analysis with other toolkits.
17778 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17779 (x_dispatch_event): Declare static if USE_GTK, and
17780 define if USE_GTK || USE_X_TOOLKIT.
17781 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17782 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17783 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17784 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17785
17786 * xmenu.c (menu_help_callback): Pointer type fixes.
17787 Use const pointers when pointing at readonly data. Avoid pointer
17788 signedness clashes.
17789 (FALSE): Remove unused macro.
17790 (update_frame_menubar): Remove unused decl.
17791
17792 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17793
17794 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17795 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17796 (single_menu_item): Rename local to avoid shadowing.
17797
17798 * keyboard.c (make_lispy_event): Remove unused local var.
17799
17800 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17801 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17802
17803 * bitmaps: Change bitmaps from unsigned char back to the X11
17804 compatible char. Avoid the old compiler warnings about
17805 out-of-range initializers by using, for example, '\xab' rather
17806 than 0xab.
17807
17808 * xgselect.c (xgselect_initialize): Check vs interface
17809 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17810
17811 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17812
17813 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17814 to read-only memory.
17815
17816 * fns.c (vector): Remove; this old hack is no longer needed.
17817
17818 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17819 Remove unused var.
17820 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17821
17822 * xrdb.c (x_load_resources): Omit unused local.
17823
17824 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17825 (x_window): Rename locals to avoid shadowing.
17826 (USG): Use the kludged USG macro, to pacify gcc.
17827
17828 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17829 (x_term_init): Remove local to avoid shadowing.
17830
17831 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17832
17833 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17834 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17835
17836 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17837
17838 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17839
17840 Fix regex.c, syntax.c and friends for buffers > 2GB.
17841 * syntax.h (struct gl_state_s): Declare character position members
17842 EMACS_INT.
17843
17844 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17845
17846 * textprop.c (verify_interval_modification, interval_of):
17847 Declare arguments EMACS_INT.
17848
17849 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17850 EMACS_INT.
17851
17852 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17853
17854 * indent.c (Fvertical_motion): Local variable it_start is now
17855 EMACS_INT.
17856
17857 * regex.c (re_match, re_match_2, re_match_2_internal)
17858 (bcmp_translate, regcomp, regexec, print_double_string)
17859 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17860 (re_compile_pattern, re_exec): Declare arguments and local
17861 variables `size_t' and `ssize_t' and return values `regoff_t', as
17862 appropriate.
17863 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17864 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17865 <compile_stack_type>: `size' and `avail' are now `size_t'.
17866
17867 * regex.h <regoff_t>: Use ssize_t, not int.
17868 (re_search, re_search_2, re_match, re_match_2): Arguments that
17869 specify buffer/string position and length are now ssize_t and
17870 size_t. Return type is regoff_t.
17871
17872 2011-04-16 Ben Key <bkey76@gmail.com>
17873
17874 * nsfont.m: Fixed bugs in ns_get_family and
17875 ns_descriptor_to_entity that were caused by using free to
17876 deallocate memory blocks that were allocated by xmalloc (via
17877 xstrdup). This caused Emacs to crash when compiled with
17878 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17879 --enable-checking=xmallocoverrun). xfree is now used to
17880 deallocate these memory blocks.
17881
17882 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17883
17884 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17885
17886 emacs_write: Accept and return EMACS_INT for sizes.
17887 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17888 et seq.
17889 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17890 Accept and return EMACS_INT.
17891 (emacs_gnutls_write): Return the number of bytes written on
17892 partial writes.
17893 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17894 (emacs_read, emacs_write): Remove check for negative size, as the
17895 Emacs source code has been audited now.
17896 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17897 (emacs_read, emacs_write): Use it.
17898 * process.c (send_process): Adjust to the new signatures of
17899 emacs_write and emacs_gnutls_write. Do not attempt to store
17900 a byte offset into an 'int'; it might overflow.
17901 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17902
17903 * sound.c: Don't assume sizes fit in 'int'.
17904 (struct sound_device.period_size, alsa_period_size):
17905 Return EMACS_INT, not int.
17906 (struct sound_device.write, vox_write, alsa_write):
17907 Accept EMACS_INT, not int.
17908 (wav_play, au_play): Use EMACS_INT to store sizes and to
17909 record read return values.
17910
17911 2011-04-15 Ben Key <bkey76@gmail.com>
17912
17913 * keyboard.c (Qundefined): Don't declare static since it is used
17914 in nsfns.m.
17915 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17916 static since they are used in nsfont.m.
17917
17918 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17919
17920 * process.c (Qprocessp): Don't declare static.
17921 * lisp.h (Qprocessp): Declare again.
17922
17923 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17924
17925 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17926
17927 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17928
17929 Improve C-level modularity by making more things 'static'.
17930
17931 Don't publish debugger-only interfaces to other modules.
17932 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17933 (verify_bytepos, count_markers): Move decls to the only modules
17934 that need them.
17935 * region-cache.h (pp_cache): Likewise.
17936 * window.h (check_all_windows): Likewise.
17937 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17938
17939 * sysdep.c (croak): Now static, if
17940 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17941 * syssignal.h (croak): Declare only if not static.
17942
17943 * alloc.c (refill_memory_reserve): Now static if
17944 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17945 * lisp.h (refill_memory_reserve): Declare only if not static.
17946
17947 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17948 Define only if USE_LUCID.
17949
17950 * xrdb.c (x_customization_string, x_rm_string): Now static.
17951
17952 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17953 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17954
17955 * xdisp.c (draw_row_with_mouse_face): Now static.
17956 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17957
17958 * window.h (check_all_windows): Mark externally visible.
17959
17960 * window.c (window_deletion_count): Now static.
17961
17962 * undo.c: Make symbols static if they're not exported.
17963 (last_undo_buffer, last_boundary_position, pending_boundary):
17964 Now static.
17965
17966 * textprop.c (interval_insert_behind_hooks): Now static.
17967 (interval_insert_in_front_hooks): Likewise.
17968
17969 * term.c: Make symbols static if they're not exported.
17970 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17971 (max_frame_lines, tty_set_terminal_modes):
17972 (tty_reset_terminal_modes, tty_turn_off_highlight):
17973 (get_tty_terminal): Now static.
17974 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17975 * termhooks.h (term_mouse_moveto): Do not declare if
17976 HAVE_WINDOW_SYSTEM.
17977 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17978 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17979
17980 * sysdep.c: Make symbols static if they're not exported.
17981 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17982 Now static.
17983 (sigprocmask_set, full_mask): Remove; unused.
17984 (wait_debugging): Mark as visible.
17985 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17986 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17987
17988 * syntax.c (syntax_temp): Define only if !__GNUC__.
17989
17990 * sound.c (current_sound_device, current_sound): Now static.
17991
17992 * search.c (searchbufs, searchbuf_head): Now static.
17993
17994 * scroll.c (scroll_cost): Remove; unused.
17995 * dispextern.h (scroll_cost): Remove decl.
17996
17997 * region-cache.h (pp_cache): Mark as externally visible.
17998
17999 * process.c: Make symbols static if they're not exported.
18000 (process_tick, update_tick, create_process, chan_process):
18001 (Vprocess_alist, proc_buffered_char, datagram_access):
18002 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18003 (deactivate_process): Mark defn as static, as well as decl.
18004 * lisp.h (create_process): Remove decl.
18005 * process.h (chan_process, Vprocess_alist): Remove decls.
18006
18007 * print.c: Make symbols static if they're not exported.
18008 (print_depth, new_backquote_output, being_printed, print_buffer):
18009 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18010 (print_interval, print_number_index, initial_stderr_stream):
18011 Now static.
18012 * lisp.h (Fprinc): Remove decl.
18013 (debug_output_compilation_hack): Mark as externally visible.
18014
18015 * sysdep.c (croak): Move decl from here to syssignal.h.
18016 * syssignal.h (croak): Put it here, so the API can be checked when
18017 'croak' is called from dissociate_if_controlling_tty.
18018
18019 * minibuf.c: Make symbols static if they're not exported.
18020 (minibuf_save_list, choose_minibuf_frame): Now static.
18021 * lisp.h (choose_minibuf_frame): Remove decl.
18022
18023 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18024
18025 * lread.c: Make symbols static if they're not exported.
18026 (read_objects, initial_obarray, oblookup_last_bucket_number):
18027 Now static.
18028 (make_symbol): Remove; unused.
18029 * lisp.h (initial_obarray, make_symbol): Remove decls.
18030
18031 * keyboard.c: Make symbols static if they're not exported.
18032 (single_kboard, recent_keys_index, total_keys, recent_keys):
18033 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18034 (this_single_command_key_start, echoing, last_auto_save):
18035 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18036 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18037 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18038 (Vlispy_mouse_stem, double_click_count):
18039 Now static.
18040 (force_auto_save_soon): Define only if SIGDANGER.
18041 (ignore_mouse_drag_p): Now static if
18042 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18043 (print_help): Remove; unused.
18044 (stop_character, last_timer_event): Mark as externally visible.
18045 * keyboard.h (ignore_mouse_drag_p): Declare only if
18046 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18047 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18048 * lisp.h (echoing): Remove decl.
18049 (force_auto_save_soon): Declare only if SIGDANGER.
18050 * xdisp.c (redisplay_window): Simplify code, to make it more
18051 obvious that ignore_mouse_drag_p is not accessed if !defined
18052 USE_GTK && !defined HAVE_NS.
18053
18054 * intervals.c: Make symbols static if they're not exported.
18055 (merge_properties_sticky, merge_interval_right, delete_interval):
18056 Now static.
18057 * intervals.h (merge_interval_right, delete_interval): Remove decls.
18058
18059 * insdel.c: Make symbols static if they're not exported.
18060 However, leave prepare_to_modify_buffer alone. It's never
18061 called from outside this function, but that appears to be a bug.
18062 (combine_after_change_list, combine_after_change_buffer):
18063 (adjust_after_replace, signal_before_change): Now static.
18064 (adjust_after_replace_noundo): Remove; unused.
18065 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18066 (signal_before_change): Remove decls.
18067
18068 * indent.c (val_compute_motion, val_vmotion): Now static.
18069
18070 * image.c: Make symbols static if they're not exported.
18071 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18072 if USE_GTK.
18073 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18074 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18075
18076 * fringe.c (standard_bitmaps): Now static.
18077 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18078
18079 * frame.c: Make symbols static if they're not exported.
18080 (x_report_frame_params, make_terminal_frame): Now static.
18081 (get_frame_param): Now static, unless HAVE_NS.
18082 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18083 (x_get_resource_string): Remove; not used.
18084 * frame.h (make_terminal_frame, x_report_frame_params):
18085 (x_get_resource_string); Remove decls.
18086 (x_fullscreen_adjust): Declare only if WINDOWSNT.
18087 * lisp.h (get_frame_param): Declare only if HAVE_NS.
18088
18089 * font.c, fontset.c: Make symbols static if they're not exported.
18090 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18091 (FACE_SUITABLE_FOR_CHAR_P): Use it.
18092 * font.c (font_close_object): Now static.
18093 * font.h (font_close_object): Remove.
18094 * fontset.c (FONTSET_OBJLIST): Remove.
18095 (free_realized_fontset) #if-0 the body, which does nothing.
18096 (face_suitable_for_char_p): #if-0, as it's never called.
18097 * fontset.h (face_suitable_for_char_p): Remove decl.
18098 * xfaces.c (face_at_string_position):
18099 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18100 since 0 is always ASCII.
18101
18102 * fns.c (weak_hash_tables): Now static.
18103
18104 * fileio.c: Make symbols static if they're not exported.
18105 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18106 (Vwrite_region_annotation_buffers): Now static.
18107
18108 * eval.c: Make symbols static if they're not exported.
18109 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18110 * lisp.h (backtrace_list): Remove decl.
18111
18112 * emacs.c: Make symbols static if they're not exported.
18113 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18114 (fatal_error_code, fatal_error_signal_hook, standard_args):
18115 Now static.
18116 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18117 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18118 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18119 * lisp.h (fatal_error_signal_hook): Remove decl.
18120 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18121
18122 * editfns.c: Move a (normally-unused) function to its only use.
18123 * editfns.c, lisp.h (get_operating_system_release): Remove.
18124 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18125 worth the hassle of breaking this out.
18126
18127 * xterm.c: Make symbols static if they're not exported.
18128 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18129 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18130 (x_destroy_window, x_delete_display):
18131 Now static.
18132 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18133 (x_mouse_leave): Remove; unused.
18134 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18135 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18136 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18137 Remove decls.
18138 (x_mouse_leave): Declare only if WINDOWSNT.
18139 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18140 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18141 USE_X_TOOLKIT.
18142
18143 * ftxfont.c: Make symbols static if they're not exported.
18144 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18145 HAVE_FREETYPE.
18146 * font.h (ftxfont_driver): Likewise.
18147
18148 * xfns.c: Make symbols static if they're not exported.
18149 (x_last_font_name, x_display_info_for_name):
18150 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18151 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18152 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18153 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18154 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18155 (last_show_tip_args): Now static.
18156 (xic_defaut_fontset, xic_create_fontsetname): Define only if
18157 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18158 (x_screen_planes): Remove; unused.
18159 * dispextern.h (x_screen_planes): Remove decl.
18160
18161 * dispnew.c: Make symbols static if they're not exported.
18162 * dispextern.h (redraw_garbaged_frames, scrolling):
18163 (increment_row_positions): Remove.
18164 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18165 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18166 Now static.
18167 (redraw_garbaged_frames): Remove; unused.
18168
18169 * xfaces.c: Make symbols static if they're not exported.
18170 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18171 Remove decls.
18172 * xterm.h (defined_color): Remove decls.
18173 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18174 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18175 (menu_face_changed_default, defined_color, free_realized_face):
18176 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18177 (ascii_face_of_lisp_face): Remove; unused.
18178
18179 * xdisp.c: Make symbols static if they're not exported.
18180 * dispextern.h (scratch_glyph_row, window_box_edges):
18181 (glyph_to_pixel_coords, set_cursor_from_row):
18182 (get_next_display_element, set_iterator_to_next):
18183 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18184 (show_mouse_face): Remove decls
18185 * frame.h (message_buf_print): Likewise.
18186 * lisp.h (pop_message, set_message, check_point_in_composition):
18187 Likewise.
18188 * xterm.h (set_vertical_scroll_bar): Likewise.
18189 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18190 (message_buf_print, scratch_glyph_row, displayed_buffer):
18191 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18192 (get_next_display_element, show_mouse_face, window_box_edges):
18193 (frame_to_window_pixel_xy, check_point_in_composition):
18194 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18195 (glyph_to_pixel_coords): Remove; unused.
18196
18197 * dired.c (file_name_completion): Now static.
18198
18199 * dbusbind.c (xd_in_read_queued_messages): Now static.
18200
18201 * lisp.h (circular_list_error, FOREACH): Remove; unused.
18202 * data.c (circular_list_error): Remove.
18203
18204 * commands.h (last_point_position, last_point_position_buffer):
18205 (last_point_position_window): Remove decls.
18206 * keyboard.c: Make these variables static.
18207
18208 * coding.h (coding, code_convert_region, encode_coding_gap):
18209 Remove decls.
18210 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
18211 (iso_code_class, detect_coding, code_convert_region): Now static.
18212 (encode_coding_gap): Remove; unused.
18213
18214 * chartab.c (chartab_chars, chartab_bits): Now static.
18215
18216 * charset.h (charset_iso_8859_1): Remove decl.
18217 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
18218 Now static.
18219
18220 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
18221 * ccl.c (Vccl_program_table): Now static.
18222 (check_ccl_update): Remove; unused.
18223
18224 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
18225 * category.h: ... from here.
18226 * category.c (check_category_table, set_category_set): Now static.
18227
18228 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
18229 * lisp.h: Remove these decls.
18230
18231 * buffer.c (buffer_count): Remove unused var.
18232
18233 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
18234 so that it's not optimized away.
18235 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
18236 * dispextern.h (bidi_dump_cached_states): Remove, since it's
18237 exported only to the debugger.
18238
18239 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
18240 * atimer.h (run_all_atimers): Remove; not exported.
18241
18242 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
18243 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
18244 was inaccessible from Lisp.
18245 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
18246 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
18247
18248 alloc.c: Import and export fewer symbols, and remove unused items.
18249 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
18250 is defined.
18251 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
18252 it's not optimized away by whole-program optimization.
18253 (message_enable_multibyte, free_misc): Remove.
18254 (catchlist, handlerlist, mark_backtrace):
18255 Declare only if BYTE_MARK_STACK.
18256 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
18257 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
18258 (message_enable_multibyte): Remove decl.
18259 (free_misc, interval_free_list, float_block, float_block_index):
18260 (n_float_blocks, float_free_list, cons_block, cons_block_index):
18261 (cons_free_list, last_marked_index):
18262 Now static.
18263 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
18264 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
18265 (mark_backtrace): Define only if BYTE_MARK_STACK.
18266 * xdisp.c (message_enable_multibyte): Now static.
18267
18268 Declare Lisp_Object Q* variables to be 'static' if not exported.
18269 This makes it easier for human readers (and static analyzers)
18270 to see whether these variables are used from other modules.
18271 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
18272 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
18273 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
18274 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
18275 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
18276 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
18277 * xmenu.c, xselect.c:
18278 Declare Q* vars static if they are not used in other modules.
18279 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
18280 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
18281 Remove decls of unexported vars.
18282 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
18283
18284 * lisp.h (DEFINE_FUNC): Make sname 'static'.
18285
18286 Make Emacs functions such as Fatom 'static' by default.
18287 This makes it easier for human readers (and static analyzers)
18288 to see whether these functions can be called from other modules.
18289 DEFUN now defines a static function. To make the function external
18290 so that it can be used in other C modules, use the new macro DEFUE.
18291 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
18292 (Finit_image_library):
18293 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
18294 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
18295 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
18296 Remove decls, since these functions are now static.
18297 (Funintern, Fget_internal_run_time): New decls, since these functions
18298 were already external.
18299
18300 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
18301 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
18302 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
18303 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
18304 * keyboard.c, keymap.c, lread.c:
18305 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
18306 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
18307 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
18308 Mark functions with DEFUE instead of DEFUN,
18309 if they are used in other modules.
18310 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
18311 decls for now-static functions.
18312 * buffer.h (Fdelete_overlay): Remove decl.
18313 * callproc.c (Fgetenv_internal): Mark as internal.
18314 * composite.c (Fremove_list_of_text_properties): Remove decl.
18315 (Fcomposition_get_gstring): New forward static decl.
18316 * composite.h (Fcomposite_get_gstring): Remove decl.
18317 * dired.c (Ffile_attributes): New forward static decl.
18318 * doc.c (Fdocumntation_property): New forward static decl.
18319 * eval.c (Ffetch_bytecode): New forward static decl.
18320 (Funintern): Remove extern decl; now in .h file where it belongs.
18321 * fileio.c (Fmake_symbolic_link): New forward static decl.
18322 * image.c (Finit_image_library): New forward static decl.
18323 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
18324 * intervals.h (Fprevious_property_change):
18325 (Fremove_list_of_text_properties): Remove decls.
18326 * keyboard.c (Fthis_command_keys): Remove decl.
18327 (Fcommand_execute): New forward static decl.
18328 * keymap.c (Flookup_key): New forward static decl.
18329 (Fcopy_keymap): Now static.
18330 * keymap.h (Flookup_key): Remove decl.
18331 * process.c (Fget_process): New forward static decl.
18332 (Fprocess_datagram_address): Mark as internal.
18333 * syntax.c (Fsyntax_table_p): New forward static decl.
18334 (skip_chars): Remove duplicate decl.
18335 * textprop.c (Fprevious_property_change): New forward static decl.
18336 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
18337 Now internal.
18338 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
18339 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
18340
18341 * editfns.c (Fformat): Remove unreachable code.
18342
18343 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
18344
18345 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
18346 change. (Bug#8496)
18347
18348 2011-04-13 Eli Zaretskii <eliz@gnu.org>
18349
18350 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
18351 when at ZV. (Bug#8487)
18352
18353 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
18354
18355 * charset.c (Fclear_charset_maps): Use xfree instead of free.
18356 (Bug#8437)
18357 * keyboard.c (parse_tool_bar_item): Likewise.
18358 * sound.c (sound_cleanup, alsa_close): Likewise.
18359 * termcap.c (tgetent): Likewise.
18360 * xfns.c (x_default_font_parameter): Likewise.
18361 * xsettings.c (read_and_apply_settings): Likewise.
18362
18363 * alloc.c (overrun_check_malloc, overrun_check_realloc)
18364 (overrun_check_free): Protoize.
18365
18366 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
18367
18368 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18369 since callers should never pass a negative size.
18370 Change the signature to match that of plain 'read' and 'write'; see
18371 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18372 * lisp.h: Update prototypes of emacs_write and emacs_read.
18373
18374 2011-04-11 Eli Zaretskii <eliz@gnu.org>
18375
18376 * xdisp.c (redisplay_window): Don't try to determine the character
18377 position of the scroll margin if the window start point w->startp
18378 is outside the buffer's accessible region. (Bug#8468)
18379
18380 2011-04-10 Eli Zaretskii <eliz@gnu.org>
18381
18382 Fix write-region and its subroutines for buffers > 2GB.
18383 * fileio.c (a_write, e_write): Modify declaration of arguments and
18384 local variables to support buffers larger than 2GB.
18385 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18386
18387 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18388 argument, local variables, and return value.
18389
18390 * lisp.h: Update prototypes of emacs_write and emacs_read.
18391
18392 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18393
18394 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
18395
18396 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18397
18398 Fix more problems found by GCC 4.6.0's static checks.
18399
18400 * xdisp.c (vmessage): Use a better test for character truncation.
18401
18402 * charset.c (load_charset_map): <, not <=, for optimization,
18403 and to avoid potential problems with integer overflow.
18404 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18405 * casetab.c (set_identity, shuffle): Likewise.
18406 * editfns.c (Fformat): Likewise.
18407 * syntax.c (skip_chars): Likewise.
18408
18409 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18410 This also lets GCC 4.6.0 generate slightly better loop code.
18411
18412 * callint.c (Fcall_interactively): <, not <=, for optimization.
18413 (Fcall_interactively): Count the number of arguments produced,
18414 not the number of arguments given. This is simpler and lets GCC
18415 4.6.0 generate slightly better code.
18416
18417 * ftfont.c: Distingish more carefully between FcChar8 and char.
18418 The previous code passed unsigned char * to a functions like
18419 strlen and xstrcasecmp that expect char *, which does not
18420 conform to the C standard.
18421 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18422 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18423 char * when the C standard requires it.
18424
18425 * keyboard.c (read_char): Remove unused var.
18426
18427 * eval.c: Port to Windows vsnprintf (Bug#8435).
18428 Include <limits.h>.
18429 (SIZE_MAX): Define if the headers do not.
18430 (verror): Do not give up if vsnprintf returns a negative count.
18431 Instead, grow the buffer. This ports to Windows vsnprintf, which
18432 does not conform to C99. Problem reported by Eli Zaretskii.
18433 Also, simplify the allocation scheme, by avoiding the need for
18434 calling realloc, and removing the ALLOCATED variable.
18435
18436 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18437
18438 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18439 But keep the doprint source code for now, as we might revamp it
18440 and use it again (Bug#8435).
18441 * lisp.h (doprnt): Remove.
18442 * Makefile.in (base_obj): Remove doprnt.o.
18443 * deps.mk (doprnt.o): Remove.
18444
18445 error: Print 32- and 64-bit integers portably (Bug#8435).
18446 Without this change, on typical 64-bit hosts error ("...%d...", N)
18447 was used to print both 32- and 64-bit integers N, which relied on
18448 undefined behavior.
18449 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18450 * lisp.h (error, verror): Mark as printf-like functions.
18451 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18452 Report overflow in size calculations when allocating printf buffer.
18453 Do not truncate output string at its first null byte.
18454 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18455 Truncate the output at a character boundary, since vsnprintf does not
18456 do that.
18457 * charset.c (check_iso_charset_parameter): Convert internal
18458 character to string before calling 'error', since %c now has the
18459 printf meaning.
18460 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18461 overflow when computing char to be passed to 'error'. Do not
18462 pass Lisp_Object to 'error'; pass the integer instead.
18463 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18464 formatted with plain %d.
18465
18466 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18467
18468 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18469
18470 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18471
18472 * xterm.c (x_catch_errors): Remove duplicate declaration.
18473
18474 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18475
18476 * xdisp.c, lisp.h (message_nolog): Remove; unused.
18477
18478 2011-04-10 Jim Meyering <meyering@redhat.com>
18479
18480 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18481 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18482 return ssize_t not "int", and use size_t as the buffer length.
18483 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18484 * gnutls.h: Update declarations.
18485 * process.c (read_process_output): Use ssize_t, to match.
18486 (send_process): Likewise.
18487
18488 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18489
18490 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18491
18492 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18493
18494 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18495 Use unsigned char, to match FcChar8 type definition.
18496
18497 * xterm.c (handle_one_xevent):
18498 * xmenu.c (create_and_show_popup_menu):
18499 * xselect.c (x_decline_selection_request)
18500 (x_reply_selection_request): Avoid type-punned deref of X events.
18501
18502 2011-04-09 Eli Zaretskii <eliz@gnu.org>
18503
18504 Fix some uses of `int' instead of EMACS_INT.
18505 * search.c (string_match_1, fast_string_match)
18506 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18507 (scan_buffer, find_next_newline_no_quit)
18508 (find_before_next_newline, search_command, Freplace_match)
18509 (Fmatch_data): Make some `int' variables be EMACS_INT.
18510
18511 * xdisp.c (display_count_lines): 3rd argument and return value now
18512 EMACS_INT. All callers changed.
18513 (pint2hrstr): Last argument is now EMACS_INT.
18514
18515 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18516 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18517 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18518 (decode_coding_utf_16, decode_coding_emacs_mule)
18519 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18520 (decode_coding_ccl, decode_coding_charset)
18521 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18522 (decode_coding_iso_2022, decode_coding_emacs_mule)
18523 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18524 <char_offset, last_offset>: Declare EMACS_INT.
18525 (encode_coding_utf_8, encode_coding_utf_16)
18526 (encode_coding_emacs_mule, encode_invocation_designation)
18527 (encode_designation_at_bol, encode_coding_iso_2022)
18528 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18529 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18530 Declare EMACS_INT.
18531 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18532 (encode_invocation_designation): Last argument P_NCHARS is now
18533 EMACS_INT.
18534 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18535 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18536
18537 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18538 All users changed.
18539
18540 * ccl.c (Fccl_execute_on_string): Declare some variables
18541 EMACS_INT.
18542
18543 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
18544
18545 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18546
18547 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18548
18549 * process.c (Fformat_network_address): Doc fix.
18550
18551 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18552
18553 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18554
18555 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18556
18557 * keyboard.c (read_char): Call Lisp function help-form-show,
18558 instead of using internal_with_output_to_temp_buffer.
18559 (Qhelp_form_show): New var.
18560 (syms_of_keyboard): Use DEFSYM macro.
18561
18562 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18563
18564 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18565
18566 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18567
18568 * process.c (Flist_processes): Remove to Lisp.
18569 (list_processes_1): Delete.
18570
18571 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18572
18573 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18574
18575 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18576
18577 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
18578
18579 Fix more problems found by GCC 4.6.0's static checks.
18580
18581 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18582
18583 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18584
18585 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18586
18587 * xdisp.c (vmessage): Mark as a printf-like function.
18588
18589 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18590
18591 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18592
18593 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18594 printf-like functions.
18595 (tiff_load): Add casts to remove these marks before passing them
18596 to system-supplied API.
18597
18598 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18599
18600 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18601 This avoids several warnings with gcc -Wstrict-overflow.
18602 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18603 directly, rather than having caller test rule sign. This avoids
18604 some unnecessary tests.
18605 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18606 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18607 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18608
18609 * xfont.c (xfont_text_extents): Remove var that was set but not used.
18610 (xfont_open): Avoid unnecessary tests.
18611
18612 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18613
18614 * composite.h, composite.c (composition_gstring_put_cache):
18615 Use EMACS_INT, not int, for length.
18616
18617 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18618 breaking out part of COMPOSITION_DECODE_RULE.
18619 (COMPOSITION_DECODE_RULE): Use it.
18620 * composite.c (get_composition_id): Remove unused local vars,
18621 by using the new macro.
18622
18623 * textprop.c (set_text_properties_1): Change while to do-while,
18624 since the condition is always true at first.
18625
18626 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18627 (interval_deletion_adjustment): Return unsigned value.
18628 All uses changed.
18629
18630 * process.c (list_processes_1, create_pty, read_process_output):
18631 (exec_sentinel): Remove vars that were set but not used.
18632 (create_pty): Remove unnecessary "volatile"s.
18633 (Fnetwork_interface_info): Avoid possibility of int overflow.
18634 (read_process_output): Do adaptive read buffering even if carryover.
18635 (read_process_output): Simplify nbytes computation if buffered.
18636
18637 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18638
18639 * syntax.c (scan_words): Remove var that was set but not used.
18640 (update_syntax_table): Use unsigned instead of int.
18641
18642 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18643 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18644 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18645
18646 * print.c (print_error_message): Avoid int overflow.
18647
18648 * font.c (font_list_entities): Redo for clarity,
18649 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18650
18651 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18652 (font_score): Avoid potential overflow in diff calculation.
18653
18654 * fns.c (substring_both): Remove var that is set but not used.
18655 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18656
18657 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18658
18659 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18660 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18661 can always succeed if overflow has undefined behavior.
18662
18663 * search.c (boyer_moore, wordify): Remove vars set but not used.
18664 (wordify): Omit three unnecessary tests.
18665
18666 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18667 All callers changed. This avoids the need for an unused var.
18668
18669 * casefiddle.c (casify_region): Remove var that is set but not used.
18670
18671 * dired.c (file_name_completion): Remove var that is set but not used.
18672
18673 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18674
18675 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18676 (Finsert_file_contents): Remove unnecessary code checking fd.
18677
18678 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18679 Check for integer overflow on size calculations.
18680
18681 * buffer.c (Fprevious_overlay_change): Remove var that is set
18682 but not used.
18683
18684 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18685 Remove vars that are set but not used.
18686 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18687 (timer_check_2): Mark vars as initialized.
18688
18689 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18690
18691 * image.c (lookup_image): Remove var that is set but not used.
18692 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18693
18694 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18695 that are set but not used.
18696
18697 * xfns.c (make_invisible_cursor): Don't return garbage
18698 if XCreateBitmapFromData fails (Bug#8410).
18699
18700 * xselect.c (x_get_local_selection, x_handle_property_notify):
18701 Remove vars that are set but not used.
18702
18703 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18704 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18705
18706 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18707 Remove var that is set but not used.
18708 (scroll_bar_windows_size): Now size_t, not int.
18709 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18710 Check for overflow.
18711
18712 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18713 (map_tty_color) [!defined MSDOS]: Likewise.
18714
18715 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18716
18717 * coding.c: Remove vars that are set but not used.
18718 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18719 All callers changed.
18720 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18721 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18722 (decode_coding_charset): Remove vars that are set but not used.
18723
18724 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18725 that is set but not used.
18726
18727 * print.c (print_object): Remove var that is set but not used.
18728
18729 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18730 The gnulib version avoids calling malloc in the usual case,
18731 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18732 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18733 * filelock.c (current_lock_owner): Likewise.
18734 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18735 * sysdep.c: Include allocator.h, careadlinkat.h.
18736 (emacs_no_realloc_allocator): New static constant.
18737 (emacs_readlink): New function.
18738 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18739 ../lib/careadlinkat.h.
18740
18741 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18742
18743 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18744 first non-nil return value).
18745
18746 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18747
18748 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18749 if not defined (Bug#8403).
18750
18751 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18752
18753 * xdisp.c (display_count_lines): Remove parameter `start',
18754 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18755 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18756 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18757 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18758 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18759 and thereabouts. All callers changed.
18760 (get_per_char_metric): Remove parameter `f', unused since
18761 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18762
18763 2011-04-02 Jim Meyering <meyering@redhat.com>
18764
18765 do not dereference NULL upon failed strdup
18766 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18767 (ns_get_family): Likewise.
18768
18769 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18770
18771 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18772
18773 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18774
18775 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18776 later (Bug#8403).
18777
18778 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18779
18780 Add lexical binding.
18781
18782 * window.c (Ftemp_output_buffer_show): New fun.
18783 (Fsave_window_excursion):
18784 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18785
18786 * lread.c (lisp_file_lexically_bound_p): New function.
18787 (Fload): Bind Qlexical_binding.
18788 (readevalloop): Remove `evalfun' arg.
18789 Bind Qinternal_interpreter_environment.
18790 (Feval_buffer): Bind Qlexical_binding.
18791 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18792 Mark as dynamic.
18793 (syms_of_lread): Declare `lexical-binding'.
18794
18795 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18796
18797 * keyboard.c (eval_dyn): New fun.
18798 (menu_item_eval_property): Use it.
18799
18800 * image.c (parse_image_spec): Use Ffunctionp.
18801
18802 * fns.c (concat, mapcar1): Accept byte-code-functions.
18803
18804 * eval.c (Fsetq): Handle lexical vars.
18805 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18806 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18807 (FletX, Flet): Obey lexical binding.
18808 (Fcommandp): Handle closures.
18809 (Feval): New `lexical' arg.
18810 (eval_sub): New function extracted from Feval. Use it almost
18811 everywhere where Feval was used. Look up vars in lexical env.
18812 Handle closures.
18813 (Ffunctionp): Move from subr.el.
18814 (Ffuncall): Handle closures.
18815 (apply_lambda): Remove `eval_flags'.
18816 (funcall_lambda): Handle closures and new byte-code-functions.
18817 (Fspecial_variable_p): New function.
18818 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18819 but without exporting it to Lisp.
18820
18821 * doc.c (Fdocumentation, store_function_docstring):
18822 * data.c (Finteractive_form): Handle closures.
18823
18824 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18825 interactive spec.
18826
18827 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18828 New byte-codes.
18829 (exec_byte_code): New function extracted from Fbyte_code to handle new
18830 calling convention for byte-code-functions. Add new byte-codes.
18831
18832 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18833
18834 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18835
18836 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18837
18838 * xdisp.c (redisplay_internal): Fix prototype.
18839
18840 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18841
18842 * xdisp.c (SCROLL_LIMIT): New macro.
18843 (try_scrolling): Use it when setting scroll_limit.
18844 Limit scrolling to 100 screen lines.
18845 (redisplay_window): Even when falling back on "recentering",
18846 position point in the window according to scroll-conservatively,
18847 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18848
18849 (try_scrolling): When point is above the window, allow searching
18850 as far as scroll_max, or one screenful, to compute vertical
18851 distance from PT to the scroll margin position. This prevents
18852 try_scrolling from unnecessarily failing when
18853 scroll-conservatively is set to a value slightly larger than the
18854 window height. Clean up the case of PT below the margin at bottom
18855 of window: scroll_max can no longer be INT_MAX. When aggressive
18856 scrolling is in use, don't let point enter the opposite scroll
18857 margin as result of the scroll.
18858 (syms_of_xdisp) <scroll-conservatively>: Document the
18859 threshold of 100 lines for never-recentering scrolling.
18860
18861 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18862
18863 * dispextern.h (move_it_by_lines):
18864 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18865 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18866 (message_log_check_duplicate): Remove parameters `prev_bol' and
18867 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18868 (redisplay_internal): Remove parameter `preserve_echo_area',
18869 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18870
18871 * indent.c (Fvertical_motion):
18872 * window.c (window_scroll_pixel_based, Frecenter):
18873 Don't pass `need_y_p' to `move_it_by_lines'.
18874
18875 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18876
18877 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18878 steal a few bits to be more compact.
18879 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18880 Remove unneeded casts.
18881
18882 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18883
18884 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18885
18886 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18887 binding" message (bug#7967).
18888
18889 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18890
18891 Fix more problems found by GCC 4.6.0's static checks.
18892
18893 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18894 Remove unused local var.
18895
18896 * editfns.c (Fmessage_box): Remove unused local var.
18897
18898 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18899 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18900 Omit unused local vars.
18901 * window.c (shrink_windows): Omit unused local var.
18902 * menu.c (digest_single_submenu): Omit unused local var.
18903 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18904 Omit unused local var.
18905
18906 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18907 Don't assume string length fits in int.
18908 (keyremap_step, read_key_sequence): Use size_t for sizes.
18909 (read_key_sequence): Don't check last_real_key_start redundantly.
18910
18911 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18912 instead of alloca (Bug#8344).
18913
18914 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18915 (Fbacktrace_frame): Don't assume nframes fits in int.
18916
18917 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18918
18919 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18920 concerns.
18921
18922 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18923
18924 * cm.c (calccost): Turn while-do into do-while, for clarity.
18925
18926 * keyboard.c (syms_of_keyboard): Use the same style as later
18927 in this function when indexing through an array. This also
18928 works around GCC bug 48267.
18929
18930 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18931
18932 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18933
18934 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18935 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18936
18937 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18938 This avoids undefined behavior on integer overflow, and is a bit
18939 more convenient anyway since it is compared to a size_t variable.
18940
18941 Variadic C functions now count arguments with size_t, not int.
18942 This avoids an unnecessary limitation on 64-bit machines, which
18943 caused (substring ...) to crash on large vectors (Bug#8344).
18944 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18945 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18946 All variadic functions and their callers changed accordingly.
18947 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18948 * data.c (arith_driver, float_arith_driver): Likewise.
18949 * editfns.c (general_insert_function): Likewise.
18950 * eval.c (struct backtrace.nargs, interactive_p)
18951 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18952 (funcall_lambda, mark_backtrace): Likewise.
18953 * fns.c (concat): Likewise.
18954 * frame.c (x_set_frame_parameters): Likewise.
18955 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18956 0 if not found, not -1. All callers changed.
18957
18958 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18959 (stack_copy_size): Now size_t, not int.
18960 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18961
18962 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18963
18964 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18965 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18966 All callers changed.
18967
18968 * lisp.h (multibyte_char_to_unibyte):
18969 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18970 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18971 * character.h (CHAR_TO_BYTE8):
18972 * cmds.c (internal_self_insert):
18973 * editfns.c (general_insert_function):
18974 * keymap.c (push_key_description):
18975 * search.c (Freplace_match):
18976 * xdisp.c (message_dolog, set_message_1): All callers changed.
18977
18978 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18979
18980 * keyboard.c (safe_run_hook_funcall): New function.
18981 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18982 don't set the hook to nil, but remove the offending function instead.
18983 (Qcommand_hook_internal): Remove, unused.
18984 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18985 Vcommand_hook_internal.
18986
18987 * eval.c (enum run_hooks_condition): Remove.
18988 (funcall_nil, funcall_not): New functions.
18989 (run_hook_with_args): Call each function through a `funcall' argument.
18990 Remove `cond' argument, now redundant.
18991 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18992 (Frun_hook_with_args_until_failure): Adjust accordingly.
18993 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18994
18995 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18996
18997 * dispextern.h (string_buffer_position): Remove declaration.
18998
18999 * print.c (strout): Remove parameter `multibyte', unused since
19000 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19001
19002 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19003 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19004 All callers changed.
19005
19006 * w32.c (_wsa_errlist): Use braces for struct initializers.
19007
19008 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19009 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19010 All callers changed.
19011 (string_buffer_position): Likewise. Also, make static (it's never
19012 used outside xdisp.c).
19013 (cursor_row_p): Remove parameter `w', unused since
19014 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
19015 (decode_mode_spec): Remove parameter `precision', introduced during
19016 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19017 All callers changed.
19018
19019 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19020
19021 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19022
19023 2011-03-27 Anders Lindgren <andlind@gmail.com>
19024
19025 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19026 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19027 (ns_update_auto_hide_menu_bar): New functions.
19028 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19029 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19030 ns_constrain_all_frames.
19031 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19032 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19033
19034 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19035
19036 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19037
19038 2011-03-27 Glenn Morris <rgm@gnu.org>
19039
19040 * syssignal.h: Replace RETSIGTYPE with void.
19041 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19042 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19043 Replace SIGTYPE with void everywhere.
19044 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19045 * s/template.h (SIGTYPE): Remove commented out definition.
19046
19047 2011-03-26 Eli Zaretskii <eliz@gnu.org>
19048
19049 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19050 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19051
19052 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
19053
19054 * w32.c (read_unc_volume): Use parameter `henum', instead of
19055 global variable `wget_enum_handle'.
19056
19057 * keymap.c (describe_vector): Remove parameters `indices' and
19058 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19059 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19060
19061 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19062
19063 * keyboard.c (timer_check): Remove parameter `do_it_now',
19064 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19065 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19066 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19067
19068 * keyboard.c (read_char):
19069 * w32menu.c (w32_menu_display_help):
19070 * xmenu.c (show_help_event, menu_help_callback):
19071 Adjust calls to `show_help_echo'.
19072
19073 * gtkutil.c (xg_maybe_add_timer):
19074 * keyboard.c (readable_events):
19075 * process.c (wait_reading_process_output):
19076 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19077
19078 * insdel.c (adjust_markers_gap_motion):
19079 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19080 (gap_left, gap_right): Don't call it.
19081
19082 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
19083
19084 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19085 incurred during fontification.
19086
19087 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19088
19089 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19090 (DEFVAR_PER_BUFFER): Don't pass it.
19091
19092 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19093 (scrolling_window): Don't pass it.
19094
19095 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19096
19097 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19098
19099 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19100 and `suffix'.
19101 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19102 of variables specific to SELinux and computation of `encoded_absname'.
19103
19104 * image.c (XPutPixel): Remove unused variable `height'.
19105
19106 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19107
19108 * unexw32.c (get_section_info): Remove unused variable `section'.
19109
19110 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19111 (system_process_attributes): Remove unused variable `sess'.
19112 (sys_read): Remove unused variable `err'.
19113
19114 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19115 (w32_wnd_proc): Remove unused variable `isdead'.
19116 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19117 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19118 (x_create_tip_frame): Remove unused variable `tem'.
19119
19120 * w32inevt.c (w32_console_read_socket):
19121 Remove unused variable `no_events'.
19122
19123 * w32term.c (x_draw_composite_glyph_string_foreground):
19124 Remove unused variable `width'.
19125
19126 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
19127
19128 * w32term.c (x_set_glyph_string_clipping):
19129 Don't pass uninitialized region to CombineRgn.
19130
19131 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
19132
19133 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19134 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19135 (Fx_close_connection): Remove unused variable `i'.
19136
19137 * w32font.c (w32font_draw): Return number of glyphs.
19138 (w32font_open_internal): Remove unused variable `i'.
19139 (w32font_driver): Add missing initializer.
19140
19141 * w32menu.c (utf8to16): Remove unused variable `utf16'.
19142 (fill_in_menu): Remove unused variable `items_added'.
19143
19144 * w32term.c (last_mouse_press_frame): Remove static global variable.
19145 (w32_clip_to_row): Remove unused variable `f'.
19146 (x_delete_terminal): Remove unused variable `i'.
19147
19148 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19149 (NOTHING): Remove unused static global variable.
19150 (uniscribe_check_otf): Remove unused variable `table'.
19151 (uniscribe_font_driver): Add missing initializers.
19152
19153 2011-03-23 Julien Danjou <julien@danjou.info>
19154
19155 * term.c (Fsuspend_tty, Fresume_tty):
19156 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19157 * window.c (temp_output_buffer_show):
19158 * insdel.c (signal_before_change):
19159 * frame.c (Fhandle_switch_frame):
19160 * fileio.c (Fdo_auto_save):
19161 * emacs.c (Fkill_emacs):
19162 * editfns.c (save_excursion_restore):
19163 * cmds.c (internal_self_insert):
19164 * callint.c (Fcall_interactively):
19165 * buffer.c (Fkill_all_local_variables):
19166 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19167 Use Frun_hooks.
19168 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
19169 unconditionally since it does the check itself.
19170
19171 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
19172
19173 Fix more problems found by GCC 4.5.2's static checks.
19174
19175 * coding.c (encode_coding_raw_text): Avoid unnecessary test
19176 the first time through the loop, since we know p0 < p1 then.
19177 This also avoids a gcc -Wstrict-overflow warning.
19178
19179 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19180 leading to a memory leak, possible in functions like
19181 load_charset_map_from_file that can allocate an unbounded number
19182 of objects (Bug#8318).
19183
19184 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19185 that could (at least in theory) be that large.
19186
19187 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19188 This is less likely to overflow, and avoids undefined behavior if
19189 overflow does occur. All callers changed. Use strtoul to scan
19190 for the unsigned long integer.
19191 (pint2hrstr): Simplify and tune code slightly.
19192 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19193
19194 * scroll.c (do_scrolling): Work around GCC bug 48228.
19195 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19196
19197 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19198 This also avoids a warning with gcc -Wstrict-overflow.
19199 (validate_x_resource_name): Simplify count usage.
19200 This also avoids a warning with gcc -Wstrict-overflow.
19201
19202 * fileio.c (Fcopy_file): Report error if fchown or fchmod
19203 fail (Bug#8306).
19204
19205 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
19206
19207 * process.c (Fmake_network_process): Use socklen_t, not int,
19208 where POSIX says socklen_t is required in portable programs.
19209 This fixes a porting bug on hosts like 64-bit HP-UX, where
19210 socklen_t is wider than int (Bug#8277).
19211 (Fmake_network_process, server_accept_connection):
19212 (wait_reading_process_output, read_process_output):
19213 Likewise.
19214
19215 * process.c: Rename or move locals to avoid shadowing.
19216 (list_processes_1, Fmake_network_process):
19217 (read_process_output_error_handler, exec_sentinel_error_handler):
19218 Rename or move locals.
19219 (Fmake_network_process): Define label "retry_connect" only if needed.
19220 (Fnetwork_interface_info): Fix pointer signedness.
19221 (process_send_signal): Add cast to avoid pointer signedness problem.
19222 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
19223 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
19224
19225 Make tparam.h and terminfo.c consistent.
19226 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
19227 Include tparam.h instead, since it declares them.
19228 * cm.h (PC): Remove extern decl; tparam.h now does this.
19229 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
19230 * terminfo.c: Include tparam.h, to check interfaces.
19231 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
19232 (tparam): Adjust signature to match interface in tparam.h;
19233 this removes some undefined behavior. Check that outstring and len
19234 are zero, which they always are with Emacs.
19235 * tparam.h (PC, BC, UP): New extern decls.
19236
19237 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
19238 (xftfont_open): Rename locals to avoid shadowing.
19239
19240 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
19241 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
19242 (OTF_TAG_SYM): Omit macro if not needed.
19243 (ftfont_list): Remove unused local.
19244 (get_adstyle_property, ftfont_pattern_entity):
19245 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
19246 Rename locals to avoid shadowing.
19247
19248 * xfont.c (xfont_list_family): Mark var as initialized.
19249
19250 * xml.c (make_dom): Now static.
19251
19252 * composite.c (composition_compute_stop_pos): Rename local to
19253 avoid shadowing.
19254 (composition_reseat_it): Remove unused locals.
19255 (find_automatic_composition, composition_adjust_point): Likewise.
19256 (composition_update_it): Mark var as initialized.
19257 (find_automatic_composition): Mark vars as initialized,
19258 with a FIXME (Bug#8290).
19259
19260 character.h: Rename locals to avoid shadowing.
19261 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
19262 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
19263 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
19264 (BUF_DEC_POS): Be more systematic about renaming local temporaries
19265 to avoid shadowing.
19266
19267 * textprop.c (property_change_between_p): Remove; unused.
19268
19269 * intervals.c (interval_start_pos): Now static.
19270
19271 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
19272
19273 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
19274 Rename locals to avoid shadowing.
19275
19276 * sound.c (wav_play, au_play, Fplay_sound_internal):
19277 Fix pointer signedness.
19278 (alsa_choose_format): Remove unused local var.
19279 (wav_play): Initialize a variable to 0, to prevent undefined
19280 behavior (Bug#8278).
19281
19282 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
19283
19284 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
19285
19286 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
19287 clobbering (Bug#8298).
19288 * sysdep.c (sys_subshell): Likewise.
19289 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
19290
19291 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
19292 This should get cleaned up, so that child_setup has the
19293 same signature on all platforms.
19294
19295 * callproc.c (call_process_cleanup): Now static.
19296 (relocate_fd): Rename locals to avoid shadowing.
19297
19298 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
19299
19300 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
19301 not to be necessary, and produces flickering.
19302
19303 2011-03-20 Glenn Morris <rgm@gnu.org>
19304
19305 * config.in: Remove file.
19306
19307 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
19308
19309 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
19310 are now in src/globals.h.
19311 (syms_of_minibuf): Remove spurious & from previous change.
19312
19313 2011-03-20 Leo Liu <sdl.web@gmail.com>
19314
19315 * minibuf.c (completing-read-function): New variable.
19316 (completing-read-default): Rename from completing-read.
19317 (completing-read): Call completing-read-function.
19318
19319 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19320
19321 * xfaces.c (Fx_load_color_file):
19322 Read color file from absolute filename (bug#8250).
19323
19324 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19325
19326 * makefile.w32-in: Update dependencies.
19327
19328 2011-03-17 Eli Zaretskii <eliz@gnu.org>
19329
19330 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
19331
19332 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
19333
19334 Fix more problems found by GCC 4.5.2's static checks.
19335
19336 * process.c (make_serial_process_unwind, send_process_trap):
19337 (sigchld_handler): Now static.
19338
19339 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
19340 That way, the code declares only the vars that it needs.
19341 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
19342 * s/cygwin.h (PTY_ITERATION): Likewise.
19343 * s/darwin.h (PTY_ITERATION): Likewise.
19344 * s/gnu-linux.h (PTY_ITERATION): Likewise.
19345
19346 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
19347 * process.c (allocate_pty): Don't declare stb unless it's needed.
19348
19349 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19350 (CONSTANTLIM): Remove; unused.
19351 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
19352 Define only if needed.
19353
19354 * unexelf.c (unexec): Name an expression,
19355 to avoid gcc -Wbad-function-cast warning.
19356 Use a different way to cause a compilation error if anyone uses
19357 n rather than nn, a way that does not involve shadowing.
19358 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
19359
19360 * deps.mk (unexalpha.o): Remove; unused.
19361
19362 New file unexec.h, the (simple) interface for unexec (Bug#8267).
19363 * unexec.h: New file.
19364 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19365 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19366 Depend on unexec.h.
19367 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19368 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19369 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19370 Change as necessary to match prototype in unexec.h.
19371
19372 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19373 shadowing.
19374 (back_comment, skip_chars): Mark vars as initialized.
19375
19376 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19377 Rename locals to avoid shadowing.
19378
19379 * lread.c (read1): Rewrite so as not to use empty "else".
19380 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19381
19382 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19383
19384 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19385 warning when compiling print.c.
19386
19387 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19388 instead of using an uninitialized var.
19389 (font_sort_entities): Mark var as initialized.
19390
19391 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19392
19393 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19394 pointers to constants.
19395 (font_parse_fcname): Remove unused vars.
19396 (font_delete_unmatched): Now static.
19397 (font_get_spec): Remove; unused.
19398 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19399 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19400 Rename or move locals to avoid shadowing.
19401
19402 * fns.c (require_nesting_list, require_unwind): Now static.
19403 (Ffillarray): Rename locals to avoid shadowing.
19404
19405 * floatfns.c (domain_error2): Define only if needed.
19406 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19407
19408 * alloc.c (mark_backtrace): Move decl from here ...
19409 * lisp.h: ... to here, so that it can be checked.
19410
19411 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19412 (Fdefvar): Rewrite so as not to use empty "else".
19413 (lisp_indirect_variable): Name an expression,
19414 to avoid gcc -Wbad-function-cast warning.
19415 (Fdefvar): Rename locals to avoid shadowing.
19416
19417 * callint.c (quotify_arg, quotify_args): Now static.
19418 (Fcall_interactively): Rename locals to avoid shadowing.
19419 Use const pointer when appropriate.
19420
19421 * lisp.h (get_system_name, get_operating_system_release):
19422 Move decls here, to check interfaces.
19423 * process.c (get_operating_system_release): Move decl to lisp.h.
19424 * xrdb.c (get_system_name): Likewise.
19425 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19426 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19427 some of which prompt warnings from gcc -Wbad-function-cast.
19428 (Fformat_time_string, Fencode_time, Finsert_char):
19429 (Ftranslate_region_internal, Fformat):
19430 Rename or remove local vars to avoid shadowing.
19431 (Ftranslate_region_internal): Mark var as initialized.
19432
19433 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19434 avoid shadowing.
19435
19436 * lisp.h (eassert): Check that the argument compiles, even if
19437 ENABLE_CHECKING is not defined.
19438
19439 * data.c (Findirect_variable): Name an expression, to avoid
19440 gcc -Wbad-function-cast warning.
19441 (default_value, arithcompare, arith_driver, arith_error): Now static.
19442 (store_symval_forwarding): Rename local to avoid shadowing.
19443 (Fmake_variable_buffer_local, Fmake_local_variable):
19444 Mark variables as initialized.
19445 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
19446
19447 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
19448 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19449 Rename locals to avoid shadowing.
19450 (mark_stack): Move local variables into the #ifdef region where
19451 they're used.
19452 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19453 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19454 needed otherwise.
19455 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19456 (GC_STRING_CHARS): Remove; not used.
19457 (Fmemory_limit): Cast sbrk's returned value to char *.
19458
19459 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19460 avoids undefined behavior in theory.
19461
19462 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19463
19464 Use functions, not macros, for up- and down-casing (Bug#8254).
19465 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19466 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
19467 to use the following functions instead of these macros.
19468 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
19469 EMACS_INT, since callers assume the returned value fits in int.
19470 (upcase1): Likewise, for UPCASE_TABLE.
19471 (uppercasep, lowercasep, upcase): New static inline functions.
19472 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19473 the race-condition problem in the old DOWNCASE.
19474
19475 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19476 Rename locals to avoid shadowing.
19477 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19478 (regex_compile, re_search_2, re_match_2_internal):
19479 Remove unused local vars.
19480 (FREE_VAR): Rewrite so as not to use empty "else",
19481 which gcc can warn about.
19482 (regex_compile, re_match_2_internal): Mark locals as initialized.
19483 (RETALLOC_IF): Define only if needed.
19484 (WORDCHAR_P): Likewise. This one is never needed, but is used
19485 only in a comment talking about a compiler bug, so put inside
19486 the #if 0 of that comment.
19487 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19488 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19489 Remove; unused.
19490
19491 * search.c (boyer_moore): Rename locals to avoid shadowing.
19492 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19493 (PREV_CHAR_BOUNDARY): Likewise.
19494
19495 * search.c (simple_search): Remove unused var.
19496
19497 * dired.c (compile_pattern): Move decl from here ...
19498 * lisp.h: ... to here, so that it can be checked.
19499 (struct re_registers): New forward decl.
19500
19501 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19502
19503 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19504 All uses changed.
19505 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19506 Rename locals to avoid shadowing.
19507 (Fvertical_motion): Mark locals as initialized.
19508
19509 * casefiddle.c (casify_object, casify_region): Now static.
19510 (casify_region): Mark local as initialized.
19511
19512 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19513
19514 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19515 New macros, so that the caller can use some names other than
19516 gcpro1, gcpro2, etc.
19517 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19518 of the new macros.
19519 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19520 argument, for consistency with GCPRO2_VAR, etc: it is now the
19521 prefix of the variable, not the variable itself. All uses
19522 changed.
19523 * dired.c (directory_files_internal, file_name_completion):
19524 Rename locals to avoid shadowing.
19525
19526 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19527 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19528 dired.c's scmp function, had undefined behavior.
19529 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19530 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19531 * buffer.h: ... to here, because these macros use current_buffer,
19532 and the new implementation with inline functions needs to have
19533 current_buffer in scope now, rather than later when the macros
19534 are used.
19535 (downcase, upcase1): New static inline functions.
19536 (DOWNCASE, UPCASE1): Reimplement using these functions.
19537 This avoids undefined behavior in expressions like
19538 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19539 from race conditions in accessing the global variables
19540 case_temp1 and case_temp2.
19541 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19542 * lisp.h (case_temp1, case_temp2): Remove their decls.
19543 * character.h (ASCII_CHAR_P): Move from here ...
19544 * lisp.h: ... to here, so that the inline functions mentioned
19545 above can use them.
19546
19547 * dired.c (directory_files_internal_unwind): Now static.
19548
19549 * fileio.c (file_name_as_directory, directory_file_name):
19550 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19551 Now static.
19552 (file_name_as_directory): Use const pointers when appropriate.
19553 (Fexpand_file_name): Likewise. In particular, newdir might
19554 point at constant storage, so make it a const pointer.
19555 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19556 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19557 signedness issues.
19558 (Fset_file_times, Finsert_file_contents, auto_save_error):
19559 Rename locals to avoid shadowing.
19560
19561 * minibuf.c (choose_minibuf_frame_1): Now static.
19562 (Ftry_completion, Fall_completions): Rename or remove locals
19563 to avoid shadowing.
19564
19565 * marker.c (bytepos_to_charpos): Remove; unused.
19566
19567 * lisp.h (verify_bytepos, count_markers): New decls,
19568 so that gcc does not warn that these functions aren't declared.
19569
19570 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19571 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19572 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19573 (copy_text): Remove unused local var.
19574
19575 * filelock.c (within_one_second): Now static.
19576 (lock_file_1): Rename local to avoid shadowing.
19577
19578 * buffer.c (fix_overlays_before): Mark locals as initialized.
19579 (fix_start_end_in_overlays): Likewise. This function should be
19580 simplified by using pointers-to-pointers, but that's a different
19581 matter.
19582 (switch_to_buffer_1): Now static.
19583 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19584 (report_overlay_modification): Rename locals to avoid shadowing.
19585
19586 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19587 Fix pointer signedness issue.
19588 (sys_subshell): Mark local as volatile if checking for lint,
19589 to suppress a gcc -Wclobbered warning that does not seem to be right.
19590 (MAXPATHLEN): Define only if needed.
19591
19592 * process.c (serial_open, serial_configure): Move decls from here ...
19593 * systty.h: ... to here, so that they can be checked.
19594
19595 * fns.c (get_random, seed_random): Move extern decls from here ...
19596 * lisp.h: ... to here, so that they can be checked.
19597
19598 * sysdep.c (reset_io): Now static.
19599 (wait_for_termination_signal): Remove; unused.
19600
19601 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19602 (copy_keymap_item, append_key, push_text_char_description):
19603 Now static.
19604 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19605 (DENSE_TABLE_SIZE): Remove; unused.
19606 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19607 (describe_map_tree):
19608 Rename locals to avoid shadowing.
19609
19610 * keyboard.c: Declare functions static if they are not used elsewhere.
19611 (echo_char, echo_dash, cmd_error, top_level_2):
19612 (poll_for_input, handle_async_input): Now static.
19613 (read_char, kbd_buffer_get_event, make_lispy_position):
19614 (make_lispy_event, make_lispy_movement, apply_modifiers):
19615 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19616 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19617 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19618 (read_key_sequence, read_char): Mark locals as initialized.
19619 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19620
19621 * keyboard.h (make_ctrl_char): New decl.
19622 (mark_kboards): Move decl here ...
19623 * alloc.c (mark_kboards): ... from here.
19624
19625 * lisp.h (force_auto_save_soon): New decl.
19626
19627 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19628 (DEFINE_DUMMY_FUNCTION): New macro.
19629 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19630 Use it.
19631 (main): Add casts to avoid warnings
19632 if GCC considers string literals to be constants.
19633
19634 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19635
19636 * dbusbind.c: Pointer signedness fixes.
19637 (xd_signature, xd_append_arg, xd_initialize):
19638 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19639 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19640 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19641 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19642
19643 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19644 if GCC considers string literals to be constants.
19645 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19646
19647 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19648
19649 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19650 (print_preprocess, print_object): New macro to fix last change.
19651
19652 * print.c (print_preprocess): Don't forget font objects.
19653
19654 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19655
19656 * emacs.c (USAGE3): Doc fixes.
19657
19658 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19659
19660 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19661 structure.
19662
19663 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19664
19665 * lisp.h (VWindow_system, Qfile_name_history):
19666 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19667 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19668 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19669
19670 * w32select.c: Don't #include "keyboard.h".
19671 (run_protected): Add extern declaration for waiting_for_input.
19672
19673 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19674 * w32console.c (detect_input_pending, read_input_pending)
19675 (encode_terminal_code):
19676 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19677 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19678 (w32_system_caret_y, Qfile_name_history):
19679 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19680 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19681 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19682 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19683 * w32proc.c (Qlocal, report_file_error):
19684 * w32term.c (Vwindow_system, updating_frame):
19685 * w32uniscribe.c (initialized, uniscribe_font_driver):
19686 Remove unneeded extern declarations.
19687
19688 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19689
19690 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19691
19692 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19693
19694 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19695 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19696 These macros can no longer be used for assignment.
19697
19698 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19699 Assign struct members directly, instead of using BUF_BEGV etc.
19700 (record_buffer_markers, fetch_buffer_markers): New functions for
19701 recording and fetching special buffer markers.
19702 (set_buffer_internal_1, set_buffer_temp): Use them.
19703
19704 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19705
19706 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19707
19708 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19709 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19710
19711 * xdisp.c (hscroll_window_tree):
19712 (reconsider_clip_changes): Use PT instead of BUF_PT.
19713
19714 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19715
19716 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19717 $(EMACS_ROOT)/lib/intprops.h.
19718
19719 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19720
19721 Fix more problems found by GCC 4.5.2's static checks.
19722
19723 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19724 to unsigned char * to avoid compiler diagnostic.
19725 (xg_free_frame_widgets): Make it clear that a local variable is
19726 needed only if USE_GTK_TOOLTIP.
19727 (gdk_window_get_screen): Make it clear that this macro is needed
19728 only if USE_GTK_TOOLTIP.
19729 (int_gtk_range_get_value): New function, which avoids a diagnostic
19730 from gcc -Wbad-function-cast.
19731 (xg_set_toolkit_scroll_bar_thumb): Use it.
19732 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19733 diagnostic from gcc -Wbad-function-cast.
19734 (get_utf8_string, xg_get_file_with_chooser):
19735 Rename locals to avoid shadowing.
19736 (create_dialog): Move locals to avoid shadowing.
19737
19738 * xgselect.c (xg_select): Remove unused var.
19739
19740 * image.c (four_corners_best): Mark locals as initialized.
19741 (gif_load): Initialize transparent_p to zero (Bug#8238).
19742 Mark another local as initialized.
19743 (my_png_error, my_error_exit): Mark with NO_RETURN.
19744
19745 * image.c (clear_image_cache): Now static.
19746 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19747 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19748 (x_edge_detection): Remove unnecessary cast that
19749 gcc -Wbad-function-cast diagnoses.
19750 (gif_load): Fix pointer signedness.
19751 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19752 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19753
19754 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19755
19756 Improve quality of tests for time stamp overflow.
19757 For example, without this patch (encode-time 0 0 0 1 1
19758 1152921504606846976) returns the obviously-bogus value (-948597
19759 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19760 reports time overflow. See
19761 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19762 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19763 * editfns.c: Include limits.h and intprops.h.
19764 (TIME_T_MIN, TIME_T_MAX): New macros.
19765 (time_overflow): Move earlier, to before first use.
19766 (hi_time, lo_time): New functions, for an accurate test for
19767 out-of-range times.
19768 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19769 (Fget_internal_run_time): Don't assume time_t fits in int.
19770 (make_time): Use list2 instead of Fcons twice.
19771 (Fdecode_time): More accurate test for out-of-range times.
19772 (check_tm_member): New function.
19773 (Fencode_time): Use it, to test for out-of-range times.
19774 (lisp_time_argument): Don't rely on undefined left-shift and
19775 right-shift behavior when checking for time stamp overflow.
19776
19777 * editfns.c (time_overflow): New function, refactoring common code.
19778 (Fformat_time_string, Fdecode_time, Fencode_time):
19779 (Fcurrent_time_string): Use it.
19780
19781 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19782 * dired.c (make_time): Move to ...
19783 * editfns.c (make_time): ... here.
19784 * systime.h: Note the move.
19785
19786 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19787
19788 * fringe.c (update_window_fringes): Remove unused variables.
19789
19790 * unexmacosx.c (copy_data_segment): Also copy __got section.
19791 (Bug#8223)
19792
19793 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19794
19795 * termcap.c [MSDOS]: Include "msdos.h".
19796 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19797 Constify `char *' arguments and their references according to
19798 prototypes in tparam.h.
19799
19800 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19801
19802 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19803 Adapt all references accordingly.
19804
19805 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19806
19807 2011-03-11 Tom Tromey <tromey@redhat.com>
19808
19809 * buffer.c (syms_of_buffer): Remove obsolete comment.
19810
19811 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19812
19813 * termhooks.h (encode_terminal_code): Declare prototype.
19814
19815 * msdos.c (encode_terminal_code): Don't declare prototype.
19816
19817 * term.c (encode_terminal_code): Now external again, used by
19818 w32console.c and msdos.c.
19819
19820 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19821 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19822
19823 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19824
19825 Fix some minor problems found by GCC 4.5.2's static checks.
19826
19827 * fringe.c (update_window_fringes): Mark locals as initialized
19828 (Bug#8227).
19829 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19830
19831 * alloc.c (mark_fringe_data): Move decl from here ...
19832 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19833 to check its interface.
19834 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19835
19836 * fontset.c (free_realized_fontset): Now static.
19837 (Fset_fontset_font): Rename local to avoid shadowing.
19838 (fontset_font): Mark local as initialized.
19839 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19840
19841 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19842
19843 * xselect.c (x_disown_buffer_selections): Remove; not used.
19844 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19845 (x_own_selection, Fx_disown_selection_internal): Rename locals
19846 to avoid shadowing.
19847 (x_handle_dnd_message): Remove local to avoid shadowing.
19848
19849 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19850 so that the caller can use some name other than gcpro1.
19851 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19852 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19853 (Fx_backspace_delete_keys_p):
19854 Use them to avoid shadowing, and rename vars to avoid shadowing.
19855 (x_decode_color, x_set_name, x_window): Now static.
19856 (Fx_create_frame): Add braces to silence GCC warning.
19857 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19858 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19859 Remove unused locals.
19860 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19861 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19862 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19863 macros.
19864
19865 * xterm.h (x_mouse_leave): New decl.
19866
19867 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19868 Remove unused functions.
19869 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19870 (x_calc_absolute_position): Now static.
19871 (XTread_socket): Don't define label "out" unless it's used.
19872 Don't declare local "event" unless it's used.
19873 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19874 unless they are used.
19875 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19876 (x_fatal_error_signal): Remove; not used.
19877 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19878 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19879 (x_error_catcher, x_connection_closed, x_error_handler):
19880 (x_error_quitter, xembed_send_message, x_iconify_frame):
19881 (my_log_handler): Rename locals to avoid shadowing.
19882 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19883 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19884
19885 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19886 Rename or move locals to avoid shadowing.
19887 (tty_defined_color, merge_face_heights): Now static.
19888 (free_realized_faces_for_fontset): Remove; not used.
19889 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19890 does not deduce is never used uninitialized.
19891 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19892 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19893
19894 * terminal.c (store_terminal_param): Now static.
19895
19896 * xmenu.c (menu_highlight_callback): Now static.
19897 (set_frame_menubar): Remove unused local.
19898 (xmenu_show): Rename parameter to avoid shadowing.
19899 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19900 since they might point to immutable storage.
19901 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19902 since it's unused otherwise.
19903
19904 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19905 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19906 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19907 avoids a gcc -Wuninitialized diagnostic.
19908 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19909 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19910 does not deduce are never used uninitialized.
19911
19912 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19913
19914 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19915 * window.c (window_loop, size_window):
19916 (run_window_configuration_change_hook, enlarge_window): Likewise.
19917
19918 * window.c (display_buffer): Now static.
19919 (size_window): Mark variables that gcc -Wuninitialized
19920 does not deduce are never used uninitialized.
19921 * window.h (check_all_windows): New decl, to forestall
19922 gcc -Wmissing-prototypes diagnostic.
19923 * dispextern.h (bidi_dump_cached_states): Likewise.
19924
19925 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19926 shadowing.
19927 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19928 Include <limits.h>.
19929 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19930 and to avoid gcc -Wuninitialized warning.
19931 (load_charset_map): Mark variables that gcc -Wuninitialized
19932 does not deduce are never used uninitialized.
19933 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19934
19935 * coding.c (coding_set_source, coding_set_destination):
19936 Use "else { /* comment */ }" rather than "else /* comment */;"
19937 for clarity, and to avoid gcc -Wempty-body warning.
19938 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19939 a block, when the outer 'i' will do.
19940 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19941 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19942 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19943 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19944 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19945 Rename locals to avoid shadowing.
19946 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19947 * coding.c (emacs_mule_char, encode_invocation_designation):
19948 Now static, since they're not used elsewhere.
19949 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19950 (decode_coding_object, encode_coding_object, detect_coding_system):
19951 (decode_coding_emacs_mule): Mark variables that gcc
19952 -Wuninitialized does not deduce are never used uninitialized.
19953 (detect_coding_iso_2022): Initialize a local variable that might
19954 be used uninitialized. Leave a FIXME because it's not clear that
19955 this initialization is needed. (Bug#8211)
19956 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19957 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19958 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19959 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19960 Remove unused macros.
19961
19962 * category.c (hash_get_category_set): Remove unused local var.
19963 (copy_category_table): Now static, since it's not used elsewhere.
19964 * character.c (string_count_byte8): Likewise.
19965
19966 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19967 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19968
19969 * chartab.c (copy_sub_char_table): Now static, since it's not used
19970 elsewhere.
19971 (sub_char_table_ref_and_range, char_table_ref_and_range):
19972 Rename locals to avoid shadowing.
19973 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19974
19975 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19976 (BIDI_BOB): Remove unused macro.
19977
19978 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19979 deduce are never used uninitialized.
19980 * term.c (encode_terminal_code): Likewise.
19981
19982 * term.c (encode_terminal_code): Now static. Remove unused local.
19983
19984 * tparam.h: New file.
19985 * term.c, tparam.h: Include it.
19986 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19987 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19988 Move these decls to tparam.h, and make them agree with what
19989 is actually in tparam.c. The previous trick of using incompatible
19990 decls in different modules does not conform to the C standard.
19991 All callers of tparam changed to use tparam's actual API.
19992 * tparam.c (tparam1, tparam, tgoto):
19993 Use const pointers where appropriate.
19994
19995 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19996 * cm.h (struct cm): Likewise.
19997 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19998 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19999 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20000 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20001 (turn_on_face, init_tty): Likewise.
20002 * termchar.h (struct tty_display_info): Likewise.
20003
20004 * term.c (term_mouse_position): Rename local to avoid shadowing.
20005
20006 * alloc.c (mark_ttys): Move decl from here ...
20007 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20008
20009 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
20010
20011 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20012
20013 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
20014
20015 * search.c (compile_pattern_1): Remove argument regp, unused since
20016 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20017 (compile_pattern): Don't pass it.
20018
20019 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
20020
20021 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20022 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20023 for ! HAVE_GTK3.
20024 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20025
20026 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20027
20028 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20029 gdk_window_get_screen, gdk_window_get_geometry,
20030 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20031 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20032 (xg_get_pixbuf_from_pixmap): New function.
20033 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20034 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20035 Call xg_get_pixbuf_from_pixmap instead of
20036 gdk_pixbuf_get_from_drawable.
20037 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20038 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20039 (xg_check_special_colors): Use GtkStyleContext and its functions
20040 for HAVE_GTK3.
20041 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20042 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20043 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20044 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20045 Call gtk_widget_get_preferred_size.
20046 (xg_frame_resized): gdk_window_get_geometry only takes 5
20047 parameters.
20048 (xg_win_to_widget, xg_event_is_for_menubar):
20049 Call gdk_x11_window_lookup_for_display.
20050 (xg_set_widget_bg): New function.
20051 (delete_cb): New function.
20052 (xg_create_frame_widgets): Connect delete-event to delete_cb.
20053 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
20054 (xg_set_background_color): Call xg_set_widget_bg.
20055 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20056 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20057 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20058 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20059 if ! HAVE_GTK3.
20060 (update_frame_tool_bar): Call gtk_widget_hide.
20061 (xg_initialize): Use GDK_KEY_g.
20062
20063 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20064 if ! HAVE_GTK3
20065 (x_session_initialize): Call gdk_x11_set_sm_client_id.
20066
20067 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20068 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20069 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20070
20071 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
20072
20073 * w32xfns.c (select_palette): Check success of RealizePalette against
20074 GDI_ERROR, not zero.
20075
20076 See ChangeLog.11 for earlier changes.
20077
20078 ;; Local Variables:
20079 ;; coding: utf-8
20080 ;; End:
20081
20082 Copyright (C) 2011-2012 Free Software Foundation, Inc.
20083
20084 This file is part of GNU Emacs.
20085
20086 GNU Emacs is free software: you can redistribute it and/or modify
20087 it under the terms of the GNU General Public License as published by
20088 the Free Software Foundation, either version 3 of the License, or
20089 (at your option) any later version.
20090
20091 GNU Emacs is distributed in the hope that it will be useful,
20092 but WITHOUT ANY WARRANTY; without even the implied warranty of
20093 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20094 GNU General Public License for more details.
20095
20096 You should have received a copy of the GNU General Public License
20097 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.