1. 09 Sep, 2011 1 commit
  2. 29 Aug, 2011 1 commit
    • Paul Eggert's avatar
      sprintf-related integer and memory overflow issues. · 62f19c19
      Paul Eggert authored
      * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
      (esprintf, esnprintf, exprintf, evxprintf): New functions.
      * keyboard.c (command_loop_level): Now EMACS_INT, not int.
      (cmd_error): kbd macro iterations count is now EMACS_INT, not int.
      (modify_event_symbol): Do not assume that the length of
      name_alist_or_stem is safe to alloca and fits in int.
      (Fexecute_extended_command): Likewise for function name and binding.
      (Frecursion_depth): Wrap around reliably on integer overflow.
      * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
      since some callers pass EMACS_INT values.
      (Fsingle_key_description): Don't crash if symbol name contains more
      than MAX_ALLOCA bytes.
      * minibuf.c (minibuf_level): Now EMACS_INT, not int.
      (get_minibuffer): Arg is now EMACS_INT, not int.
      * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
      (esprintf, esnprintf, exprintf, evxprintf): New decls.
      * window.h (command_loop_level, minibuf_level): Reflect API changes.
      62f19c19
  3. 19 Aug, 2011 1 commit
  4. 04 Aug, 2011 1 commit
    • Jan Djärv's avatar
      Check for pthread and use it if found. · ae9e757a
      Jan Djärv authored
      * configure.in (HAVE_PTHREAD): Add check for -lpthread.
      (HAVE_GTK_AND_PTHREAD): Remove.
      
      * src/Makefile.in (LIB_PTHREAD): New variable.
      (LIBES): Add LIB_PTHREAD (Bug#9216).
      
      * src/alloc.c, src/emacs.c, src/gmalloc.c, src/gtkutil.c, src/keyboard.c, src/syssignal.h:
      Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
      ae9e757a
  5. 29 Jul, 2011 1 commit
    • Paul Eggert's avatar
      * keyboard.c: Integer and memory overflow fixes. · 34db673b
      Paul Eggert authored
      (read_char, menu_bar_items, tool_bar_items, read_char_x_menu_prompt)
      (read_char_minibuf_menu_width, read_char_minibuf_menu_prompt)
      (follow_key, read_key_sequence): Use ptrdiff_t, not int, to count maps.
      (read_char_minibuf_menu_prompt): Check for overflow in size
      calculations.  Don't update size until allocation succeeds.  Redo
      calculations to avoid overflow.
      * keyboard.h: Change prototypes to match the above.
      34db673b
  6. 17 Jul, 2011 1 commit
    • Paul Eggert's avatar
      * keyboard.c: Overflow, signedness and related fixes. · b13995db
      Paul Eggert authored
      (make_lispy_movement): Use same integer type in forward decl
      that is used in the definition.
      (read_key_sequence, keyremap_step):
      Change bufsize argument back to int, undoing my 2011-03-30 change.
      We prefer signed types, and int is wide enough here.
      (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
      than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
      larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
      length, not size_t.  Use ptrdiff_t for index, not int.
      (keyremap_step, read_key_sequence): Redo bufsize check to avoid
      possibility of integer overflow.
      b13995db
  7. 14 Jul, 2011 1 commit
  8. 07 Jul, 2011 1 commit
  9. 02 Jul, 2011 2 commits
    • Chong Yidong's avatar
      Fix corner case in prefix-arg handling for mouse events (Bug#1586). · 7a8e04f7
      Chong Yidong authored
      * src/keyboard.c (command_loop_1): If a down-mouse event is unbound,
      leave any prefix arg for the up event.
      7a8e04f7
    • Stefan Monnier's avatar
      Add multiple inheritance to keymaps. · 3349e122
      Stefan Monnier authored
      * src/keymap.c (Fmake_composed_keymap): New function.
      (Fset_keymap_parent): Simplify.
      (fix_submap_inheritance): Remove.
      (access_keymap_1): New function extracted from access_keymap to handle
      embedded parents and handle lists of maps.
      (access_keymap): Use it.
      (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
      (Fcopy_keymap): Handle embedded parents.
      (Fcommand_remapping, define_as_prefix): Simplify.
      (Fkey_binding): Simplify.
      (syms_of_keymap): Move minibuffer-local-completion-map,
      minibuffer-local-filename-completion-map,
      minibuffer-local-must-match-map, and
      minibuffer-local-filename-must-match-map to Elisp.
      (syms_of_keymap): Defsubr make-composed-keymap.
      * src/keyboard.c (menu_bar_items): Use map_keymap_canonical.
      (parse_menu_item): Trivial simplification.
      * lisp/subr.el (remq): Don't allocate if it's not needed.
      (keymap--menu-item-binding, keymap--menu-item-with-binding)
      (keymap--merge-bindings): New functions.
      (keymap-canonicalize): Use them to refine the canonicalization.
      * lisp/minibuffer.el (minibuffer-local-completion-map)
      (minibuffer-local-must-match-map): Move initialization from C.
      (minibuffer-local-filename-completion-map): Move initialization from C;
      don't inherit from anything here.
      (minibuffer-local-filename-must-match-map): Make obsolete.
      (completing-read-default): Use make-composed-keymap to combine
      minibuffer-local-filename-completion-map with either
      minibuffer-local-must-match-map or
      minibuffer-local-filename-completion-map.
      3349e122
  10. 20 Jun, 2011 1 commit
  11. 14 Jun, 2011 1 commit
    • Paul Eggert's avatar
      Variadic C functions now count arguments with ptrdiff_t. · f66c7cf8
      Paul Eggert authored
      This partly undoes my 2011-03-30 change, which replaced int with size_t.
      Back then I didn't know that the Emacs coding style prefers signed int.
      Also, in the meantime I found a few more instances where arguments
      were being counted with int, which may truncate counts on 64-bit
      machines, or EMACS_INT, which may be unnecessarily wide.
      * lisp.h (struct Lisp_Subr.function.aMANY)
      (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
      Arg counts are now ptrdiff_t, not size_t.
      All variadic functions and their callers changed accordingly.
      (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
      * bytecode.c (exec_byte_code): Check maxdepth for overflow,
      to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
      * callint.c (Fcall_interactively): Check arg count for overflow,
      to avoid potential buffer overrun.  Use signed char, not 'int',
      for 'varies' array, so that we needn't bother to check its size
      calculation for overflow.
      * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
      * eval.c (apply_lambda):
      * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
      (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
      (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
      f66c7cf8
  12. 13 Jun, 2011 1 commit
  13. 12 Jun, 2011 2 commits
    • Paul Eggert's avatar
      Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts. · d37ca623
      Paul Eggert authored
      These casts should not be needed on 32-bit hosts, either.
      * keyboard.c (read_char):
      * lread.c (Fload): Remove casts to unsigned.
      d37ca623
    • Paul Eggert's avatar
      * lisp.h (UNSIGNED_CMP): New macro. · ea204efb
      Paul Eggert authored
      This fixes comparison bugs on 64-bit hosts.
      (ASCII_CHAR_P): Use it.
      * casefiddle.c (casify_object):
      * character.h (ASCII_BYTE_P, CHAR_VALID_P):
      (SINGLE_BYTE_CHAR_P, CHAR_STRING):
      * composite.h (COMPOSITION_ENCODE_RULE_VALID):
      * dispextern.h (FACE_FROM_ID):
      * keyboard.c (read_char): Use UNSIGNED_CMP.
      ea204efb
  14. 01 Jun, 2011 1 commit
    • Paul Eggert's avatar
      Minor fixes for signed vs unsigned integers. · ccd9a01a
      Paul Eggert authored
      * character.h (MAYBE_UNIFY_CHAR):
      * charset.c (maybe_unify_char):
      * keyboard.c (read_char, reorder_modifiers):
      XINT -> XFASTINT, since the integer must be nonnegative.
      * ftfont.c (ftfont_spec_pattern):
      * keymap.c (access_keymap, silly_event_symbol_error):
      XUINT -> XFASTINT, since the integer must be nonnegative.
      (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
      since it makes no difference and we prefer signed.
      * keyboard.c (record_char): Use XUINT when all the neighbors do.
      (access_keymap): NATNUMP -> INTEGERP, since the integer must be
      nonnegative.
      ccd9a01a
  15. 28 May, 2011 2 commits
    • Paul Eggert's avatar
      [ChangeLog] · 55d4c1b2
      Paul Eggert authored
      Use 'inline', not 'INLINE'.
      * configure.in, autogen/config.in (INLINE): Remove.
      [lib-src/ChangeLog]
      Use 'inline', not 'INLINE'.
      * etags.c (hash): Now inline unconditionally.
      * make-docfile.c (put_char): inline, not INLINE.
      [nt/ChangeLog]
      Use 'inline', not 'INLINE'.
      * config.nt (INLINE): Remove.
      [src/ChangeLog]
      Use 'inline', not 'INLINE'.
      * alloc.c, fontset.c (INLINE): Remove.
      * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
      * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
      * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
      * gmalloc.c (register_heapinfo): Use inline unconditionally.
      * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
      55d4c1b2
    • Eli Zaretskii's avatar
      Fix cursor motion across display strings covering reordered text. · 0e14fe90
      Eli Zaretskii authored
       src/xdisp.c (set_cursor_from_row): Set start and stop points
       according to the row's direction when priming the loop that looks
       for the glyph on which to display cursor.
       (single_display_spec_intangible_p): Function deleted.
       (display_prop_intangible_p): Reimplement to call
       handle_display_spec instead of single_display_spec_intangible_p.
       Accept 3 additional arguments needed by handle_display_spec.  This
       fixes incorrect cursor motion across display property with complex
       values: lists, `(when COND...)' forms, etc.
       (single_display_spec_string_p): Support property values that are
       lists with the argument STRING its top-level element.
       (display_prop_string_p): Fix the condition for processing a
       property that is a list to be consistent with handle_display_spec.
       src/keyboard.c (adjust_point_for_property): Adjust the call to
       display_prop_intangible_p to its new signature.
       src/dispextern.h (display_prop_intangible_p): Adjust prototype.
      0e14fe90
  16. 12 May, 2011 2 commits
    • Paul Eggert's avatar
      Be more systematic about user-interface timestamps. · 08dc5ae6
      Paul Eggert authored
      Before, the code sometimes used 'Time', sometimes 'unsigned long',
      and sometimes 'EMACS_UINT', to represent these timestamps.  This
      change causes it to use 'Time' uniformly, as that's what X uses.
      This makes the code easier to follow, and makes it easier to catch
      integer overflow bugs such as Bug#8664.
      * frame.c (Fmouse_position, Fmouse_pixel_position):
      Use Time, not unsigned long, for user-interface timestamps.
      * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
      (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
      * keyboard.h (last_event_timestamp): Likewise.
      * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
      * menu.h (xmenu_show): Likewise.
      * term.c (term_mouse_position): Likewise.
      * termhooks.h (struct input_event.timestamp): Likewise.
      (struct terminal.mouse_position_hook): Likewise.
      * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
      * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
      * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
      HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
      what it was before.
      * menu.h, termhooks.h: Include "systime.h", for Time.
      08dc5ae6
    • Paul Eggert's avatar
      * keyboard.c (make_lispy_event): Fix problem in integer overflow. · 8e55734a
      Paul Eggert authored
      Don't assume that the difference between two unsigned long values
      can fit into an integer.  At this point, we know button_down_time
      <= event->timestamp, so the difference must be nonnegative, so
      there's no need to cast the result if double-click-time is
      nonnegative, as it should be; check that it's nonnegative, just in
      case.  This bug is triggered when events are more than 2**31 ms
      apart (about 25 days).
      8e55734a
  17. 09 May, 2011 1 commit
    • Eli Zaretskii's avatar
      Backport revisions... · 14fe7b53
      Eli Zaretskii authored
      Backport revisions 2011-04-24T05:30:24Z!eggert@cs.ucla.edu..2011-04-25T19:40:22Z!eggert@cs.ucla.edu (inclusive) from trunk (bug#8623)
      
      	The next log entry shows the actual changes by Paul Eggert.
      
       Fix a problem with aliasing and vector headers.
       GCC 4.6.0 optimizes based on type-based alias analysis.  For
       example, if b is of type struct buffer * and v of type struct
       Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
       != &v->size, and therefore "v->size = 1; b->size = 2; return
       v->size;" must therefore return 1.  This assumption is incorrect
       for Emacs, since it type-puns struct Lisp_Vector * with many other
       types.  To fix this problem, this patch adds a new type struct
       vector_header that documents the constraints on layout of vectors
       and pseudovectors, and helps optimizing compilers not get fooled
       by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
       XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
       src/lisp.h (XVECTOR_SIZE): New convenience macro.  All previous uses of
       XVECTOR (foo)->size replaced to use this macro, to avoid the hassle
       of writing XVECTOR (foo)->header.size.
       src/lisp.h: Say "vectorlike header" rather than "vector header.
       (struct vectorlike_header): Rename from struct vector_header.
       (XVECTORLIKE_HEADER_SIZE): Renamed from XVECTOR_HEADER_SIZE.
       All uses changed.
       (XVECTOR_HEADER_SIZE): New macro, for use in XSETPSEUDOVECTOR.
       (XSETTYPED_PVECTYPE): New macro, specifying the name of the size
       member.
       (XSETPVECTYPE): Rewrite in terms of new macro.
       (XSETPVECTYPESIZE): New macro, specifying both type and size.
       This is a bit clearer, and further avoids the possibility of
       undesirable aliasing.
       (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
       (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR
       and XVECTOR_HEADER_SIZE.
       (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
       since Lisp_Subr is a special case (no "next" field).
       (ASIZE): Rewrite in terms of XVECTOR_SIZE.
       (struct vector_header): New type.
       (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
       object, to help avoid aliasing.
       (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
       (SUBRP): Likewise, since Lisp_Subr is a special case.
       src/lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
       (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
       (struct Lisp_Hash_Table): Combine first two members into a single
       struct vector_header member.  All uses of "size" and "next" members
       changed to be "header.size" and "header.next".
       src/buffer.h (struct buffer): Likewise.
       src/font.h (struct font_spec, struct font_entity, struct font): Likewise.
       src/frame.h (struct frame): Likewise.
       src/process.h (struct Lisp_Process): Likewise.
       src/termhooks.h (struct terminal): Likewise.
       src/window.c (struct save_window_data, struct saved_window): Likewise.
       src/window.h (struct window): Likewise.
       src/alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
       Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
       src/buffer.c (init_buffer_once): Likewise.
       src/lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
       special case.
       src/process.c (Fformat_network_address): Use local var for size,
       for brevity.
       src/fns.c (vector): Remove; this old hack is no longer needed.
       src/bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
      14fe7b53
  18. 28 Apr, 2011 1 commit
    • Juanma Barranquero's avatar
      Add delayed warnings support. · 638f053a
      Juanma Barranquero authored
      * etc/NEWS: Document `delayed-warnings-list' and `delayed-warnings-hook'.
      
      * lisp/subr.el (display-delayed-warnings): New function.
        (delayed-warnings-hook): New variable.
      
      * src/keyboard.c (Qdelayed_warnings_hook): Define.
        (command_loop_1): Run `delayed-warnings-hook' if Vdelayed_warnings_list
        is non-nil.
        (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
        (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
      638f053a
  19. 26 Apr, 2011 3 commits
  20. 25 Apr, 2011 2 commits
    • Paul Eggert's avatar
      * lisp.h: (XVECTOR_SIZE): Remove. All uses replaced with ASIZE. · 77b37c05
      Paul Eggert authored
      (ASIZE): Now contains previous implementation of XVECTOR_SIZE
      instead of invoking XVECTOR_SIZE.
      77b37c05
    • Paul Eggert's avatar
      lisp.h: Fix a problem with aliasing and vector headers. · eab3844f
      Paul Eggert authored
      GCC 4.6.0 optimizes based on type-based alias analysis.  For
      example, if b is of type struct buffer * and v of type struct
      Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
      != &v->size, and therefore "v->size = 1; b->size = 2; return
      v->size;" must therefore return 1.  This assumption is incorrect
      for Emacs, since it type-puns struct Lisp_Vector * with many other
      types.  To fix this problem, this patch adds a new type struct
      vector_header that documents the constraints on layout of vectors
      and pseudovectors, and helps optimizing compilers not get fooled
      by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
      XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
      * lisp.h (XVECTOR_SIZE): New convenience macro.  All previous uses of
      XVECTOR (foo)->size replaced to use this macro, to avoid the hassle
      of writing XVECTOR (foo)->header.size.
      (XVECTOR_HEADER_SIZE): New macro, for use in XSETPSEUDOVECTOR.
      (XSETTYPED_PVECTYPE): New macro, specifying the name of the size
      member.
      (XSETPVECTYPE): Rewrite in terms of new macro.
      (XSETPVECTYPESIZE): New macro, specifying both type and size.
      This is a bit clearer, and further avoids the possibility of
      undesirable aliasing.
      (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
      (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR
      and XVECTOR_HEADER_SIZE.
      (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
      since Lisp_Subr is a special case (no "next" field).
      (ASIZE): Rewrite in terms of XVECTOR_SIZE.
      (struct vector_header): New type.
      (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
      object, to help avoid aliasing.
      (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
      (SUBRP): Likewise, since Lisp_Subr is a special case.
      * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
      (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
      (struct Lisp_Hash_Table): Combine first two members into a single
      struct vector_header member.  All uses of "size" and "next" members
      changed to be "header.size" and "header.next".
      * buffer.h (struct buffer): Likewise.
      * font.h (struct font_spec, struct font_entity, struct font): Likewise.
      * frame.h (struct frame): Likewise.
      * process.h (struct Lisp_Process): Likewise.
      * termhooks.h (struct terminal): Likewise.
      * window.c (struct save_window_data, struct saved_window): Likewise.
      * window.h (struct window): Likewise.
      * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
      Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
      * buffer.c (init_buffer_once): Likewise.
      * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
      special case.
      * process.c (Fformat_network_address): Use local var for size,
      for brevity.
      eab3844f
  21. 19 Apr, 2011 1 commit
    • Paul Eggert's avatar
      Replace pEd with more-general pI, and fix some printf arg casts. · c2982e87
      Paul Eggert authored
      * lisp.h (pI): New macro, generalizing old pEd macro to other
      conversion specifiers.  For example, use "...%"pI"d..." rather
      than "...%"pEd"...".
      (pEd): Remove.  All uses replaced with similar uses of pI.
      * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
      * alloc.c (check_pure_size): Don't overflow by converting size to int.
      * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
      * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
      * dbusbind.c (xd_append_arg): Use pI to avoid cast.
      (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
      * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
      64-bit hosts.
      (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
      * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
      * print.c (safe_debug_print, print_object): Likewise.
      (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
      to int.
      Use pI instead of if-then-else-abort.  Use %p to avoid casts.
      * process.c (Fmake_network_process): Use pI to avoid cast.
      * region-cache.c (pp_cache): Likewise.
      * xdisp.c (decode_mode_spec): Likewise.
      * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
      behavior on 64-bit hosts with printf arg.
      * xselect.c (x_queue_event): Use %p to avoid casts.
      (x_stop_queuing_selection_requests): Likewise.
      (x_get_window_property): Don't truncate byte count to an 'int'
      when tracing.
      c2982e87
  22. 16 Apr, 2011 2 commits
  23. 15 Apr, 2011 1 commit
  24. 14 Apr, 2011 3 commits
    • Paul Eggert's avatar
    • Paul Eggert's avatar
      Undo the DEFUN->DEFUE change. · a7ca3326
      Paul Eggert authored
      a7ca3326
    • Paul Eggert's avatar
      * keyboard.c: Make symbols static if they're not exported. · 8a1414fa
      Paul Eggert authored
      (single_kboard, recent_keys_index, total_keys, recent_keys):
      (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
      (this_single_command_key_start, echoing, last_auto_save):
      (read_key_sequence_cmd, dribble, recursive_edit_unwind):
      (command_loop, echo_now, keyboard_init_hook, help_char_p):
      (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
      (Vlispy_mouse_stem, double_click_count):
      Now static.
      (force_auto_save_soon): Define only if SIGDANGER.
      (ignore_mouse_drag_p): Now static if
      !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
      (print_help): Remove; unused.
      (stop_character, last_timer_event): Mark as externally visible.
      * keyboard.h (ignore_mouse_drag_p): Declare only if
      defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
      (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
      * lisp.h (echoing): Remove decl.
      (force_auto_save_soon): Declare only if SIGDANGER.
      * xdisp.c (redisplay_window): Simplify code, to make it more
      obvious that ignore_mouse_drag_p is not accessed if !defined
      USE_GTK && !defined HAVE_NS.
      8a1414fa
  25. 12 Apr, 2011 1 commit
    • Andreas Schwab's avatar
      Use xfree instead of free where appropriate (Bug#8437) · baad03f0
      Andreas Schwab authored
      * charset.c (Fclear_charset_maps): Use xfree instead of free.
      (Bug#8437)
      * keyboard.c (parse_tool_bar_item): Likewise.
      * sound.c (sound_cleanup, alsa_close): Likewise.
      * termcap.c (tgetent): Likewise.
      * xfns.c (x_default_font_parameter): Likewise.
      * xsettings.c (read_and_apply_settings): Likewise.
      baad03f0
  26. 11 Apr, 2011 3 commits
    • Paul Eggert's avatar
      * commands.h (last_point_position, last_point_position_buffer): · 14a9c8df
      Paul Eggert authored
      (last_point_position_window): Remove decls.
      * keyboard.c: Make these variables static.
      14a9c8df
    • Paul Eggert's avatar
      Declare Lisp_Object Q* variables to be 'static' if not exproted. · 955cbe7b
      Paul Eggert authored
      This makes it easier for human readers (and static analyzers)
      to see whether these variables are used from other modules.
      * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
      * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
      * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
      * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
      * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
      * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
      * xmenu.c, xselect.c:
      Declare Q* vars static if they are not used in other modules.
      * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
      * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
      Remove decls of unexported vars.
      * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
      955cbe7b
    • Paul Eggert's avatar
      Make Emacs functions such as Fatom 'static' by default. · 16a97296
      Paul Eggert authored
      This makes it easier for human readers (and static analyzers)
      to see whether these functions can be called from other modules.
      DEFUN now defines a static function.  To make the function external
      so that it can be used in other C modules, use the new macro DEFUE.
      * lisp.h (DEFINE_FUNC): New macro, with the old contents of DEFUN.
      (DEFUN): Rewrite in terms of DEFINE_FUNC.  It now generates a
      static function definition.  Use DEFUE if you want an extern one.
      (DEFUE, INFUN): New macros.
      (Funibyte_char_to_multibyte, Fsyntax_table_p, Finit_image_library):
      (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
      (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
      (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
      Remove decls, since these functions are now static.
      (Funintern, Fget_internal_run_time): New decls, since these functions
      were already external.
      * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
      * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
      * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
      * keyboard.c, keymap.c, lread.c:
      * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
      * syntax.c, term.c, terminal.c, textprop.c, undo.c:
      * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
      Mark functions with DEFUE instead of DEFUN,
      if they are used in other modules.
      * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
      decls for now-static functions.
      * buffer.h (Fdelete_overlay): Remove decl.
      * callproc.c (Fgetenv_internal): Mark as internal.
      * composite.c (Fremove_list_of_text_properties): Remove decl.
      (Fcomposition_get_gstring): New forward static decl.
      * composite.h (Fcomposite_get_gstring): Remove decl.
      * dired.c (Ffile_attributes): New forward static decl.
      * doc.c (Fdocumntation_property): New forward static decl.
      * eval.c (Ffetch_bytecode): New forward static decl.
      (Funintern): Remove extern decl; now in .h file where it belongs.
      * fileio.c (Fmake_symbolic_link): New forward static decl.
      * image.c (Finit_image_library): New forward static decl.
      * insdel.c (Fcombine_after_change_execute): Make forward decl static.
      * intervals.h (Fprevious_property_change):
      (Fremove_list_of_text_properties): Remove decls.
      * keyboard.c (Fthis_command_keys): Remove decl.
      (Fcommand_execute): New forward static decl.
      * keymap.c (Flookup_key): New forward static decl.
      (Fcopy_keymap): Now static.
      * keymap.h (Flookup_key): Remove decl.
      * process.c (Fget_process): New forward static decl.
      (Fprocess_datagram_address): Mark as internal.
      * syntax.c (Fsyntax_table_p): New forward static decl.
      (skip_chars): Remove duplicate decl.
      * textprop.c (Fprevious_property_change): New forward static decl.
      * window.c (Fset_window_fringes, Fset_window_scroll_bars):
      Now internal.
      (Fset_window_margins, Fset_window_vscroll): New forward static decls.
      * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
      16a97296
  27. 09 Apr, 2011 1 commit
  28. 08 Apr, 2011 1 commit