* lisp/emacs-lisp/comp.el (comp-spill-lap-function): Don't use
`byte+native-compile' to select output directory but always axpect
it explicit through `native-compile-target-directory'.
(batch-byte+native-compile): Set `native-compile-target-directory'.
* test/src/comp-tests.el (comp-tests-bootstrap): Set
`native-compile-target-directory'.
This fixes bug#65017. Binding symbols-with-pos-enabled in two
macro handling functions was harmful; one of these caused
cl--labels-convert to fail. Binding print-symbols-bare in many
places in the byte compiler was redundant.
* lisp/emacs-lisp/bytecomp.el (byte-compile-recurse-toplevel)
(byte-compile-initial-macro-environment)
(byte-compile-output-file-form, byte-compile-output-docform)
(byte-compile-preprocess): Remove bindings of
print-symbols-bare.
* lisp/emacs-lisp/macroexp.el (macroexp--compiler-macro)
(internal-macroexpand-for-load): Remove bindings of
symbols-with-pos-enabled.
(internal-macroexpand-for-load): Remove binding of
print-symbols-bare.
Since we know that the value from [NSString UTF8String] is valid
UTF-8, using make_string is wastefully slow.
* src/nsfns.m (count_utf8_chars): New function, at least twice as fast
as parse_str_as_multibyte used by make_string for this purpose.
([NSString lispString]): Use count_utf8_chars. We now always make a
multibyte string because there is no reason not to.
* doc/emacs/input.texi (Touchscreens, On-Screen Keyboards): Fix
section titles.
* src/android-emacs.c (main): If EMACS_LD_LIBRARY_PATH is set,
make it LD_LIBRARY_PATH.
* src/android.c (JNICALL): Set LD_LIBRARY_PATH as well as
EMACS_LD_LIBRARY_PATH.
* src/image.c (svg_css_length_to_pixels): Make percent units always
return zero and handle font size based units better.
(svg_load_image): Don't rely on the width and height values from the
SVG actually having any useful data, even if they're explicitly set.
* lisp/emacs-lisp/lisp-mnt.el (lm-verify): Make file footer regexp
more strict to match requirement in old versions of package.el (now
only a warning).
Improve on the famously bad error message given when the :name keyword
parameter is missing or of the wrong type in calls to make-process,
make-pipe-process and make-network-process (bug#65030).
* src/process.c (get_required_string_keyword_param): New function.
(Fmake_process, Fmake_pipe_process, Fmake_network_process): Use it.
The functions make-process and make-network-process have many
keyword args and it's easy to misspell some of them.
Use a compiler macro to warn about some possible mistakes.
* lisp/emacs-lisp/bytecomp.el (bytecomp--check-keyword-args): New
helper.
(make-process, make-network-process): Define a compiler macro that
performs some checks but doesn't anything else.
* test/lisp/emacs-lisp/bytecomp-tests.el: Add some tests.
* test/lisp/emacs-lisp/bytecomp-resources/:
(warn-make-process-missing-keyword-arg.el,
warn-make-process-missing-keyword-value.el,
warn-make-process-repeated-keyword-arg.el,
warn-make-process-unknown-keyword-arg.el): New test files
* lisp/kmacro.el (kmacro-step-edit-query)
(kmacro-step-edit-pre-command): Use `dummy-event' instead of
[nil] to continue a kbd macro; this is because nil now has a
function key map.
* src/androidfns.c (Fx_hide_tip): Allow calling this as a stub.
* src/fileio.c (Finsert_file_contents): In adherence to the
documentation, forbid supplying a BEG offset even for seekable
files, i.e. /dev/urandom on Linux kernel based systems.
* lisp/dired-aux.el (dired-do-create-files): Preserve the return value
that isn't documented but used by dired-test-bug30624 in
dired-aux-tests. Change suggested by Po Lu.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-equal, byte-optimize-eq):
Optimise (eq X X) -> t where X is a variable; idem for eql and equal.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.
* java/org/gnu/emacs/EmacsSafThread.java (EmacsSafThread)
(cacheFileStatus): New argument NO_CACHE.
(cacheDirectoryFromCursor, statDocument1):
* java/org/gnu/emacs/EmacsService.java (EmacsService)
(statDocument): Plumb that argument through each of these wrapper
functions.
* src/android.c (android_init_emacs_service): Adjust JNI
function signatures to agree with statDocument1.
* src/androidvfs.c (android_saf_stat): Plumb that argument
through here.
(android_saf_tree_stat, android_saf_file_open): And don't cache
file status if a write is imminent.
* src/androidvfs.c (android_saf_stat): Set STATB->st_dev.
(android_fstat): Likewise.
(NATIVE_NAME): Seek to start of file after truncation.
* src/fileio.c (write_region): Use stat instead of open+fstat
to obtain updated mtime.
* java/org/gnu/emacs/EmacsSafThread.java (openDocument1): Use
plain r or w where possible, as the fileio stuff is now better
prepared for FIFOs.
(openDocument): New argument READ.
* java/org/gnu/emacs/EmacsService.java (openDocument): New
argument READ.
* src/android.c (android_init_emacs_service): Adjust
correspondingly.
* src/androidvfs.c (android_saf_file_open): Don't support
O_APPEND. Pass read as well as trunc and write.
* doc/lispref/files.texi (Reading from Files): Document new
`if-regular' value of REPLACE.
* etc/NEWS: Announce the new value.
* lisp/files.el (basic-save-buffer-2): Demote errors saving
backup files, since FIFOs cannot be copied.
(revert-buffer-insert-file-contents--default-function): Supply
`if-regular' instead of t as REPLACE.
* src/fileio.c (selinux_enabled_p): New function.
(Fcopy_file, Ffile_selinux_context, Fset_file_selinux_context):
Call that function to ascertain if SELinux applies to a file.
(read_non_regular): Don't assume `emacs_fd_read' always returns
int.
(Finsert_file_contents): If REPLACE is if-regular and FILENAME
is a special non-seekable file, fall back to erasing the buffer
before inserting the contents of that file.
(syms_of_fileio) <Qif_regular>: New symbol.