Michael Albinus [Thu, 3 Aug 2023 11:17:02 +0000 (13:17 +0200)]
Improve SELinux handling in Tramp
* lisp/net/tramp-sh.el (tramp-stat-file-attributes-with-selinux)
(tramp-stat-directory-files-and-attributes-with-selinux): New defconst.
(tramp-do-file-attributes-with-ls)
(tramp-do-file-attributes-with-stat)
(tramp-do-directory-files-and-attributes-with-stat): Return also
SELinux context.
(tramp-remote-selinux-p, tramp-do-copy-or-rename-file): Adapt docstring.
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file)
(tramp-sudoedit-remote-selinux-p): Adapt docstring.
(tramp-sudoedit-file-attributes-with-selinux): New defconst.
(tramp-sudoedit-handle-file-attributes): Use it.
Helmut Eller [Thu, 20 Jul 2023 14:27:34 +0000 (16:27 +0200)]
Improve interactive prompting for face colors
When displaying the completion candidates, show how the face would
look with the new foreground/background.
* lisp/faces.el (faces--string-with-color): New helper,
factored out from 'defined-colors-with-face-attributes'.
(defined-colors-with-face-attributes): Use it.
(read-color): Add optional argument FACE and pass
it to 'faces--string-with-color.'
(read-face-attribute): Call 'read-color' with more appropriate
foreground and face arguments.
* doc/lispref/minibuf.texi (High-Level Completion): Describe
the intention behind the arguments FOREGROUND and FACE of
'read-color'. (Bug#64725)
Po Lu [Thu, 3 Aug 2023 02:41:40 +0000 (10:41 +0800)]
Update Android port
* java/org/gnu/emacs/EmacsSafThread.java (CacheToplevel):
(EmacsSafThread):
(DocIdEntry):
(getCache):
(pruneCache):
(cacheDirectoryFromCursor):
(run):
(documentIdFromName1):
(statDocument1):
(openDocumentDirectory1):
(openDocument1): Introduce a file status cache and populate
it with files within directories as they are opened.
* java/org/gnu/emacs/EmacsService.java (createDocument):
(createDirectory):
(moveDocument): Invalidate the file status cache wherever
needed.
* src/fileio.c (check_vfs_filename):
(Fset_file_modes): Permit `set-file-modes' to silently fail
on asset and content files.
Harald Jörg [Wed, 2 Aug 2023 21:53:42 +0000 (23:53 +0200)]
cperl-mode.el: Subroutine names are fontified correctly in all places
Subroutine names are fontified as subroutine names even if the name is also
the name of a builtin (fixing an ancient unreported bug). Subroutine name
are just comments in comment and pod (fixing a bug introduced recently)
* lisp/progmodes/cperl-mode.el (cperl-init-faces): Move
fontification of sub declarations before that of builtins. Don't
override existing faces when fontifying subroutine declarations.
Don't fontify method calls even if the sub names match those of
builtins.
* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-fontify-sub-names):
New tests with a subroutine name in several surroundings.
* test/lisp/progmodes/cperl-mode-resources/sub-names.pl: New resource
for the new test.
Stefan Kangas [Wed, 2 Aug 2023 19:46:55 +0000 (21:46 +0200)]
Don't hardcode ruby version in interpreter-mode-alist
* lisp/progmodes/ruby-mode.el (interpreter-mode-alist): Don't hardcode
ruby version. This adds support for modern versions of Ruby like
"ruby2.7", instead of the previously hardcoded "ruby1.9".
rx: better not-wordchar and (syntax word) translation
* lisp/emacs-lisp/rx.el:
Add tables of legacy syntax.
(rx--translate-symbol):
Translate the legacy construct `not-wordchar` as (not wordchar), which
is more intuitively obvious.
* lisp/emacs-lisp/rx.el (rx--translate-syntax):
Generate the shorter \w and \W instead of \sw and \Sw.
* test/lisp/emacs-lisp/rx-tests.el (rx-atoms, rx-syntax, rx-not):
Adapt tests.
* lisp/emacs-lisp/rx.el (rx--generate-alt):
Treat the intervals and classes lists separately without joining,
to reduce allocation. Handle special cases first.
(rx--union-intervals):
Implement directly instead of using intersection and complement.
* test/lisp/emacs-lisp/rx-tests.el (rx-any): Adapt test, as some
character alternatives are now slightly different.
(rx--complement-intervals, rx--union-intervals)
(rx--intersect-intervals): New unit tests.
Michael Albinus [Tue, 1 Aug 2023 18:24:44 +0000 (20:24 +0200)]
Add more `tramp-suppress-trace' properties in Tramp
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
Use `tramp-archive-handle-file-symlink-p'.
(tramp-archive-handle-file-symlink-p): New defun.
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.
Stefan Kangas [Tue, 1 Aug 2023 10:18:12 +0000 (12:18 +0200)]
Fix font locking of booleans in conf-toml-mode
* lisp/textmodes/conf-mode.el (conf-toml-mode): Do not use case
folding when font locking.
* test/lisp/textmodes/conf-mode-tests.el (conf-test-toml-mode):
Expand test.
* test/lisp/textmodes/conf-mode-tests.el (conf-test-javaprop-mode):
Attempt to give the test some meaning by repairing regexps,
and fixing it so that it passes.
Stefan Kangas [Tue, 1 Aug 2023 07:55:01 +0000 (09:55 +0200)]
Remove IE9 support tag from HTML5 skeleton
This is no longer recommended in 2023, and in any case seems like
overkill in an otherwise bare-bones HTML5 template.
Ref: https://stackoverflow.com/a/6771584
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.