1. 12 Dec, 2016 11 commits
    • Clément Pit--Claudel's avatar
      Move backtrace to ELisp using a new mapbacktrace primitive · 27cada03
      Clément Pit--Claudel authored
      * src/eval.c (get_backtrace_starting_at, backtrace_frame_apply)
      (Fmapbacktrace, Fbacktrace_frame_internal): New functions.
      (get_backtrace_frame, Fbacktrace_debug): Use `get_backtrace_starting_at'.
      * lisp/subr.el (backtrace--print-frame): New function.
      (backtrace): Reimplement using `backtrace--print-frame' and `mapbacktrace'.
      (backtrace-frame): Reimplement using `backtrace-frame--internal'.
      * lisp/emacs-lisp/debug.el (debugger-setup-buffer): Pass a base to
      `mapbacktrace' instead of searching for "(debug" in the output of
      * test/lisp/subr-tests.el (subr-test-backtrace-simple-tests)
      (subr-test-backtrace-integration-test): New tests.
      * doc/lispref/debugging.texi (Internals of Debugger): Document
      `mapbacktrace' and missing argument BASE of `backtrace-frame'.
    • Paul Eggert's avatar
      Use C99 syntax for font drivers · a41ded87
      Paul Eggert authored
      Problem reported by Daniel Colascione in:
      * src/ftcrfont.c (ftcrfont_driver):
      * src/ftfont.c (ftfont_driver):
      * src/ftxfont.c (ftxfont_driver):
      * src/macfont.m (macfont_driver):
      * src/nsfont.m (nsfont_driver):
      * src/xfont.c (xfont_driver):
      * src/xftfont.c (xftfont_driver):
      Use C99 syntax, not the old GNU C syntax.
    • Glenn Morris's avatar
      Obsolete gs.el · 3c655230
      Glenn Morris authored
      * lisp/gs.el: Move to lisp/obsolete.  (Bug#1524)
      * doc/lispref/display.texi (Image Formats): Remove postscript.
      (PostScript Images): Remove section.
      * doc/lispref/elisp.texi: Update menu.
    • Glenn Morris's avatar
      Un-revert recent Ffset change · ffb13021
      Glenn Morris authored
      * src/data.c (Ffset): Reinstate the check for "nil".
    • Glenn Morris's avatar
      Minor advice.el fix · 61f8c238
      Glenn Morris authored
      * lisp/emacs-lisp/advice.el (ad-preactivate-advice):
      Avoid setting the function definition of nil.
      This was happening during bootstrap of org-compat.el,
      apparently due to eager macro expansion of code behind
      a (featurep 'xemacs) test.
    • Eli Zaretskii's avatar
      Make etags-tests work in out-of-tree builds · 940df477
      Eli Zaretskii authored
      * test/lisp/progmodes/etags-tests.el (etags-bug-158)
      (etags-bug-23164): Make them work in an out-of-tree build.
      Reported by Ken Brown <kbrown@cornell.edu>.
    • Eli Zaretskii's avatar
      Avoid crashing if a new thread is signaled right away · 825f4dd4
      Eli Zaretskii authored
      * src/thread.c (post_acquire_global_lock): Don't raise the pending
      signal if the thread's handlers were not yet set up, as that will
      cause Emacs to exit with a fatal error.  This can happen if a
      thread is signaled as soon as make-thread returns, before the new
      thread had an opportunity to acquire the global lock, set up the
      handlers, and call the thread function.
      * test/src/thread-tests.el (thread-signal-early): New test.
    • Eli Zaretskii's avatar
      Fix point motion in cloned buffers · a416e1d6
      Eli Zaretskii authored
      * src/thread.c (post_acquire_global_lock): Call
      set_buffer_internal_2 instead of tricking set_buffer_internal_1
      into resetting the current buffer even if it didn't change.  This
      avoids bug#25165, caused by failing to record the modified values
      of point and mark, because current_buffer was set to NULL.  Also,
      don't bother re-setting the buffer if there was no thread switch,
      as that just wastes cycles.
      * src/buffer.c (set_buffer_internal_2): New function, with most of
      the body of set_buffer_internal_1, but without the test for B
      being identical to the current buffer.
      (set_buffer_internal_1): Call set_buffer_internal_2 if B is not
      identical to the current buffer.
      * src/buffer.h (set_buffer_internal_2): Add prototype.
      * test/src/thread-tests.el (thread-sticky-point): New test.
    • Michael Albinus's avatar
      Further improvements in Tramp's file name unquoting · 00d4ba27
      Michael Albinus authored
      * lisp/net/tramp-adb.el (tramp-adb-handle-file-local-copy)
      (tramp-adb-handle-write-region): Unquote localname.
      (tramp-adb-handle-copy-file): Implement direct copy on remote device.
      (tramp-adb-handle-rename-file): Quote arguments, add "-f" to force.
      * lisp/net/tramp.el (tramp-file-name-unquote-localname): New defun.
      * lisp/net/tramp-gvfs.el (tramp-gvfs-get-file-attributes)
      (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec)
      * lisp/net/tramp-sh.el (tramp-make-copy-program-file-name):
      * lisp/net/tramp-smb.el (tramp-smb-get-share)
      (tramp-smb-get-localname): Use it.
      * test/lisp/net/tramp-tests.el (tramp--test-docker-p): New defun.
      (tramp--test-special-characters, tramp-test34-utf8)
      (tramp-test34-utf8-with-stat, tramp-test34-utf8-with-perl)
      (tramp-test34-utf8-with-ls): Use it.
    • Martin Rudalics's avatar
      Strengthen conditions for resizing sibling windows (Bug#25169) · 184ed361
      Martin Rudalics authored
      * lisp/window.el (window-resize, delete-window): Resize other siblings
      only if `window-combination-resize' equals t (Bug#25169).
    • Noam Postavsky's avatar
      Quote filenames containing '~' in prompts · a92a027d
      Noam Postavsky authored
      When in a directory named '~', the default value given by
      `read-file-name' should be quoted by prepending '/:', in order to
      prevent it from being interpreted as referring to the $HOME
      directory (Bug#16984).
      * lisp/minibuffer.el (minibuffer-maybe-quote-filename): New function.
      (completion--sifn-requote, read-file-name-default): Use it instead of
      * test/lisp/files-tests.el (files-test-read-file-in-~): Test it.
  2. 11 Dec, 2016 11 commits
  3. 10 Dec, 2016 8 commits
    • Andreas Schwab's avatar
      * Makefile.in (install-etc): Don't prepend $(DESTDIR) to commands in · 2335b910
      Andreas Schwab authored
      system unit file.
    • Glenn Morris's avatar
      ; Fix copyright years in new files · 25a52ca6
      Glenn Morris authored
    • Philipp Stephani's avatar
      ; Update file name in comment · 759415df
      Philipp Stephani authored
    • Eli Zaretskii's avatar
      Support concurrency in Emacs Lisp · 2412a1fc
      Eli Zaretskii authored
      Merge branch 'test-concurrency'
      * src/thread.c:
      * src/thread.h:
      * src/systhread.c:
      * src/systhread.h: New files.
      * src/xgselect.c (xg_select): Avoid using SAFE_NALLOCA and use
      xnmalloc unconditionally.
      * src/window.c (struct save_window_data): Rename current_buffer to
      * src/w32proc.c (sys_select): Change the function signature to
      closer fit 'pselect' on Posix hosts.
      * src/search.c:
      * src/regex.h: Convert some globals to macros that reference
      thread-specific values.
      * src/process.c (pset_thread, add_non_keyboard_read_fd)
      (add_process_read_fd, add_non_blocking_write_fd)
      (recompute_input_desc, compute_input_wait_mask)
      (compute_non_process_wait_mask, compute_non_keyboard_wait_mask)
      (compute_write_mask, clear_waiting_thread_info)
      (update_processes_for_thread_death, Fset_process_thread)
      (Fprocess_thread): New functions.
      (enum fd_bits): New enumeration.
      (fd_callback_data): Add 'thread' and 'waiting_thread', rename
      'condition' to 'flags'.
      (set_process_filter_masks, create_process, create_pty)
      (Fmake_serial_process, finish_after_tls_connection)
      (connect_network_socket, deactivate_process)
      (server_accept_connection, wait_reading_process_output)
      (Fcontinue_process, Fstop_process, keyboard_bit_set)
      (add_timer_wait_descriptor, add_keyboard_wait_descriptor)
      (delete_keyboard_wait_descriptor): Use the new functions instead
      of manipulating fd flags and masks directly.
      (syms_of_process): Defsubr the new primitives.
      * src/print.c (print_object): Print threads, mutexes, and
      conditional variables.
      * src/lisp.h (enum pvec_type): New values PVEC_THREAD, PVEC_MUTEX,
      and PVEC_CONDVAR.
      (CHECK_THREAD, CHECK_MUTEX, CHECK_CONDVAR): New inline functions.
      (struct handler): Add back byte_stack.  Rename lisp_eval_depth to
      * src/eval.c (specpdl_kind, specpdl_arg, do_specbind)
      (rebind_for_thread_switch, do_one_unbind)
      (unbind_for_thread_switch): New functions.
      (init_eval): 'handlerlist' is not malloc'ed.
      (specbind): Call do_specbind.
      (unbind_to): Call do_one_unbind.
      (mark_specpdl): Accept 2 arguments.
      (mark_specpdl): Mark the saved value in a let-binding.
      * src/emacs.c (main): Call init_threads_once, init_threads, and
      * src/data.c (Ftype_of): Support thread, mutex, and condvar
      (Fthreadp, Fmutexp, Fcondition_variable_p): New functions.
      (syms_of_data): DEFSYM and defsubr new symbols and primitives.
      * src/bytecode.c (struct byte_stack, FETCH, CHECK_RANGE)
      (BYTE_CODE_QUIT): Add back.
      (exec_byte_code): Add back byte stack manipulation.
      * src/alloc.c (cleanup_vector): Handle threads, mutexes, and
      conditional variables.
      (mark_stack): Now extern; accept additional argument 'bottom'.
      (flush_stack_call_func): New function.
      (garbage_collect_1): Call mark_threads and unmark_threads.  Don't
      mark handlers.
      * src/.gdbinit (xbytecode): Add back.
      * test/src/thread-tests.el: New tests.
      * test/src/data-tests.el (binding-test-manual)
      (binding-test-setq-default, binding-test-makunbound)
      (binding-test-defvar-bool, binding-test-defvar-int)
      (binding-test-set-constant-t, binding-test-set-constant-nil)
      (binding-test-set-constant-nil): New tests.
      * doc/lispref/processes.texi (Processes and Threads): New
      * doc/lispref/threads.texi: New file
      * doc/lispref/elisp.texi (Top): Include it.
      * doc/lispref/objects.texi (Thread Type, Mutex Type)
      (Condition Variable Type): New subsections.
      (Type Predicates): Add thread-related predicates.
      * doc/lispref/objects.texi (Editing Types):
      * doc/lispref/elisp.texi (Top): Update higher-level menus.
      * etc/NEWS: Mention concurrency features.
    • Eli Zaretskii's avatar
      Fix error messages in thread.c · 828b4560
      Eli Zaretskii authored
      * src/thread.c (lisp_mutex_unlock, Fcondition_wait)
      (Fcondition_notify, Fthread_join): Fix error messages.
    • Eli Zaretskii's avatar
      Improve doc strings in thread.c · c364d62f
      Eli Zaretskii authored
      * src/thread.c (Fmake_condition_variable, Fcondition_wait)
      (Fcondition_notify, Fcondition_mutex, Fcondition_name, Fmake_thread)
      (Fthread_join, Fall_threads): Doc fixes.
    • Eli Zaretskii's avatar
      Fix building with check-lisp-object-type · e4df093e
      Eli Zaretskii authored
      * src/thread.c (mark_one_thread): Use NILP to compare with
      m_saved_last_thing_searched, which is a Lisp object.  Reported by
      Andreas Politz <politza@hochschule-trier.de>.
    • Eli Zaretskii's avatar
      Documentation and commentary improvements · 19bc4302
      Eli Zaretskii authored
      * src/lisp.h:
      * src/regex.c:
      * src/xgselect.c (xg_select): Improve commentary and formatting.
      * doc/lispref/objects.texi (Thread Type, Mutex Type)
      (Condition Variable Type): New subsections.
      (Type Predicates): Add thread-related predicates.
      * doc/lispref/objects.texi (Editing Types):
      * doc/lispref/elisp.texi (Top): Update higher-level menus.
  4. 09 Dec, 2016 9 commits
    • Michael Albinus's avatar
      Fix further problems with quoted file names in Tramp · fc0fd24c
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-quoted-name-p, tramp-quote-name)
      (tramp-unquote-name): Move defsubst ...
      * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p)
      (tramp-compat-file-name-unquote): ... here. Adapt callees.
      * lisp/net/tramp-cache.el (tramp-flush-file-property)
      * lisp/net/tramp-gvfs.el (tramp-gvfs-url-file-name):
      * lisp/net/tramp-sh.el (tramp-make-copy-program-file-name):
      * lisp/net/tramp-smb.el (tramp-smb-handle-copy-file)
      (tramp-smb-get-share, tramp-smb-get-localname): Handle quoted files.
    • Eli Zaretskii's avatar
      *src/sysdep.c: Fix a comment. · ad03e7af
      Eli Zaretskii authored
    • Eli Zaretskii's avatar
      Fix compilation error on Fedora 24 · a708a5c6
      Eli Zaretskii authored
      * src/sysdep.c [HAVE_H_ERRNO]: Remove declaration of h_errno.
      Reported by Paul Eggert <eggert@cs.ucla.edu>.
    • Eli Zaretskii's avatar
      Fix compilation warnings due to prototype of thread_select · 7399f53a
      Eli Zaretskii authored
      * src/thread.h <int select_func>: Make the 5th and 6th arguments
      be 'const'.
      * src/process.c [WINDOWSNT]:
      * src/w32proc.c: Make the 5th and 6th argument to sys_select be
    • Eli Zaretskii's avatar
      Fix compilation on Debian GNU/Linux · ae490069
      Eli Zaretskii authored
      * src/thread.h: Include sys/types.h, for ssize_t that regex.h
      uses.  Reported by Robert Marshall <robert.marshall@codethink.co.uk>.
    • Eli Zaretskii's avatar
      Fix subtle errors with let-binding of localized variables · 3ef50c1f
      Eli Zaretskii authored
      * src/eval.c (do_specbind): Don't require a "symbol" that is
      actually a cons cell, in order to call set-default, as there are
      no longer such bindings.  This makes do_specbind work like the
      pre-concurrency implementation in specbind for bindings of
      forwarded symbols.  Use specpdl_kind to access the type of the
      (specpdl_kind): New function.
    • Michael Albinus's avatar
      Document file-name-quote, file-name-unquote and file-name-quoted-p · 57a77f83
      Michael Albinus authored
      * doc/lispref/files.texi (File Name Expansion):
      * etc/NEWS: Mention file-name-quote, file-name-unquote and
      * lisp/files.el (file-name-non-special): Revert using
      file-name-quote, file-name-unquote and file-name-quoted-p.
    • Noam Postavsky's avatar
      Fix bad quoting of python-shell-interpreter · 8f611e5e
      Noam Postavsky authored
      `python-shell-calculate-command' was using `shell-quote-argument' as if
      it was generating a shell command, but its callers don't pass the result
      to a shell, and they expect to parse it with `split-string-and-unquote'.
      This caused problems depending on the flavor of shell quoting in
      effect (Bug#25025).
      * lisp/progmodes/python.el (python-shell-calculate-command): Use
      `combine-and-quote-strings' to quote the interpreter, so that it can be
      parsed by `python-shell-make-comint' successfully using
    • Paul Eggert's avatar
  5. 08 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Make read1 more reentrant · f0a1e9ec
      Paul Eggert authored
      This is needed if ‘read’ is called soon after startup, before the
      Unicode tables have been set up, and it reads a \N escape and
      needs to look up a value the Unicode tables, a lookup that in turn
      calls read1 recursively.  Although this change doesn’t make ‘read’
      fully reentrant, it’s good enough to handle this case.
      * src/lread.c (read_buffer_size, read_buffer): Remove static vars.
      (grow_read_buffer): Revamp to use locals, not statics, and to
      record memory allocation un the specpdl.  All callers changed.
      (read1): Start with a stack-based buffer, and use the heap
      only if the stack buffer is too small.  Use unbind_to to
      free any heap buffer allocated.  Use bool for boolean.
      Redo symbol loop so that only one call to grow_read_buffer
      is needed.
      (init_obarray): Remove no-longer-needed initialization.