Po Lu [Tue, 1 Aug 2023 13:06:06 +0000 (21:06 +0800)]
Update Android port
* doc/emacs/android.texi (Android File System): Describe how to
access real files named /assets or /contents if so required.
* java/org/gnu/emacs/EmacsService.java (validAuthority):
* src/android.c (android_init_emacs_service):
* src/android.h: New function.
* src/androidvfs.c (android_saf_valid_authority_p): New
function. Wrap the Java function.
(android_saf_root_stat, android_saf_root_access): Don't return
success if no authority by vp->authority's name exists.
(android_saf_tree_from_name): Check validity of string data
before giving it to JNI.
Po Lu [Tue, 1 Aug 2023 06:54:30 +0000 (14:54 +0800)]
Micro-optimize PUSHW/PUSHB
* src/sfnt.c (CHECK_STACK_AVAILABLE): New macro.
(PUSH):
(PUSH_UNCHECKED): Always define to unchecked versions,
even if TEST.
(PUSH2_UNCHECKED): New macro.
(NPUSHB):
(NPUSHW):
(PUSHB):
(PUSHW): Check the number of remaining stack elements
once.
(stack_overflow_test_args): Expect zero stack arguments.
Michael Albinus [Mon, 31 Jul 2023 17:40:11 +0000 (19:40 +0200)]
Optimizations on Tramp symlink handling
* lisp/net/tramp-sh.el (cl-seq): Require.
(tramp-perl-file-truename): Print also whether the file is a symlink.
(tramp-bundle-read-file-names): Rename from
`tramp-vc-registered-read-file-names'. Print also the
`file-directory-p: value.
(tramp-sh-handle-make-symbolic-link): Combine two commands. Use
`tramp-skeleton-make-symbolic-link'.
(tramp-sh-handle-file-truename): Read also "file-symlink-marker"
property.
(tramp-sh-handle-file-directory-p): Simplify if-let clause.
(tramp-sh-handle-file-name-all-completions): Simplify command.
(tramp-bundle-read-file-names): New defun.
(tramp-sh-handle-vc-registered, tramp-get-remote-path): Use it.
(tramp-open-shell): Flush "scripts" connection property.
(tramp-open-connection-setup-interactive-shell): Combine two commands.
* lisp/net/tramp-smb.el (tramp-smb-handle-make-symbolic-link):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-make-symbolic-link):
Use `tramp-skeleton-make-symbolic-link'.
* lisp/language/vietnamese.el (vietnamese-vscii): Update docstring.
(vietnamese-tcvn, tcvn, tcvn-5712): Make them aliases of
vietnamese-vscii.
("Vietnamese"): Drop vietnamese-tcvn from coding-system values.
Update docstring.
Eli Zaretskii [Mon, 31 Jul 2023 15:11:23 +0000 (11:11 -0400)]
; Merge from origin/emacs-29
The following commits were skipped:
0002d4f3166 Avoid spurious whitespace in the modeline of emacsclient ... 96d52f89444 Fix function help for advised aliases (bug#64797) 71419a60c37 Avoid crashes due to invalid 'mode-line-format' b2cb6e82160 ; Better documentation of HOME on MS-Windows 54e98b5f9bd ; Clarify documentation of 'server-after-make-frame-hook' d13029cdcde Avoid crashes under 'which-key-mode' cb1f7db2490 ; Minor documentation fixes 4a687bcc20d Bump Emacs version
Eli Zaretskii [Mon, 31 Jul 2023 15:11:23 +0000 (11:11 -0400)]
Merge from origin/emacs-29
a9b28224af0 ; Last-minute changes befor releasing 29.1 7da1cee56b3 Update CMake support due to upstream changes (bug#64922) c2d95dd00e6 Remove nullptr named node from c++-ts-mode (bug#64818) 4e977136d31 Make compat check also check typescript 906ecf442c4 ; * etc/HISTORY: Fix the 28.3 entry.
Eli Zaretskii [Mon, 31 Jul 2023 15:11:21 +0000 (11:11 -0400)]
Merge from origin/emacs-29
ee20b50dfed ; * lisp/progmodes/typescript-ts-mode.el (treesit-query-c... 2215298d90b Update JSX support due to upstream changes (bug#64647) 235561a2ccc Update TSX support due to upstream changes (bug#64647) 12ab82d3b35 ; Fix customization form of 'bookmark-watch-bookmark-file' d149a4dc428 ; Improve documentation of automatic addition to minibuff... 42a99627948 ; Improve documentation of 'last-command-event' 101455cb853 ; * lisp/subr.el (ignore, always): Doc fixes. (Bug#64776)
; Fix backport of help-fns--analyze-function bug fix
* lisp/help-fns.el (help-fns--analyze-function):
Add back the NOERROR argument to function-alias-p, needed because
Emacs 29 doesn't prevent the creation of circular function aliases.
This fixes a failure in help-fns-tests.
Po Lu [Mon, 31 Jul 2023 02:50:12 +0000 (10:50 +0800)]
Implement cross-directory SAF rename operations
* java/org/gnu/emacs/EmacsService.java (renameDocument): Don't
catch UnsupportedOperationException; handle ENOSYS in
android_saf_rename_document instead.
(moveDocument): New function.
* lisp/subr.el (y-or-n-p): Always change the text conversion
style.
* src/android.c (android_init_emacs_service)
(android_exception_check_4): New function.
* src/android.h: Update Java function table.
* src/androidvfs.c (android_saf_rename_document): Handle ENOSYS
here by setting errno to EXDEV.
(android_saf_move_document): New function.
(android_document_id_from_name): Take const `dir_name'.
(android_saf_tree_rename): Use delete-move-rename to implement
cross-directory renames.
* etc/themes/deeper-blue-theme.el (class):
* etc/themes/leuven-dark-theme.el (class):
* etc/themes/leuven-theme.el (class):
* etc/themes/manoj-dark-theme.el (manoj-dark):
* etc/themes/whiteboard-theme.el (class):
Use `unspecified` instead of `nil` as attribute for :background and
:foreground to silence HANDLE_INVALID_NIL_VALUE warning.
(rx (in (?^ . ?a))) was incorrectly translated to "[^-a]".
Change it so that we get "[_-a^]" instead.
* lisp/emacs-lisp/rx.el (rx--generate-alt): Split ranges starting with
`^` occurring first in a non-negated character alternative.
* test/lisp/emacs-lisp/rx-tests.el (rx-any): Add and adapt tests.
(rx (in (?^ . ?a))) was incorrectly translated to "[^-a]".
Change it so that we get "[_-a^]" instead.
* lisp/emacs-lisp/rx.el (rx--generate-alt): Split ranges starting with
`^` occurring first in a non-negated character alternative.
* test/lisp/emacs-lisp/rx-tests.el (rx-any): Add and adapt tests.
This was originally installed on 2023-06-17 in the emacs-29 release
branch and later reverted. This backport follows the Emacs 29.1
release (bug#64019).
The shy groups were caught by modified versions of the GNU ELPA
packages xr and relint:
- https://github.com/mattiase/xr/pull/6
- https://github.com/mattiase/relint/pull/14
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query): Quote special
character in regexp.
* lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings):
* lisp/progmodes/js.el (js--plain-method-re):
(js--treesit-font-lock-settings):
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Replace character
alternative [\\d], which matches '\' or 'd', with the most likely
intention [0-9]. Fix shy groups mistyped as optional colons.
Remove unneeded numbered :match group in rust-ts-mode.
Eli Zaretskii [Sun, 30 Jul 2023 15:05:00 +0000 (11:05 -0400)]
; Fix admin/upload-manuals script
* admin/upload-manuals (html_mono): Chdir to the right directory
before committing.
(html_node): Avoid computing $stale in newly-created or empty
directories.
Allow default values in 'map-let' and the pcase 'map' form
* lisp/emacs-lisp/map.el (map-let, map)
(map--make-pcase-bindings): Add a third argument for specifying a
default value, like in 'map-elt'. (Bug#49407)
* lisp/emacs-lisp/map.el (map--make-pcase-bindings): Clarify that keys
that aren't found aren't ignored, they actually get the value
nil (unless the new default value is given). The overall pattern can
still fail to match if the sub-pattern for the unfound key doesn't
match nil.
* test/lisp/emacs-lisp/map-tests.el (test-map-let-default)
(test-map-plist-pcase-default, test-map-pcase-matches): Add tests,
including for the above item.
* lisp/net/tramp-message.el (tramp-byte-run--set-suppress-trace):
New function. Add it to `defun-declarations-alist'.
(tramp-setup-debug-buffer, tramp-debug-buffer-name)
(tramp-get-debug-buffer, tramp-get-debug-file-name)
(tramp-trace-buffer-name, tramp-debug-message, tramp-message):
Add declare form.
(tramp-debug-buffer-name): Use `tramp-string-empty-or-nil-p'.
(tramp-test-message): New defun.
* lisp/help-fns.el (help-fns--analyze-function):
For aliases, use the base function name if at the end of the chain.
This fixes a regression introduced in d30fde6b0cc.
Po Lu [Sun, 30 Jul 2023 05:39:27 +0000 (13:39 +0800)]
Partially implement rename operations on SAF files
* java/org/gnu/emacs/EmacsSafThread.java
(postInvalidateCacheDir):
* java/org/gnu/emacs/EmacsService.java (renameDocument): New
functions.
* src/android.c (android_init_emacs_service):
* src/android.h (struct android_emacs_service): Link to new JNI
function.
* src/androidvfs.c (android_saf_rename_document): New function.
(android_saf_tree_rename): Implement in terms of that function
if possible.
Update CMake support due to upstream changes (bug#64922)
A recent change in tree-sitter-cmake grammar support for CMake (commit fe9b5e0), now put arguments are wrapped in a new argument_list node.
To support the old and new version of the grammar, a new function was
added on which string syntax highlighting now depends.
* lisp/progmodes/cmake-ts-mode.el
(cmake-ts-mode--font-lock-compatibility-fe9b5e0): Indent helper
function to handle different tree-sitter-cmake version.
* lisp/progmodes/cmake-ts-mode.el
(cmake-ts-mode--font-lock-settings): Use the new function to handle
the new argument_list node.
Po Lu [Sat, 29 Jul 2023 07:57:44 +0000 (15:57 +0800)]
Update Android port
* java/org/gnu/emacs/EmacsSafThread.java (postInvalidateCache):
New argument cacheName. Remove that file from the cache.
(accessDocument1): Consult the storage cache as well.
* java/org/gnu/emacs/EmacsService.java (deleteDocument): New
argument NAME.
* src/android.c (android_init_emacs_service): Add new argument.
* src/androidvfs.c (android_saf_delete_document)
(android_saf_tree_rmdir, android_saf_file_unlink): Pass name of
file being deleted to `deleteDocument'.
Po Lu [Sat, 29 Jul 2023 03:24:07 +0000 (11:24 +0800)]
Update Android port
* java/org/gnu/emacs/EmacsSafThread.java (EmacsSafThread, getCache)
(pruneCache1, pruneCache, cacheChild, cacheDirectoryFromCursor)
(documentIdFromName1, openDocumentDirectory1): Implement the
cache referred to by the commentary.
* java/org/gnu/emacs/EmacsService.java (deleteDocument):
Invalidate the cache upon document removal.
* src/androidvfs.c (android_saf_exception_check)
(android_document_id_from_name): Correctly preserve or set errno
in error cases.
F. Jason Park [Mon, 24 Jul 2023 06:09:42 +0000 (23:09 -0700)]
Simplify multi-frame behavior in erc-bufbar-mode
* lisp/erc/erc-status-sidebar.el (erc-status-sidebar-singular,
erc-status-sidebar--singular-p): Replace option new in ERC 5.6 with
the latter, an internal flag.
(erc-status-sidebar-get-window): Use new name for option turned
ordinary variable `erc-status-sidebar--singular-p'.
(erc-status-sidebar-close): Add comment.
(erc-status-sidebar--open): New function containing the old body of
`erc-status-sidebar-open'.
(erc-bufbar-mode, erc-bufbar-enable, erc-bufbar-disable): Update
variable names. Close sidebar window on all frames when disabling,
and don't set mode variable to nil when enabling. These may have made
some practical sense but were illogical. For example, it's confusing
to leave `erc-status-sidebar--open' in `erc--setup-buffer-hook' while
reporting the mode as being disabled.
(erc-status-sidebar-open): Move to slightly later in same file, after
defining `erc-bufbar-mode'. When `erc-bufbar-mode' is active, always
create a sidebar if needed, even when another frame is already
displaying one.
(erc-status-toggle-sidebar): When `erc-bufbar-mode' is disabled,
revert to pre-5.6 behavior. When the module is enabled, adopt new
behavior of ensuring the current frame shows a sidebar, even if
another frame already has one.
(erc-status-sidebar-refresh): Save and restore `window-start' in all
windows showing a sidebar buffer after refreshing. Update option and
variable names.
(erc-status-sidebar-refresh-triggers): Add doc string, noting that the
variable is set locally when the option
`erc-status-sidebar-highlight-active-buffer' is non-nil.
(erc-status-sidebar--highlight-refresh-triggers): New variable
containing additional triggers enabled when the option
`erc-status-highlight-active-buffer' is non-nil.
(erc-status-sidebar--refresh-unless-input): New function to run
`erc-status-sidebar-refresh' unless input is pending or the selected
window's buffer is a minibuffer.
(erc-status-sidebar--post-refresh): Call `erc-status-sidebar-refresh'
wrapper `erc-status-sidebar--refresh-unless-input' instead.
(erc-status-sidebar-set-window-preserve-size): Update var name to
`erc-status-sidebar--singular-p'.
(erc-status-sidebar-mode): Run `erc-status-sidebar--post-refresh' on
`window-selection-change-functions' globally when highlighting active
buffers. (bug#63595)
F. Jason Park [Sun, 23 Jul 2023 12:05:13 +0000 (05:05 -0700)]
; Add example buffer-display option to ERC's manual
* doc/misc/erc.texi: Add customization for `erc-interactive-display'
to Sample Configuration section.
* etc/ERC-NEWS: Improve various entries, like those for
`keep-place-indicator', `fill-wrap', `bufbar', etc.
F. Jason Park [Sat, 22 Jul 2023 21:07:38 +0000 (14:07 -0700)]
Fix CTCP ACTION regression in erc-fill-wrap
* lisp/erc/erc-fill.el (erc-fill--wrap-continued-message-p): Return
nil when current message is a CTCP ACTION. This fixes a regression
introduced by 63d8b2a59a4 "Make erc-fill-wrap work with left-sided
stamps".
* test/lisp/erc/erc-fill-tests.el: (erc-fill-wrap--merge-action):
New test.
* test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: New
test data file. (Bug#60936)
* lisp/doc-view.el (doc-view-ghostscript-program)
(doc-view--revert-buffer, doc-view--pdf-outline): Compare
'shell-command' / 'call-process' return values with 'eql' instead of
'=' to cater for the situation where the process received a signal.
Make uniquify-tests work with out-of-tree builds and clean up
* test/lisp/uniquify-tests.el (uniquify-project-transform):
Set an explicit default-directory.
* test/lisp/uniquify-tests.el (uniquify-dirs): Remove temporary
directory after test.
Po Lu [Fri, 28 Jul 2023 07:19:37 +0000 (15:19 +0800)]
Allow quitting from Android content provider operations
* doc/emacs/android.texi (Android Document Providers): Say that
quitting is now possible.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): New
functions `safSyncAndReadInput', `safync' and `safPostRequest'.
* java/org/gnu/emacs/EmacsSafThread.java: New file. Move
cancel-able SAF operations here.
* java/org/gnu/emacs/EmacsService.java (EmacsService): Allow
quitting from most SAF operations.
* src/androidvfs.c (android_saf_exception_check): Return EINTR
if OperationCanceledException is received.
(android_saf_stat, android_saf_access)
(android_document_id_from_name, android_saf_tree_opendir_1)
(android_saf_file_open): Don't allow reentrant calls from async
input handlers.
(NATIVE_NAME): Implement new synchronization primitives for JNI.
(android_vfs_init): Initialize new class.
* src/dired.c (open_directory): Handle EINTR from opendir.
* src/sysdep.c: Describe which operations may return EINTR on
Android.
Eli Zaretskii [Fri, 28 Jul 2023 06:31:25 +0000 (09:31 +0300)]
Fix userlock.el and filelock-tests in some rare cases
* lisp/userlock.el (userlock--check-content-unchanged): Don't
assume 'file-truename' of FILENAME is always non-nil. It could be
nil if we are called from a temporary buffer where some Lisp
program has forcibly set 'buffer-file-name'. (Bug#64821)
* test/src/filelock-tests.el (filelock-tests--fixture): Set
'buffer-file-name' to the true name of the temporary file.
Patch by Mattias Engdegård <mattias.engdegard@gmail.com>.
(filelock-tests-detect-external-change): Quote the file names
passed to shell commands.
* lisp/help-fns.el (help-fns--analyze-function):
For aliases, use the base function name if at the end of the chain.
This fixes a regression introduced in d30fde6b0cc.
Better compilation of char-before, backward-char and backward-word
Implement char-before, backward-char and backward-word as compiler
macros instead of byte-compile handlers so that the source-level
optimiser gets to simplify the result. In particular, this removes
some branches.
Manuel Giraud [Sat, 25 Feb 2023 18:27:07 +0000 (19:27 +0100)]
New option 'image-dired-thumb-naming' (bug#61394)
* lisp/image/image-dired.el (image-dired-thumb-naming): New user
option to control thumbnail name.
* lisp/image/image-dired-util.el (image-dired-thumb-name): Update
to use new user option and compute contents SHA-1 if needed.
(image-dired-contents-sha1): New function to compute the SHA-1 of the
first 4KiB of a file.
Po Lu [Thu, 27 Jul 2023 13:59:58 +0000 (21:59 +0800)]
Update Android port
* doc/emacs/android.texi (Android Document Providers): Improve
wording of paragraph clarifying limits on subprocesses.
* java/org/gnu/emacs/EmacsService.java (getDocumentTrees): Use
Java standard US-ASCII coding standard instead of the
undocumented ``ASCII'' alias.
(decodeFileName): Remove unused function.
(documentIdFromName):
* src/android.c (android_init_emacs_service): Take a String for
NAME instead of a byte array.
* src/androidvfs.c (android_verify_jni_string): New function.
(android_document_id_from_name): Verify that STRING is a valid
Modified UTF-8 string.
Po Lu [Thu, 27 Jul 2023 12:56:43 +0000 (20:56 +0800)]
Update Android port
* src/android.c (android_run_in_emacs_thread): Behave more
robustly if SIGIO arrives too late Emacs for Emacs to check for
signals, but too early to preempt a long running syscall.