1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-16 17:19:41 +00:00
Commit Graph

129557 Commits

Author SHA1 Message Date
Paul Eggert
27bb4de72b Port cleanup attribute to Oracle Studio 12.5
* INSTALL (--with-modules): List cleanup attribute as prereq.
* src/conf_post.h (__has_attribute_cleanup): Remove; no longer needed.
* src/emacs-module.c (MODULE_SETJMP_1): Don’t attempt to verify
(__has_attribute (cleanup)), as Oracle Studio 12.5 supports
__has_attribute only inside preprocessor expressions.  The C
compiler should check the cleanup attribute in the next line anyway.
(module_reset_handlerlist): Remove an unnecessary ‘const’
that causes Oracle Studio 12.5 to refuse to compile.
2017-06-13 18:20:07 -07:00
Glenn Morris
510a674280 Fix running tests in without-modules builds
* test/Makefile.in (EMACSOPT): Remove option that is only defined
with-modules.  emacs-module-tests.el passes it where needed.
2017-06-13 18:53:38 -04:00
Glenn Morris
863b333543 * test/Makefile.in (src/emacs-module-tests.log): Out-of-tree fix. 2017-06-13 15:41:56 -04:00
Philipp Stephani
58b9b098a4 Inline test module Makefile into main test Makefile
The test/data/emacs-module/Makefile only built a single target, and
inlining it into test/Makefile simplifies dependency tracking and
reduces code duplication.

* configure.ac: Don't build test/data/emacs-module/Makefile.

* Makefile.in ($(test_module)): Inline compilation.
(clean): Also clean test module outputs.
2017-06-13 20:48:15 +02:00
Michael Albinus
a63aeb64b7 * lisp/net/tramp-sh.el (tramp-set-file-uid-gid): Do not handle locally on w32. 2017-06-13 15:54:09 +02:00
Michael Albinus
4e22083bf7 Minor tweaks in Tramp manual
* doc/misc/trampver.texi: Add prefixwithspace flag.

