1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 16:21:07 -08:00
Commit graph

33732 commits

Author SHA1 Message Date
Paul Eggert
f0a8017501 Undo faccessat change. 2012-10-19 12:25:18 -07:00
Paul Eggert
e752e0b0a2 Use faccessat, not access, when checking file permissions.
* .bzrignore: Add lib/fcntl.h.
* configure.ac (euidaccess): Remove check; gnulib does this for us now.
(gl_FCNTL_O_FLAGS): Define a dummy version.
* lib/at-func.c, lib/euidaccess.c, lib/faccessat.c, lib/fcntl.in.h:
* lib/getgroups.c, lib/group-member.c, lib/root-uid.h:
* lib/xalloc-oversized.h, m4/euidaccess.m4, m4/faccessat.m4:
* m4/fcntl_h.m4, m4/getgroups.m4, m4/group-member.m4:
New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* admin/merge-gnulib (GNULIB_MODULES): Add faccessat.
(GNULIB_TOOL_FLAGS): Avoid at-internal, fchdir, malloc-posix,
openat-die, openat-h, save-cwd.  Do not avoid fcntl-h.
Omit gnulib's m4/fcntl-o.m4.
* nt/inc/ms-w32.h (AT_FDCWD, AT_EACCESS): New symbols.
(access): Remove.
(faccessat): New macro.
* src/Makefile.in (LIB_EACCESS): New macro.
(LIBES): Use it.
* src/callproc.c (init_callproc):
* src/charset.c (init_charset):
* src/fileio.c (check_existing, check_executable):
* src/lread.c (openp, load_path_check):
* src/process.c (allocate_pty):
* src/xrdb.c (file_p):
Use faccessat, not access or euidaccess.  Use symbolic names
instead of integers for the flags, as they're portable now.
* src/charset.c, src/xrdb.c: Include <fcntl.h>, for the new flags used.
* src/fileio.c (Ffile_readable_p):
Use faccessat, not stat + open + close.
(file_directory_p): New function, which uses 'stat' on most places
but 'access' (for efficiency) if WINDOWSNT.
* src/fileio.c (Ffile_directory_p, Fset_file_times):
* src/xrdb.c (file_p): Use file_directory_p.
* src/lisp.h (file_directory_p): New decl.
* src/lread.c (openp): When opening a file, use fstat rather than
stat, as that avoids a permissions race.  When not opening a file,
use file_directory_p rather than stat.
* src/process.c, src/sysdep.c, src/term.c: All uses of '#ifdef O_NONBLOCK'
changed to '#if O_NONBLOCK', to accommodate gnulib O_* tyle.
* src/w32.c (sys_faccessat): Rename from sys_access and switch to
faccessat's API.  All uses changed.

Fixes: debbugs:12632
2012-10-19 09:52:02 -07:00
Kenichi Handa
6ec83f926d src/ChangeLog: Fix changers name. 2012-10-19 22:02:52 +09:00
Kenichi Handa
a0d7415fb6 font.c (Ffont_at): Fix previous change. 2012-10-19 21:59:42 +09:00
Eli Zaretskii
c052c554b4 Increase the value of BASE_PURESIZE to avoid pure space overflow.
src/puresize.h (BASE_PURESIZE): Bump the base value to 1700000.  See
 http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
 for the reasons.
2012-10-19 12:05:09 +02:00
Eli Zaretskii
d282492862 Decrease NSTATICS to 0x800. 2012-10-19 08:43:12 +02:00
Stefan Monnier
f60d391f5f * src/fns.c (Fnreverse): Include the problem element when signalling an error.
Fixes: debbugs:12677
2012-10-18 20:54:35 -04:00
Jan Djärv
1a9327d5cd * nsterm.m (ns_select): Check writefds before call to
FD_ISSET.

