1. 01 Aug, 2012 2 commits
    • Dmitry Antipov's avatar
      Use INTERNAL_FIELD for symbols. · 8271d590
      Dmitry Antipov authored
      * src/lisp.h (SVAR): New macro.  Adjust users.
      * src/alloc.c, src/bytecode.c, src/cmds.c, src/data.c, src/doc.c, src/eval.c:
      * src/fns.c, src/keyboard.c, src/lread.c, src/xterm.c: Users changed.
      * admin/coccinelle/symbol.cocci: Semantic patch to replace direct
      access to Lisp_Object members of struct Lisp_Symbol to SVAR.
      8271d590
    • 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
  2. 31 Jul, 2012 2 commits
    • 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
    • Dmitry Antipov's avatar
      Miscellaneous fixes for non-default X toolkits. · c09bfb2f
      Dmitry Antipov authored
      * configure.ac (MOTIF): Check for /usr/include/openmotif
      and /usr/(lib|lib64)/openmotif if --with-x-toolkit=motif.
      * lwlib/lwlib-Xm.c (make_menu_in_widget): Remove unused variable.
      * src/xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
      * src/xterm.c (x_frame_of_widget): Remove redundant prototype.
      Move under #ifdef USE_LUCID.
      (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
      definition and usage to avoid warnings.
      c09bfb2f
  3. 10 Jul, 2012 2 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
    • 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
  4. 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
    • 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
  5. 28 Jun, 2012 2 commits
    • 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
  6. 26 Jun, 2012 1 commit
    • Dmitry Antipov's avatar
      * src/alloc.c: Remove build_string. · 1130ecfc
      Dmitry Antipov authored
      * src/lisp.h: Define build_string as static inline.  This provides
      a better opportunity to optimize away calls to strlen when the
      function is called with compile-time constant argument.
      * src/image.c (imagemagick_error): Convert to build_string.
      * src/w32proc.c (sys_spawnve): Likewise.
      * src/xterm.c (x_term_init): Likewise.
      * admin/coccinelle/build_string.cocci: Semantic patch
      to convert from make_string to build_string.
      1130ecfc
  7. 24 Jun, 2012 2 commits
  8. 22 Jun, 2012 1 commit
  9. 17 Jun, 2012 2 commits
    • Paul Eggert's avatar
      * xterm.c (x_draw_underwave): Check for integer overflow. · 9a900ca9
      Paul Eggert authored
      This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
      9a900ca9
    • Alp Aker's avatar
      Implement wave-style variant of underlining. · 9b0e3eba
      Alp Aker authored
        * doc/lispref/display.texi: Document new face attribute.
        * lisp/cus-face.el (custom-face-attributes): Add wave-style underline
        attribute.
        * lisp/faces.el (set-face-attribute): Update docstring.
        * src/dispextern.h (face_underline_type): New enum.
        (face): Add field for underline type.
        * src/nsterm.m (ns_draw_underwave): New function.
        (ns_draw_text_decoration): Use it.
        * src/w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
        New functions.
        (x_draw_glyph_string): Use them.
        * src/xfaces.c (Qline, Qwave): New Lisp objects.
        (check_lface_attrs, merge_face_ref)
        (Finternal_set_lisp_face_attribute, realize_x_face): Handle
        wave-style underline face attributes.
        * src/xterm.c (x_draw_underwave): New function.
        (x_draw_glyph_string): Use it.
      9b0e3eba
  10. 31 May, 2012 2 commits
    • Paul Eggert's avatar
      Pacify gcc -Wdouble-precision when using Xaw. · ca34e0be
      Paul Eggert authored
      * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
      [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
      Use 'float' consistently, rather than 'float' in most places
      and 'double' in a couple of places.
      ca34e0be
    • Paul Eggert's avatar
      Remove obsolete '#define static' cruft. · ba93a187
      Paul Eggert authored
      * etc/PROBLEMS: Remove obsolete '#define static' cruft.
      * lwlib/xlwmenu.c [emacs]: Include "bitmaps/gray.xbm".
      (gray_bitmap_width, gray_bitmap_height, gray_bitmap_bits) [!emacs]:
      Remove; all uses replaced with definiens.
      * src/s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
      This #undef was "temporary" in 2000; it is no longer needed
      now that '#define static' has gone away.
      * src/xfns.c, src/xterm.h (gray_bitmap_width, gray_bitmap_height)
      (gray_bitmap_bits): Remove; no longer needed.
      All uses replaced with definiens.
      * src/xterm.c: Include "bitmaps/gray.xbm".
      ba93a187
  11. 21 May, 2012 1 commit
    • Paul Eggert's avatar
      Assume C89 or later. · 261cb4bb
      Paul Eggert authored
      * configure.in (AC_C_PROTOTYPES, AC_C_VOLATILE, AC_C_CONST)
      (POINTER_TYPE, PROTOTYPES): Remove.
      * admin/CPP-DEFINES: Remove NULL, const.
      * lib-src/etags.c (static, const): Remove macros.
      (PTR): Remove; all uses replaced with void *.  Omit needless casts.
      * src/alloc.c, src/buffer.c, lisp.h: Replace POINTER_TYPE with void.
      * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
      (xrealloc):
      * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
      * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
      * textprop.c, tparam.c (NULL): Remove.
      * ralloc.c, vm-limit.c (POINTER): Assume void * works.
      * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
      * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
      * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
      * xterm.c (input_signal_count): Assume volatile works.
      261cb4bb
  12. 02 May, 2012 1 commit
  13. 09 Apr, 2012 1 commit
  14. 24 Mar, 2012 1 commit
  15. 22 Feb, 2012 2 commits
  16. 02 Feb, 2012 1 commit
    • Glenn Morris's avatar
      Native scroll-bars are not implemented for Nextstep (bug#10673) · 44f92739
      Glenn Morris authored
      * configure.in [HAVE_NS]: Error if use --without-toolkit-scroll-bars.
      
      * src/nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
      Unconditionally set to t.
      
      * src/nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
      * src/w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
      * src/xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
      44f92739
  17. 31 Jan, 2012 1 commit
    • Glenn Morris's avatar
      x-toolkit-scroll-bars doc fix. · 97897668
      Glenn Morris authored
      * src/nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
      * src/xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
      97897668
  18. 11 Jan, 2012 1 commit
  19. 07 Jan, 2012 1 commit
  20. 05 Jan, 2012 1 commit
  21. 19 Dec, 2011 1 commit
  22. 10 Dec, 2011 1 commit
  23. 05 Dec, 2011 1 commit
  24. 03 Dec, 2011 1 commit
  25. 29 Nov, 2011 1 commit
  26. 21 Nov, 2011 1 commit
  27. 20 Nov, 2011 1 commit
  28. 19 Nov, 2011 1 commit
  29. 17 Nov, 2011 1 commit
  30. 30 Oct, 2011 2 commits
    • Jan Djärv's avatar
      Fix bug 9869. · 6e56383b
      Jan Djärv authored
      xterm.c: Include X11/Xproto.h if HAVE_GTK3.
      (x_error_handler): Ignore BadMatch for X_SetInputFocus for
      HAVE_GTK3 (Bug#9869).
      6e56383b
    • Jan Djärv's avatar
      Fix hang after C-z in gnome-shell. · b77a6a7f
      Jan Djärv authored
      * xterm.c: Declare x_handle_net_wm_state to return int.
      (handle_one_xevent): Check if we are iconified but don't have
      _NET_WM_STATE_HIDDEN.  If do, treat as deiconify.
      (get_current_wm_state): Return non-zero if not hidden,
      check for _NET_WM_STATE_HIDDEN (Bug#9893).
      (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
      (x_handle_net_wm_state): Return what get_current_wm_state returns.
      (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
      
      * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
      b77a6a7f