* doc/misc/tramp.texi (Password handling): Harmonize example.
(File name completion): Use prefixwithspace flag.
(Frequently Asked Questions): Explain `tramp-histfile-override'.
2017-06-13 15:20:43 +02:00
Philipp Stephani
e408e9aa03 Silence two Clang warnings by introducing additional local variables
* lib/strftime.c (libc_hidden_def):
* lib-src/make-docfile.c (put_filename): Introduce local variables to
silence Clang warnings.
2017-06-13 13:56:46 +02:00
Noam Postavsky
cc8aa484cd Fix wrong indentation after string literal (Bug#27306)
* lisp/emacs-lisp/lisp-mode.el (lisp-indent-state)
(lisp-indent-calc-next): Remove `depth' field, use (car ppss) instead.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-region-after-string-literal): New test.
2017-06-13 07:19:12 -04:00
Philipp Stephani
9af2ab68ca Fix version checks for emacs-module.h
We don't need C11 or C++11 because stdbool.h is in C99, and for C++ we
don't need it at all.
2017-06-13 09:53:33 +02:00
Lele Gaifax
88e0df33e0 ; Fix docstring
* lisp/bindings.el (mode-line-percent-position):
End docstring first sentence with a period (Bug#27339).

Copyright-paperwork-exempt: yes
2017-06-13 14:31:53 +09:00
Noam Postavsky
9b0f52a86e Buttonize #<bytecode> part of printed functions (Bug#25226)
* lisp/emacs-lisp/cl-print.el: Autoload `disassemble-1'.
(cl-print-compiled-button): New variable.
(help-byte-code): New button type, calls `disassemble' in its action.
(cl-print-object): Use it if `cl-print-compiled-button' is
non-nil.
2017-06-12 22:52:37 -04:00
Philipp Stephani
52c846d45d Print module structure sizes when initializing test module
* test/data/emacs-module/mod-test.c (emacs_module_init): Print
compile-time and runtime sizes of module structures to ease debugging
2017-06-12 23:46:02 +02:00
Glenn Morris
69899d4a7e Small portability fix for emacs-module.h (bug#27346)
* src/emacs-module.h (EMACS_ATTRIBUTE_NONNULL) [!__has_attribute]:
Avoid 'error: missing binary operator before token "("'.
2017-06-12 17:43:28 -04:00
Glenn Morris
73b50a1073 Give a more informative failure in module assertion test
* test/src/emacs-module-tests.el (module--test-assertions):
Rephrase final check to give a more informative failure.
2017-06-12 17:37:55 -04:00
Philipp Stephani
1da7bc7e46 Fix off-by-one error
* test/data/emacs-module/mod-test.c (emacs_module_init): Fix
off-by-one error.
2017-06-12 23:36:10 +02:00
Glenn Morris
ab2116c9a9 Clean up after module assertion tests
* test/src/emacs-module-tests.el (module--test-assertions):
Use a temporary directory to contain any core dumps.
2017-06-12 17:31:25 -04:00
Glenn Morris
1612d3dd78 Small improvement for module assertion test
* test/src/emacs-module-tests.el (module--test-assertions):
Don't rely on the precise form of an "Abort" message.
2017-06-12 17:17:20 -04:00
Glenn Morris
6096f81151 Improve previous test/data/emacs-module/Makefile change
* test/data/emacs-module/Makefile.in (clean):
Avoid doing unpleasant things if run in a build without modules.
2017-06-12 16:52:49 -04:00
Glenn Morris
5f25857f61 Small improvements for test/data/emacs-module/Makefile
* test/data/emacs-module/Makefile.in (%.o):
Fix emacs-module dependency.
(SECONDARY): Stop make automatically deleting *.o.
(clean): New rule.
2017-06-12 16:35:39 -04:00
Glenn Morris
710ed38912 * make-dist: Skip some more generated files in test/. 2017-06-12 13:54:07 -04:00
Alan Third
1d1f30104c Note how fullscreen differs on the NS port
doc/lispref/frames.texi (Size Parameters):
doc/emacs/frames.texi (Tool Bars): Add a description of how macOS
hides the tool-bar and menu-bar in fullscreen.
2017-06-12 18:51:57 +01:00
Alan Third
0f24ad7b81 Add no-focus-on-map to NS build (bug#25408)
* src/nsfns.m (ns_frame_parm_handlers): Add x_set_no_focus_on_map.
(x-create-frame): Check for no-focus-on-map.
* src/nsterm.h (x_set_no_focus_on_map): New function.
* src/nsterm.m (x_set_no_focus_on_map): New function.
(ns_raise_frame): Add parameter for specifying whether to focus the
frame.
(ns_frame_raise_lower):
(x_make_frame_visible): Handle new parameter for ns_raise_frame.
2017-06-12 18:51:57 +01:00
Paul Eggert
6b9618e813 _Noreturn not noreturn
_Noreturn is more portable to non-C11 platforms.  See:
https://www.gnu.org/software/gnulib/manual/html_node/stdnoreturn_002eh.html
* src/emacs-module.c: Use _Noreturn, not noreturn.  No need to
include <stdnoreturn.h>.  Reindent to fit in 80 columns.
2017-06-12 10:39:15 -07:00
Glenn Morris
d92599d3a9 Update make-dist for recent test/ changes
* make-dist: No longer distribute test/data/emacs-module/Makefile.
2017-06-12 12:33:37 -04:00
Michael Albinus
e32d99593b ; Instrument `tramp-handle-file-name-case-insensitive-p' for debugging 2017-06-12 17:54:53 +02:00
Michael Albinus
7dfc8353ce Handle port and domain in Tramp's password cache
* doc/misc/tramp.texi (Password handling): Explain port and
domain handling in authinfo.

* lisp/net/tramp.el (tramp-process-actions, tramp-clear-passwd):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handler-askpassword):
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band)
(tramp-maybe-open-connection):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-file-acl, tramp-smb-handle-set-file-acl)
(tramp-smb-maybe-open-connection): Handle also domain and port.
2017-06-12 17:52:42 +02:00
Eli Zaretskii
e6f47a9d6c Avoid compilation warnings with pre-C99 libc
* src/emacs-module.c (module_free_global_ref)
(module_assert_runtime, module_assert_env, value_to_lisp): Use 'pD'
instead of C99 't' format descriptor.
2017-06-12 18:04:04 +03:00
Philipp Stephani
d29a9dae71 Flush all output streams before aborting
Maybe the stdout buffer still contains something interesting that
should be flushed.

