aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix comment detection on open parensNoam Postavsky2017-01-231-55/+62
| | | | | | | | | | | | | | | Characters having both open paren syntax and comment start syntax were being detected as open parens even when they should have been part a comment starter (Bug#24870). * src/syntax.c (in_2char_comment_start): New function, extracted from `scan_sexps_forward'. (scan_sexps_forward): Add check for a 2-char comment starter before the loop. Inside the loop, do that check after incrementing the 'from' character index. Move the single char comment syntax cases into the switch instead of special casing them before. * test/src/syntax-tests.el (parse-partial-sexp-paren-comments): (parse-partial-sexp-continue-over-comment-marker): New tests.
* Improve uses of CHECK_LIST etc.Paul Eggert2017-01-226-190/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/eval.c (FletX): Report an error for invalid constructs like ‘(let* (a . 0))’, so that ‘let*’ is more consistent with ‘let’. (lambda_arity): Use plain CHECK_CONS. * src/fns.c (CHECK_LIST_END): Move from here to lisp.h. (Fcopy_alist): Remove unnecessary CHECK_LIST call, since concat does that for us. (Fnthcdr, Fmember, Fmemql, Fdelete, Fnreverse): Use CHECK_LIST_END, not CHECK_LIST_CONS. This hoists a runtime check out of the loop. (Fmemq): Simplify and use CHECK_LIST_END instead of CHECK_LIST. (Fassq, Fassoc, Frassq, Frassoc): Simplify and use CHECK_LIST_END instead of CAR. (assq_no_quit, assoc_no_quit): Simplify and assume proper list. (Fnconc): Use plain CHECK_CONS, and do-while instead of while loop. * src/fontset.c (Fnew_fontset): * src/frame.c (Fmodify_frame_parameters): Use CHECK_LIST_END at end, rather than CHECK_LIST at start, for a more-complete check. * src/gfilenotify.c (Fgfile_add_watch): Omit unnecessary CHECK_LIST, since Fmember does that for us. * src/lisp.h (lisp_h_CHECK_LIST_CONS, CHECK_LIST_CONS): Remove; no longer used. (CHECK_LIST_END): New inline function.
* Don't wait for frame to become visibleNoam Postavsky2017-01-201-54/+4
| | | | | | | | * src/xterm.c (x_make_frame_visible): Remove code that waits for the frame to become visible. We have to deal with invisible frames anyway, the loop could sometimes before the frame turned visible, and for some window managers (e.g., XMonad, i3wm) it caused Emacs to get stuck in a busy loop (Bug#24091).
* Check that variable lists are actually listsPhilipp Stephani2017-01-191-0/+2
| | | | | | | | | | 'let' and 'let*' document that their first argument has to be a list, but don't check for that; instead, they allow (and silently ignore) other types. Introduce an explicit type check. * src/eval.c (Flet, FletX): Check that the variable list is indeed a list. * test/src/eval-tests.el: Add unit tests.
* Remove lock file when auto-saving into the visited fileEli Zaretskii2017-01-181-4/+11
| | | | | | * src/fileio.c (write_region): When auto-saving into the visited file, unlock the file whenever we mark the buffer unmodified. (Bug#25470)
* Fix a bug with signaling a thread that waits for condvarEli Zaretskii2017-01-181-17/+24
| | | | | | | | | | | * src/thread.c (lisp_mutex_lock_for_thread): New function, with all the guts of lisp_mutex_lock. (lisp_mutex_lock): Call lisp_mutex_lock_for_thread. (condition_wait_callback): Don't call post_acquire_global_lock before locking the mutex, as that could cause a signaled thread to exit prematurely, because the condvar's mutex is recorded to be not owned by any thread, and with-mutex wants to unlock it as part of unwinding the stack in response to the signal.
* Rudimentary error handling for non-main threadsEli Zaretskii2017-01-181-3/+17
| | | | | | | | | | | | | | * src/thread.c (last_thread_error): New static variable. (syms_of_threads): Staticpro it. (record_thread_error, Fthread_last_error): New functions. (syms_of_threads): Defsubr Fthread_last_error. * doc/lispref/threads.texi (Basic Thread Functions): Document thread-last-error. * test/src/thread-tests.el (thread-errors, thread-signal-early) (threads-condvar-wait): Test the values returned by thread-last-error.
* Fix NS main thread check (bug#25265)Alan Third2017-01-141-2/+2
| | | | | * src/nsterm.m (ns_read_socket, ns_select): Replace mainThread with isMainThread.
* Fix a bug in waiting for condition variableEli Zaretskii2017-01-131-2/+41
| | | | | | | | | | | * src/thread.c (lisp_mutex_lock, lisp_mutex_unlock) (lisp_mutex_unlock_for_wait, condition_wait_callback) (condition_notify_callback): Improve commentary. (condition_wait_callback): Call post_acquire_global_lock before attempting to lock the mutex, to make sure the lock's owner is recorded correctly. * test/src/thread-tests.el (threads-condvar-wait): New test.
* Use expanded stack during regex matchesNoam Postavsky2017-01-083-40/+62
| | | | | | | | | | | | | | | | | | | | | | | While the stack is increased in main(), to allow the regex stack allocation to use alloca we also need to modify regex.c to actually take advantage of the increased stack, and not limit stack allocations to SAFE_ALLOCA bytes. * src/regex.c (MATCH_MAY_ALLOCATE): Remove obsolete comment about allocations in signal handlers which no longer happens and correct description about when and why MATCH_MAY_ALLOCATE should be defined. (emacs_re_safe_alloca): New variable. (REGEX_USE_SAFE_ALLOCA): Use it as the limit of stack allocation instead of MAX_ALLOCA. (emacs_re_max_failures): Rename from `re_max_failures' to avoid confusion with glibc's `re_max_failures'. * src/emacs.c (main): Increase the amount of fixed 'extra' bytes we add to the stack. Instead of changing emacs_re_max_failures based on the new stack size, just change emacs_re_safe_alloca; emacs_re_max_failures remains constant regardless, since if we run out stack space SAFE_ALLOCA will fall back to heap allocation. Co-authored-by: Eli Zaretskii <eliz@gnu.org>
* Fix computation of regex stack limitNoam Postavsky2017-01-081-9/+6
| | | | | | | | | | | The regex stack limit was being computed as the number of stack entries, whereas it was being compared with the current size as measured in bytes. This could cause indefinite looping when nearing the stack limit if re_max_failures happened not to be a multiple of sizeof fail_stack_elt_t (Bug #24751). * src/regex.c (GROW_FAIL_STACK): Compute both current stack size and limit as numbers of stack entries.
* Remove apploopnrAlan Third2017-01-081-70/+43
| | | | | * src/nsterm.m (ns_select, ns_read_socket): Remove apploopnr and only allow app loop to run in main thread.
* Remove unnecessary blankp codePaul Eggert2017-01-081-5/+0
| | | | | * src/character.c (blankp): Remove redundant code that slows Emacs down a bit. The caller already does the test.
* Remove @SET_MAKE@ from manually-maintained filesPaul Eggert2017-01-071-3/+0
| | | | | | Emacs now assumes GNU Make, so @SET_MAKE@ is no longer needed. * Makefile.in, lwlib/Makefile.in, nextstep/Makefile.in: * src/Makefile.in: Remove @SET_MAKE@.
* Add support for Unicode whitespace in [:blank:]Philipp Stephani2017-01-063-4/+26
| | | | | | | | | | | | | | | | See Bug#25366. * src/character.c (blankp): New function for checking Unicode horizontal whitespace. * src/regex.c (ISBLANK): Use 'blankp' for non-ASCII horizontal whitespace. (BIT_BLANK): New bit for range table. (re_wctype_to_bit, execute_charset): Use it. * test/lisp/subr-tests.el (subr-tests--string-match-p--blank): Add unit test for [:blank:] character class. * test/src/regex-tests.el (test): Adapt unit test. * doc/lispref/searching.texi (Char Classes): Document new Unicode behavior for [:blank:].
* Revert "Rework NS event handling (bug#25265)"Alan Third2017-01-042-68/+313
| | | | This reverts commit e0e5b0f4a4ce1d19ee0240c514dedd873d4165dc.
* Generate nt/gnulib.mk from lib/gnulib.mkEli Zaretskii2017-01-031-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | This was proposed by Paul Eggert <eggert@cs.ucla.edu>, with the purpose of avoiding manual maintenance of nt/gnulib.mk. * nt/gnulib-modules-to-delete.cfg: New file. * nt/Makefile.in (AM_V_GEN, am__v_GEN_, am__v_GEN_0) (am__v_GEN_1): New variables. (${srcdir}/gnulib.mk): Rules to generate gnulib.mk from lib/gnulib.mk and list of modules in gnulib-modules-to-delete.cfg. * make-dist (nt): Add gnulib-modules-to-delete.cfg to the list of files to link. * configure.ac (GNULIB_MK): Compute the value according to $opsys. * autogen.sh: Create nt/gnulib.mk if it doesn't exist, before running autoreconf. * Makefile.in (gnulib_mk): New variable. ($(srcdir)/nt/gnulib.mk): Rule to produce it. (AUTOMAKE_INPUTS): Use $(gnulib_mk) instead of a literal file name. * .gitignore: Add nt/gnulib.mk. * src/w32.c (acl_errno_valid): Implement it here, as we no longer build the acl-permissions module from Gnulib.
* Fix compilation --without-xEli Zaretskii2017-01-021-2/+3
| | | | | * src/composite.c (autocmp_chars) [HAVE_WINDOW_SYSTEM]: Call font_range only if it is compiled in. (Bug#25334)
* ; Fix typoMichael Albinus2017-01-011-1/+1
| | | | * src/gfilenotify.c:
* Update copyright year to 2017 in masterPaul Eggert2017-01-015-5/+5
| | | | | | Run admin/update-copyright in the master branch. This fixes files that were not already fixed in the emacs-25 branch before it was merged here.
* Merge from origin/emacs-25Paul Eggert2017-01-01209-209/+209
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-31209-209/+209
| | | | | | | | Run admin/update-copyright.
| * Backport: Remove an ambiguity from defvar's doc string. Fixes bug #25292.Alan Mackenzie2016-12-301-4/+5
| | | | | | | | | | | | | | | | | | The ambiguity was whether INITVALUE is evaluated when it's not going to be used to set SYMBOL's value. * src/eval.c (defvar): Rewrite a paragraph of the doc string. (cherry picked from commit 8295e97f18490a535d1188a3daf0b0fd1bf4fa0d)
* | Merge from origin/emacs-25Paul Eggert2017-01-012-7/+22
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 697167b ; Improve wording of previous change in variables.texi d7973e8 Document 'default-toplevel-value' and 'set-default-toplevel-v... 8b71826 Don't modify minibuffer variables globally 5b5e036 Revert to pre-25.1 behavior in ffap 19994a1 * lisp/ffap.el: Fix obsolete comment referencing ffap-bug. 3ace730 Attempt to fix 64-bit AIX build f69bd79 Clarify usage of 'ediff-cleanup-hook' (Bug#24675) c04ac8a Document that variable binding order is unspecified 272554a * lisp/desktop.el (desktop-buffers-not-to-save): Doc fix. 08de101 Fix M-x hints on Mac port 86a297a Work around reporting a dpi change in apply_xft_settings cf1f985 ; lisp/skeleton.el (skeleton-insert): Fix typo in last change 9e1209d Amend the version number of CC Mode 5.33 -> 5.32.99. Don't m... 88cdf14 Improve skeleton docstrings
| * Attempt to fix 64-bit AIX buildEli Zaretskii2016-12-231-5/+5
| | | | | | | | | | * src/unexaix.c (make_hdr, copy_text_and_data, write_segment): Fix type-casts that assumed 32-bit pointers. (Bug#25141)
| * Work around reporting a dpi change in apply_xft_settingsMartin Rudalics2016-12-221-2/+17
| | | | | | | | | | * src/xsettings.c (apply_xft_settings): Don't report a change when dpi settings do not differ substantially.
* | Merge from origin/emacs-25Paul Eggert2017-01-011-1/+2
|\ \ | |/ | | | | 4179238 Improve documentation of 'w32-scroll-lock-modifier'
| * Improve documentation of 'w32-scroll-lock-modifier'Eli Zaretskii2016-12-191-1/+2
| | | | | | | | | | | | | | | | * doc/emacs/msdos.texi (Windows Keyboard): Document how to set up w32-scroll-lock-modifier so that Scroll Lock toggles the LED. * src/w32fns.c (syms_of_w32fns) <w32-scroll-lock-modifier>: Doc fix. (Bug#25204)
| * Port to Sun C 5.14Paul Eggert2016-12-011-4/+4
| | | | | | | | | | | | | | Backport from master. Sun C 5.14 supports C11 but not GCC extensions, and so refuses to compile Emacs without this patch. * src/alloc.c (lmalloc, lrealloc): Don't use INT_ADD_WRAPV on size_t, as in general this macro is restricted to signed types.
* | Clarify internal_catch etc.Paul Eggert2016-12-311-48/+43
| | | | | | | | | | | | | | | | | | | | | | | | The recent change to internal_catch and friends relied on some confusion I introduced to the code in 2013. Attempt to fix the confusion by clarifying the code instead. This saves an instruction and a load dependency in the typical case. * src/eval.c (internal_catch, internal_condition_case) (internal_condition_case_1, internal_condition_case_2) (internal_condition_case_n): Undo the previous change. Instead, use use ‘c’ rather than ‘handlerlist’ in the typical case. Also, use ‘eassert’ rather than ‘clobbered_eassert’ when possible.
* | * src/xdisp.c (string_from_display_spec): Simplify.Paul Eggert2016-12-311-16/+8
| |
* | Rework NS event handling (bug#25265)Alan Third2016-12-312-313/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/nsterm.m (unwind_apploopnr): Remove. (ns_read_socket): Remove references to apploopnr. Make processing the NS event loop conditional on being in the main thread. (ns_select): Remove references to apploopnr. Remove all fd_handler related stuff. Check if there are events waiting on the NS event queue rather than running the event loop. Remove unused variables and code. (fd_handler): Remove. (ns_term_init): Remove creation of fd_handler thread. (hold_event, EmacsApp:sendEvent, EmacsView:mouseMoved, EmacsView:windowDidExpose): Remove send_appdefined. (ns_send_appdefined): Always check the event queue for applicationDefined events rather than relying on send_appdefined var. * src/nsterm.h: Remove reference to fd_handler method.
* | Don't define NOMINMAX on MS-WindowsEli Zaretskii2016-12-311-1/+0
| | | | | | | | | | | | * src/callproc.c (NOMINMAX) [WINDOWSNT]: Don't define. This is no longer needed with the current sources and MinGW headers, while defining NOMINMAX causes an annoying compiler warning.
* | Simplify code in eval.c that calls 'setjmp'Chris Gregory2016-12-311-43/+48
| | | | | | | | | | | | | | | | | | * src/eval.c (internal_catch, internal_condition_case) (internal_condition_case_1, internal_condition_case_2) (internal_condition_case_n): Factor out the common tail of the functions. Copyright-paperwork-exempt: yes
* | Simplify code in 'string_from_display_spec'Chris Gregory2016-12-311-6/+5
| | | | | | | | | | | | | | * src/xdisp.c (string_from_display_spec): Eliminate a redundant test before the loop. Copyright-paperwork-exempt: yes
* | Serialize random number generation on MS-WindowsEli Zaretskii2016-12-311-2/+25
| | | | | | | | | | | | | | | | * src/w32.c (rand_as183): New function. (random): Use it instead of MS runtime's 'rand'. This avoids producing separate and identical random series in each Lisp thread. (srandom): Modify to supply 3 seed values to 'rand_as183'.
* | * src/gfilenotify.c (Fgfile_monitor_name): Return interned symbol.Michael Albinus2016-12-311-1/+1
| |
* | Don't call xg_select for a NextStep build.Ken Raeburn2016-12-301-2/+2
| | | | | | | | | | | | | | NextStep builds use glib but don't use xg_select. * src/process.c (wait_reading_process_output): Don't call xg_select for a NextStep build.
* | Increase the obarray size.Ken Raeburn2016-12-301-1/+1
| | | | | | | | | | | | | | | | In a typical GNU/Linux/X11 build, we wind up with over 15k symbols by the time we've started. The old obarray size ensured an average chain length of 10 or more. * src/lread.c (OBARRAY_SIZE): Increase to 15121.
* | Initialize thread support for Xlib.Ken Raeburn2016-12-301-0/+7
| | | | | | | | | | * src/xterm.c (x_initialize) [THREADS_ENABLED]: Call XInitThreads before doing anything else with X.
* | Rename primary_thread to main_threadPaul Eggert2016-12-304-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | This avoids the confusion of using two different phrases "main thread" and "primary thread" internally to mean the same thing. See: http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg01142.html * src/thread.c (main_thread): Rename from primary_thread, since the new name no longer clashes with main_thread_id and Emacs internals normally call this the "main thread". (init_main_thread): Rename from init_primary_thread. (main_thread_p): Rename from primary_thread_p. All uses changed.
* | Rename main_thread to main_thread_id and simplifyPaul Eggert2016-12-305-40/+12
| | | | | | | | | | | | | | | | | | | | | | | | * src/emacs-module.c: Include syssignal.h, for main_thread_id. [HAVE_PTHREAD]: Do not include pthread.h. (main_thread): Remove. All uses replaced by main_thread_id, or by dwMainThreadId on NT. Since the HAVE_PTHREAD code is now using the main_thread_id established by sysdep.c, there is no need for a separate copy of the main thread ID here. (module_init): Remove. All uses removed. * src/sysdep.c (main_thread_id) [HAVE_PTHREAD]: Rename from main_thread. All uses changed. Now extern.
* | * src/gfilenotify.c (Fgfile_monitor_name): Return a symbol.Michael Albinus2016-12-301-4/+3
| |
* | * src/sysdep.c (deliver_process_signal): Improve comment.Paul Eggert2016-12-301-3/+6
| |
* | Attempt to fix crashes with threads in GTK buildsEli Zaretskii2016-12-303-12/+17
| | | | | | | | | | | | | | | | | | | | * src/xgselect.c (xg_select): Call pselect via thread_select, not directly, to avoid running Lisp (via unblock_input) when more than one thread could be running. (Bug#25247) * src/process.c (wait_reading_process_output) [HAVE_GLIB]: Call xg_select directly instead of through thread_select. * src/xgselect.h (xg_select): Last 2 arguments are no longer 'const', for consistency with thread_select.
* | Remove an ambiguity from defvar's doc string. Fixes bug #25292.Alan Mackenzie2016-12-291-4/+5
| | | | | | | | | | | | | | The ambiguity was whether INITVALUE is evaluated when it's not going to be used to set SYMBOL's value. * src/eval.c (defvar): Rewrite a paragraph of the doc string.
* | Improve filenotify-tests.elMichael Albinus2016-12-294-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/inotify.c (Finotify_valid_p): * src/kqueue.c (Fkqueue_valid_p): * src/w32notify.c (Fw32notify_valid_p): * src/gfilenotify.c (Fgfile_valid_p): Fix typo in docstring. (Fgfile_monitor_name): New defun. (syms_of_gfilenotify): Declare Sgfile_monitor_name. * test/lisp/filenotify-tests.el (file-notify--test-read-event): New defun, derived from `file-notify--test-read-event-timeout'. Replace all calls of `read-event' by this. (file-notify--test-timeout): Fix docstring. (file-notify--test-monitor): New defun. (file-notify--deftest-remote): Do not bind `file-notify--test-read-event-timeout' anymore. (file-notify-test00-availability): Print also monitor, if existent. (file-notify--test-with-events): Add an additional `file-notify--test-read-event' call, in order to get it work after `file-notify-add-watch'. Remove special timeout for cygwin. (file-notify-test02-events): Make a better check for cygwin. (file-notify-test06-many-events): Improve event list for cygwin. (file-notify-test08-watched-file-in-watched-dir): Add cygwin case.
* | ; fix indentingPaul Eggert2016-12-271-2/+2
| | | | | | | | | | | | Problem reported by Chris Gregory in: http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00968.html * src/keyboard.c (read_event_from_main_queue): Fix indenting.
* | Simplify prog1 implementationPaul Eggert2016-12-273-17/+8
| | | | | | | | | | | | | | | | | | | | Inspired by a suggestion from Chris Gregory in: http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00965.html On my platform, this generates exactly the same machine insns. * src/eval.c (prog_ignore): Rename from unwind_body, since it’s more general than that. All callers changed. (Fprog1): Simplify by using prog_ignore. (Fwhile): Clarify by using prog_ignore.
* | Fix expand-file-name on DOS_NT systems when /: escaping is usedEli Zaretskii2016-12-271-1/+10
| | | | | | | | | | | | | | * src/fileio.c (Fexpand_file_name) [DOS_NT]: Don't expand "~" in file names escaped by "/:". Don't recursively expand default-directory escaped with "/:" which is not followed by a drive spec. (Bug#25183)