Michael Albinus [Sun, 11 Jun 2023 18:33:34 +0000 (20:33 +0200)]
Fix tramp-sshfs
* lisp/net/tramp-fuse.el (tramp-fuse-handle-file-exists-p): New defun.
(tramp-fuse-mount-timeout): Move up.
(tramp-fuse-mount-point): Use `tramp-fuse-mount-timeout'.
(tramp-fuse-unmount): Flush "mount-point" file property.
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
Use `tramp-fuse-handle-file-exists-p'.
* test/lisp/net/tramp-tests.el (all): Use function read syntax
where appropriate.
(tramp-test39-detect-external-change): Let-bind
`read-from-minibuffer' instead of `yes-or-no-p'.
Po Lu [Sun, 11 Jun 2023 06:35:13 +0000 (14:35 +0800)]
Update Android port
* java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView):
Document member variables.
(onDraw): Use separate Paint object on the UI thread.
* src/textconv.c (really_commit_text, really_set_composing_text)
(really_delete_surrounding_text): Run modification hooks when
deleting text.
Po Lu [Sun, 11 Jun 2023 00:52:10 +0000 (08:52 +0800)]
Avoid extraneous calls to the UI thread
* java/org/gnu/emacs/EmacsView.java (EmacsView)
(showOnScreenKeyboard, hideOnScreenKeyboard)
(onCheckIsTextEditor): Make synchronized.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow)
(toggleOnScreenKeyboard): Don't post to the main thread.
Eli Zaretskii [Sat, 10 Jun 2023 10:42:43 +0000 (06:42 -0400)]
Merge from origin/emacs-29
0d8b69e0ad3 Don't ding when completion succeeded f11e2d36999 ; * admin/git-bisect-start: Update failing commits 9855a3ea744 ; * src/xdisp.c (redisplay_tool_bar): Fix a typo in a com... f4ee696b887 Improve documentation of color-related functions 90eadc3e234 Revert "* package.el (package--get-activatable-pkg): Pref... 65f355ea0a3 ; Update my mail address a3a69ec2342 Fix connection-local user options handling (bug#63300) 240803cc3e1 Document 'startup-redirect-eln-cache' 026afb22984 ; * etc/PROBLEMS: Entry about crashes due to anti-virus (... bcc222251e1 Fix `emacs-lisp-native-compile-and-load' for C-h f (bug#5... 07c8211ca30 Add 'infer' as a keyword to typescript-ts-mode (bug#63880) dd2d8ff2f5c ; * etc/NEWS: Mention the issue with PGTK on WSL (bug#633... fa8135f8916 Revert changes to the order in which package descs are lo... 27fcfa2c0a7 ; * etc/NEWS: Improve instructions for grammar libraries. 2a84ab905c8 Handle point in last file-name component in minibuffer co... 05f25238b7b Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... 4bc043ff45d Avoid asking redundant question in emacsbug.el 2eadf328d05 * test/infra/Dockerfile.emba (emacs-base): Don't install ... 583ba1db7ee typescript-ts-mode: Add a rule for function_signature
Morgan Smith [Mon, 5 Jun 2023 17:34:59 +0000 (13:34 -0400)]
Don't ding when completion succeeded
* lisp/minibuffer.el (minibuffer-completion-help): Ensure 'ding'
is not called on a successful completion. Ensure 'ding' is not
called on a failure if 'completion-fail-discreetly' is set.
Also change "No completions" to "No match" as that is what is
used elsewhere. (Bug#63913)
Po Lu [Sat, 10 Jun 2023 08:10:46 +0000 (16:10 +0800)]
Update Android port
* src/android.c (android_select, android_check_query)
(android_check_query_urgent, android_answer_query)
(android_answer_query_spin, android_begin_query, android_end_query)
(android_run_in_emacs_thread): Use finer grained memory
synchronization semantics.
* src/androidterm.c (android_get_selection): Use the current
selection, not its value at the time of the last redisplay.
* src/keyboard.c (handle_input_available_signal): Place memory
barrier.
Po Lu [Sat, 10 Jun 2023 01:57:41 +0000 (09:57 +0800)]
Inherit surrounding text properties when inserting conversion text
* src/textconv.c (really_commit_text)
(really_set_composing_text): Improve behavior of certain
fontification mechanisms by inheriting text properties from
surrounding text.
Po Lu [Sat, 10 Jun 2023 01:21:48 +0000 (09:21 +0800)]
Prevent hangs from IM requests with the main thread busy
* src/android.c (android_select): Clear `android_urgent_query'.
(android_check_query): Make static. Clear
`android_urgent_query'.
(android_check_query_urgent): New function; work like
`android_check_query', but only answer urgent queries.
(android_answer_query, android_end_query): Clear urgent query
flag.
(android_run_in_emacs_thread): Initially wait two seconds for
the query to run from the keyboard loop; upon a timeout, set
`android_urgent_query' to true and wait for it to run while
reading async input.
* src/android.h: Update prototypes.
* src/keyboard.c (handle_async_input): Call
`android_check_query_urgent'.
Po Lu [Fri, 9 Jun 2023 10:05:26 +0000 (18:05 +0800)]
Avoid responding to input method queries asynchronously
* src/androidterm.c (handle_one_android_event): Don't answer
queries here; just rely on the event interrupting
android_select. This avoids exposing buffer contents to input
methods while a command is being executed.
* src/textconv.c (TEXTCONV_DEBUG, really_commit_text)
(really_finish_composing_text, really_set_composing_text)
(really_set_composing_region, really_delete_surrounding_text)
(really_set_point_and_mark, get_extracted_text): Add debugging
printouts.
Po Lu [Fri, 9 Jun 2023 06:03:50 +0000 (14:03 +0800)]
Block profiling signals in the Android UI thread
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): New
function `setupSystemThread'.
* java/org/gnu/emacs/EmacsService.java (onCreate): Block all
signals except for SIGBUS and SIGSEGV in the UI thread.
* src/android.c (setupSystemThread): New function.
The Pyright language server issues very heavy file watching requests,
which sometimes exceed the OS limit. Most of these file watches are
useless, but Pyright insists on issuing them.
What's more, for some (absurd?) reason, Pyright issues two file
watching requests for the _same_ directories, only to then almost
immediately ask to undo the effects of one of these requests.
This change to Eglot makes it so that if a single server requests to
watch a specific directory twice, only one file watch object is used.
Suggested by: https://github.com/thejeffphil
* lisp/progmodes/eglot.el (eglot-lsp-server): Change structure of
file-watches field.
(eglot--on-shutdown): Adapt to new structure.
(eglot-register-capability): Rework.
(eglot-unregister-capability): Rework.
Po Lu [Thu, 8 Jun 2023 12:50:02 +0000 (20:50 +0800)]
Correctly display popup dialogs from Emacsclient
* java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu):
Make subclasses final.
* java/org/gnu/emacs/EmacsDialog.java (display1): Check if an
instance of EmacsOpenActivity is open; if it is, try using it to
display the pop up dialog.
* java/org/gnu/emacs/EmacsDialogButtonLayout.java
(EmacsDialogButtonLayout): Make final.
* java/org/gnu/emacs/EmacsHolder.java (EmacsHolder<T>):
Likewise.
* java/org/gnu/emacs/EmacsOpenActivity.java (EmacsOpenActivity):
New field `currentActivity'.
(onCreate, onDestroy, onWindowFocusChanged, onPause): Set that
field as appropriate.
This reverts commit fb87d5008e21d1bc03547c1edf2280fb4cb8311e.
It caused problems when new versions of packages are installed
without deleting old versions. (Bug#63757)
Michael Albinus [Thu, 8 Jun 2023 07:59:06 +0000 (09:59 +0200)]
Fix connection-local user options handling (bug#63300)
* lisp/files-x.el (connection-local-set-profiles)
(connection-local-set-profile-variables): Avoid saving the changed
user option to file unless triggered explicitly by user. (Bug#63300)
Po Lu [Wed, 7 Jun 2023 03:03:56 +0000 (11:03 +0800)]
Update Android port
* java/org/gnu/emacs/EmacsInputConnection.java (beginBatchEdit)
(endBatchEdit, commitCompletion, commitText, deleteSurroundingText)
(finishComposingText, getSelectedText, getTextAfterCursor)
(getTextBeforeCursor, setComposingText, setComposingRegion)
(performEditorAction, performContextMenuAction, getExtractedText)
(setSelection, sendKeyEvent, deleteSurroundingTextInCodePoints)
(requestCursorUpdates): Ensure that the input connection is up
to date.
(getSurroundingText): New function.
* java/org/gnu/emacs/EmacsNative.java (getSurroundingText):
Export new C function.
* java/org/gnu/emacs/EmacsService.java (resetIC): Invalidate
previously created input connections.
* java/org/gnu/emacs/EmacsView.java (EmacsView)
(onCreateInputConnection): Signify that input connections are
now up to date.
* src/androidterm.c (struct
android_get_surrounding_text_context): New structure.
(android_get_surrounding_text, NATIVE_NAME):
* src/textconv.c (get_surrounding_text):
* src/textconv.h: New functions.
Po Lu [Tue, 6 Jun 2023 13:00:44 +0000 (21:00 +0800)]
Fix problems resulting from modification of the undo list
* doc/lispref/text.texi (Atomic Changes): Describe what not to
do inside an atomic change group.
* lisp/elec-pair.el (electric-pair-inhibit-if-helps-balance):
Don't call `delete-char'; that edits the undo list by removing
boundary markers.
* lisp/subr.el (atomic-change-group, prepare-change-group): Warn
against modifying the undo list inside.
Eshel Yaron [Sun, 4 Jun 2023 16:41:20 +0000 (19:41 +0300)]
Avoid header line with some empty non-nil formats
Allow the value of 'header-line-format' to indicate that no header
line should be displayed when it trivially yields 'nil', even if it is
not plain 'nil'. Previously, any non-nil 'header-line-format'
resulted in a (possibly empty) header line. This change adds some
flexibility by also taking a non-nil value of 'header-line-format' to
mean that no header line should be displayed if it's a list whose
'car' is a symbol and either that symbol is ':eval' and the second
list element evaluates to 'nil', or the symbol's value as a variable
is 'nil' or void.
(Bug#63825)
* src/xdisp.c (safe_eval_inhibit_quit): New function.
* src/lisp.h (safe_eval_inhibit_quit): Declare it.
* src/window.c (null_header_line_format): New function.
(window_wants_header_line): Use it.
* doc/lispref/modes.texi (Header Line): Update to reflect new
conditions for displaying a window's header line.
* etc/NEWS: Announce updated treatment of 'header-line-format'.
Sean Whitton [Tue, 6 Jun 2023 11:15:25 +0000 (12:15 +0100)]
eval-command-interactive-spec: Shorten code
* lisp/emacs-lisp/subr-x.el (eval-command-interactive-spec): Don't
reimplement checking for an 'interactive-form symbol property.
`interactive-form' already does this. Thanks to Stefan Monnier.
Andrea Corallo [Tue, 6 Jun 2023 09:27:13 +0000 (11:27 +0200)]
Fix `emacs-lisp-native-compile-and-load' for C-h f (bug#58314)
* lisp/emacs-lisp/comp.el (comp-write-bytecode-file): New function
spilling code from `batch-byte+native-compile'.
(batch-byte+native-compile): Make use of.
* lisp/progmodes/elisp-mode.el
(emacs-lisp-native-compile-and-load): Produce the elc file and ask
to have it loaded.
Po Lu [Tue, 6 Jun 2023 06:35:19 +0000 (14:35 +0800)]
Update Android port
* java/org/gnu/emacs/EmacsContextMenu.java (display): Use
`EmacsHolder' instead of `Holder'.
* java/org/gnu/emacs/EmacsDialog.java (toAlertDialog): Use
`EmacsDialogButtonLayout' to ensure that buttons are wrapped
properly.
(display): Adjust for new holder class.
* java/org/gnu/emacs/EmacsDialogButtonLayout.java
(EmacsDialogButtonLayout, onMeasure, onLayout): New functions.
* java/org/gnu/emacs/EmacsDrawLine.java:
* java/org/gnu/emacs/EmacsFillPolygon.java: Remove redundant
imports.
* java/org/gnu/emacs/EmacsHolder.java (EmacsHolder<T>):
* java/org/gnu/emacs/EmacsService.java (class Holder<T>)
(getEmacsView, EmacsService): Rename `Holder' to `EmacsHolder'
and make it public.
Po Lu [Tue, 6 Jun 2023 02:06:10 +0000 (10:06 +0800)]
Improve undo behavior on Android
* lisp/simple.el (undo-auto-amalgamate): Update doc string to
describe new amalgamating commands.
(analyze-text-conversion): Make this an amalgamating command by
default, unless a new line has been inserted. Also, shorten the
undo boundary timer.
* src/textconv.c (really_commit_text)
(really_set_composing_text): Correctly report ephemeral
deletions.
(syms_of_textconv): Fix doc strings.
Eli Zaretskii [Mon, 5 Jun 2023 12:57:05 +0000 (15:57 +0300)]
Fix bug with point-adjustment after M-x COMMAND
* src/keyboard.c (command_loop_1): Preserve 'last_point_position'
across command execution, to avoid bugs in
'adjust_point_for_property' if the command invokes
'recursive-edit'. Reported by Mats Lidell <matsl@gnu.org>.
Michael Albinus [Mon, 5 Jun 2023 11:29:21 +0000 (13:29 +0200)]
Adapt emba integration
* test/infra/Dockerfile.emba (emacs-tree-sitter):
Use "/root/.emacs.d/tree-sitter" instead of "/usr/local/lib/tree-sitter".
* test/infra/gitlab-ci.yml (.job-template): Run "/bin/bash -xvc".
(test-eglot): Revert last change, it doesn't work yet.
(test-tree-sitter): Set TEST_HOME instead of LD_LIBRARY_PATH.
Po Lu [Mon, 5 Jun 2023 02:38:25 +0000 (10:38 +0800)]
Update Android port
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): New
function clearInputFlags.
* java/org/gnu/emacs/EmacsView.java (onCreateInputConnection):
Stop reporting changes after a new input method connection is
established.
* src/androidterm.c (android_handle_ime_event): Implement that
change.
(JNICALL): New function.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Optimise closed-over values in closure creation like any other, which
can lead to stack variables being eliminated.
Revert changes to the order in which package descs are loaded
* lisp/emacs-lisp/package.el (package-load-all-descriptors): Remove
NOSORT argument to 'directory-files', reverting back to the behaviour
as of Emacs 28. (Bug#63757)
Andrea Corallo [Tue, 30 May 2023 13:30:11 +0000 (15:30 +0200)]
Print know function types in C-h f
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Improve comment.
(comp-funciton-type-spec): New function.
* lisp/help-fns.el (help-fns--signature): Update to make use of
`comp-funciton-type-spec'.
Spencer Baugh [Sat, 3 Jun 2023 00:57:32 +0000 (20:57 -0400)]
Handle point in last file-name component in minibuffer completion
This is a followup to commit e338a8ac41d4a9fd798dda90275abe75ac071335
(Handle point not at EOB in minibuffer-choose-completion).
That commit added a heuristic, but the heuristic was insufficient:
It still had the original wrong behavior when completing the last
file-name component (i.e., the completion category is 'file' and
there's no slash after point). This patch makes the heuristic
cover that case as well.
* lisp/minibuffer.el (minibuffer-next-completion)
(minibuffer-choose-completion): If in file completion and there's no
slash after point, clear what's after point when we complete.
(Bug#62700)
Some AWK implementations have a fixed buffer for sprintf; for mawk the
default size is 8192 bytes. Hoist a string concatenation from
a sprintf call to avoid running into that limit. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00090.html .
Some AWK implementations have a fixed buffer for sprintf; for mawk the
default size is 8192 bytes. Hoist a string concatenation from
a sprintf call to avoid running into that limit. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00090.html .
Eli Zaretskii [Sat, 3 Jun 2023 09:50:58 +0000 (05:50 -0400)]
Merge from origin/emacs-29
ede3535051a ; Fix last change 8ec786349e1 Fix apostrophe handling in rust-ts-mode and go-ts-mode (B... 0eba9cf6511 * test/infra/Dockerfile.emba (emacs-base): Install also g... 4897c98b6c4 Fix 'python-util-clone-local-variables' 6b2c8dc9050 Revert "Enhance Python font-lock to support multilines" 348e4504c6d Fix typo in calc.texi 03663b8798a Update to Transient v0.4.1 dc7acb1aafe Avoid errors in 'delete-forward-char' deleting static com... 2f94f6de9d6 Make VS-15 and VS-16 compositions work correctly 753f8aa1f14 Fix project-name for vc-aware backend in non-file buffers 17c7915ab94 ; Fix 'package-install-upgrade-built-in' check for packag... e252ce26eab Add type_predicate 'is' as keyword in typescript-ts-mode ... 0a354d65784 Fix infloop in info-look.el 83b22139e4c Fix several todo-mode.el item editing bugs (bug#63811) ed4cd3eddf7 dockerfile-ts-mode: Prevent empty categories in imenu (Bu... 2e20e318da2 Brush up doc strings and terminology in plstore.el 372bc1278c2 Add internal documentation on plstore.el 23a14e7b902 Add compact_constructor_declaration font-locking to java-... 500abc4dc37 * lisp/tmm.el (tmm-completion-delete-prompt): Add more ch... afc1f329356 Allow to disable the DWIMish behavior of 'x' in package menu 08104c01504 Allow dired to invoke secondary browser a3063f0bc87 Add a binding for enriched-toggle-markup d8ba28fa394 Fix order of tmm-menubar when 'tmm-mid-prompt' is nil
Eli Zaretskii [Sat, 3 Jun 2023 09:50:49 +0000 (05:50 -0400)]
Merge from origin/emacs-29
3f441525679 Save the tree-sitter grammar recipe when installing a gra... c0c7b947baf Add instructions and test file for VS-15/VS-16 3be33aff963 A better fix for "Fix cancellation of Wdired" 756244c6963 ; * lisp/minibuffer.el (completions-header-format): Doc fix. 5d844e129ad Fix tmm-menubar when 'tmm-completion-prompt' is nil