* src/emacs-module.c (module_abort): Flush all output streams before
aborting.
2017-06-12 16:39:15 +02:00
Philipp Stephani
655439b71e Remove an assertion that doesn't test Emacs invariants
* src/emacs-module.c (module_copy_string_contents): Remove an
assertion that doesn't test Emacs invariants.
2017-06-12 16:37:45 +02:00
Philipp Stephani
272235c1d5 Test module: add necessary version checks
* test/data/emacs-module/mod-test.c (emacs_module_init): Add necessary
version checks.
2017-06-12 16:28:16 +02:00
Philipp Stephani
d7f6477c01 Use additional CFLAGS from configure 2017-06-12 16:18:01 +02:00
Philipp Stephani
c90a97adc4 Use Autoconf to generate the test module Makefile
This makes it easier to pass compilation flags around.

* configure.ac: Also build test module Makefile.

* test/data/emacs-module/Makefile.in: New makefile template.

* test/Makefile.in ($(test_module)): No longer necessary to pass
@MODULES_SUFFIX@ around.

* .gitignore: Test module Makefile can now be ignored.
2017-06-12 16:09:37 +02:00
Philipp Stephani
909dfaf325 Also compile test module as C11
* test/data/emacs-module/Makefile (CFLAGS): Compile test module as C11
2017-06-12 15:27:18 +02:00
Philipp Stephani
cf97132764 Implement module assertions for users
Add a new command-line option '-module-assertions' that users can
enable developing or debugging a module.  If this option is present,
Emacs performs additional checks to verify that modules fulfill their
requirements.  These checks are expensive and crash Emacs if modules
are invalid, so disable them by default.

This is a command-line option instead of an ordinary variable because
changing it while Emacs is running would cause data structure
imbalances.

* src/emacs.c (main): New command line option '-module-assertions'.

* src/emacs-module.c (module_assert_main_thread)
(module_assert_runtime, module_assert_env, module_assert_value):
New functions to assert module requirements.
(syms_of_module): New uninterned variable 'module-runtimes'.
(init_module_assertions, in_main_thread, module_abort): New helper
functions.
(initialize_environment): Initialize value list.  If assertions are
enabled, use a heap-allocated environment object.
(finalize_environment): Add assertion that environment list is never
empty.
(finalize_runtime_unwind): Pop module runtime object stack.
(value_to_lisp): Assert that the value is valid.
(lisp_to_value): Record new value if assertions are enabled.
(mark_modules): Mark allocated object list.
(MODULE_FUNCTION_BEGIN_NO_CATCH)
(module_non_local_exit_check, module_non_local_exit_clear)
(module_non_local_exit_get, module_non_local_exit_signal)
(module_non_local_exit_throw): Assert thread and environment.
(module_get_environment): Assert thread and runtime.
(module_make_function, module_funcall, module_intern)
(module_funcall, module_make_integer, module_make_float)
(module_make_string, module_make_user_ptr, module_vec_get)
(funcall_module, Fmodule_load): Adapt callers.
(module_make_global_ref): If assertions are enabled, use the global
environment to store global values.
(module_free_global_ref): Remove value from global value list.

* test/Makefile.in (EMACSOPT): Enable module assertions when testing
modules.

* test/data/emacs-module/mod-test.c (Fmod_test_invalid_store)
(Fmod_test_invalid_load): New functions to test module assertions.
(emacs_module_init): Bind the new functions.

