diff options
| author | John Wiegley | 2016-01-11 22:51:27 -0800 |
|---|---|---|
| committer | John Wiegley | 2016-01-11 22:51:27 -0800 |
| commit | c7bef6a4f033fa6b22906de0be6da54958d5b3c3 (patch) | |
| tree | 3a0f34b340ad01de290f068530c27f35aba83724 /src | |
| parent | f5d90b5fcf0251466055c7dbed6069c1850d802d (diff) | |
| parent | 1f6898d0510cd15455f665c0f38451755a374243 (diff) | |
| download | emacs-c7bef6a4f033fa6b22906de0be6da54958d5b3c3.tar.gz emacs-c7bef6a4f033fa6b22906de0be6da54958d5b3c3.zip | |
Merge from origin/emacs-25
1f6898d test/automated/vc-hg.el: Support out-of-tree build
3adb56e Minor change in tramp-tests.el
2b535ba ; * etc/NEWS: Update the js.el entry.
76b518c * etc/HELLO: Add Armenian and Mongolian greetings.
b51f1ef Java Mode: Fontify identifiers in the presence of annotations.
36b9539 Avoid an infloop when we run out of memory
2006752 Avoid unnecessary failures of auto-saving after fatal error
eef6784 Simplify HAVE_MODULES use in mark_maybe_pointer
552694a Revert attempt to use 'noexcept' in typedef
6ad0d39 Update documentation of 'indirect-function'
c6a5314 ; * etc/NEWS: Move entry of 'inhibit-point-motion-hooks'.
303141a Update documentation for obsoleting 'syntax-begin-function'
4e6f61c ; * etc/NEWS: Mark documented and not-to-be-documented entries.
e667bbb Document new features if Eshell
9c4e4e0 ; * etc/NEWS: Update EUDC entries.
1089dc9 Handle too long commands in Tramp
684eb58 * .gitattributes: *.cur and *.pif are binary files too.
d2c7fda * src/alloc.c (mark_maybe_pointer): HAVE_MODULES may be undefined
bd3f53d * sh-script.el (sh-smie-sh-rules): Improve indentation inside $(...)
09b2b8a * src/alloc.c (mark_maybe_pointer): Also check wide-int's emacs_value
cca0f93 ; Account for spaces before the filename
c71e1e8 Use short date for 'hg annotate', and output the author
f50027b Spelling fix
c7dff67 ; * etc/NEWS: Fix the Xref entries that got separated.
cc140bc Document user-level functions in project.el
f8208b6 Document the user-level features of the Xref package
b131fb8 * loading.texi: Add `define-type' entry for load-history
db3c2a8 Improve doc strings and prompts in xref.el
f6117ef Allow the use of `font-lock-extend-region-multiline' in CC Mode.
90fd798 Fix coding system for Tramp on OS X.
e985a0e ; * etc/NEWS: Mark the 'check-expensive' entry not to be documented.
9dfcbf0 Update 'load-history' docs
207e191 Fix (error ...) error
457738f Correctly analyze brace arguments in templated C++ function declarations.
d57724a * lisp/cedet/mode-local.el (describe-function-orig-buffer): Declare.
2a9532d * lisp/ffap.el (ffap-latex-mode): Avoid free variable.
1a6b084 * lisp/play/dunnet.el (dun-fix-screen): Avoid `end-of-buffer`.
8be046f Respect fontification region calculated by major mode. Fixes bug #22316.
4b37cba Improve documentation of Delete Selection mode
a034dd3 Fix two project-find-file issues
30abf29 Clarify doc string of 'dired-current-directory'
e990bb2 Use the face of preceding text for displaying the ellipsis
5810ac3 Suppress Chinese file name test for OSX in tramp-tests.el
eeb710a ; * lisp/startup.el: Sentences end with two spaces.
428b3de * admin/admin.el (set-version): Also handle the NEWS file.
648de81 ; Add NEWS entry for project.el
671862f apropos-library: Skip obvious duplicates; don't error on generics
51668a5 ; Grammar fix
ed41d11 Add project-find-file and project-or-external-find-file
056da45 ; Improve commentary in 'setup_for_ellipsis'
269d008 ; Improve docstring for `inhibit-startup-echo-area-message'
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 51 | ||||
| -rw-r--r-- | src/emacs-module.c | 6 | ||||
| -rw-r--r-- | src/emacs-module.h | 19 | ||||
| -rw-r--r-- | src/lisp.h | 2 | ||||
| -rw-r--r-- | src/lread.c | 6 | ||||
| -rw-r--r-- | src/w32.c | 3 | ||||
| -rw-r--r-- | src/xdisp.c | 14 |
7 files changed, 62 insertions, 39 deletions
diff --git a/src/alloc.c b/src/alloc.c index 9ec44b8a2c3..03dacc77c6e 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3732,7 +3732,7 @@ make_event_array (ptrdiff_t nargs, Lisp_Object *args) | |||
| 3732 | #ifdef HAVE_MODULES | 3732 | #ifdef HAVE_MODULES |
| 3733 | /* Create a new module user ptr object. */ | 3733 | /* Create a new module user ptr object. */ |
| 3734 | Lisp_Object | 3734 | Lisp_Object |
| 3735 | make_user_ptr (void (*finalizer) (void*), void *p) | 3735 | make_user_ptr (void (*finalizer) (void *), void *p) |
| 3736 | { | 3736 | { |
| 3737 | Lisp_Object obj; | 3737 | Lisp_Object obj; |
| 3738 | struct Lisp_User_Ptr *uptr; | 3738 | struct Lisp_User_Ptr *uptr; |
| @@ -4594,6 +4594,10 @@ maybe_lisp_pointer (void *p) | |||
| 4594 | return (uintptr_t) p % GCALIGNMENT == 0; | 4594 | return (uintptr_t) p % GCALIGNMENT == 0; |
| 4595 | } | 4595 | } |
| 4596 | 4596 | ||
| 4597 | #ifndef HAVE_MODULES | ||
| 4598 | enum { HAVE_MODULES = false }; | ||
| 4599 | #endif | ||
| 4600 | |||
| 4597 | /* If P points to Lisp data, mark that as live if it isn't already | 4601 | /* If P points to Lisp data, mark that as live if it isn't already |
| 4598 | marked. */ | 4602 | marked. */ |
| 4599 | 4603 | ||
| @@ -4607,8 +4611,17 @@ mark_maybe_pointer (void *p) | |||
| 4607 | VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); | 4611 | VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); |
| 4608 | #endif | 4612 | #endif |
| 4609 | 4613 | ||
| 4610 | if (!maybe_lisp_pointer (p)) | 4614 | if (sizeof (Lisp_Object) == sizeof (void *) || !HAVE_MODULES) |
| 4611 | return; | 4615 | { |
| 4616 | if (!maybe_lisp_pointer (p)) | ||
| 4617 | return; | ||
| 4618 | } | ||
| 4619 | else | ||
| 4620 | { | ||
| 4621 | /* For the wide-int case, also mark emacs_value tagged pointers, | ||
| 4622 | which can be generated by emacs-module.c's value_to_lisp. */ | ||
| 4623 | p = (void *) ((uintptr_t) p & ~(GCALIGNMENT - 1)); | ||
| 4624 | } | ||
| 4612 | 4625 | ||
| 4613 | m = mem_find (p); | 4626 | m = mem_find (p); |
| 4614 | if (m != MEM_NIL) | 4627 | if (m != MEM_NIL) |
| @@ -4685,8 +4698,7 @@ mark_maybe_pointer (void *p) | |||
| 4685 | static void ATTRIBUTE_NO_SANITIZE_ADDRESS | 4698 | static void ATTRIBUTE_NO_SANITIZE_ADDRESS |
| 4686 | mark_memory (void *start, void *end) | 4699 | mark_memory (void *start, void *end) |
| 4687 | { | 4700 | { |
| 4688 | void **pp; | 4701 | char *pp; |
| 4689 | int i; | ||
| 4690 | 4702 | ||
| 4691 | /* Make START the pointer to the start of the memory region, | 4703 | /* Make START the pointer to the start of the memory region, |
| 4692 | if it isn't already. */ | 4704 | if it isn't already. */ |
| @@ -4697,6 +4709,8 @@ mark_memory (void *start, void *end) | |||
| 4697 | end = tem; | 4709 | end = tem; |
| 4698 | } | 4710 | } |
| 4699 | 4711 | ||
| 4712 | eassert (((uintptr_t) start) % GC_POINTER_ALIGNMENT == 0); | ||
| 4713 | |||
| 4700 | /* Mark Lisp data pointed to. This is necessary because, in some | 4714 | /* Mark Lisp data pointed to. This is necessary because, in some |
| 4701 | situations, the C compiler optimizes Lisp objects away, so that | 4715 | situations, the C compiler optimizes Lisp objects away, so that |
| 4702 | only a pointer to them remains. Example: | 4716 | only a pointer to them remains. Example: |
| @@ -4715,13 +4729,11 @@ mark_memory (void *start, void *end) | |||
| 4715 | away. The only reference to the life string is through the | 4729 | away. The only reference to the life string is through the |
| 4716 | pointer `s'. */ | 4730 | pointer `s'. */ |
| 4717 | 4731 | ||
| 4718 | for (pp = start; (void *) pp < end; pp++) | 4732 | for (pp = start; (void *) pp < end; pp += GC_POINTER_ALIGNMENT) |
| 4719 | for (i = 0; i < sizeof *pp; i += GC_POINTER_ALIGNMENT) | 4733 | { |
| 4720 | { | 4734 | mark_maybe_pointer (*(void **) pp); |
| 4721 | void *p = *(void **) ((char *) pp + i); | 4735 | mark_maybe_object (*(Lisp_Object *) pp); |
| 4722 | mark_maybe_pointer (p); | 4736 | } |
| 4723 | mark_maybe_object (XIL ((intptr_t) p)); | ||
| 4724 | } | ||
| 4725 | } | 4737 | } |
| 4726 | 4738 | ||
| 4727 | #if !defined GC_SAVE_REGISTERS_ON_STACK && !defined GC_SETJMP_WORKS | 4739 | #if !defined GC_SAVE_REGISTERS_ON_STACK && !defined GC_SETJMP_WORKS |
| @@ -5513,9 +5525,16 @@ garbage_collect_1 (void *end) | |||
| 5513 | don't let that cause a recursive GC. */ | 5525 | don't let that cause a recursive GC. */ |
| 5514 | consing_since_gc = 0; | 5526 | consing_since_gc = 0; |
| 5515 | 5527 | ||
| 5516 | /* Save what's currently displayed in the echo area. */ | 5528 | /* Save what's currently displayed in the echo area. Don't do that |
| 5517 | message_p = push_message (); | 5529 | if we are GC'ing because we've run out of memory, since |
| 5518 | record_unwind_protect_void (pop_message_unwind); | 5530 | push_message will cons, and we might have no memory for that. */ |
| 5531 | if (NILP (Vmemory_full)) | ||
| 5532 | { | ||
| 5533 | message_p = push_message (); | ||
| 5534 | record_unwind_protect_void (pop_message_unwind); | ||
| 5535 | } | ||
| 5536 | else | ||
| 5537 | message_p = false; | ||
| 5519 | 5538 | ||
| 5520 | /* Save a copy of the contents of the stack, for debugging. */ | 5539 | /* Save a copy of the contents of the stack, for debugging. */ |
| 5521 | #if MAX_SAVE_STACK > 0 | 5540 | #if MAX_SAVE_STACK > 0 |
| @@ -5646,7 +5665,7 @@ garbage_collect_1 (void *end) | |||
| 5646 | } | 5665 | } |
| 5647 | } | 5666 | } |
| 5648 | 5667 | ||
| 5649 | if (garbage_collection_messages) | 5668 | if (garbage_collection_messages && NILP (Vmemory_full)) |
| 5650 | { | 5669 | { |
| 5651 | if (message_p || minibuf_level > 0) | 5670 | if (message_p || minibuf_level > 0) |
| 5652 | restore_message (); | 5671 | restore_message (); |
diff --git a/src/emacs-module.c b/src/emacs-module.c index 2fec7e5d0fe..b5e044e758f 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c | |||
| @@ -65,6 +65,12 @@ enum | |||
| 65 | && INTPTR_MAX == EMACS_INT_MAX) | 65 | && INTPTR_MAX == EMACS_INT_MAX) |
| 66 | }; | 66 | }; |
| 67 | 67 | ||
| 68 | /* Function prototype for module user-pointer finalizers. These | ||
| 69 | should not throw C++ exceptions, so emacs-module.h declares the | ||
| 70 | corresponding interfaces with EMACS_NOEXCEPT. There is only C code | ||
| 71 | in this module, though, so this constraint is not enforced here. */ | ||
| 72 | typedef void (*emacs_finalizer_function) (void *); | ||
| 73 | |||
| 68 | 74 | ||
| 69 | /* Private runtime and environment members. */ | 75 | /* Private runtime and environment members. */ |
| 70 | 76 | ||
diff --git a/src/emacs-module.h b/src/emacs-module.h index 3efea349d71..575966ea7b5 100644 --- a/src/emacs-module.h +++ b/src/emacs-module.h | |||
| @@ -26,19 +26,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 26 | 26 | ||
| 27 | #if defined __cplusplus && __cplusplus >= 201103L | 27 | #if defined __cplusplus && __cplusplus >= 201103L |
| 28 | # define EMACS_NOEXCEPT noexcept | 28 | # define EMACS_NOEXCEPT noexcept |
| 29 | |||
| 30 | /* Function prototype for module user-pointer finalizers. | ||
| 31 | |||
| 32 | NOTE: C++11 15.4: An exception-specification shall not appear in a | ||
| 33 | typedef declaration or alias-declaration. | ||
| 34 | |||
| 35 | */ | ||
| 36 | void emacs_dummy_finalizer_function (void *) noexcept; | ||
| 37 | typedef decltype(emacs_dummy_finalizer_function) *emacs_finalizer_function; | ||
| 38 | |||
| 39 | #else | 29 | #else |
| 40 | # define EMACS_NOEXCEPT | 30 | # define EMACS_NOEXCEPT |
| 41 | typedef void (*emacs_finalizer_function) (void *); | ||
| 42 | #endif | 31 | #endif |
| 43 | 32 | ||
| 44 | #ifdef __cplusplus | 33 | #ifdef __cplusplus |
| @@ -184,17 +173,17 @@ struct emacs_env_25 | |||
| 184 | 173 | ||
| 185 | /* Embedded pointer type. */ | 174 | /* Embedded pointer type. */ |
| 186 | emacs_value (*make_user_ptr) (emacs_env *env, | 175 | emacs_value (*make_user_ptr) (emacs_env *env, |
| 187 | emacs_finalizer_function fin, | 176 | void (*fin) (void *) EMACS_NOEXCEPT, |
| 188 | void *ptr); | 177 | void *ptr); |
| 189 | 178 | ||
| 190 | void *(*get_user_ptr) (emacs_env *env, emacs_value uptr); | 179 | void *(*get_user_ptr) (emacs_env *env, emacs_value uptr); |
| 191 | void (*set_user_ptr) (emacs_env *env, emacs_value uptr, void *ptr); | 180 | void (*set_user_ptr) (emacs_env *env, emacs_value uptr, void *ptr); |
| 192 | 181 | ||
| 193 | emacs_finalizer_function (*get_user_finalizer) (emacs_env *env, | 182 | void (*(*get_user_finalizer) (emacs_env *env, emacs_value uptr)) |
| 194 | emacs_value uptr); | 183 | (void *) EMACS_NOEXCEPT; |
| 195 | void (*set_user_finalizer) (emacs_env *env, | 184 | void (*set_user_finalizer) (emacs_env *env, |
| 196 | emacs_value uptr, | 185 | emacs_value uptr, |
| 197 | emacs_finalizer_function fin); | 186 | void (*fin) (void *) EMACS_NOEXCEPT); |
| 198 | 187 | ||
| 199 | /* Vector functions. */ | 188 | /* Vector functions. */ |
| 200 | emacs_value (*vec_get) (emacs_env *env, emacs_value vec, ptrdiff_t i); | 189 | emacs_value (*vec_get) (emacs_env *env, emacs_value vec, ptrdiff_t i); |
diff --git a/src/lisp.h b/src/lisp.h index 90a0c1272c9..02b8078a9fd 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3927,7 +3927,7 @@ extern bool let_shadows_global_binding_p (Lisp_Object symbol); | |||
| 3927 | 3927 | ||
| 3928 | #ifdef HAVE_MODULES | 3928 | #ifdef HAVE_MODULES |
| 3929 | /* Defined in alloc.c. */ | 3929 | /* Defined in alloc.c. */ |
| 3930 | extern Lisp_Object make_user_ptr (void (*finalizer) (void*), void *p); | 3930 | extern Lisp_Object make_user_ptr (void (*finalizer) (void *), void *p); |
| 3931 | 3931 | ||
| 3932 | /* Defined in emacs-module.c. */ | 3932 | /* Defined in emacs-module.c. */ |
| 3933 | extern void module_init (void); | 3933 | extern void module_init (void); |
diff --git a/src/lread.c b/src/lread.c index e9f3d7da967..25e3ff01d47 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -3720,7 +3720,11 @@ static size_t oblookup_last_bucket_number; | |||
| 3720 | Lisp_Object | 3720 | Lisp_Object |
| 3721 | check_obarray (Lisp_Object obarray) | 3721 | check_obarray (Lisp_Object obarray) |
| 3722 | { | 3722 | { |
| 3723 | if (!VECTORP (obarray) || ASIZE (obarray) == 0) | 3723 | /* We don't want to signal a wrong-type-argument error when we are |
| 3724 | shutting down due to a fatal error, and we don't want to hit | ||
| 3725 | assertions in VECTORP and ASIZE if the fatal error was during GC. */ | ||
| 3726 | if (!fatal_error_in_progress | ||
| 3727 | && (!VECTORP (obarray) || ASIZE (obarray) == 0)) | ||
| 3724 | { | 3728 | { |
| 3725 | /* If Vobarray is now invalid, force it to be valid. */ | 3729 | /* If Vobarray is now invalid, force it to be valid. */ |
| 3726 | if (EQ (Vobarray, obarray)) Vobarray = initial_obarray; | 3730 | if (EQ (Vobarray, obarray)) Vobarray = initial_obarray; |
| @@ -3210,7 +3210,8 @@ map_w32_filename (const char * name, const char ** pPath) | |||
| 3210 | return shortname; | 3210 | return shortname; |
| 3211 | } | 3211 | } |
| 3212 | 3212 | ||
| 3213 | if (is_fat_volume (name, (const char **)&path)) /* truncate to 8.3 */ | 3213 | if (!fatal_error_in_progress /* disable fancy processing during crash */ |
| 3214 | && is_fat_volume (name, (const char **)&path)) /* truncate to 8.3 */ | ||
| 3214 | { | 3215 | { |
| 3215 | register int left = 8; /* maximum number of chars in part */ | 3216 | register int left = 8; /* maximum number of chars in part */ |
| 3216 | register int extn = 0; /* extension added? */ | 3217 | register int extn = 0; /* extension added? */ |
diff --git a/src/xdisp.c b/src/xdisp.c index ee748bd8680..d730a0bf1b6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -4583,11 +4583,15 @@ setup_for_ellipsis (struct it *it, int len) | |||
| 4583 | it->current.dpvec_index = 0; | 4583 | it->current.dpvec_index = 0; |
| 4584 | it->dpvec_face_id = -1; | 4584 | it->dpvec_face_id = -1; |
| 4585 | 4585 | ||
| 4586 | /* Remember the current face id in case glyphs specify faces. | 4586 | /* Use IT->saved_face_id for the ellipsis, so that it has the same |
| 4587 | IT's face is restored in set_iterator_to_next. | 4587 | face as the preceding text. IT->saved_face_id was set in |
| 4588 | saved_face_id was set to preceding char's face in handle_stop. */ | 4588 | handle_stop to the face of the preceding character, and will be |
| 4589 | if (it->saved_face_id < 0 || it->saved_face_id != it->face_id) | 4589 | different from IT->face_id only if the invisible text skipped in |
| 4590 | it->saved_face_id = it->face_id = DEFAULT_FACE_ID; | 4590 | handle_invisible_prop has some non-default face on its first |
| 4591 | character. We thus ignore the face of the invisible text when we | ||
| 4592 | display the ellipsis. IT's face is restored in set_iterator_to_next. */ | ||
| 4593 | if (it->saved_face_id >= 0) | ||
| 4594 | it->face_id = it->saved_face_id; | ||
| 4591 | 4595 | ||
| 4592 | /* If the ellipsis represents buffer text, it means we advanced in | 4596 | /* If the ellipsis represents buffer text, it means we advanced in |
| 4593 | the buffer, so we should no longer ignore overlay strings. */ | 4597 | the buffer, so we should no longer ignore overlay strings. */ |