1. 19 Nov, 2015 7 commits
  2. 18 Nov, 2015 6 commits
    • Eli Zaretskii's avatar
      Fix MS-Windows build --with-modules · 520dc85f
      Eli Zaretskii authored
      * src/module.c: Reformat copyright commentary.
      (module_vec_get): Use explicit cast to size_t to avoid compiler
      warning in 32-bit builds.
      (check_main_thread) [WINDOWSNT]: Fix letter-case in Windows APIs.
      Compare thread IDs directly, as GetThreadId is not available
      before Windows Vista.
      (check_main_thread) [WINDOWSNT]: Duplicate the thread handle
      without using APIs and constants not available on XP and older
      systems.  Obtain and store the thread ID as well.
      520dc85f
    • Aurélien Aptel's avatar
      Make 'Fload' look for modules · 218caccd
      Aurélien Aptel authored
      'Fload' can now load dynamic modules. This also makes 'require' work.
      
      * src/lread.c:
        (suffix_p): New function.
        (Fload): Use 'suffix_p'.  Call 'Fmodule_load' when we try to load a file
        with a module suffix.
        (syms_of_lread): Append module suffix to 'Vload_suffixes'.
      218caccd
    • Aurélien Aptel's avatar
      Add dynamic module module support · 307e76c7
      Aurélien Aptel authored
      
      
      * configure.ac: Add '--with-modules' option.  Conditionally add
        dynlib.o and module.o to the list of objects.  Add any system
        specific flags to the linker flags to support dynamic libraries.
      * m4/ax_gcc_var_attribute.m4: Add autoconf extension to test gcc
        attributes.
      * src/Makefile.in: Conditionally add module objects and linker flags.
      * src/alloc.c (garbage_collect_1): protect module local values from
        GC.
      * src/lisp.h: Add 'module_init' and 'syms_of_module' prototypes.
      * src/emacs_module.h: New header file included by modules.  Public
        module API.
      * src/module.c: New module implementation file.
      Co-authored-by: default avatarPhilipp Stephani <phst@google.com>
      307e76c7
    • Aurélien Aptel's avatar
      Add new User Pointer (User_Ptr) type · f69cd6bf
      Aurélien Aptel authored
      * src/lisp.h: Add new Lisp_Misc_User_Ptr type.
      (XUSER_PTR): New User_Ptr accessor.
      * src/alloc.c (make_user_ptr): New function.
      (mark_object, sweep_misc): Handle Lisp_Misc_User_Ptr.
      * src/data.c (Ftype_of): Return 'user-ptr' for user pointer.
      (Fuser-ptrp): New user pointer type predicate function.
      (syms_of_data): New 'user-ptrp', 'user-ptr' symbol.  New 'user-ptrp'
      subr.
      * src/print.c (print_object): Add printer for User_Ptr type.
      f69cd6bf
    • Aurélien Aptel's avatar
      Add portable layer for dynamic loading · 435cf35b
      Aurélien Aptel authored
      
      
      * src/dynlib.h: New file.
      * src/dynlib.c: New file.
      Co-authored-by: default avatarPhilipp Stephani <phst@google.com>
      435cf35b
    • Philipp Stephani's avatar
      Add catch-all & no-signal version of PUSH_HANDLER · 7cdc5d62
      Philipp Stephani authored
      Ground work for modules. Add a non-signaling version of PUSH_HANDLER and
      a new "catch-all" handler type.
      
      * src/eval.c (init_handler, push_handler, push_handler_nosignal): New
        functions.
      * src/fns.c (hash_remove_from_table): Expose function public.
      * src/lisp.h: New handler type, define macro to push_handler call.
      7cdc5d62
  3. 17 Nov, 2015 3 commits
    • Paul Eggert's avatar
      Fix docstring quoting problems with ‘ '’ · ac16149b
      Paul Eggert authored
      Problem reported by Artur Malabarba in:
      http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01513.html
      Most of these fixes are to documentation; many involve fixing
      longstanding quoting glitches that are independent of the
      recent substitute-command-keys changes.  The changes to code are:
      * lisp/cedet/mode-local.el (mode-local-augment-function-help)
      (describe-mode-local-overload):
      Substitute docstrings before displaying them.
      * lisp/emacs-lisp/cl-macs.el (cl--transform-lambda):
      Quote the generated docstring for later substitution.
      ac16149b
    • Paul Eggert's avatar
      eval_sub followed dangling pointer when debugging · 54beeef1
      Paul Eggert authored
      Problem reported by Pip Cet (Bug#21245).
      This bug could occur in eval_sub if the C compiler reused
      storage associated with the ‘argvals’ local after ‘argvals’
      went out of scope, and if the Elisp debugger stopped on Elisp
      function exit and accessed ‘argvals’.  It could also occur if
      a variadic function was called with so many arguments (over
      2048 args on x86-64) that SAFE_ALLOCA_LISP called malloc, then
      SAFE_FREE freed the arguments, then the memory manager used
      the storage for other purposes, then the debugger accessed the
      arguments.
      * src/eval.c (eval_sub): Declare ‘argvals’ at top level of
      function body.	Simplify local decls.
      When allocating args via SAFE_ALLOCA, call
      debugger before invoking SAFE_FREE, as the debugger needs
      access to the args.
      (eval_sub, apply_lambda): Rework to avoid need for
      set_backtrace_debug_on_exit hack.  This is cleaner,
      and should work better with buggy custom debuggers.
      54beeef1
    • Paul Eggert's avatar
      ELF unexec: align section header · c9fd597a
      Paul Eggert authored
      This ports the recent unexelf.c changes to Fedora x86-64
      when configured with GCC’s -fsanitize=undefined option.
      * src/unexelf.c (unexec): Align new_data2_size to a multiple
      of ElfW (Shdr)’s alignment, so that NEW_SECTION_H returns a
      pointer aligned appropriately for its type.
      c9fd597a
  4. 16 Nov, 2015 2 commits
    • Andreas Schwab's avatar
      Do more checks on bytecode objects (Bug#21929) · d4437101
      Andreas Schwab authored
      * src/eval.c (funcall_lambda): Check size of compiled function
      object.
      (Ffetch_bytecode): Likewise.
      d4437101
    • Paul Eggert's avatar
      Improve fix for regex reentrancy abort · 8ff888a0
      Paul Eggert authored
      Suggested by Stefan Monnier (Bug#21688).
      * src/syntax.c (update_syntax_table_forward):
      Remove recently-added PROPERTIZE arg, and assume it is true.
      All callers changed.
      * src/syntax.h (UPDATE_SYNTAX_TABLE_FORWARD_FAST):
      Invoke update_syntax_table directly.
      8ff888a0
  5. 15 Nov, 2015 6 commits
    • Stephen Leake's avatar
      Improve a few doc strings, comments · a6843cce
      Stephen Leake authored
      * lisp/cedet/cedet-global.el (cedet-gnu-global-expand-filename):
      * lisp/cedet/ede/locate.el (ede-locate-base):
      * lisp/cedet/semantic/symref.el (semantic-symref-calculate-rootdir):
      * src/fns.c (Fdelq): Improve doc string.
      
      * lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions): Add FIXME.
      a6843cce
    • Anders Lindgren's avatar
      Enhance NSTRACE (trace output for NextStep). · ae16894d
      Anders Lindgren authored
      Trace can be disabled for groups of functions. By default, event
      functions and functions that generate lots of output are disabled.
      
      Trace output of Objective-C functions now use the "[ClassName
      parameter:]" form.
      
      * src/nsterm.h (NSTRACE_ALL_GROUPS, NSTRACE_GROUP_EVENTS)
      (NSTRACE_GROUP_UPDATES, NSTRACE_GROUP_FRINGE, NSTRACE_GROUP_COLOR)
      (NSTRACE_GROUP_GLYPHS, NSTRACE_GROUP_FOCUS): New macros,
      controlling in which function groups trace should be active.
      (NSTRACE_WHEN): Support for silencing a function, this also
      silencing all called functions.
      (NSTRACE_UNSILENCE): New macro, used to re-enable trace.
      (NSTRACE_FMT_FSTYPE, NSTRACE_ARG_FSTYPE): New macros, used to
      print the full screen state in NSTRACE functions.
      
      * src/nsterm.m (nstrace_depth, nstrace_num): Made volatile as they
      can be accessed from multiple threads.
      (nstrace_enabled_global): New variable, when FALSE, trace is
      silenced.
      (nstrace_restore_global_trace_state): New function, used to
      restore `nstrace_enabled_global' at end of block.
      ([EmacsView setFrame:], [EmacsWindow setFrame:display:])
      ([EmacsWindow setFrame:display:animation:])
      ([EmacsWindow setFrameTopLeftPoint:]): New functions, print trace
      and call corresponding super function.
      (Many functions): Add or enhance trace output.
      
      * src/nsimage.m (ns_image_from_file): Enhanced trace output.
      
      * src/nsfns.m (x_set_tool_bar_lines): Add trace output.
      
      * src/nsmenu.m ([EmacsToolbar setVisible:]): New function, print trace
      and call corresponding super function.
      ae16894d
    • Anders Lindgren's avatar
    • Anders Lindgren's avatar
      Fixed a toolbar related issue on OS X. · b36ba568
      Anders Lindgren authored
      Earlier, when toggling the tool-bar in a maximized frame, the
      frame size didn't match the number of text lines, leaving an
      unused area at the bottom of the frame.
      
      * nsfns.m (x_set_tool_bar_lines): Exit maximized and full height
      fullscreen modes when tool bar is disabled.
      b36ba568
    • Anders Lindgren's avatar
      Fixed OS X 10.6.8 build issue (bug#21862). · 63e6f4c8
      Anders Lindgren authored
      * src/nsterm.h (EmacsView): Add missing declarations.
      * src/nsterm.m ([EmacsView windowDidBecomeKey]): New method, like
      the standard method but without the notification parameter.
      Intended to be used for direct calls.
      ([EmacsView windowDidEnterFullScreen]): Call the non-notification
      version of `windowDidBecomeKey'. Made the notification method call
      the non-notification method instead of the vice versa.
      (NSWindowDidEnterFullScreenNotification): Deleted, no longer
      needed.
      63e6f4c8
    • Paul Eggert's avatar
      Fix regex abort when it tries to reenter itself · 8121757b
      Paul Eggert authored
      Problem reported by Ken Raeburn.
      Solution suggested by Stefan Monnier (Bug#21688).
      * src/regex.c (re_match_2_internal):
      Use new _FAST functions to avoid regex code reentering itself.
      * src/syntax.c (update_syntax_table_forward): New arg PROPERTIZE.
      All callers changed.
      * src/syntax.h (UPDATE_SYNTAX_TABLE_FORWARD_FAST)
      (UPDATE_SYNTAX_TABLE_FAST): New inline functions.
      8121757b
  6. 13 Nov, 2015 16 commits
    • Juri Linkov's avatar
      Support rectangular regions for more commands · 31f6e939
      Juri Linkov authored
      * lisp/simple.el (region-extract-function): Handle the arg value ‘bounds’.
      (region-insert-function): New function.
      (shell-command-on-region): Add arg ‘region-noncontiguous-p’.
      If non-nil, operate on multiple chunks.
      (region-noncontiguous-p): New function.
      
      * lisp/rect.el: Add function rectangle--insert-region
      around region-insert-function.
      (extract-rectangle-bounds): New function.
      (rectangle--extract-region): Handle the arg value ‘bounds’.
      (rectangle--insert-region): New function.
      
      * lisp/emulation/cua-rect.el: Add function cua--insert-rectangle
      around region-insert-function.
      (cua--extract-rectangle-bounds): New function.
      (cua--rectangle-region-extract): Handle the arg value ‘bounds’.
      
      * lisp/replace.el (query-replace, query-replace-regexp): Add arg
      ‘region-noncontiguous-p’.  Use ‘use-region-p’.
      (query-replace-regexp-eval, map-query-replace-regexp)
      (replace-string, replace-regexp): Use ‘use-region-p’.
      (keep-lines, flush-lines, how-many): Use ‘use-region-p’.
      (perform-replace): Add arg ‘region-noncontiguous-p’.
      If non-nil, operate on multiple chunks.
      
      * src/casefiddle.c (Fdowncase_region): Add arg ‘region-noncontiguous-p’.
      If non-nil, operate on multiple chunks. (Bug#19829)
      31f6e939
    • Paul Eggert's avatar
      Spruce up ftfont.c memory allocation · 04ac097f
      Paul Eggert authored
      * src/ftfont.c (setup_otf_gstring):
      Avoid O(N**2) behavior when reallocating.
      (ftfont_shape_by_flt): Prefer xpalloc to xrealloc when
      reallocating buffers; this simplifies the code.  Do not trust
      mflt_run to leave the output areas unchanged on failure, as
      this isn’t part of its interface spec.
      04ac097f
    • Paul Eggert's avatar
      Port recent XCB changes to 64-bit ‘long int’ · da05685d
      Paul Eggert authored
      For historical reasons, libX11 represents 32-bit values like Atoms as
      ‘long int’ even on platforms where ‘long int’ is 64 bits.  XCB doesn’t
      do that, so adapt the recent XCB code to behave properly on 64-bit
      platforms.  Also, fix what appears to be a bug in the interpretation
      of xcb_get_property_value_length, at least on my Fedora platform
      which is running libxcb-1.11-5.fc21.
      * src/xfns.c (x_real_pos_and_offsets):
      * src/xterm.c (get_current_wm_state):
      xcb_get_property_value_length returns a byte count, not a word count.
      For 32-bit quantities, xcb_get_property_value returns a vector
      of 32-bit words, not of (possibly 64-bit) long int.
      
      Backport.
      da05685d
    • Paul Eggert's avatar
      * src/undo.c (run_undoable_change): Now static. · 97226341
      Paul Eggert authored
      Backport.
      97226341
    • Eli Zaretskii's avatar
      Remove support for ':timeout' from w32 tray notifications · 34530571
      Eli Zaretskii authored
      * src/w32fns.c (Fw32_notification_notify): Delete the code that
      supports ':timeout'.
      (syms_of_w32fns): Don't DEFSYM ':timeout'.  This avoids clashes
      with dbusbind.c when D-Bus is compiled in.
      
      * doc/lispref/os.texi (Desktop Notifications): Don't mention
      ':timeout'.
      
      Backport.
      34530571
    • Juanma Barranquero's avatar
      * src/undo.c: Small fixes for previous change · d6b046c9
      Juanma Barranquero authored
      (run_undoable_change): Mark void argument list.
      (record_property_change): Remove unused variable `boundary'.
      
      Backport.
      d6b046c9
    • Eli Zaretskii's avatar
      Fix last change · f8d8e0b7
      Eli Zaretskii authored
      * src/w32fns.c (syms_of_w32fns) [WINDOWSNT && !HAVE_DBUS]:
      Don't DEFSYM tray notification symbols if D-Bus is being used.
      
      Backport.
      f8d8e0b7
    • Eli Zaretskii's avatar
      Another fix for MinGW64 and Cygwin builds due to notifications · 82f3dc0e
      Eli Zaretskii authored
      * src/w32fns.c: Ifdef away tray notification code if D-Bus is
      being compiled into Emacs.
      (syms_of_w32fns) [WINDOWSNT && !HAVE_DBUS]: Don't defsubr
      Sw32_notification_notify and Sw32_notification_close if the code
      is not compiled.  Reported by Andy Moreton <andrewjmoreton@gmail.com>.
      
      Backport.
      82f3dc0e
    • YAMAMOTO Mitsuharu's avatar
      Remove intern calls and XXX comments from Fx_export_frames · 071b2e16
      YAMAMOTO Mitsuharu authored
      * src/xfns.c (Fx_export_frames): Use Qpdf, Qpng, Qpostscript, and
      Qsvg instead of intern calls.  Use "postscript" instead of "ps"
      for consistency with image types.  Remove XXX comments.
      (syms_of_xfns) <Qpdf>: DEFSYM it.
      
      Backport.
      071b2e16
    • Paul Eggert's avatar
      Port recent XCB changes to 64-bit ‘long int’ · 4c4b5205
      Paul Eggert authored
      For historical reasons, libX11 represents 32-bit values like Atoms as
      ‘long int’ even on platforms where ‘long int’ is 64 bits.  XCB doesn’t
      do that, so adapt the recent XCB code to behave properly on 64-bit
      platforms.  Also, fix what appears to be a bug in the interpretation
      of xcb_get_property_value_length, at least on my Fedora platform
      which is running libxcb-1.11-5.fc21.
      * src/xfns.c (x_real_pos_and_offsets):
      * src/xterm.c (get_current_wm_state):
      xcb_get_property_value_length returns a byte count, not a word count.
      For 32-bit quantities, xcb_get_property_value returns a vector
      of 32-bit words, not of (possibly 64-bit) long int.
      4c4b5205
    • Paul Eggert's avatar
      4f0ce9c8
    • Eli Zaretskii's avatar
      Remove support for ':timeout' from w32 tray notifications · 695a6f93
      Eli Zaretskii authored
      * src/w32fns.c (Fw32_notification_notify): Delete the code that
      supports ':timeout'.
      (syms_of_w32fns): Don't DEFSYM ':timeout'.  This avoids clashes
      with dbusbind.c when D-Bus is compiled in.
      
      * doc/lispref/os.texi (Desktop Notifications): Don't mention
      ':timeout'.
      695a6f93
    • Juanma Barranquero's avatar
      * src/undo.c: Small fixes for previous change · 66b9f7bd
      Juanma Barranquero authored
      (run_undoable_change): Mark void argument list.
      (record_property_change): Remove unused variable `boundary'.
      66b9f7bd
    • Eli Zaretskii's avatar
      Fix last change · 508e77b7
      Eli Zaretskii authored
      * src/w32fns.c (syms_of_w32fns) [WINDOWSNT && !HAVE_DBUS]:
      Don't DEFSYM tray notification symbols if D-Bus is being used.
      508e77b7
    • Eli Zaretskii's avatar
      Another fix for MinGW64 and Cygwin builds due to notifications · d60ed3f3
      Eli Zaretskii authored
      * src/w32fns.c: Ifdef away tray notification code if D-Bus is
      being compiled into Emacs.
      (syms_of_w32fns) [WINDOWSNT && !HAVE_DBUS]: Don't defsubr
      Sw32_notification_notify and Sw32_notification_close if the code
      is not compiled.  Reported by Andy Moreton <andrewjmoreton@gmail.com>.
      d60ed3f3
    • YAMAMOTO Mitsuharu's avatar
      Remove intern calls and XXX comments from Fx_export_frames · 805a39bc
      YAMAMOTO Mitsuharu authored
      * src/xfns.c (Fx_export_frames): Use Qpdf, Qpng, Qpostscript, and
      Qsvg instead of intern calls.  Use "postscript" instead of "ps"
      for consistency with image types.  Remove XXX comments.
      (syms_of_xfns) <Qpdf>: DEFSYM it.
      805a39bc