* test/src/emacs-module-tests.el (mod-test-emacs): New constant for
the Emacs binary file.
(mod-test-file): New constant for the test module file name.
(module--test-assertions): New unit test.
2017-06-12 15:22:27 +02:00
Philipp Stephani
b49dd3b047 emacs-module: Use __attribute__((nonnull))
Annotate all parameters with __attribute__((nonnull)) that may not be
NULL.
2017-06-12 10:57:39 +02:00
Philipp Stephani
9dc6e93b77 Explicitly require C11 or C++11 in emacs-module.h
We already implicitly require them by including stdbool.h.  Just make
the error message a bit clearer, and remove an unnecessary version
comparison.
2017-06-12 10:54:29 +02:00
Philipp Stephani
3f89df5c3b Add missing 'require' forms to prevent compiler warnings.
* lisp/eshell/esh-ext.el (esh-arg, esh-proc): Add missing
requirements.
2017-06-12 10:01:25 +02:00
Paul Eggert
07ab837491 Merge from gnulib
This incorporates:
2017-06-11 getopt-posix: port to glibc 2.25.90
2017-06-04 same-inode: port better to VMS 8.2 and later
* doc/misc/texinfo.tex, lib/getopt-pfx-core.h, lib/getopt-pfx-ext.h:
* m4/sys_types_h.m4: Copy from gnulib.
2017-06-11 17:30:06 -07:00
Paul Eggert
bb534f6afe Remove Lisp_Misc_Float
* src/data.c (Ftype_of): Do not worry about Lisp_Misc_Float.
* src/lisp.h (Lisp_Misc_Float): Remove.  This placeholder has been
unused for two decades; if we ever want to change floats to be a
misc type we can bring it back then.
2017-06-11 17:05:29 -07:00
Paul Eggert
d0ff364fe8 Make two symbols private to emacs-module.c
* src/lisp.h (allocate_module_function, XSET_MODULE_FUNCTION):
Move from here ...
* src/emacs-module.c: ... to here.
2017-06-11 17:05:28 -07:00
Glenn Morris
3a63d80843 Merge from origin/emacs-25
da62c1532e (origin/emacs-25) Improve the documentation of filesets
2017-06-11 16:20:41 -07:00
Glenn Morris
933f91a36f ; Merge from origin/emacs-25
The following commits were skipped:

16ef7539cb Don't advertise s_client in tls.el docs
94a6c964a4 Remove s_client usage from tls.el
2017-06-11 16:20:41 -07:00
Glenn Morris
030df01c7c Merge from origin/emacs-25
e80f6a210b Describe problems with Microsoft Intellipoint
a73ec1edb0 More accurate documentation of the ':box' face attribute
2017-06-11 16:20:41 -07:00
Glenn Morris
30963b4ef9 ; Merge from origin/emacs-25
The following commit was skipped:

50b4f85720 ; Bump Emacs version past 25.2
2017-06-11 16:20:40 -07:00
Glenn Morris
f5ea4efbe7 Merge from origin/emacs-25
eaa00584ce Improve documentation of 'gnutls-verify-error'
908498cc01 ; etc/PROBLEMS: Describe GTK-related crashes on elementar...
741daec617 ; Describe the problem with ksh when resizing shell window
2017-06-11 16:20:40 -07:00
Michael Albinus
87958db425 Some further improvements for tramp-gvfs.el
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name)
(tramp-gvfs-get-file-attributes)
(tramp-gvfs-maybe-open-connection): Handle davs? properly.
(tramp-gvfs-handler-askquestion): Improve `yes-or-no-p' prompt.
Show question also in batch mode.  Cache result.

* test/lisp/net/tramp-tests.el (tramp-test24-file-name-completion):
Support completion for host names and ports.
2017-06-11 23:16:13 +02:00
Simen Heggestøyl
ee051688c1 Fix highlighting of CSS selectors with double hyphens
* lisp/textmodes/css-mode.el (css--font-lock-keywords): Fix
highlighting of selectors that contain double hyphens.  They would be
mistaken for a variable.
2017-06-11 19:32:17 +02:00
Philipp Stephani
8160c7d914 Support threads in modules
Rather than checking for the main thread, check for the current
thread.

* emacs-module.c (check_thread): New function.
(MODULE_FUNCTION_BEGIN_NO_CATCH, module_get_environment)
(module_non_local_exit_check, module_non_local_exit_clear)
(module_non_local_exit_get, module_non_local_exit_signal)
(module_non_local_exit_throw, module_is_not_nil, module_eq): Use it.
2017-06-11 15:24:05 +02:00
Philipp Stephani
9a86966edb Allow non-local exits in module initializers
Previously signals, throws, and quits from module initialization
functions were ignored.  These function aren't special, and better
errors can be reported using signals than with the initialization
return code, so allow non-local exits.

* src/emacs-module.c (module_signal_or_throw): New helper function.
(Fmodule_load, funcall_module): Use it.
(Fmodule_load): Also allow quitting.
2017-06-11 14:54:05 +02:00
Noam Postavsky
cf557fa9c5 Let eshell/sudo handle absolute command names (Bug#27167)
* lisp/eshell/esh-ext.el (eshell-find-interpreter): Don't change
absolute paths into relative ones.
2017-06-11 07:39:40 -04:00