1. 13 Nov, 2015 4 commits
  2. 12 Nov, 2015 7 commits
    • Phillip Lord's avatar
      The heuristic that Emacs uses to add an `undo-boundary' has been · 44dfa86b
      Phillip Lord authored
      reworked, as it interacts poorly with functions on `post-command-hook'
      or `after-change-functions'.
      
      * lisp/simple.el: New section added.
      * src/cmds.c (remove_excessive_undo_boundaries): Now in lisp.
      (self_insert_command): Calls simple.el to amalgamate.
      (delete_char): Calls simple.el to amalgamate.
      * src/keyboard.c (last_undo_boundary): Removed.
      * src/undo.c (run_undoable_change): New function.
      44dfa86b
    • Eli Zaretskii's avatar
      Fix the MinGW64 and Cygwin-w32 builds · c1bc6e5d
      Eli Zaretskii authored
      * src/w32fns.c (MYNOTIFYICONDATAW_V1_SIZE)
      (MYNOTIFYICONDATAW_V2_SIZE, MYNOTIFYICONDATAW_V3_SIZE): Define and
      use instead of the corresponding NOTIFYICONDATAW_Vn_SIZE macros,
      which cause trouble with MinGW42 headers.  Ifdef away tray
      notifications code for Cygwin.  Reported by Andy Moreton
      <andrewjmoreton@gmail.com>.
      c1bc6e5d
    • Ken Raeburn's avatar
      Speed up x_real_pos_and_offsets using XCB · aa17de90
      Ken Raeburn authored
      * src/xfns.c (x_real_pos_and_offsets) [USE_XCB]: Add XCB flavors of
      all X calls, and pipeline requests when possible, collecting results
      later.  Eliminate use of x_catch_errors (and thus XSync) in XCB case.
      aa17de90
    • Ken Raeburn's avatar
      Enable use of XCB for checking window manager state · a838c833
      Ken Raeburn authored
      * src/xterm.c (get_current_wm_state) [USE_XCB]: Use XCB calls instead
      of XGetWindowProperty plus error-catching, since we can explicitly
      check for errors in the XCB version.  This eliminates 3 XSync calls on
      top of the round-trip actually fetching the information.
      a838c833
    • Ken Raeburn's avatar
      Detect XCB and save a connection handle · c7f2b6ad
      Ken Raeburn authored
      * configure.ac: If using X11, check for XCB libraries and header.
      * src/Makefile.in (XCB_LIBS): Define.
      (LIBX_EXTRA): Include it.
      
      * src/xterm.h [USE_XCB]: Include X11/Xlib-xcb.h.
      (struct x_display_info) [USE_XCB]: Add an XCB connection handle field.
      * src/xterm.c (x_term_init) [USE_XCB]: Initialize the new field.
      c7f2b6ad
    • Ken Raeburn's avatar
      Reduce some data dependencies between X calls · e1c27dbd
      Ken Raeburn authored
      Gains nothing in the traditional-Xlib code, but more closely aligns
      with how the XCB version will work.
      
      * src/xfns.c (x_real_pos_and_offsets): When translating coordinates,
      send coordinates (0,0) to the X server and add in the real coordinates
      after getting the response.  Move XGetGeometry for outer window inside
      error-trapping block.  Use DPY variable more, since it's available.
      e1c27dbd
    • Ken Raeburn's avatar
      Use color cache for creating bitmap · 25e32bd8
      Ken Raeburn authored
      * src/image.c (x_create_bitmap_from_xpm_data) [ALLOC_XPM_COLORS]: Set
      attributes to use the caching color allocator.  Initialize and free
      the cache.
      25e32bd8
  3. 11 Nov, 2015 1 commit
    • Eli Zaretskii's avatar
      Implement tray notifications for MS-Windows · 9d439415
      Eli Zaretskii authored
      * src/w32fns.c (MY_NOTIFYICONDATAW): New typedef.
      (NOTIFYICONDATAW_V1_SIZE, NOTIFYICONDATAW_V2_SIZE)
      (NOTIFYICONDATAW_V3_SIZE, NIF_INFO, NIIF_NONE, NIIF_INFO)
      (NIIF_WARNING, NIIF_ERROR, EMACS_TRAY_NOTIFICATION_ID)
      (EMACS_NOTIFICATION_MSG): New macros.
      (NI_Severity): New enumeration.
      (get_dll_version, utf8_mbslen_lim, add_tray_notification)
      (delete_tray_notification, Fw32_notification_notify)
      (Fw32_notification_close): New functions.
      (syms_of_w32fns): Defsubr functions exposed to Lisp.  DEFSYM
      keywords used by w32-notification-notify.
      
      * doc/lispref/os.texi (Desktop Notifications): Describe the native
      w32 tray notifications.
      9d439415
  4. 10 Nov, 2015 3 commits
    • David Reitter's avatar
      Avoid creating notification objects when possible · 0bba3040
      David Reitter authored
      * src/nsterm.m (windowWillEnterFullScreen, windowWillExitFullScreen:,
      windowDidEnterFullScreen, windowDidExitFullScreen): provide
      convenience functions that do not require a notification object.  When
      needed, define NSWindowDidEnterFullScreenNotification to allow for
      compilation on OS X 10.6.8.
      0bba3040
    • Paul Eggert's avatar
      Move INTEGER_TO_CONS body out of .h file · 0e0ea300
      Paul Eggert authored
      * src/data.c (INTBIG_TO_LISP): New macro, with most
      of the contents of the old INTEGER_TO_CONS.
      (intbig_to_lisp, uintbig_to_lisp): New functions.
      * src/lisp.h (INTEGER_TO_CONS):
      Simplify by using EXPR_SIGNED and the new functions.
      This shrinks code size a bit, and makes it easier to
      put a breakpoint on handling of large integers.
      0e0ea300
    • Paul Eggert's avatar
      Spelling fixes · c92dbd6d
      Paul Eggert authored
      * lisp/net/soap-inspect.el (soap-inspect-xs-simple-type):
      Fix misspelling in output.
      c92dbd6d
  5. 09 Nov, 2015 3 commits
    • Eli Zaretskii's avatar
      Fix assertion violation in define-key · 86c19714
      Eli Zaretskii authored
      * src/keymap.c (store_in_keymap): Don't use XFASTINT on non-character
      objects.  Reported by Drew Adams <drew.adams@oracle.com>
      and Juanma Barranquero <lekktu@gmail.com>.
      86c19714
    • Dima Kogan's avatar
      Fix a memory leak in GC of font cache · c6c16fb3
      Dima Kogan authored
      * src/alloc.c (compact_font_cache_entry): Don't GC unmarked font
      entities if some of the fonts it references are marked.  This
      plugs a memory leak.  (Bug#21556)
      c6c16fb3
    • Paul Eggert's avatar
      Use INT_ADD_WRAPV etc. to check integer overflow · 10873055
      Paul Eggert authored
      * src/alloc.c (xnmalloc, xnrealloc, xpalloc, Fmake_string):
      * src/buffer.c (record_overlay_string, overlay_strings):
      * src/casefiddle.c (casify_object):
      * src/ccl.c (Fccl_execute_on_string):
      * src/character.c (char_width, c_string_width, lisp_string_width)
      (count_size_as_multibyte, string_escape_byte8):
      * src/coding.c (coding_alloc_by_realloc, produce_chars):
      * src/data.c (arith_driver):
      * src/dispnew.c (realloc_glyph_pool, init_display):
      * src/editfns.c (styled_format):
      * src/fns.c (Ffillarray):
      * src/ftfont.c (ftfont_shape_by_flt):
      * src/gnutls.c (gnutls_hex_string):
      * src/gtkutil.c (get_utf8_string):
      * src/image.c (x_to_xcolors, x_detect_edges, png_load_body):
      * src/keymap.c (Fkey_description):
      * src/lisp.h (SAFE_ALLOCA_LISP):
      * src/term.c (encode_terminal_code):
      * src/tparam.c (tparam1):
      * src/xselect.c (x_property_data_to_lisp):
      * src/xsmfns.c (smc_save_yourself_CB):
      * src/xterm.c (x_term_init):
      When checking for integer overflow, prefer INT_MULTIPLY_WRAPV to
      more-complicated code involving division and/or
      INT_MULTIPLY_OVERFLOW, and similarly for INT_ADD_WRAPV and
      subtraction and/or INT_ADD_OVERFLOW.
      * src/casefiddle.c (casify_object): Simplify multibyte size check.
      * src/character.c: Remove some obsolete ‘#ifdef emacs’s.
      * src/data.c (arith_driver): Also check for division overflow,
      as that’s now possible given that the accumulator can now contain
      any Emacs integer.
      * src/lisp.h (lisp_word_count): Remove; no longer used.
      10873055
  6. 08 Nov, 2015 11 commits
    • Paul Eggert's avatar
    • Alan Modra's avatar
      ELF unexec: Don't insert a new section · 3008c521
      Alan Modra authored
      Reuse the .bss section instead, making it SHT_PROGBITS.  This way we
      don't need to mess with symbol st_shndx, or section sh_link and
      sh_info.
      
      This does lead to eu-elflint complaints about symbols defined in .bss
      with a needed version, because normally it is undefined symbols that
      have needed versions;  Defined symbols have version definitions.
      The exception is symbols defined by the linker in .dynbss for
      variables copied from a shared library in order to avoid text
      relocations, with copy relocs to copy their initial values from the
      shared library.  These symbols are both defined and have needed
      versions, and eu-elflink only expects to see them in SHT_NOBITS
      sections.  Of course there is no real problem with having such symbols
      in SHT_PROGBITS sections.  glibc ld.so handles them fine.
      
      * unexelf.c: Delete outdated comments.
      (PATCH_INDEX): Delete.
      (find_section): Delete.
      (unexec): Don't add a new section.  Instead reuse the last bss
      section, extending it to cover dumped data.  Make bss sections
      SHT_PROGBITS.  Remove all patching of sh_link, sh_info and
      st_shndx.  Rename bss sections.
      3008c521
    • Alan Modra's avatar
      ELF unexec: Drive from PT_LOAD header rather than sections · 0d644226
      Alan Modra authored
      This rewrites bss handling in the ELF unexec code.  Finding bss
      sections by name results in complicated code that
      - does not account for all names of possible bss sections,
      - assumes specific ordering of bss sections,
      - can wrongly choose a SHT_NOBITS section not in the bss segment,
      - incorrectly calculates bss size (no accounting for alignment gaps),
      - assumes .data and .bss are in the same segment.
      
      All of these problems and more are solved by finding the bss segment
      in PT_LOAD headers, ie. the address range included in p_memsz but not
      p_filesz of the last PT_LOAD header, then matching SHT_NOBITS sections
      in that address range.
      
      * unexelf.c: Delete old ppc comment.
      (OLD_PROGRAM_H): Define.
      (round_up): Delete.
      (unexec): Don't search for bss style sections by name.  Instead,
      use the last PT_LOAD header address range covered by p_memsz
      but not p_filesz and match any SHT_NOBITS section in that
      address range.  Simplify initialisation of section header vars.
      Don't assume that section headers are above bss segment.  Move
      copying of bss area out of section loop.  Align .data2 section
      to 1, since it now covers the entire bss area.  For SHT_NOBITS
      sections in the bss segment, leave sh_addr and sh_addralign
      unchanged, but correct sh_offset.  Clear memory corresponding
      to SHT_NOBITS .plt section.  Delete comment and hacks for
      sections partly overlapping bss range now that the full range
      is properly calculated.  Delete now dead .sbss code.
      (Bug#20614)
      0d644226
    • Alan Modra's avatar
      ELF unexec: R_*_NONE relocs · 8285c2ab
      Alan Modra authored
      These should be ignored on all targets.
      
      * unexelf.c (unexec): Ignore R_*_NONE relocs for any target,
      not just Alpha.  Comment on reloc size assumption.
      8285c2ab
    • Alan Modra's avatar
      ELF unexec: _OBJC_ symbols in bss sections · 3ff9fc0e
      Alan Modra authored
      This code assumed that there was only one bss section.  Rather than
      checking for a particular index, check the section type.  Also, handle
      the possibility that the section was SHT_NOBITS originally and is
      unchanged, in which case no clearing is needed (and sh_offset isn't
      necessarily valid, which can lead to a wild memset).
      
      * unexelf.c (unexec): Properly handle _OBJC_ symbols in bss sections.
      3ff9fc0e
    • Alan Modra's avatar
      ELF unexec: Symbol table patching · 190b968f
      Alan Modra authored
      No st_shndx value larger than SHN_LORESERVE should be changed.
      * unexelf.c (unexec): Don't adjust any st_shndx larger than
      SHN_LORESERVE.  Error on SHN_XINDEX.
      190b968f
    • Alan Modra's avatar
      ELF unexec: Merge Alpha and MIPS COFF debug handling · 47c6e303
      Alan Modra authored
      * unexelf.c (unexec): Merge Alpha and MIPS COFF debug handling.
      Don't find .mdebug section index, find the section in the loop.
      Allow for unlikely possibility that .mdebug is located at sh_offset
      before bss segment, by calculating move from difference in
      sh_offset rather than just assuming new_data2_size.  Simplify
      cbLineOffset handling.
      47c6e303
    • Alan Modra's avatar
      ELF unexec: Tidy code · 856f4eab
      Alan Modra authored
      Separate out some of the more mechanical changes so following patches
      are smaller.
      
      * unexelf.c (unexec): Rearrange initialisation of program
      header vars.  Use pointer vars in loops rather than indexing
      section header array via macros.  Simplify _OBJC_ sym code
      and reloc handling code.
      856f4eab
    • Alan Modra's avatar
      ELF unexec: Correct section header index · 0bcd08ef
      Alan Modra authored
      First a small fix.  The code incorrectly uses "NEW_SECTION_H (n)" when
      it should have been using "NEW_SECTION_H (nn)" to find the name of the
      section currently being processed.  Of course, before the bss
      sections, n and nn have the same value, so this doesn't matter except
      in the case of .sbss.  For .sbss this probably meant .bss (most likely
      the next section) was copied from memory.  A later patch removes the
      bogus .sbss handling anyway.
      
      * unexelf.c (unexec): Use correct index to look up names.
      0bcd08ef
    • Paul Eggert's avatar
      Prefer xpalloc to doubling buffers by hand · 8a8613bc
      Paul Eggert authored
      * src/lread.c (grow_read_buffer): New function, which uses xpalloc.
      (read1): Use it for simplicity.
      * src/macros.c (store_kbd_macro_char):
      * src/minibuf.c (read_minibuf_noninteractive):
      * src/term.c (encode_terminal_code):
      * src/xrdb.c (magic_db):
      Prefer xpalloc to growing buffers by hand.
      This doesn’t fix any bugs, but simplifies the code a bit.
      8a8613bc
    • David Reitter's avatar
      Provide NS notification objects where required to eliminate warnings · 35cd5181
      David Reitter authored
      * nsterm.m (windowDidResize:, toggleFullScreen:):
      Call notification functions with notification objects
      as per delegate APIs.
      35cd5181
  7. 07 Nov, 2015 3 commits
    • David Reitter's avatar
      Ignore fullscreen exit notifications on NS when frame is dead · 53def55b
      David Reitter authored
      * nsterm.m (windowDidResize:,windowWillExitFullScreen:)
        (windowDidExitFullScreen:): Return if frame is dead.
        These functions may be called when a fullscreen frame
        is closed; they are called before, not after.
      
      May address Bug#21428.
      53def55b
    • Eli Zaretskii's avatar
      Speed up lookup in redisplay--variables · fc61ea4f
      Eli Zaretskii authored
      * lisp/frame.el (redisplay--variables): Make it a hash-table.
      
      * src/xdisp.c (maybe_set_redisplay): Access redisplay--variables
      as a hash-table.  This speeds up this function by an order of
      magnitude: where previously a setq was slowed down by 100% by
      introducing the maybe_set_redisplay test, it is now only 5%
      slower.
      (syms_of_xdisp) <redisplay--variables>: Doc fix.
      fc61ea4f
    • Martin Rudalics's avatar
      In x_consider_frame_title don't set title of tooltip frames · e5a98644
      Martin Rudalics authored
      * src/xdisp.c (x_consider_frame_title): Return immediately for
      tooltip frames to avoid displaying empty tooltips.
      e5a98644
  8. 06 Nov, 2015 4 commits
  9. 04 Nov, 2015 1 commit
    • Anders Lindgren's avatar
      Render fringe bitmaps correctly on NextStep (bug#21301). · 411b516d
      Anders Lindgren authored
      The fringe bitmaps were inverted, the background was not transparent,
      the image data was horizontally mirrored, and periodic fringe bitmaps
      were not supported.
      
      * nsimage.m ([EmacsImage initFromXBM:width:height:fg:bg:]): When
      both background and foreground colors are 0, set the background
      alpha channel to 0 (making the background transparent).  When
      copying the image data, do this from the most significant bit
      (leftmost) to the least (rightmost), to avoid mirroring.
      * nsterm.m (ns_draw_fringe_bitmap): Don't invert the image bits. Add
      support for periodic images (e.g. the empty line indicator).
      411b516d
  10. 03 Nov, 2015 1 commit
  11. 31 Oct, 2015 1 commit
  12. 30 Oct, 2015 1 commit
    • Eli Zaretskii's avatar
      Fix a typo in a macro name · e11aaee2
      Eli Zaretskii authored
      * src/w32proc.c (_NLSCMPERROR): Fix a typo in the name of this macro.
      (w32_compare_strings): Adjust for the correction.
      e11aaee2