1. 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
  2. 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
  3. 15 Sep, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix MS-Windows build broken by 2012-09-15T07:06:56Z!eggert@cs.ucla.edu,... · 7105c8cb
      Eli Zaretskii authored
      Fix MS-Windows build broken by 2012-09-15T07:06:56Z!eggert@cs.ucla.edu, completing fix for bug #12446.
      
       src/w32xfns.c:
       src/w32uniscribe.c:
       src/w32term.c:
       src/w32select.c:
       src/w32reg.c:
       src/w32proc.c:
       src/w32menu.c:
       src/w32inevt.c:
       src/w32heap.c:
       src/w32font.c:
       src/w32fns.c:
       src/w32console.c:
       src/w32.c:
       src/w16select.c: Remove inclusion of setjmp.h, as it is now included
       by lisp.h.  This completes removal of setjmp.h inclusion
       erroneously announced in the previous commit.
       src/lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
       more accurate.
       src/image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
       not defined as a macro.  The latter happens on MS-Windows.
      7105c8cb
  4. 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
  5. 01 Sep, 2012 1 commit
  6. 18 Aug, 2012 2 commits
    • 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
    • Paul Eggert's avatar
      * window.h (WSET): Remove. · e8c17b81
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
      (WINDOW_INLINE): New macro.
      (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
      (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
      (wset_total_lines, wset_vertical_scroll_bar)
      (wset_window_end_pos, wset_window_end_valid)
      (wset_window_end_vpos): New setter functions.
      * window.c (WINDOW_INLINE):
      Define to EXTERN_INLINE, so that the corresponding functions
      are compiled into code.
      (wset_combination_limit, wset_dedicated, wset_display_table)
      (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
      (wset_new_normal, wset_new_total, wset_next_buffers)
      (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
      (wset_prev_buffers, wset_right_fringe_width)
      (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
      (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
      (wset_window_parameters):
      * xdisp.c (wset_base_line_number, wset_base_line_pos)
      (wset_column_number_displayed, wset_region_showing):
      New setter functions.
      
      Fixes: debbugs:12215
      e8c17b81
  7. 17 Aug, 2012 2 commits
    • Paul Eggert's avatar
      * keyboard.h (KSET): Remove. · 15dbb4d6
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
      (KEYBOARD_INLINE): New macro.
      (kset_default_minibuffer_frame, kset_defining_kbd_macro)
      (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
      (kset_prefix_arg, kset_system_key_alist, kset_window_system):
      New setter functions.
      * keyboard.c (KEYBOARD_INLINE):
      Define to EXTERN_INLINE, so that the corresponding functions
      are compiled into code.
      (kset_echo_string, kset_kbd_queue)
      (kset_keyboard_translate_table, kset_last_prefix_arg)
      (kset_last_repeatable_command, kset_local_function_key_map)
      (kset_overriding_terminal_local_map, kset_real_last_command)
      (kset_system_key_syms): New setter functions.
      
      Fixes: debbugs:12215
      15dbb4d6
    • Paul Eggert's avatar
      * frame.h (FSET): Remove (Bug#12215). · f00af5b1
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
      (FRAME_INLINE): New macro.
      (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
      (fset_current_tool_bar_string, fset_desired_tool_bar_string)
      (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
      (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
      (fset_param_alist, fset_root_window, fset_scroll_bars)
      (fset_selected_window, fset_title, fset_tool_bar_items)
      (fset_tool_bar_position, fset_tool_bar_window): New functions.
      * frame.c (FRAME_INLINE):
      Define to EXTERN_INLINE, so that the corresponding functions
      are compiled into code.
      (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
      f00af5b1
  8. 14 Aug, 2012 1 commit
    • Martin Rudalics's avatar
      Don't call Fset_window_buffer from C code. · 08908aca
      Martin Rudalics authored
      * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
      (delete_frame, Fmake_frame_invisible, Ficonify_frame):
      * minibuf.c (choose_minibuf_frame, read_minibuf):
      * w32fns.c (x_create_tip_frame):
      * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
      Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
      08908aca
  9. 13 Aug, 2012 2 commits
  10. 10 Aug, 2012 3 commits
    • Dmitry Antipov's avatar
      Define Qnone once for all platforms. · 9fb0c957
      Dmitry Antipov authored
      * frame.c (Qnone): Define here.
      (syms_of_frame): DEFSYM it.
      * lisp.h (Qnone): New declaration.
      * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
      * xfns.c: Remove duplication.  Adjust users.
      9fb0c957
    • Eli Zaretskii's avatar
      Improve commit in 2012-08-10T06:54:37Z!eliz@gnu.org. · 9b855fd6
      Eli Zaretskii authored
       src/w32fns.c <w32_unicode_gui>: New static variable.
       (globals_of_w32fns): Initialize it according to os_subtype.
       (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
       testing os_subtype.
      9b855fd6
    • Eli Zaretskii's avatar
      Fix bug #10299 with Unicode characters sent on MS-Windows by MSKLC. · d30be705
      Eli Zaretskii authored
       src/w32fns.c (INIT_WINDOW_CLASS): New macro.
       (w32_init_class): Use it to initialize the Emacs class with either
       ANSI or Unicode API calls.
       (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
       later.
       (w32_wnd_proc): If the character code sent by WM_CHAR or
       WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
       original message.  Call DefWindowProcW on NT and later.
      d30be705
  11. 07 Aug, 2012 2 commits
    • 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
    • Dmitry Antipov's avatar
      Drop FGET and revert read access to Lisp_Objects slots of struct frame. · e69b0960
      Dmitry Antipov authored
      * frame.h (FGET): Remove.
      (struct frame): Do not use INTERNAL_FIELD.
      * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
      * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
      * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
      * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
      e69b0960
  12. 06 Aug, 2012 2 commits
    • 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
    • Dmitry Antipov's avatar
      Separate read and write access to Lisp_Object slots of struct frame. · edd74c35
      Dmitry Antipov authored
      * frame.h (FGET, FSET): New macros similar to AREF and ASET.
      * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
      * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
      * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
      * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
      edd74c35
  13. 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
  14. 31 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Generalize INTERNAL_FIELD between buffers, keyboards and frames. · e34f7f79
      Dmitry Antipov authored
      * src/lisp.h (INTERNAL_FIELD): New macro.
      * src/buffer.h (BUFFER_INTERNAL_FIELD): Removed.
      (BVAR): Change to use INTERNAL_FIELD.
      * src/keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
      (KVAR): Change to use INTERNAL_FIELD.
      * src/frame.h (FVAR): New macro.
      (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
      * src/alloc.c, src/buffer.c, src/data.c, src/dispnew.c, src/dosfns.c
      * src/eval.c, src/frame.c, src/fringe.c, src/gtkutil.c, src/minibuf.c
      * src/nsfns.m, src/nsterm.m, src/print.c, src/term.c, src/w32fns.c
      * src/w32menu.c, src/w32term.c, src/window.c, src/window.h, src/xdisp.c
      * src/xfaces.c, src/xfns.c, src/xmenu.c, src/xterm.c: Users changed.
      * admin/coccinelle/frame.cocci: Semantic patch to replace direct
      access to Lisp_Object members of struct frame to FVAR.
      e34f7f79
  15. 30 Jul, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix bug #12082 with input of Meta-non-ASCII-characters on MS-Windows. · 302fc036
      Eli Zaretskii authored
       src/w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
       w32_kbd_patch_key as the 2nd arg.
       src/w32term.c <w32_keyboard_codepage>: Renamed from
       keyboard_codepage and now external.  All users changed.
       src/w32term.h: Add declaration of w32_keyboard_codepage.
       src/w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
       the codepage to translate keys to Unicode.  If this argument is
       -1, use the value returned by GetConsoleCP.  All callers changed.
      302fc036
  16. 29 Jul, 2012 1 commit
    • Paul Eggert's avatar
      Don't use the abbreviation "win" to refer to Windows (Bug#10421). · b46a6a83
      Paul Eggert authored
      * lisp/org/ob-lilypond.el (ly-w32-ly-path): Rename from ly-win32-ly-path.
      (ly-w32-pdf-path): Rename from ly-win32-pdf-path.
      (ly-w32-midi-path): Rename from ly-win32-midi-path.
      (ly-determine-ly-path, ly-determine-pdf-path, ly-determine-midi-path):
      Check for "windows-nt", not "win32", in system-type.
      * src/regex.c (MAX_BUF_SIZE): Remove some incorrect and
      long-ago-commented-out code that talks about "WIN32".
      * src/w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
      All uses changed.
      b46a6a83
  17. 27 Jul, 2012 3 commits
    • Eli Zaretskii's avatar
      Fix failure to compile on Windows due to 2012-07-27T06:04:35Z!dmantipov@yandex.ru. · 3438fe21
      Eli Zaretskii authored
       src/lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
       enumeration constants, as PURE and HEAP are too general, and clash
       with other headers and sources, such as gmalloc.c and the
       MS-Windows system headers.  All users changed.
      3438fe21
    • Dmitry Antipov's avatar
      Fix recently-introduced typos in Windows port. · 073c88c2
      Dmitry Antipov authored
      Reported by Martin Rudalics <rudalics@gmx.at>.
      * w32.c (init_environment): Replace comma with semicolon.
      * w32fns.c (syms_of_w32fns): Likewise.
      073c88c2
    • Dmitry Antipov's avatar
      Utility function to make a list from specified amount of objects. · 694b6c97
      Dmitry Antipov authored
      * lisp.h (enum constype): New datatype.
      (listn): New prototype.
      * alloc.c (listn): New function.
      (Fmemory_use_count, syms_of_alloc): Use it.
      * buffer.c (syms_of_buffer): Likewise.
      * callint.c (syms_of_callint): Likewise.
      * charset.c (define_charset_internal): Likewise.
      * coding.c (syms_of_coding): Likewise.
      * keymap.c (syms_of_keymap): Likewise.
      * search.c (syms_of_search): Likewise.
      * syntax.c (syms_of_syntax): Likewise.
      * w32.c (init_environment): Likewise.
      * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
      * xdisp.c (syms_of_xdisp): Likewise.
      * xfns.c (syms_of_xfns): Likewise.
      694b6c97
  18. 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
  19. 11 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Avoid calls to strlen in font processing functions. · 984e7f30
      Dmitry Antipov authored
      * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
      (font_open_by_name): Changed to use length argument.  Adjust
      users accordingly.
      * font.h (font_open_by_name, font_parse_xlfd): Adjust prototypes.
      * xfont.c (xfont_decode_coding_xlfd): Changed to return ptrdiff_t.
      (xfont_list_pattern, xfont_match): Use length returned by
      xfont_decode_coding_xlfd.
      * xfns.c (x_default_font_parameter): Omit useless xstrdup.
      984e7f30
  20. 10 Jul, 2012 2 commits
    • Dmitry Antipov's avatar
      Use XCAR and XCDR instead of Fcar and Fcdr where possible. · 7d7bbefd
      Dmitry Antipov authored
      * admin/coccinelle/list_loop.cocci: Semantic patch to convert from Fcdr
      to XCDR and consistently use CONSP in the list iteration loops.
      * admin/coccinelle/vector_contents.cocci: Fix indentation.
      * src/callint.c, src/coding.c, src/doc.c, src/editfns.c, src/eval.c,
      * src/font.c, src/fontset.c, src/frame.c, src/gnutls.c, src/minibuf.c,
      * src/msdos.c, src/textprop.c, src/w32fns.c, src/w32menu.c, src/window.c,
      * src/xmenu.c: Changed to use XCAR and XCDR where argument type is known
      to be a Lisp_Cons.
      7d7bbefd
    • 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
  21. 06 Jul, 2012 2 commits
  22. 05 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Cleanup xmalloc. · 23f86fce
      Dmitry Antipov authored
      * admin/coccinelle/xzalloc.cocci: Semantic patch to convert
      calls to xmalloc with following memset to xzalloc.
      * src/lisp.h (xzalloc): New prototype.  Omit needless casts.
      * src/alloc.c (xzalloc): New function.  Omit needless casts.
      * src/charset.c: Omit needless casts.  Convert all calls to
      malloc with following memset to xzalloc.
      * src/dispnew.c: Likewise.
      * src/fringe.c: Likewise.
      * src/image.c: Likewise.
      * src/sound.c: Likewise.
      * src/term.c: Likewise.
      * src/w32fns.c: Likewise.
      * src/w32font.c: Likewise.
      * src/w32term.c: Likewise.
      * src/xfaces.c: Likewise.
      * src/xfns.c: Likewise.
      * src/xterm.c: Likewise.
      * src/atimer.c: Omit needless casts.
      * src/buffer.c: Likewise.
      * src/callproc.c: Likewise.
      * src/ccl.c: Likewise.
      * src/coding.c: Likewise.
      * src/composite.c: Likewise.
      * src/doc.c: Likewise.
      * src/doprnt.c: Likewise.
      * src/editfns.c: Likewise.
      * src/emacs.c: Likewise.
      * src/eval.c: Likewise.
      * src/filelock.c: Likewise.
      * src/fns.c: Likewise.
      * src/gtkutil.c: Likewise.
      * src/keyboard.c: Likewise.
      * src/lisp.h: Likewise.
      * src/lread.c: Likewise.
      * src/minibuf.c: Likewise.
      * src/msdos.c: Likewise.
      * src/print.c: Likewise.
      * src/process.c: Likewise.
      * src/region-cache.c: Likewise.
      * src/search.c: Likewise.
      * src/sysdep.c: Likewise.
      * src/termcap.c: Likewise.
      * src/terminal.c: Likewise.
      * src/tparam.c: Likewise.
      * src/w16select.c: Likewise.
      * src/w32.c: Likewise.
      * src/w32reg.c: Likewise.
      * src/w32select.c: Likewise.
      * src/w32uniscribe.c: Likewise.
      * src/widget.c: Likewise.
      * src/xdisp.c: Likewise.
      * src/xmenu.c: Likewise.
      * src/xrdb.c: Likewise.
      * src/xselect.c: Likewise.
      23f86fce
  23. 28 Jun, 2012 3 commits
    • Stefan Monnier's avatar
      * src/editfns.c (region_limit): Clip to narrowing. · 7d7e0027
      Stefan Monnier authored
      Fixes: debbugs:11770
      7d7e0027
    • Dmitry Antipov's avatar
      * configure.in: Add glyphs category to --enable-checking option. · e509cfa6
      Dmitry Antipov authored
      (GLYPH_DEBUG): Define if glyphs debugging is enabled.
      * src/dispextern.h (GLYPH_DEBUG): Now defined in config.h if
      enabled with --enable-checking=[all,glyphs] configure option.
      Fix GLYPH_DEBUG usage assuming that it may be undefined,
      adjust comments accordingly.
      * src/dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
      undefined, adjust comments accordingly.
      * src/image.c: Likewise.
      * src/scroll.c: Likewise.
      * src/w32fns.c: Likewise.
      * src/w32term.c: Likewise.
      * src/xdisp.c: Likewise.
      * src/xfaces.c: Likewise.
      * src/xfns.c: Likewise.
      * src/xterm.c: Likewise.
      e509cfa6
    • Dmitry Antipov's avatar
      Generalize run-time debugging checks. · a54e2c05
      Dmitry Antipov authored
      * configure.in (ENABLE_CHECKING): Update comment.
      * src/dispextern.h (XASSERTS): Remove.
      * src/fontset.c (xassert): Remove.
      Convert from xassert to eassert.
      * src/alloc.c: Convert from xassert to eassert.
      * src/bidi.c: Likewise.
      * src/dispnew.c: Likewise.
      * src/fns.c: Likewise.
      * src/fringe.c: Likewise.
      * src/ftfont.c: Likewise.
      * src/gtkutil.c: Likewise.
      * src/image.c: Likewise.
      * src/keyboard.c: Likewise.
      * src/menu.c: Likewise.
      * src/process.c: Likewise.
      * src/scroll.c: Likewise.
      * src/sound.c: Likewise.
      * src/term.c: Likewise.
      * src/w32console.c: Likewise.
      * src/w32fns.c: Likewise.
      * src/w32term.c: Likewise.
      * src/window.c: Likewise.
      * src/xdisp.c: Likewise.
      * src/xfaces.c: Likewise.
      * src/xfns.c: Likewise.
      * src/xselect.c: Likewise.
      * src/xterm.c: Likewise.
      a54e2c05
  24. 16 Jun, 2012 1 commit
    • Andreas Schwab's avatar
      * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline. · e5560ff7
      Andreas Schwab authored
      (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
      * character.c (_fetch_multibyte_char_p): Remove.
      * alloc.c: Include "character.h" before "buffer.h".
      * bidi.c: Likewise.
      * buffer.c: Likewise.
      * bytecode.c: Likewise.
      * callint.c: Likewise.
      * callproc.c: Likewise.
      * casefiddle.c: Likewise.
      * casetab.c: Likewise.
      * category.c: Likewise.
      * cmds.c: Likewise.
      * coding.c: Likewise.
      * composite.c: Likewise.
      * dired.c: Likewise.
      * dispnew.c: Likewise.
      * doc.c: Likewise.
      * dosfns.c: Likewise.
      * editfns.c: Likewise.
      * emacs.c: Likewise.
      * fileio.c: Likewise.
      * filelock.c: Likewise.
      * font.c: Likewise.
      * fontset.c: Likewise.
      * fringe.c: Likewise.
      * indent.c: Likewise.
      * insdel.c: Likewise.
      * intervals.c: Likewise.
      * keyboard.c: Likewise.
      * keymap.c: Likewise.
      * lread.c: Likewise.
      * macros.c: Likewise.
      * marker.c: Likewise.
      * minibuf.c: Likewise.
      * nsfns.m: Likewise.
      * nsmenu.m: Likewise.
      * print.c: Likewise.
      * process.c: Likewise.
      * regex.c: Likewise.
      * region-cache.c: Likewise.
      * search.c: Likewise.
      * syntax.c: Likewise.
      * term.c: Likewise.
      * textprop.c: Likewise.
      * undo.c: Likewise.
      * unexsol.c: Likewise.
      * w16select.c: Likewise.
      * w32fns.c: Likewise.
      * w32menu.c: Likewise.
      * window.c: Likewise.
      * xdisp.c: Likewise.
      * xfns.c: Likewise.
      * xmenu.c: Likewise.
      * xml.c: Likewise.
      * xselect.c: Likewise.
      e5560ff7
  25. 13 Jun, 2012 1 commit
    • Andreas Schwab's avatar
      Use a simple struct to implement compile time checks for the Lisp_Object type · 646b5f55
      Andreas Schwab authored
      * configure.in: Rename --enable-use-lisp-union-type to
      --enable-check-lisp-object-type and define CHECK_LISP_OBJECT_TYPE
      instead of USE_LISP_UNION_TYPE.
      
      * admin/make-emacs: Rename --union-type to --check-lisp-type.  Define
      CHECK_LISP_OBJECT_TYPE insted of USE_LISP_UNION_TYPE.
      * admin/CPP-DEFINES (DEBUG_LISP_OBJECT_TYPE): Renamed from
      USE_LISP_UNION_TYPE.
      
      * src/lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
      instead of union.
      (XLI, XIL): Define.
      (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG): Use
      them.
      * src/emacs.c (gdb_use_struct): Renamed from gdb_use_union.
      * src/.gdbinit: Check gdb_use_struct instead of gdb_use_union.
      * src/alloc.c (widen_to_Lisp_Object): Removed.
      (mark_memory): Use XIL instead of widen_to_Lisp_Object.
      * src/frame.c (delete_frame): Remove outdated comment.
      * src/w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
      USE_LISP_UNION_TYPE.
      (Fw32_unregister_hot_key): Likewise.
      (Fw32_toggle_lock_key): Likewise.
      * src/w32menu.c (add_menu_item): Likewise.
      (w32_menu_display_help): Use XIL instead of checking
      USE_LISP_UNION_TYPE.
      * src/w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
      (init_heap): Likewise.
      * src/w32term.c (w32_read_socket): Update comment.
      646b5f55
  26. 28 May, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix bug #11513 with raise-frame on MS-Windows. · 85d0efd1
      Eli Zaretskii authored
       src/w32term.c (my_bring_window_to_top): New function.
       (x_raise_frame): Use handle returned by DeferWindowPos, which
       could be different from the original one.  Call
       my_bring_window_to_top instead of my_set_foreground_window.
       src/w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
       by calling BringWindowToTop.
       src/w32term.h (WM_EMACS_BRINGTOTOP): New message.
       (WM_EMACS_END): Increase by one.
      85d0efd1
  27. 18 May, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows. · 784b56e2
      Eli Zaretskii authored
       src/w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
       (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
       src/w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
       reference to image_cache->refcount.
       (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
      784b56e2