Fixes: debbugs:12668
2012-10-18 20:54:37 +02:00
Eli Zaretskii
afb8aa2482 Fix wording of error message in staticpro. 2012-10-18 20:21:55 +02:00
Daniel Colascione
14145a1e84 Increase NSTATICS; tell the user when we run out of static slots. 2012-10-18 09:00:08 -08:00
Martin Rudalics
1f76f6f579 In window.c fix two flaws reported by Dmitry Antipov.
* window.c (Ftemp_output_buffer_show): Remove.
(Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
(syms_of_window): Remove defsubr for Stemp_output_buffer_show.
2012-10-18 10:27:49 +02:00
Eli Zaretskii
a68089e4a4 Fix warnings when compiling on MS-Windows with -std=gnu99.
src/makefile.w32-in ($(BLD)/w32.$(O)): 
 ($(BLD)/vm-limit.$(O)): 
 ($(BLD)/term.$(O)): 
 ($(BLD)/unexw32.$(O)): 
 ($(BLD)/fileio.$(O)): 
 ($(BLD)/dispnew.$(O)): Update dependencies.
 src/w32term.h (w32_initialize_display_info, initialize_w32_display):
 Add prototypes.
 src/w32proc.c: Include ctype.h.
 src/w32.h (init_environment, check_windows_init_file)
 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
 (sys_link): Add prototypes.
 src/w32.c: Include w32select.h.
 (sys_access, e_malloc, sys_select): Add prototypes.
 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
 src/vm-limit.c [WINDOWSNT]: Include w32heap.h.
 src/unexw32.c: Include lisp.h and w32.h.
 src/term.c [WINDOWSNT]: Include w32term.h.
 src/process.c [WINDOWSNT]: Add prototype of sys_select.
 src/fileio.c [WINDOWSNT]: Include w32.h.
 src/dispnew.c [WINDOWSNT]: Include w32.h.

 nt/inc/pwd.h (getuid, geteuid): Add prototypes.
 nt/inc/ms-w32.h (sys_wait, _getpid, gmtgime_r, localtime_r)
 (signal_handler, sys_signal, sigemptyset, sigfillset, sigprocmask)
 (pthread_sigmask, sigismember, setpgrp, sigaction, alarm)
 (sys_kill, getpagesize): Add prototypes for emulated functions.
 nt/inc/grp.h (getgid, getegid): Add prototypes.
 nt/gmake.defs (DEBUG_CFLAGS) [NOOPT]: Add -std=gnu99.
 nt/configure.bat (chkapiN): Avoid compiler warning in junk.c when
 compiling with -std=gnu99.
 nt/config.nt (CHECK_LISP_OBJECT_TYPE): Don't undef, so that it
 could be used via --cflags switch to configure.bat.
2012-10-17 21:02:44 +02:00
Eli Zaretskii
fcf148759e Fix bug #12661 with w32 and cygw32 builds under --enable-check-lisp-object-type.
src/cygw32.c (Fcygwin_convert_path_to_windows)
 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
 Lisp_Object values.
 src/w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
 to Lisp_Object.
2012-10-17 17:37:55 +02:00
Kenichi Handa
596846525b merge trunk 2012-10-17 22:33:48 +09:00
Kenichi Handa
fe0b1ec409 xdisp.c (reseat_1): Make the information stored in it->cmp_it invalidate. 2012-10-17 22:30:56 +09:00
Juanma Barranquero
1f9f395d80 Fix ChangeLog typos. 2012-10-17 13:24:34 +02:00
Dmitry Antipov
d556ebf9b8 * buffer.c (Fkill_buffer): When unchaining the marker,
reset it's buffer pointer to NULL (Bug#12652).
2012-10-17 09:22:23 +04:00
Dmitry Antipov
f0863a5468 Do not verify indirection counters of killed buffers (Bug#12579).
* buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
* buffer.c (compact_buffer, set_buffer_internal_1): Use it.
2012-10-17 08:58:15 +04:00
Dmitry Antipov
12fbe7552c * alloc.c (Fmake_byte_code): Fix typo in comment.
* print.c (print_interval): Define as static to match prototype.
* indent.c (disptab_matches_widthtab, recompute_width_table):
Convert to eassert.
2012-10-16 11:56:44 +04:00
Dmitry Antipov
61655b89f4 * editfns.c (get_system_name): Remove.
* lisp.h (get_system_name): Remove prototype.
* xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
(get_environ_db): Use Vsystem_name.  Avoid call to strlen.
2012-10-16 06:22:25 +04:00
Stefan Monnier
8599b23a90 * lisp/erc/erc.el (erc-log): Make it into a defsubst.
(erc-with-server-buffer, define-erc-module, erc-with-buffer)
(erc-with-all-buffers-of-server): Use `declare'.
* lisp/erc/erc-backend.el (erc-log): Adjust autoload accordingly.
2012-10-15 12:49:57 -04:00
Daniel Colascione
9520f2f20c Add comment for undef of "interface" 2012-10-15 02:10:17 -08:00
Martin Rudalics
dca778d53a Fix Fwindow_end's handling of cached position (Bug#12600).
* window.c (Fwindow_end): Rewrite check whether cached position
can be used (Bug#12600).
(resize_frame_windows, grow_mini_window, shrink_mini_window):
Set windows_or_buffers_changed.
2012-10-15 11:03:56 +02:00
Daniel Colascione
3e0341b0a4 Fix cygw32 build break with dbus compilation 2012-10-14 17:38:07 -08:00
Daniel Colascione
33d4113cf5 * image.c (init_tiff_functions, init_imagemagick_functions)
(init_svg_functions): Fix cygw32 build break by using these
functions only when WINDOWSNT _and_ HAVE_NTGUI.
2012-10-14 15:25:37 -08:00
Jan Djärv
a36fb15e08 * nsterm.m (ns_select): Count fd:s in writefs also.
Fixes: debbugs:12422
2012-10-14 20:28:48 +02:00
Glenn Morris
8336c6b3c5 ChangeLog fix 2012-10-13 17:17:07 -07:00
Jan Djärv
537f336d62 * gtkutil.c (xg_set_widget_bg): Divide by 65535.
Fixes: debbugs:12612
2012-10-13 23:52:09 +02:00
Kenichi Handa
2e58893d16 merge trunk 2012-10-13 22:11:40 +09:00
Kenichi Handa
0ba06a77fd coding.c (detect_coding): Set coding->id before calling this->detector. 2012-10-13 21:58:52 +09:00
Andreas Schwab
ce2fe65ae1 * fileio.c: Formatting fixes. 2012-10-13 10:55:26 +02:00
Paul Eggert
d6453ce497 Fix some stat-related races.
* fileio.c (Fwrite_region): Avoid race condition if a file is
removed or renamed by some other process immediately after Emacs
writes it but before Emacs stats it.  Do not assume that stat (or
fstat) succeeds.
* image.c (slurp_file): Resolve the file name with fopen + fstat
rather than stat + fopen.
(pbm_read_file) [0]: Remove unused code with stat race.
* process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
Remove ineffective code with stat race.
2012-10-12 17:52:01 -07:00
Stefan Monnier
06485aa821 * src/doc.c (get_doc_string): Don't signal an error if the file is missing.
* lisp/help-fns.el (describe-variable, describe-function-1):
* lisp/help-mode.el (help-make-xrefs): Remove error handler, made unneeded.
2012-10-12 16:11:50 -04:00
Jan Djärv
167e3640f1 * nsterm.m (hold_event_q): New static variable.
(EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
! q_event_ptr.
(hold_event): New function.
(ns_read_socket): If hold_event_q have events, store them and
return.
(setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
is zero (Bug#12384).
2012-10-12 19:50:39 +02:00
Juanma Barranquero
c40239dff9 src/makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies. 2012-10-12 18:32:40 +02:00
Eli Zaretskii
99b1553e07 Fix typo in last change. 2012-10-12 17:30:06 +02:00
Eli Zaretskii
2a9f109915 Update dependencies in src/makefile.w32-in.
src/makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
2012-10-12 17:22:50 +02:00
Eli Zaretskii
bb385a92ec Fix bug #12587 with slow startup on MS-Windows with Netlogon service.
src/fileio.c (check_existing): New function.
 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
 instead of calling 'stat', when what's needed is to check whether
 a file exists.  This avoids expensive system calls on MS-Windows.
 src/w32.c (init_environment): Call 'check_existing' instead of 'stat'.
 src/lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
 determine whether a file exists and is not a directory.
 src/lisp.h (check_existing): Add prototype.
2012-10-12 17:19:54 +02:00
Eli Zaretskii
605a3df681 Add comments about how non-GUI input works on MS-Windows. 2012-10-12 16:14:35 +02:00
Jan Djärv
2b9c2e6850 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct. 2012-10-12 12:01:05 +02:00
Glenn Morris
81749a2374 * src/buffer.c (Fset_buffer): Doc fix. (Bug#12624) 2012-10-11 21:47:40 -04:00
Stefan Monnier
389a94a53d * src/buffer.c (Fkill_buffer): Null out the overlay list(s) as well. 2012-10-11 16:32:11 -04:00
Stefan Monnier
5253a5fd75 Fix spurious "cl--defsubst-expand might not be defined at runtime"
* lisp/emacs-lisp/bytecomp.el (byte-compile-eval): Adjust to long-ago
changes to the format of load-history.
* src/eval.c (Fautoload): Remember previous autoload status in load-history.
2012-10-11 16:08:38 -04:00
Paul Eggert
7cded46f2b lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
* lread.c (load_each_byte, new_backquote_flag, readchar)
(read_filtered_event, lisp_file_lexically_bound_p)
(safe_to_load_version, Fload, complete_filename_p, openp)
(build_load_history, readevalloop, read_escape, read1)
(string_to_number, read_vector, read_list):
* macros.c (Fstart_kbd_macro):
* marker.c (CONSIDER):
* menu.c (parse_single_submenu, digest_single_submenu)
(find_and_return_menu_selection, Fx_popup_menu):
* minibuf.c (read_minibuf_noninteractive, read_minibuf)
(Ftry_completion):
* nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
(ns_menu_show):
* xmenu.c (set_frame_menubar, create_and_show_popup_menu)
(xmenu_show, xdialog_show):
Use bool for booleans.
* lread.c (safe_to_load_version): Rename from safe_to_load_p,
as it's not a predicate.  All uses changed.  Omit unnecessary
buffer termination.
2012-10-11 09:23:37 -07:00
Dmitry Antipov
549c3414d9 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
(save_excursion_restore): Do not restore mark if it was not saved.
2012-10-11 17:23:12 +04:00
Paul Eggert
fd2f90cf5c * marker.c (cached_modiff): EMACS_INT, not int. 2012-10-10 21:33:12 -07:00
Paul Eggert
c1af190b72 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
instead of having a wrong decl.
2012-10-10 17:32:25 -07:00
Paul Eggert
e85aafe7bd * nsmenu.m (waiting_for_input): Remove wrong decl. 2012-10-10 17:26:58 -07:00
Paul Eggert
9fa1de305a keyboard.c, keymap.c: Use bool for booleans.
* dispnew.c (sit_for): Distinguish between 3-way display_option
and boolean do_display.
* keyboard.c (single_kboard, this_command_key_count_reset)
(waiting_for_input, echoing, immediate_quit, input_pending)
(interrupt_input, interrupts_deferred, pop_kboard)
(temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
(command_loop_1, adjust_point_for_property)
(safe_run_hooks_error, input_polling_used, read_char):
(help_char_p, readable_events, kbd_buffer_events_waiting)
(kbd_buffer_get_event, timer_check_2, make_lispy_event)
(lucid_event_type_list_p, get_input_pending):
(gobble_input, menu_separator_name_p, menu_bar_item)
(parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
(read_char_minibuf_menu_prompt, access_keymap_keyremap)
(keyremap_step, test_undefined, read_key_sequence)
(detect_input_pending, detect_input_pending_ignore_squeezables)
(detect_input_pending_run_timers, requeued_events_pending_p)
(quit_throw_to_read_char, Fset_input_interrupt_mode):
* keymap.c (get_keymap, keymap_parent, keymap_memberp)
(access_keymap_1, access_keymap, map_keymap, get_keyelt)
(Fdefine_key, Flookup_key, struct accessible_keymaps_data)
(accessible_keymaps_1, Fkey_description, push_key_description):
(shadow_lookup, struct where_is_internal_data)
(where_is_internal, Fwhere_is_internal, where_is_internal_1)
(Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
(describe_map, describe_vector):
* menu.c (single_menu_item):
* nsmenu.m (ns_update_menubar):
* process.c (wait_reading_process_output):
* search.c (scan_buffer, scan_newline):
Use bool for boolean.
* keyboard.c (timers_run, swallow_events)
(detect_input_pending_run_timers):
* process.c (wait_reading_process_output):
Use unsigned for counter where wraparound-on-overflow is desired,
since unsigned is guaranteed to have that behavior and signed is not.
(read_char): Use ptrdiff_t for string length.
(get_input_pending): Remove first argument, since it was always
the same pointer-to-int (now pointer-to-boolean) &input_pending,
and behave as if it had that value.  Return new value of
input_pending.  All callers changed.
* keyboard.h (struct kboard): Use unsigned : 1 for boolean member
immediate_echo.  Use ptrdiff_t for echo_after_prompt, since it's
a string length.
* keymap.c (push_key_description): Omit last arg, which was always 1.
All callers changed.
2012-10-10 13:09:47 -07:00
Paul Eggert
e738ca5624 * regex.c (immediate_quit) [emacs]: Remove duplicate decl. 2012-10-10 12:53:26 -07:00