1. 17 Oct, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix warnings when compiling on MS-Windows with -std=gnu99. · a68089e4
      Eli Zaretskii authored
       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.
      a68089e4
  2. 13 Oct, 2012 2 commits
    • Andreas Schwab's avatar
      * fileio.c: Formatting fixes. · ce2fe65a
      Andreas Schwab authored
      ce2fe65a
    • Paul Eggert's avatar
      Fix some stat-related races. · d6453ce4
      Paul Eggert authored
      * 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.
      d6453ce4
  3. 12 Oct, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix bug #12587 with slow startup on MS-Windows with Netlogon service. · bb385a92
      Eli Zaretskii authored
       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.
      bb385a92
  4. 05 Oct, 2012 1 commit
    • Eli Zaretskii's avatar
      Support setting file times of directories on MS-Windows. · 0d9f584b
      Eli Zaretskii authored
       src/w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
       that time stamps of directories could also be changed.  Don't
       request the too broad GENERIC_WRITE, only the more restrictive
       FILE_WRITE_ATTRIBUTES access rights.
       src/fileio.c (Fset_file_times): Special-case ignoring errors for
       directories only on MSDOS, not on MS-Windows.
      0d9f584b
  5. 30 Sep, 2012 1 commit
    • Jan Djärv's avatar
      Support file name dialog on NS. · d7e642cc
      Jan Djärv authored
      * etc/NEWS: Mention that the file dialog is used on NS.
      
      * lisp/term/ns-win.el (x-file-dialog): New function.
      
      * src/fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
      
      * src/nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
      
      * src/nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
      Initialize panel name field if OSX >= 10.6.
      
      * src/w32fns.c (Fx_file_dialog): Update comment.
      
      * src/xfns.c (Fx_file_dialog): Update comment.
      d7e642cc
  6. 23 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Simplify and avoid signal-handling races. · 4d7e6e51
      Paul Eggert authored
      * nt/inc/ms-w32.h (emacs_raise): New macro.
      * src/alloc.c (die):
      * src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
      Avoid recursive loop if there's a fatal error in the function itself.
      * src/atimer.c (pending_atimers):
      * src/blockinput.h: Don't include "atimer.h"; no longer needed.
      (interrupt_input_pending): Remove.  All uses removed.
      pending_signals now counts both atimers and ordinary interrupts.
      This is less racy than having three separate pending-signal flags.
      (block_input, unblock_input, totally_unblock_input, unblock_input_to)
      (input_blocked_p):
      Rename from their upper-case counterparts BLOCK_INPUT,
      UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
      INPUT_BLOCKED_P, and turn into functions.  All uses changed.
      This makes it easier to access volatile variables more accurately.
      (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
      (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
      that's more reliable if the code is buggy and sets
      interrupt_input_blocked to a negative value.  All uses changed.
      * src/atimer.c (deliver_alarm_signal):
      Remove.  No need to deliver this to the parent; any thread can
      handle this signal now.  All uses replaced by underlying handler.
      * src/atimer.c (turn_on_atimers):
      * src/dispnew.c (handle_window_change_signal):
      * src/emacs.c (handle_danger_signal):
      * src/keyboard.c (kbd_buffer_get_event):
      Don't reestablish signal handler; not needed with sigaction.
      * src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
      (UNBLOCK_INPUT_TO):
      Rework to avoid unnecessary accesses to volatile variables.
      (UNBLOCK_INPUT_TO): Now a function.
      (totally_unblock_input, unblock_input): New decls.
      * src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
      (init_data): Remove.  Necessary stuff now done in init_signal.
      * src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
      * src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
      (fatal_error_code): Remove; no longer needed.
      (terminate_due_to_signal): Rename from fatal_error_backtrace, since
      it doesn't always backtrace.  All uses changed.  No need to reset
      signal to default, since sigaction and/or die does that for us now.
      Use emacs_raise (FOO), not kill (getpid (), FOO).
      (main): Check more-accurately whether we're dumping.
      Move fatal-error setup to sysdep.c
      * src/floatfns.c: Do not include "syssignal.h"; no longer needed.
      * src/gtkutil.c (xg_get_file_name, xg_get_font):
      Remove no-longer-needed signal-mask manipulation.
      * src/keyboard.c, src/process.c (POLL_FOR_INPUT):
      Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
      * src/keyboard.c (read_avail_input): Remove.
      All uses replaced by gobble_input.
      (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
      (kbd_buffer_store_event_hold, gobble_input):
      (record_asynch_buffer_change) [USABLE_SIGIO]:
      (store_user_signal_events):
      No need to mess with signal mask.
      (gobble_input): If blocking input and there are terminals, simply
      set pending_signals to 1 and return.  All hooks changed to not
      worry about whether input is blocked.
      (process_pending_signals): Clear pending_signals before processing
      them, in case a signal comes in while we're processing.
      By convention callers now test pending_signals before calling us.
      (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
      New functions, to support changes to blockinput.h.
      (handle_input_available_signal): Now extern.
      (reinvoke_input_signal): Remove.  All uses replaced by
      handle_async_input.
      (quit_count): Now volatile, since a signal handler uses it.
      (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.  All
      callers changed.  Block SIGINT only if not already blocked.
      Clear sigmask reliably, even if Fsignal returns, which it can.
      Omit unnecessary accesses to volatile var.
      (quit_throw_to_read_char): No need to restore sigmask.
      * src/keyboard.c (gobble_input, handle_user_signal):
      * src/process.c (wait_reading_process_output):
      Call signal-handling code rather than killing ourselves.
      * src/lisp.h: Include <float.h>, for...
      (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
      (pending_signals): Now volatile.
      (syms_of_data): Now const if IEEE floating point.
      (handle_input_available_signal) [USABLE_SIGIO]:
      (terminate_due_to_signal, record_child_status_change): New decls.
      * src/process.c (create_process): Avoid disaster if memory is exhausted
      while we're processing a vfork, by tightening the critical section
      around the vfork.
      (send_process_frame, process_sent_to, handle_pipe_signal)
      (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
      ignores SIGPIPE.
      (send_process): No need for setjmp/longjmp any more, since the
      SIGPIPE stuff is now gone.  Instead, report an error if errno
      is EPIPE.
      (record_child_status_change): Now extern.  PID and W are now args.
      Return void, not bool.  All callers changed.
      * src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
      Remove.  All uses removed.  This bug should be fixed now in a
      different way.
      (wait_for_termination_1): Use waitpid rather than sigsuspend,
      and record the child status change directly.  This avoids the
      need to futz with the signal mask.
      (process_fatal_action): Move here from emacs.c.
      (emacs_sigaction_flags): New function, containing
      much of what used to be in emacs_sigaction_init.
      (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
      caught by emacs, to make races less likely.
      (deliver_process_signal): Rename from handle_on_main_thread.
      All uses changed.
      (BACKTRACE_LIMIT_MAX): Now at top level.
      (thread_backtrace_buffer, threadback_backtrace_pointers):
      New static vars.
      (deliver_thread_signal, deliver_fatal_thread_signal):
      New functions, for more-accurate delivery of thread-specific signals.
      (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
      (deliver_arith_signal): Handle in this thread, not
      in the main thread, since it's triggered by this thread.
      (maybe_fatal_sig): New function.
      (init_signals): New arg DUMPING so that we can be more accurate
      about whether we're dumping.  Caller changed.
      Treat thread-specific signals differently from process-general signals.
      Block all signals while handling fatal error; that's safer.
      xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
      on IEEE hosts.
      When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
      Ignore SIGPIPE unless batch.
      (emacs_backtrace): Output backtrace for the appropriate thread,
      which is not necessarily the main thread.
      * src/syssignal.h: Include <stdbool.h>.
      (emacs_raise): New macro.
      * src/xterm.c (x_connection_signal): Remove; no longer needed
      now that we use sigaction.
      (x_connection_closed): No need to mess with sigmask now.
      (x_initialize): No need to reset SIGPIPE handler here, since
      init_signals does this for us now.
      
      Fixes: debbugs:12471
      4d7e6e51
  7. 15 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Port better to POSIX hosts lacking _setjmp. · 0328b6de
      Paul Eggert authored
      * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols.
      (_setjmp, _longjmp): Remove.
      * src/lisp.h: Include <setjmp.h> here, since we use its symbols here.
      All instances of '#include <setjmp.h>' removed, if the
      only reason for the instance was because "lisp.h" was included.
      (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
      Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
      and _longjmp with the new symbols.  Emacs already uses _setjmp if
      available, so this change affects only POSIXish hosts that have
      sigsetjmp but not _setjmp, such as some versions of Solaris and
      Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
      * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
      (png_load_body) [HAVE_PNG]:
      (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
      (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
      Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
      since PNG requires jmp_buf.  This is the only exception to the
      general rule that we now use sys_setjmp and sys_longjmp.
      This exception is OK since this code does not change the signal
      mask or longjmp out of a signal handler.
      
      Fixes: debbugs:12446
      0328b6de
  8. 14 Sep, 2012 1 commit
    • Andreas Schwab's avatar
      Fixes: debbugs:12444 · c6ba4138
      Andreas Schwab authored
      * fileio.c (Ffile_selinux_context): Only call freecon when
      lgetfilecon succeeded.
      (Fset_file_selinux_context): Likewise.
      c6ba4138
  9. 05 Sep, 2012 1 commit
    • Paul Eggert's avatar
      * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean. · f75d7a91
      Paul Eggert authored
      * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
      (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
      (file_name_absolute_p, Fsubstitute_in_file_name):
      (check_executable, check_writable, Ffile_accessible_directory_p)
      (Fset_file_selinux_context, Fdefault_file_modes)
      (Finsert_file_contents, choose_write_coding_system)
      (Fwrite_region, build_annotations, a_write, e_write)
      (Fdo_auto_save):
      * filelock.c (boot_time_initialized, get_boot_time)
      (get_boot_time_1, lock_file_1, within_one_second):
      * floatfns.c (in_float):
      * fns.c (concat, internal_equal, Frequire, base64_encode_1)
      (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
      (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
      * lisp.h (struct Lisp_Hash_Table.cmpfn):
      * window.c (compare_window_configurations):
      Use bool for booleans.
      * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
      (Fdefault_file_modes): Now mode_t, not int, for modes.
      (Fdo_auto_save): Set a boolean to 1 rather than using ++.
      (internal_delete_file): Now returns void, not a (boolean) int,
      since nobody was looking at the return value.
      * lisp.h, window.h: Adjust to above API changes.
      f75d7a91
  10. 04 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Simplify redefinition of 'abort' (Bug#12316). · 1088b922
      Paul Eggert authored
      Do not try to redefine the 'abort' function.  Instead, redo
      the code so that it calls 'emacs_abort' rather than 'abort'.
      This removes the need for the NO_ABORT configure-time macro
      and makes it easier to change the abort code to do a backtrace.
      * configure.ac (NO_ABRT): Remove.
      * admin/CPP-DEFINES (NO_ABORT): Remove.
      * nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove.
      * src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
      * src/emacs.c (abort) [!DOS_NT && !NO_ABORT]:
      Remove; sysdep.c's emacs_abort now takes its place.
      * src/lisp.h (emacs_abort): New decl.  All calls from Emacs code to
      'abort' changed to use 'emacs_abort'.
      * src/msdos.c (dos_abort) [defined abort]: Remove; not used.
      (abort) [!defined abort]: Rename to ...
      (emacs_abort): ... new name.
      * src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
      the place of the old 'abort' in emacs.c.
      * src/w32.c, src/w32fns.c (abort): Do not #undef.
      * src/w32.c (emacs_abort): Rename from w32_abort.
      1088b922
  11. 28 Aug, 2012 2 commits
    • Dmitry Antipov's avatar
      Always use set_buffer_if_live to restore original buffer at unwind. · 66322887
      Dmitry Antipov authored
      * buffer.h (record_unwind_current_buffer): New function.
      * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
      * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
      * undo.c, window.c: Adjust users.
      * buffer.c (set_buffer_if_live): Fix comment.
      66322887
    • Dmitry Antipov's avatar
      Fix usage of set_buffer_internal. · a3d794a1
      Dmitry Antipov authored
      * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
      * buffer.c (set_buffer_if_live): Use set_buffer_internal.
      * coding.c (decode_coding): Omit redundant test.
      * fileio.c (decide_coding_unwind): Likewise.
      * fns.c (secure_hash): Likewise.
      * insdel.c (modify_region): Likewise.
      * keyboard.c (command_loop_1): Likewise.
      * print.c (PRINTFINISH): Likewise.
      * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
      a3d794a1
  12. 27 Aug, 2012 1 commit
    • Paul Eggert's avatar
      * cmds.c, coding.c: Use bool for booleans. · f10fe38f
      Paul Eggert authored
      * cmds.c (move_point, Fself_insert_command):
      * coding.h (struct composition status, struct coding_system):
      * coding.c (detect_coding_utf_8, encode_coding_utf_8)
      (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
      (emacs_mule_char, decode_coding_emacs_mule)
      (encode_coding_emacs_mule, detect_coding_iso_2022)
      (decode_coding_iso_2022, encode_invocation_designation)
      (encode_designation_at_bol, encode_coding_iso_2022)
      (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
      (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
      (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
      (encode_coding_raw_text, detect_coding_charset)
      (decode_coding_charset, encode_coding_charset, detect_eol)
      (detect_coding, get_translation_table, produce_chars)
      (consume_chars, reused_workbuf_in_use)
      (make_conversion_work_buffer, code_conversion_save)
      (decode_coding_object, encode_coding_object)
      (detect_coding_system, char_encodable_p)
      (Funencodable_char_position, code_convert_region)
      (code_convert_string, code_convert_string_norecord)
      (Fset_coding_system_priority):
      * fileio.c (Finsert_file_contents):
      Use bool for booleans.
      * coding.h, lisp.h: Reflect above API changes.
      * coding.c: Remove unnecessary static function decls.
      (detect_coding): Use unsigned, not signed, to copy an unsigned field.
      (decode_coding, encode_coding, decode_coding_gap): Return 'void',
      not a boolean 'int', since callers never look at the return value.
      (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
      * coding.h (decoding_buffer_size, encoding_buffer_size)
      (emacs_mule_string_char): Remove unused extern decls.
      (struct iso_2022_spec, struct coding_system):
      Use 'unsigned int : 1' for boolean fields, since there's more than one.
      (struct emacs_mule_spec): Remove unused field 'full_support'.
      All initializations removed.
      * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
      f10fe38f
  13. 21 Aug, 2012 1 commit
    • Paul Eggert's avatar
      * alloc.c: Use bool for booleans. · fce31d69
      Paul Eggert authored
      (gc_in_progress, abort_on_gc)
      (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
      (dont_register_blocks) [GC_MALLOC_CHECK]:
      (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
      (check_string_bytes, make_specified_string, memory_full)
      (live_string_p, live_cons_p, live_symbol_p, live_float_p)
      (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
      (mark_stack, valid_pointer_p, make_pure_string)
      (Fgarbage_collect, survives_gc_p, gc_sweep):
      Use bool for booleans, instead of int.
      (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
      Remove unused local.
      * alloc.c (PURE_POINTER_P):
      * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
      * editfns.c (Fformat):
      * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
      (Fdo_auto_save):
      * fns.c (sweep_weak_table):
      * lisp.h (suppress_checking, push_message, survives_gc_p)
      (make_pure_string, gc_in_progress, abort_on_gc):
      * lread.c (readchar, read1):
      * print.c (Fprin1_to_string):
      * xdisp.c (push_message):
      Use bool for booleans affected directly or indirectly by
      alloc.c's changes.
      fce31d69
  14. 18 Aug, 2012 1 commit
    • Paul Eggert's avatar
      * buffer.h (BSET): Remove. · 39eb03f1
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      (bset_bidi_paragraph_direction, bset_case_canon_table)
      (bset_case_eqv_table, bset_directory, bset_display_count)
      (bset_display_time, bset_downcase_table)
      (bset_enable_multibyte_characters, bset_filename, bset_keymap)
      (bset_last_selected_window, bset_local_var_alist)
      (bset_mark_active, bset_point_before_scroll, bset_read_only)
      (bset_truncate_lines, bset_undo_list, bset_upcase_table)
      (bset_width_table):
      * buffer.c (bset_abbrev_mode, bset_abbrev_table)
      (bset_auto_fill_function, bset_auto_save_file_format)
      (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
      (bset_bidi_display_reordering, bset_buffer_file_coding_system)
      (bset_cache_long_line_scans, bset_case_fold_search)
      (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
      (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
      (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
      (bset_fringe_indicator_alist, bset_fringes_outside_margins)
      (bset_header_line_format, bset_indicate_buffer_boundaries)
      (bset_indicate_empty_lines, bset_invisibility_spec)
      (bset_left_fringe_width, bset_major_mode, bset_mark)
      (bset_minor_modes, bset_mode_line_format, bset_mode_name)
      (bset_name, bset_overwrite_mode, bset_pt_marker)
      (bset_right_fringe_width, bset_save_length)
      (bset_scroll_bar_width, bset_scroll_down_aggressively)
      (bset_scroll_up_aggressively, bset_selective_display)
      (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
      (bset_word_wrap, bset_zv_marker):
      * category.c (bset_category_table):
      * syntax.c (bset_syntax_table):
      New setter functions.
      
      Fixes: debbugs:12215
      39eb03f1
  15. 17 Aug, 2012 1 commit
    • Paul Eggert's avatar
      A few more naming-convention fixes for getters and setters. · 0c94c8d6
      Paul Eggert authored
      * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
      and rename from buffer_overlays_set_before.
      (set_buffer_overlays_after): Move here from buffer.h, and rename
      from buffer_overlays_set_after.
      * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
      All uses changed.
      (set_buffer_intervals): Rename from buffer_set_intervals.
      * intervals.c (set_interval_object): Move here from intervals.h,
      and rename from interval_set_object.
      (set_interval_left): Move here from intervals.h, and rename from
      interval_set_left.
      (set_interval_right): Move here from intervals.h, and rename from
      interval_set_right.
      (copy_interval_parent): Move here from intervals.h, and rename from
      interval_copy_parent.
      * intervals.h (set_interval_parent): Rename from interval_set_parent.
      (set_interval_plist): Rename from interval_set_plist.
      Return void, not Lisp_Object, since no caller uses the result.
      * lisp.h (string_intervals): Rename from string_get_intervals.
      (set_string_intervals): Rename from string_set_intervals.
      0c94c8d6
  16. 16 Aug, 2012 1 commit
    • Paul Eggert's avatar
      Use ASCII tests for character types. · 620f13b0
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add c-ctype.
      * lwlib/lwlib-Xaw.c, lwlib/lwlib.c, lwlib/xlwmenu.c:
      Don't include <ctype.h>; no longer needed.
      * lwlib/lwlib-Xaw.c (openFont):
      * lwlib/xlwmenu.c (openXftFont): Test just for ASCII digits.
      * src/category.c, src/dispnew.c, src/doprnt.c, src/editfns.c, src/syntax.c
      * src/term.c, src/xfns.c, src/xterm.c:
      Don't include <ctype.h>; was not needed.
      * src/charset.c, src/doc.c, src/fileio.c, src/font.c, src/frame.c:
      * src/gtkutil.c, src/image.c, src/sysdep.c, src/xfaces.c:
      Include <c-ctype.h> instead of <ctype.h>.
      * src/nsterm.m: Include <c-ctype.h>.
      * src/charset.c (read_hex):
      * src/doc.c (Fsnarf_documentation):
      * src/fileio.c (IS_DRIVE) [WINDOWSNT]:
      (DRIVE_LETTER) [DOS_NT]:
      (Ffile_name_directory, Fexpand_file_name)
      (Fsubstitute_in_file_name):
      * src/font.c (font_parse_xlfd, font_parse_fcname):
      * src/frame.c (x_set_font_backend):
      * src/gtkutil.c (xg_get_font):
      * src/image.c (xbm_scan, xpm_scan, pbm_scan_number):
      * src/nsimage.m (hexchar):
      * src/nsterm.m (ns_xlfd_to_fontname):
      * src/sysdep.c (system_process_attributes):
      * src/xfaces.c (hash_string_case_insensitive):
      Use C-locale tests instead of locale-specific tests for character
      types, since we want the ASCII interpretation here, not the
      interpretation suitable for whatever happens to be the current locale.
      620f13b0
  17. 14 Aug, 2012 1 commit
    • Dmitry Antipov's avatar
      Revert and cleanup some recent overlay changes. · fd318b54
      Dmitry Antipov authored
      * buffer.h (enum overlay_type): Remove.
      (buffer_get_overlays, buffer_set_overlays): Likewise.
      (buffer_set_overlays_before, buffer_set_overlays_after):
      New function.  Adjust users.
      (unchain_both): Add eassert.
      fd318b54
  18. 13 Aug, 2012 1 commit
  19. 08 Aug, 2012 3 commits
    • Dmitry Antipov's avatar
      Inline functions to examine and change buffer overlays. · 4cb3e6b3
      Dmitry Antipov authored
      * buffer.c (unchain_both): New function.
      * buffer.h (buffer_get_overlays, buffer_set_overlays):
      (buffer_has_overlays): New function.
      (enum overlay_type): New enum.
      * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
      * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
      4cb3e6b3
    • Dmitry Antipov's avatar
      Inline functions to examine and change buffer intervals. · 8707c1e5
      Dmitry Antipov authored
      * alloc.c (mark_interval_tree): Remove.
      (MARK_INTERVAL_TREE): Simplify.
      (UNMARK_BALANCE_INTERVALS): Remove.  Adjust users.
      * intervals.c (buffer_balance_intervals): New function.
      (graft_intervals_into_buffer): Adjust indentation.
      (set_intervals_multibyte): Simplify.
      * buffer.h (BUF_INTERVALS): Remove.
      (buffer_get_intervals, buffer_set_intervals): New function.
      * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
      * intervals.c, textprop.c: Adjust users.
      8707c1e5
    • Dmitry Antipov's avatar
      Cleanup intervals. · 77c7bcb1
      Dmitry Antipov authored
      * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
      (NULL_INTERVAL_P): Likewise.  Adjust users.
      (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P): Adjust
      comment.  Move under #if 0.
      * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
      * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
      77c7bcb1
  20. 07 Aug, 2012 1 commit
    • Dmitry Antipov's avatar
      Drop WGET and revert read access to Lisp_Objects slots of struct window. · d3d50620
      Dmitry Antipov authored
      * window.h (WGET): Remove.
      (struct window): Do not use INTERNAL_FIELD.
      * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
      * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
      * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
      * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
      * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
      Adjust users.
      d3d50620
  21. 06 Aug, 2012 1 commit
    • Dmitry Antipov's avatar
      Separate read and write access to Lisp_Object slots of struct window. · 077288cf
      Dmitry Antipov authored
      * window.h (WGET, WSET): New macros similar to AREF and ASET.
      * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
      * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
      * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
      * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
      * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
      Adjust users.
      077288cf
  22. 03 Aug, 2012 1 commit
    • Paul Eggert's avatar
      Remove unnecessary casts involving pointers. · 98c6f1e3
      Paul Eggert authored
      These casts are no longer needed now that we assume C89 or later,
      since they involve casting to or from void *.
      * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
      (make_pure_float, make_pure_vector):
      * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
      * macros.c (Fstart_kbd_macro):
      * menu.c (find_and_return_menu_selection):
      * minibuf.c (read_minibuf_noninteractive):
      * sysdep.c (closedir):
      * xdisp.c (x_produce_glyphs):
      * xfaces.c (compare_fonts_by_sort_order):
      * xfns.c (x_real_positions, select_visual):
      * xselect.c (x_stop_queuing_selection_requests)
      (x_get_window_property, x_get_window_property_as_lisp_data):
      * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
      Remove unnecessary pointer casts.
      * alloc.c (record_xmalloc): New function.
      * lisp.h (record_xmalloc): New decl.
      (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
      more like a function.  This is because the pointer cast is not
      needed.  All uses changed.
      * print.c (print_string, print_error_message): Avoid length recalc.
      98c6f1e3
  23. 01 Aug, 2012 1 commit
    • Dmitry Antipov's avatar
      Use INTERNAL_FIELD for windows. · 3a45383a
      Dmitry Antipov authored
      * src/window.h (WVAR): New macro.
      (struct window): Change Lisp_Object members to INTERNAL_FIELD.
      * src/alloc.c, src/buffer.c, src/composite.c, src/dispextern.h:
      * src/dispnew.c, src/editfns.c, src/fileio.c, src/font.c, src/fontset.c:
      * src/frame.c, src/frame.h, src/fringe.c, src/indent.c, src/insdel.c:
      * src/keyboard.c, src/keymap.c, src/lisp.h, src/minibuf.c, src/nsterm.m:
      * src/print.c, src/textprop.c, src/w32fns.c, src/w32menu.c, src/w32term.c:
      * src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xmenu.c:
      * src/xterm.c: Users changed.
      * admin/coccinelle/window.cocci: Semantic patch to replace direct
      access to Lisp_Object members of struct window to WVAR.
      3a45383a
  24. 20 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Simple wrapper for make_unibyte_string, adjust font_open_by_name. · d7ea76b4
      Dmitry Antipov authored
      * src/lisp.h (build_unibyte_string): New function.
      * src/dosfns.c, src/fileio.c, src/fns.c, src/ftfont.c, src/process.c:
      * src/sysdep.c, src/w32fns.c, src/xfns.c: Use it.
      * src/font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
      of type Lisp_Object to avoid redundant calls to make_unibyte_string.
      Adjust users accordingly.
      * src/font.h (font_open_by_name): Adjust prototype.
      * admin/coccinelle/unibyte_string.cocci: Semantic patch to convert from
      make_unibyte_string to build_unibyte_string where appropriate.
      d7ea76b4
  25. 14 Jul, 2012 1 commit
    • Eli Zaretskii's avatar
      Don't use FILE_SYSTEM_CASE in MS-DOS, or anywhere else. · fbf31a9c
      Eli Zaretskii authored
       src/s/msdos.h (FILE_SYSTEM_CASE): Don't define.
       src/fileio.c (FILE_SYSTEM_CASE): Don't define.
       (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
       Fixes problems on MS-DOS with Vtemp_file_name_pattern when
       call-process-region passes it through expand-file-name.
       src/dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
       admin/CPP-DEFINES: Remove FILE_SYSTEM_CASE.
      fbf31a9c
  26. 10 Jul, 2012 4 commits
    • Paul Eggert's avatar
      EMACS_TIME simplification (Bug#11875). · e9a9ae03
      Paul Eggert authored
      This replaces macros (which typically do not work in GDB)
      with functions, typedefs and enums, making the code easier to debug.
      The functional style also makes code easier to read and maintain.
      * lib-src/profile.c (TV2): Remove no-longer-needed static var.
      * src/systime.h: Include <sys/time.h> on all hosts, not just if
      WINDOWSNT, since 'struct timeval' is needed in general.
      (EMACS_TIME): Now a typedef, not a macro.
      (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
      not macros.
      (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
      (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
      (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
      (EMACS_TIME_LE): Now functions, not macros.
      (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
      (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
      which are not functions.  All uses rewritten to use:
      (make_emacs_time): New function.
      (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
      (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
      not functions.  All uses rewritten to use the following, respectively:
      (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
      (add_emacs_time, sub_emacs_time): New functions.
      * src/atimer.c: Don't include <sys/time.h>,	as "systime.h" does this.
      * src/fileio.c (Fcopy_file):
      * src/xterm.c (XTflash): Get the current time closer to when it's used.
      * src/makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
      e9a9ae03
    • Paul Eggert's avatar
      e99a530f
    • Dmitry Antipov's avatar
      Optimize pure C strings initialization. · 2a0213a6
      Dmitry Antipov authored
      * lisp.h (make_pure_string): Fix prototype.
      (build_pure_c_string): New function, defined as static inline.  This
      provides a better opportunity to optimize away calls to strlen when
      the function is called with compile-time constant argument.
      * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
      argument, adjust users accordingly.  Use build_pure_c_string where
      appropriate.
      * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
      * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
      * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
      2a0213a6
    • Dmitry Antipov's avatar
      Avoid calls to strlen in path processing functions. · c293e30c
      Dmitry Antipov authored
      * fileio.c (file_name_as_directory): Add comment.  Change to add
      srclen argument and return the length of result.  Adjust users
      accordingly.
      (directory_file_name): Fix comment.  Change to add srclen argument,
      swap 1nd and 2st arguments to obey the common convention.  Adjust
      users accordingly.
      * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
      c293e30c
  27. 07 Jul, 2012 1 commit
    • Paul Eggert's avatar
      Do not require float-time's arg to fit in time_t (Bug#11825). · 31571fd7
      Paul Eggert authored
      This works better on hosts where time_t is unsigned, and where
      float-time is applied to the (negative) difference between two times.
      * editfns.c (decode_time_components): Last arg is now double *,
      not int *, and means to store all the result as a double, without
      worrying about whether the seconds part fits in time_t.
      All callers changed.
      (lisp_time_argument): Remove last int * arg, as it's no longer needed.
      All callers changed.
      (Ffloat_time): Do not fail merely because the specified time falls
      outside of time_t range.
      31571fd7
  28. 05 Jul, 2012 2 commits
    • Paul Eggert's avatar
      More xmalloc and related cleanup. · 38182d90
      Paul Eggert authored
      * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
      * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
      * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
      * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
      * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
      * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
      * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
      * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
      * xterm.c:
      Omit needless casts involving void * pointers and allocation.
      Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
      as the former is more robust if P's type is changed.
      Prefer xzalloc to xmalloc + memset 0.
      Simplify malloc-or-realloc to realloc.
      Don't worry about xmalloc returning a null pointer.
      Prefer xstrdup to xmalloc + strcpy.
      * editfns.c (Fmessage_box): Grow message_text by at least 80 when
      growing it.
      * keyboard.c (apply_modifiers_uncached): Prefer local array to
      alloca of a constant.
      38182d90
    • Paul Eggert's avatar
  29. 04 Jul, 2012 2 commits
  30. 03 Jul, 2012 2 commits