]> git.eshelyaron.com Git - emacs.git/log
emacs.git
23 months agoUpdate Android port
Po Lu [Fri, 20 Jan 2023 14:15:53 +0000 (22:15 +0800)]
Update Android port

* src/android.c (android_run_select_thread, android_select)
(android_ftruncate):
* src/android.h (ftruncate): Fix compilation on Android 16 and
up.

23 months agoUpdate Android port
Po Lu [Fri, 20 Jan 2023 13:21:15 +0000 (21:21 +0800)]
Update Android port

* src/android.c (android_run_select_thread, android_init_events)
(android_select): Add alternative android_select implementation
for API 16 and lower.
* src/androidterm.c (handle_one_android_event): Fix
use-after-frees.

23 months agoRemove unused file
Po Lu [Fri, 20 Jan 2023 11:19:16 +0000 (19:19 +0800)]
Remove unused file

* xcompile/lib/gnulib.mk.in: Delete.

23 months agoUpdate Android port
Po Lu [Fri, 20 Jan 2023 11:06:32 +0000 (19:06 +0800)]
Update Android port

* .gitignore: Don't ignore verbose.mk.android.
* doc/emacs/Makefile.in (EMACSSOURCES): Add android.texi and
input.texi.
* doc/emacs/android.texi (Android): Document support for the
on-screen keyboard.
(Android Startup): Document how to start Emacs with -Q on
Android.
(Android Environment): Document how Emacs works around the
system ``task killer''.  Document changes to frame deletion
behavior.
* doc/emacs/emacs.texi (Top):
* doc/emacs/input.texi (Other Input Devices, On-Screen
Keyboards): Document how to use Emacs with virtual keyboards.
* doc/lispref/commands.texi (Touchscreen Events): Document
changes to `touch-screen-track-drag'.
* doc/lispref/frames.texi (Frames, On-Screen Keyboards): New
node.
* java/AndroidManifest.xml.in: Add settings activity and
appropriate OSK adjustment mode.
* java/org/gnu/emacs/EmacsActivity.java (onCreate): Allow
creating Emacs with -Q.
(onDestroy): Don't remove if killed by the system.
* java/org/gnu/emacs/EmacsContextMenu.java (inflateMenuItems):
Fix context menus again.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): Make all
event sending functions return long.
* java/org/gnu/emacs/EmacsPreferencesActivity.java
(EmacsPreferencesActivity): New class.
* java/org/gnu/emacs/EmacsService.java (EmacsService)
(onStartCommand, onCreate, startEmacsService): Start as a
foreground service if necessary to bypass system restrictions.
* java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView):
* java/org/gnu/emacs/EmacsThread.java (EmacsThread, run):
* java/org/gnu/emacs/EmacsView.java (EmacsView, onLayout)
(onDetachedFromWindow):
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow, viewLayout):
Implement frame resize synchronization..
* java/org/gnu/emacs/EmacsWindowAttachmentManager.java
(EmacsWindowAttachmentManager, removeWindowConsumer): Adjust
accordingly for changes to frame deletion behavior.
* lisp/frame.el (android-toggle-on-screen-keyboard)
(frame-toggle-on-screen-keyboard): New function.
* lisp/minibuffer.el (minibuffer-setup-on-screen-keyboard)
(minibuffer-exit-on-screen-keyboard): New functions.
(minibuffer-setup-hook, minibuffer-exit-hook): Add new functions
to hooks.

* lisp/touch-screen.el (touch-screen-relative-xy): Accept new
value of window `frame'.  Return frame coordinates in that case.
(touch-screen-set-point-commands): New variable.
(touch-screen-handle-point-up): Respect that variable.
(touch-screen-track-drag): Return `no-drag' where appropriate.
(touch-screen-drag-mode-line-1, touch-screen-drag-mode-line):
Refactor to use `no-drag'.

* src/android.c (struct android_emacs_window): New methods.
Make all event sending functions return the event serial.
(android_toggle_on_screen_keyboard, android_window_updated): New
functions.
* src/android.h: Update prototypes.
* src/androidfns.c (Fandroid_toggle_on_screen_keyboard)
(syms_of_androidfns): New function.
* src/androidgui.h (struct android_any_event)
(struct android_key_event, struct android_configure_event)
(struct android_focus_event, struct android_window_action_event)
(struct android_crossing_event, struct android_motion_event)
(struct android_button_event, struct android_touch_event)
(struct android_wheel_event, struct android_iconify_event)
(struct android_menu_event): Add `serial' fields.

* src/androidterm.c (handle_one_android_event)
(android_frame_up_to_date):
* src/androidterm.h (struct android_output): Implement frame
resize synchronization.

23 months agoCheck in missing file
Po Lu [Fri, 20 Jan 2023 01:26:50 +0000 (09:26 +0800)]
Check in missing file

* xcompile/verbose.mk.android: New file.

23 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Thu, 19 Jan 2023 14:20:23 +0000 (22:20 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

23 months agoUpdate Android port
Po Lu [Thu, 19 Jan 2023 14:19:06 +0000 (22:19 +0800)]
Update Android port

* .gitignore: Add new files.
* INSTALL.android: Explain how to build Emacs for ancient
versions of Android.
* admin/merge-gnulib (GNULIB_MODULES): Add getdelim.
* build-aux/config.guess (timestamp, version):
* build-aux/config.sub (timestamp, version): Autoupdate.
* configure.ac (BUILD_DETAILS, ANDROID_MIN_SDK):
(ANDROID_STUBIFY): Allow specifying CFLAGS via ANDROID_CFLAGS.
Add new configure tests for Android API version when not
explicitly specified.

* doc/emacs/android.texi (Android): Add reference to ``Other
Input Devices''.
(Android File System): Remove restrictions on directory-files on
the assets directory.
* doc/emacs/emacs.texi (Top): Add Other Input Devices to menu.
* doc/emacs/input.texi (Other Input Devices): New node.
* doc/lispref/commands.texi (Touchscreen Events): Document
changes to touchscreen input events.
* doc/lispref/frames.texi (Pop-Up Menus): Likewise.
* etc/NEWS: Announce changes.
* java/Makefile.in: Use lib-src/asset-directory-tool to generate
an `directory-tree' file placed in /assets.
* java/debug.sh: Large adjustments to support Android 2.2 and
later.

* java/org/gnu/emacs/EmacsContextMenu.java (inflateMenuItems):
* java/org/gnu/emacs/EmacsCopyArea.java (perform):
* java/org/gnu/emacs/EmacsDialog.java (toAlertDialog):
* java/org/gnu/emacs/EmacsDrawLine.java (perform):
* java/org/gnu/emacs/EmacsDrawRectangle.java (perform):
* java/org/gnu/emacs/EmacsDrawable.java (EmacsDrawable):
* java/org/gnu/emacs/EmacsFillPolygon.java (perform):
* java/org/gnu/emacs/EmacsFillRectangle.java (perform):
* java/org/gnu/emacs/EmacsGC.java (EmacsGC):
* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap):
(destroyHandle):
* java/org/gnu/emacs/EmacsSdk7FontDriver.java (draw): Avoid
redundant canvas saves and restores.
* java/org/gnu/emacs/EmacsService.java (run):
* java/org/gnu/emacs/EmacsView.java (EmacsView):
(handleDirtyBitmap):
* java/org/gnu/emacs/EmacsWindow.java (changeWindowBackground)
(EmacsWindow): Make compatible with Android 2.2 and later.

* lib-src/Makefile.in (DONT_INSTALL): Add asset-directory-tool
on Android.:(asset-directory-tool{EXEEXT}): New target.
* lib-src/asset-directory-tool.c (struct directory_tree, xmalloc)
(main_1, main_2, main): New file.

* lib, m4: Merge from gnulib.  This will be reverted before
merging to master.

* lisp/button.el (button-map):
(push-button):
* lisp/frame.el (display-popup-menus-p): Improve touchscreen
support.
* lisp/subr.el (event-start):
(event-end): Handle touchscreen events.
* lisp/touch-screen.el (touch-screen-handle-timeout):
(touch-screen-handle-point-update):
(touch-screen-handle-point-up):
(touch-screen-track-tap):
(touch-screen-track-drag):
(touch-screen-drag-mode-line-1):
(touch-screen-drag-mode-line): New functions.
([mode-line touchscreen-begin]):
([bottom-divider touchscreen-begin]): Bind new events.

* lisp/wid-edit.el (widget-event-point):
(widget-keymap):
(widget-event-start):
(widget-button--check-and-call-button):
(widget-button-click): Improve touchscreen support.

* src/alloc.c (make_lisp_symbol): Avoid ICE on Android NDK GCC.
(mark_pinned_symbols): Likewise.

* src/android.c (struct android_emacs_window): New struct.
(window_class): New variable.
(android_run_select_thread): Add workaround for Android platform
bug.
(android_extract_long, android_scan_directory_tree): New
functions.
(android_file_access_p): Use those functions instead.
(android_init_emacs_window): New function.
(android_init_emacs_gc_class): Update signature of `markDirty'.
(android_change_gc, android_set_clip_rectangles): Tell the GC
whether or not clip rects were dirtied.
(android_swap_buffers): Do not look up method every time.
(struct android_dir): Adjust for new directory tree lookup.
(android_opendir, android_readdir, android_closedir): Likewise.
(android_four_corners_bilinear): Fix coding style.
(android_ftruncate): New function.
* src/android.h: Update prototypes.  Replace ftruncate with
android_ftruncate when necessary.

* src/androidterm.c (handle_one_android_event): Pacify GCC.  Fix
touch screen tool bar bug.
* src/emacs.c (using_utf8): Fix compilation error.
* src/fileio.c (Ffile_system_info): Return Qnil when fsusage.o
is not built.
* src/filelock.c (BOOT_TIME_FILE): Fix definition for Android.
* src/frame.c (Fx_parse_geometry): Fix uninitialized variable
uses.
* src/keyboard.c (lispy_function_keys): Fix `back'.
* src/menu.c (x_popup_menu_1): Handle touch screen events.
(Fx_popup_menu): Document changes.

* src/sfnt.c (main): Improve tests.

* src/sfntfont-android.c (sfntfont_android_put_glyphs): Fix
minor problem.
(init_sfntfont_android): Check for
HAVE_DECL_ANDROID_GET_DEVICE_API_LEVEL.
* src/sfntfont.c (struct sfnt_font_desc): New fields `adstyle'
and `languages'.
(sfnt_parse_style): Append tokens to adstyle.
(sfnt_parse_languages): New function.
(sfnt_enum_font_1): Parse supported languages and adstyle.
(sfntfont_list_1): Handle new fields.
(sfntfont_text_extents): Fix uninitialized variable use.
(syms_of_sfntfont, mark_sfntfont): Adjust accordingly.

23 months agoMerge from origin/emacs-29
Stefan Kangas [Thu, 19 Jan 2023 05:30:25 +0000 (06:30 +0100)]
Merge from origin/emacs-29

db727873803 ruby-ts-mode: Use font-lock-constant-face for true/false/nil
819719330ad (ruby-ts--indent-rules): Add a rule for continuation of a...
94b9cbf96fb (ruby-ts--parent-call-or-bol): Handle more cases with nes...
ba33b83ce4b (ruby-ts--statement-container-regexp): Remove "parenthesi...
f2bedf695c1 ruby-ts-mode: Handle indent in parenless calls much close...
758ac5eabbe Fix split-window-below for the case when split-window-kee...
8e9783b4ce4 Rebind in read-regexp-map ‘M-c’ to ‘M-s c’ compatible wit...
78f93d92b28 * lisp/vc/vc-dir.el: Make keys ‘% m’ and ‘* %’ compatible...
dc3f85fd4b0 Use proper types for Eshell warnings
6a8338a8bc8 ; Avoid byte-compiler warning in cc-fonts.el.
9186be20aeb ; Clarify doc strings of some functions in files.el
bd5ef3ef95e Improve the documentation of 'auto-mode-alist' search
1798ff5a663 ; Fix minor mistakes in documentation
faee7e1f1bd ; * lisp/treesit.el (treesit-font-lock-fontify-region): M...
24f0dfd3731 Revert "Revert "Add c-or-c++-ts-mode (bug#59613)""
ac3bc775b6f Make it harder to misactivate tree-sitter font-lock fast ...
bdd82fa7977 ; * src/treesit.c: Remove unused boilerplate.
343b9b3dfe3 ruby-ts-mode: Obey the option ruby-method-call-indent
045404d1aac ruby-ts-mode: Obey the option ruby-after-operator-indent
300ca6ac372 ruby-ts-mode: Fix indent after operator or conditional
ac5516bd7d5 ruby-ts-mode: Fix/change indentation of a continuation me...
5e2e68a0c2d ruby-ts-mode: Fix indent inside parenthesized_expr and el...
9ed9ff4690a ruby-ts-mode: Fix the rules for hanging arrays and hashes
c4f0b6ccea1 Add more detail about how to invoke Eshell commands
dbac923b9df CC Mode: On removal of "typedef", remove pertinent types ...
56d69c2fc47 ; Relax timeouts for failing ERC test
183e7492702 Don't preserve non-module minor modes in erc-open
7b8322f6285 Use correct buffer for local-module vars in erc-open
7b13422298a ; Avoid plist-get as generalized var in erc-compat
09e9d7c7496 Fix display of warnings on w32 console
bd094207c76 Fix buffer-list-update-hook for indirect buffers
9e7a5d58eea ; Fix tree-sitter indent anchor preset
7c61a304104 Fix treesit-node-first-child-for-pos (bug#60127)
b36cc7e7bbb ; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor ch...

# Conflicts:
# etc/NEWS

23 months agoruby-ts-mode: Use font-lock-constant-face for true/false/nil
Dmitry Gutov [Thu, 19 Jan 2023 03:43:10 +0000 (05:43 +0200)]
ruby-ts-mode: Use font-lock-constant-face for true/false/nil

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Use font-lock-constant-face for true/false/nil.

23 months ago(ruby-ts--indent-rules): Add a rule for continuation of a hash pair
Dmitry Gutov [Thu, 19 Jan 2023 03:26:03 +0000 (05:26 +0200)]
(ruby-ts--indent-rules): Add a rule for continuation of a hash pair

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Add a rule for continuation of a hash pair.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.

23 months ago(ruby-ts--parent-call-or-bol): Handle more cases with nested literals
Dmitry Gutov [Thu, 19 Jan 2023 03:10:05 +0000 (05:10 +0200)]
(ruby-ts--parent-call-or-bol): Handle more cases with nested literals

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--parent-call-or-bol):
Handle more cases with nested literals.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.

23 months ago(ruby-ts--statement-container-regexp): Remove "parenthesized_statements"
Dmitry Gutov [Thu, 19 Jan 2023 01:51:51 +0000 (03:51 +0200)]
(ruby-ts--statement-container-regexp): Remove "parenthesized_statements"

* lisp/progmodes/ruby-ts-mode.el
(ruby-ts--statement-container-regexp): Remove
"parenthesized_statements", it's not really a statement container,
not one we'd use for indentation alignment anyway.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.

23 months agoruby-ts-mode: Handle indent in parenless calls much closer to ruby-mode
Dmitry Gutov [Thu, 19 Jan 2023 01:38:58 +0000 (03:38 +0200)]
ruby-ts-mode: Handle indent in parenless calls much closer to ruby-mode

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--parent-call-or-bol):
New function.
(ruby-ts--indent-rules): Use it for cases which need special
anchoring logic when inside a parenless method call.
Remove the ad-hoc handling of pair-hash-pair etc indentation,
which was there only for the parenless cases, apparently.
Have "No paren, ruby-parenless-call-arguments-indent is nil" case
align to the statement, if only because ruby-mode does that.

* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-parenless-call-arguments-indent.rb.

23 months agoFix split-window-below for the case when split-window-keep-point is nil.
Juri Linkov [Wed, 18 Jan 2023 18:24:26 +0000 (20:24 +0200)]
Fix split-window-below for the case when split-window-keep-point is nil.

* lisp/window.el (split-window-below): Don't try to move point when
split-window-keep-point is nil and window-to-split is not the selected window
or nil (that defaults to the selected window) because code makes sense
only for the selected window.
(split-window-below, split-window-right): Improve docstrings (bug#60886)

23 months agoRebind in read-regexp-map ‘M-c’ to ‘M-s c’ compatible with search-map
Juri Linkov [Wed, 18 Jan 2023 18:05:19 +0000 (20:05 +0200)]
Rebind in read-regexp-map ‘M-c’ to ‘M-s c’ compatible with search-map

Also it's compatible with 'M-s c' (isearch-toggle-case-fold)
used during Isearch.  Also makes possible to use the global keybinding
'M-c' (capitalize-dwim) in the minibuffer.

* doc/lispref/minibuf.texi (Text from Minibuffer): Rename ‘M-c’ to ‘M-s c’.

* lisp/replace.el (read-regexp-map): Rebind ‘M-c’ to ‘M-s c’ (bug#60741).
(read-regexp-toggle-case-fold): Rename from read-regexp-toggle-case-folding
to more standard name.

23 months ago* lisp/vc/vc-dir.el: Make keys ‘% m’ and ‘* %’ compatible with Dired
Juri Linkov [Wed, 18 Jan 2023 17:55:10 +0000 (19:55 +0200)]
* lisp/vc/vc-dir.el: Make keys ‘% m’ and ‘* %’ compatible with Dired

(vc-dir-mode-map): Replace ‘%’ for vc-dir-mark-by-regexp
with ‘% m’ in regexp-map and ‘* %’ in mark-map (bug#60887).

* doc/emacs/maintaining.texi (VC Directory Commands): Replace ‘%’
with ‘% m’ and ‘* %’.  Mention vc-dir-mark-registered-files.

23 months agoImproved docstring single quote warning
Mattias Engdegård [Wed, 18 Jan 2023 17:41:39 +0000 (18:41 +0100)]
Improved docstring single quote warning

* lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-style-warn):
More robust regexp.  More explicit warning message.

23 months agoBetter lambda quote warning
Mattias Engdegård [Wed, 18 Jan 2023 16:30:15 +0000 (17:30 +0100)]
Better lambda quote warning

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
Avoid `...` shown backslash-escaped as a symbol, and render an empty
argument list as `()` instead of `nil`.

23 months agoUse proper types for Eshell warnings
Jim Porter [Wed, 18 Jan 2023 04:51:15 +0000 (20:51 -0800)]
Use proper types for Eshell warnings

* lisp/eshell/esh-var.el (eshell-get-variable):
* lisp/eshell/em-basic (eshell/echo): Don't use ':warning'; that's a
warning level, not a warning type.

23 months ago; Avoid byte-compiler warning in cc-fonts.el.
Eli Zaretskii [Wed, 18 Jan 2023 15:22:48 +0000 (17:22 +0200)]
; Avoid byte-compiler warning in cc-fonts.el.

23 months ago; Clarify doc strings of some functions in files.el
Eli Zaretskii [Wed, 18 Jan 2023 14:19:10 +0000 (16:19 +0200)]
; Clarify doc strings of some functions in files.el

* lisp/files.el (file-name-sans-extension, file-name-extension)
(file-name-sans-versions): Doc fixes.  (Bug#60929)

23 months agoImprove the documentation of 'auto-mode-alist' search
Eli Zaretskii [Wed, 18 Jan 2023 14:01:12 +0000 (16:01 +0200)]
Improve the documentation of 'auto-mode-alist' search

* doc/emacs/modes.texi (Choosing Modes): Expand the description of
"recursive extension stripping" using 'auto-mode-alist'.
(Bug#60930)

23 months ago; Fix minor mistakes in documentation
Ikumi Keita [Wed, 18 Jan 2023 12:28:59 +0000 (14:28 +0200)]
; Fix minor mistakes in documentation

* lisp/emacs-lisp/cl-macs.el (cl-letf): Correct Info reference.

* doc/lispref/strings.texi (String Conversion): Fix typo.

(Bug#60926)

23 months ago; * lisp/treesit.el (treesit-font-lock-fontify-region): Minor fix.
Yuan Fu [Wed, 18 Jan 2023 06:52:22 +0000 (22:52 -0800)]
; * lisp/treesit.el (treesit-font-lock-fontify-region): Minor fix.

23 months agoRevert "Revert "Add c-or-c++-ts-mode (bug#59613)""
Yuan Fu [Wed, 18 Jan 2023 06:30:09 +0000 (22:30 -0800)]
Revert "Revert "Add c-or-c++-ts-mode (bug#59613)""

This reverts commit d46f7f4edcce14e6cbd8e2d7091dbabbe08defc1.

Aaaactually, we need this, otherwise we can't use tree-sitter based C
mode for header files.

23 months agoMake it harder to misactivate tree-sitter font-lock fast mode
Yuan Fu [Wed, 18 Jan 2023 06:26:21 +0000 (22:26 -0800)]
Make it harder to misactivate tree-sitter font-lock fast mode

This has been brought up in bug#60691 and bug#60223.  I proposed a fix
by testing the size of the tree rather than measuring the query time.
But after some thought, I fear that just looking at the size will give
us false-negatives.  So I kept the time-based activation, just added a
grace count to reduce false-positives.

* lisp/treesit.el:
(treesit--font-lock-fast-mode-grace-count): New variable.
(treesit--font-lock-notifier): Only activate fast mode after 5
offenses.

23 months ago; * src/treesit.c: Remove unused boilerplate.
Yuan Fu [Tue, 17 Jan 2023 17:37:04 +0000 (09:37 -0800)]
; * src/treesit.c: Remove unused boilerplate.

These two functions are not used after 7c61a304104.

23 months agoruby-ts-mode: Obey the option ruby-method-call-indent
Dmitry Gutov [Wed, 18 Jan 2023 01:21:32 +0000 (03:21 +0200)]
ruby-ts-mode: Obey the option ruby-method-call-indent

* lisp/progmodes/ruby-ts-mode.el
(ruby-ts--method-call-indent-p): New function.
(ruby-ts--indent-rules): Use it.

* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-method-call-indent.rb.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
Add explicit value for ruby-method-call-indent.

23 months agoruby-ts-mode: Obey the option ruby-after-operator-indent
Dmitry Gutov [Wed, 18 Jan 2023 00:55:09 +0000 (02:55 +0200)]
ruby-ts-mode: Obey the option ruby-after-operator-indent

* lisp/progmodes/ruby-ts-mode.el
(ruby-ts--after-op-indent-p): New function.
(ruby-ts--indent-rules): Use it.

* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-after-operator-indent.rb.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
Make sure indentation vars are at their default values.

23 months agoruby-ts-mode: Fix indent after operator or conditional
Dmitry Gutov [Wed, 18 Jan 2023 00:40:00 +0000 (02:40 +0200)]
ruby-ts-mode: Fix indent after operator or conditional

Make it match ruby-mode's indentation behavior.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--binary-indent-anchor):
New function.
(ruby-ts--indent-rules): Use it instead of a composite matcher.
Add a rule for 'conditional'.
(ruby-ts--assignment-ancestor, ruby-ts--is-in-condition)
(ruby-ts--endless-method): Remove.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
Add examples.

23 months agoruby-ts-mode: Fix/change indentation of a continuation method call
Dmitry Gutov [Tue, 17 Jan 2023 22:55:09 +0000 (00:55 +0200)]
ruby-ts-mode: Fix/change indentation of a continuation method call

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Fix/change indentation of a continuation method call.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
New examples.

23 months agoruby-ts-mode: Fix indent inside parenthesized_expr and else/end after unless
Dmitry Gutov [Tue, 17 Jan 2023 22:41:14 +0000 (00:41 +0200)]
ruby-ts-mode: Fix indent inside parenthesized_expr and else/end after unless

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Fix indentation for parenthesized_expression and else/end after
'unless'.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
New examples.

23 months agoruby-ts-mode: Fix the rules for hanging arrays and hashes
Dmitry Gutov [Tue, 17 Jan 2023 21:46:41 +0000 (23:46 +0200)]
ruby-ts-mode: Fix the rules for hanging arrays and hashes

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Fix the rules for hanging arrays and hashes (to line up to
parent-bol instead of the opening brace).

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
New file with examples.

* test/lisp/progmodes/ruby-ts-mode-tests.el: Use it here.

23 months ago; Fix Eshell prompt tests when the current user is root
Jim Porter [Wed, 18 Jan 2023 00:59:13 +0000 (16:59 -0800)]
; Fix Eshell prompt tests when the current user is root

* test/lisp/eshell/em-prompt-tests.el
(em-prompt-test/field-properties)
(em-prompt-test/field-properties/no-highlight): Handle the case when
the current user is root.

23 months agoPort xattr handling to Fedora 9
Paul Eggert [Tue, 17 Jan 2023 23:38:38 +0000 (15:38 -0800)]
Port xattr handling to Fedora 9

Problem reported by Po Lu (Bug#60843).
* m4/xattr.m4: Sync from Gnulib.

23 months agoAdd more detail about how to invoke Eshell commands
Jim Porter [Mon, 16 Jan 2023 02:35:31 +0000 (18:35 -0800)]
Add more detail about how to invoke Eshell commands

* doc/misc/eshell.texi (Variables): Move footnote explaining "REPL"
from here...
(Top): ... to its first use here.
(Commands): Move explanation about kernel functions to here.
(Invocation): Describe command form and Lisp form.  Fix documentation
about priority of commands in command form.
(Arguments): Add a cross reference to the Invocation node.

23 months agoCC Mode: On removal of "typedef", remove pertinent types from c-found-types
Alan Mackenzie [Tue, 17 Jan 2023 18:15:45 +0000 (18:15 +0000)]
CC Mode: On removal of "typedef", remove pertinent types from c-found-types

For this purpose, record the type names declared by typedef in a text
property, c-typedef, on the typedef.  On any change to that "typedef" or a
type, remove the old identifier(s) from c-found-types.

This should fix bug #59671.

* lisp/progmodes/cc-defs.el (c-search-forward-non-nil-char-property): New
macro.

* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): Move the scope of
identifier-start from the "inner" let form to the outer one.  Amend the
return value such that the middle element of the second element is now the
position of the "typedef", not merely non-nil.

* lisp/progmodes/cc-fonts.el (c-font-lock-declarators): Disregard the LIMIT
parameter when fontifying the declarators of a typedef construct.  Also in
this case, set the c-typedef text property on the "typedef" to the list of
declared types.  Amend this list when these declared types change.
(c-font-lock-single-decl): Massage the `types' argument given to
c-font-lock-declarators.
(c-font-lock-cut-off-declarators): Amend to work when the starting point of
the fontification is inside a brace block.

* lisp/progmodes/cc-mode.el (c-before-change-de-typedef)
(c-after-change-de-typedef): New functions.
(c-update-new-id): Replace the erroneous c-end-of-current-token with a clause
containing c-forward-token-2.
(c-before-change): Call c-before-change-de-typedef.
(c-after-change): Call c-after-change-de-typedef.

23 months ago; * src/xterm.c (handle_one_xevent): Fix GTK build. (Bug#60883)
Eli Zaretskii [Tue, 17 Jan 2023 17:45:12 +0000 (19:45 +0200)]
; * src/xterm.c (handle_one_xevent): Fix GTK build.  (Bug#60883)

23 months agoComplete implementation of `file-user-id'
Michael Albinus [Tue, 17 Jan 2023 15:00:08 +0000 (16:00 +0100)]
Complete implementation of `file-user-id'

* lisp/net/ange-ftp.el (ange-ftp-file-user-uid): New defun.  Mark
it as file name handler for `file-user-uid'.

* lisp/net/tramp-archive.el (tramp-archive-handle-file-user-uid):
Move up.  Protect `file-user-id' call for older Emacs versions.

* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
Remove 'file-user-uid'.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test44-file-user-uid): New test.
(tramp-archive-test48-auto-load)
(tramp-archive-test48-delay-load): Rename.

* test/lisp/net/tramp-tests.el (tramp-test44-file-user-uid): New test.
(tramp--test-asynchronous-requests-timeout): Adapt docstring.
(tramp-test45-asynchronous-requests)
(tramp-test46-dired-compress-file)
(tramp-test46-dired-compress-dir, tramp-test47-read-password)
(tramp-test48-auto-load, tramp-test48-delay-load)
(tramp-test48-recursive-load, tramp-test48-remote-load-path)
(tramp-test49-unload): Rename.

23 months ago; Relax timeouts for failing ERC test
F. Jason Park [Tue, 17 Jan 2023 14:26:34 +0000 (06:26 -0800)]
; Relax timeouts for failing ERC test

* test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld: Bump
timeouts to 10 seconds.
* test/lisp/erc/resources/base/netid/bouncer/foonet-again.eld: Bump
timeouts to 10 seconds.

23 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Tue, 17 Jan 2023 14:11:31 +0000 (22:11 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

23 months agoUpdate Android port
Po Lu [Tue, 17 Jan 2023 14:10:43 +0000 (22:10 +0800)]
Update Android port

* doc/emacs/android.texi (Android Fonts): Document that TTC
format fonts are now supported.
* doc/emacs/emacs.texi (Top): Fix menus.
* doc/lispref/commands.texi (Touchscreen Events)
(Key Sequence Input): Document changes to touchscreen events.
* etc/DEBUG: Describe how to debug 64 bit binaries on Android.

* java/org/gnu/emacs/EmacsCopyArea.java (perform): Explicitly
recycle copy bitmap.
* java/org/gnu/emacs/EmacsDialog.java (EmacsDialog): New class.
* java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Use 5
point PolyLine like X, because Android behaves like Postscript
on some devices and X elsewhere.
* java/org/gnu/emacs/EmacsFillRectangle.java (perform):
Explicitly recycle copy bitmap.
* java/org/gnu/emacs/EmacsPixmap.java (destroyHandle):
Explicitly recycle bitmap and GC if it is big.
* java/org/gnu/emacs/EmacsView.java (EmacsView): Make
`bitmapDirty' a boolean.
(handleDirtyBitmap): Reimplement in terms of that boolean.
Explicitly recycle old bitmap and GC.
(onLayout): Fix lock up.
(onDetachedFromWindow): Recycle bitmap and GC.

* java/org/gnu/emacs/EmacsWindow.java (requestViewLayout):
Update call to explicitlyDirtyBitmap.

* src/android.c (android_run_select_thread, android_select):
Really fix android_select.
(android_build_jstring): New function.
* src/android.h: Update prototypes.
* src/androidmenu.c (android_process_events_for_menu): Totally
unblock input before process_pending_signals.
(android_menu_show): Remove redundant unblock_input and
debugging code.
(struct android_emacs_dialog, android_init_emacs_dialog)
(android_dialog_show, android_popup_dialog, init_androidmenu):
Implement popup dialogs on Android.

* src/androidterm.c (android_update_tools)
(handle_one_android_event, android_frame_up_to_date): Allow
tapping tool bar items.
(android_create_terminal): Add dialog hook.
(android_wait_for_event): Adjust call to android_select.
* src/androidterm.h (struct android_touch_point): New field
`tool_bar_p'.
* src/keyboard.c (read_key_sequence, head_table)
(syms_of_keyboard): Prefix touchscreen events with posn.
* src/keyboard.h (EVENT_HEAD): Handle touchscreen events.
* src/process.c (wait_reading_process_output): Adjust call to
android_select.
* src/sfnt.c (sfnt_read_table_directory): If the first long
turns out to be ttcf, return -1.
(sfnt_read_ttc_header): New function.
(main): Test TTC support.

* src/sfnt.h (struct sfnt_ttc_header): New structure.
(enum sfnt_ttc_tag): New enum.

* src/sfntfont-android.c (struct
sfntfont_android_scanline_buffer): New structure.
(GET_SCANLINE_BUFFER): New macro.  Try to avoid so much malloc
upon accessing the scanline buffer.
(sfntfont_android_put_glyphs): Do not use SAFE_ALLOCA to
allocate the scaline buffer.
(Fandroid_enumerate_fonts): Enumerate ttc fonts too.

* src/sfntfont.c (struct sfnt_font_desc): New field `offset'.
(sfnt_enum_font_1): Split out enumeration code from
sfnt_enum_font.
(sfnt_enum_font): Read TTC tables and enumerate each font
therein.
(sfntfont_open): Seek to the offset specified.

* xcompile/Makefile.in (maintainer-clean): Fix depends here.

23 months agoDon't preserve non-module minor modes in erc-open
F. Jason Park [Fri, 13 Jan 2023 14:03:15 +0000 (06:03 -0800)]
Don't preserve non-module minor modes in erc-open

* lisp/erc/erc-common.el (define-erc-module): Add symbol property
`erc-module' to minor modes defined as part of a module.
* lisp/erc/erc.el (erc--merge-local-modes): Be more conservative when
persisting local minor-mode state across ERC sessions.  User and
third-party modes that were not defined via `define-erc-modules'
should be left alone.
(erc-open): Run major-mode hooks and enable minor modes after prompt
has been set up.  This ensures that module-setup code can access a
fully initialized `erc-input-marker'.
* test/lisp/erc/erc-tests.el (erc--merge-local-modes): Add mocks for
`erc-module' symbol property and a test case covering some foreign ERC
mode.
(define-erc-module--global, define-erc-module--local): Expect the
`erc-module' symbol property to be defined for mode symbols and
aliases.  (Bug#60784.)

23 months agoUse correct buffer for local-module vars in erc-open
F. Jason Park [Tue, 17 Jan 2023 07:05:16 +0000 (23:05 -0800)]
Use correct buffer for local-module vars in erc-open

* lisp/erc/erc.el (erc--target-priors): New internal variable to do
for target buffers what `erc--server-reconnecting' does for server
buffers.
(erc-open): Source the state of a local module's mode variable from
its actual buffer rather than its server buffer.  Additionally, make
all local variables from a prior session available to
module-activation functions and `erc-mode' hooks, even when
`erc-reuse-buffers' is nil.  This bug arrived with the introduction of
"local-modules" (bug#57955).

* test/lisp/erc/erc-scenarios-base-local-modules.el
(erc-scenarios-base-local-modules--toggle-helpers): Remove useless
`with-current-buffer'.
(erc-scenarios-base-local-modules--local-var, erc--phony-sblm--enable,
erc--phony-sblm--disable, erc--phony-sblm--mode): Add fake local
module and data var for test scenario.
(erc-scenarios-base-local-modules--var-persistence) Add slightly hacky
test case with promise to improve later when splitting the file.

23 months ago; Avoid plist-get as generalized var in erc-compat
F. Jason Park [Tue, 10 Jan 2023 19:59:57 +0000 (11:59 -0800)]
; Avoid plist-get as generalized var in erc-compat

* lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search): The
gv expander for `plist-get' was added in Emacs 28.  But ERC still
supports 27, as of this function's introduction, in Emacs 29.

23 months agoFix display of warnings on w32 console
Eli Zaretskii [Tue, 17 Jan 2023 13:44:51 +0000 (15:44 +0200)]
Fix display of warnings on w32 console

* lisp/emacs-lisp/warnings.el (warnings-suppress): Use alternative
symbol for TTY frames on MS-Windows.

2 years agoMake tool bar highlight work correctly during touch events
Po Lu [Tue, 17 Jan 2023 10:54:22 +0000 (18:54 +0800)]
Make tool bar highlight work correctly during touch events

* src/xterm.c (handle_one_xevent): Before activating the tool
bar in response to a touch event, set the mouse highlight to
that location.  After the touch ends, clear the mouse highlight.

2 years agoFix buffer-list-update-hook for indirect buffers
Basil L. Contovounesios [Wed, 11 Jan 2023 16:34:07 +0000 (16:34 +0000)]
Fix buffer-list-update-hook for indirect buffers

Fmake_indirect_buffer can be told whether to run buffer hooks since
bug#49160, but until now it ran buffer-list-update-hook irrespective
of this.

* src/buffer.c (Fmake_indirect_buffer): Don't run
buffer-list-update-hook when called with a non-nil
INHIBIT-BUFFER-HOOKS argument.
(run_buffer_list_update_hook): Don't special-case NULL argument, as
no such callers remain.

* test/src/buffer-tests.el
(buffer-tests-inhibit-buffer-hooks-indirect): Test whether indirect
buffer hooks are run regardless of whether base buffer hooks are
inhibited.  Check that all three buffer hooks, not just
kill-buffer-query-functions, are inhibited.

2 years agoCorrectly handle touches on the tool bar
Po Lu [Tue, 17 Jan 2023 10:28:37 +0000 (18:28 +0800)]
Correctly handle touches on the tool bar

* src/xterm.c (xi_link_touch_point): New argument `frame'.  Set
new field `touchpoint->frame' to it.
(xi_unlink_touch_points): New function.
(xi_disable_devices): Clear the tool bar device on frames whose
tool bar device matches this field.
(handle_one_xevent): If an XI_TouchBegin event lands on the tool
bar, then simulate a pointer click.  Ignore future events from
that touchpoint from there onwards.
(x_make_frame_invisible, x_free_frame_resources): Unlink touch
points associated with the frame.

* src/xterm.h (struct xi_touch_point_t): New field `frame'.
(struct x_output): New fields for keeping track of tool bar
touches.

2 years ago; Fix tree-sitter indent anchor preset
Yuan Fu [Tue, 17 Jan 2023 09:20:51 +0000 (01:20 -0800)]
; Fix tree-sitter indent anchor preset

* lisp/treesit.el:
(treesit-simple-indent-presets): Fix prev-adaptive-prefix.

2 years agoFix treesit-node-first-child-for-pos (bug#60127)
Yuan Fu [Tue, 17 Jan 2023 08:57:54 +0000 (00:57 -0800)]
Fix treesit-node-first-child-for-pos (bug#60127)

The problem is due to a bug in ts_node_first_child_for_pos, but
tree-sitter is moving pretty slowly right now so I reimplemented a
correct version of it in treesit.c.

* src/treesit.c (treesit_cursor_first_child_for_byte): New function.
(Ftreesit_node_first_child_for_pos): Use the new function.

2 years ago; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor change.
Yuan Fu [Tue, 17 Jan 2023 04:32:15 +0000 (20:32 -0800)]
; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor change.

2 years agoMerge from origin/emacs-29
Stefan Kangas [Tue, 17 Jan 2023 05:30:08 +0000 (06:30 +0100)]
Merge from origin/emacs-29

e8c77d9abda Fix hfy-exclude-file-rules (bug#60562)
c1d32d9a20d CC Mode: Prevent ids in temporary "declarators" getting i...
140824dc099 ; Fix more quoting in w32fns.c.
f367ba3ed03 ; Avoid byte-compiler warning in eglot.el
1b458aced72 ; * lisp/progmodes/eglot.el: Remove stray space.
7c8eac8fbcb ; * src/w32fns.c: Fix quoting.  Patch by Arash Esbati <ar...
67df34c143d Fix M-x eglot prompt when connection already exists (bug#...
3d1e74c82a8 Fix tree-sitter indent preset function (bug#60270)
352e41016bc ruby-ts-mode: Support the option ruby-block-indent
44c9cb8653d Improve indentation for jsx
82ae9caaddb * lisp/subr.el (while-let): Fix docs if-let->if-let* (bug...
f16bd1ead43 Revert "* lisp/subr.el (while-let): Use if-let, not if-le...
c8d54809727 Bump use-package version for Emacs 29.1

2 years agoAdd 'file-user-uid' to get the connection-local effective UID
Jim Porter [Tue, 10 Jan 2023 23:35:18 +0000 (15:35 -0800)]
Add 'file-user-uid' to get the connection-local effective UID

In particular, this lets Eshell show a "#" root prompt sigil when the
user has sudo'ed via "cd /sudo::" (bug#60722).

* lisp/simple.el (file-user-uid): New function.

* lisp/net/tramp.el (tramp-file-name-for-operation): Add
'file-user-uid'.
(tramp-handle-file-user-uid): New function.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Add 'file-user-uid'.

* lisp/net/tramp-archive.el (tramp-archive-handle-file-user-uid): New
function...
(tramp-archive-file-name-handler-alist): ... use it.

* lisp/eshell/em-prompt.el (eshell-prompt-function): Use
'file-user-uid'.

* lisp/eshell/esh-var.el (eshell-variable-aliases-list): Add '$UID'.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/uid-var): New test.

* doc/lispref/os.texi (User Identification): Document 'file-user-uid'.

* doc/lispref/files.texi (Magic File Names): Mention 'file-user-uid'.

* doc/misc/eshell.texi (Variables): Document '$UID'.  Add a missing
index entry for '$INSIDE_EMACS'.

* etc/NEWS: Announce 'file-user-uid'.

2 years ago* lisp/emacs-lisp/bytecomp.el (format-message): Warn on bad arity.
Mattias Engdegård [Thu, 12 Jan 2023 14:38:15 +0000 (15:38 +0100)]
* lisp/emacs-lisp/bytecomp.el (format-message): Warn on bad arity.

2 years agoOptimise `apply` with `cons` in tail argument
Mattias Engdegård [Thu, 12 Jan 2023 13:07:45 +0000 (14:07 +0100)]
Optimise `apply` with `cons` in tail argument

* lisp/emacs-lisp/byte-opt.el (byte-optimize-apply): Transform

  (apply F ... (cons X Y)) -> (apply F ... X Y)

This pattern is seen both in hand-written code and in backquote
expansions.

2 years agoFix hfy-exclude-file-rules (bug#60562)
Mattias Engdegård [Sun, 15 Jan 2023 14:23:44 +0000 (15:23 +0100)]
Fix hfy-exclude-file-rules (bug#60562)

* lisp/htmlfontify.el (hfy-exclude-file-rules):
Fix broken defcustom type; no longer fails test-custom-opts.
Fix regexps not to use newline-sensitive patterns like `.` and `$`
which do not make sense when matching file names.
Better doc string.
* lisp/htmlfontify.el (hfy-list-files): Simplify regexp argument.

2 years agoCC Mode: Prevent ids in temporary "declarators" getting into c-found-types
Alan Mackenzie [Mon, 16 Jan 2023 17:44:44 +0000 (17:44 +0000)]
CC Mode: Prevent ids in temporary "declarators" getting into c-found-types

This should fix bug #60765.  In the scenario type an identifier in front of
foo (bar, baz), as when started a new statement.  This temporarily makes the
function call a declarator, and bar and baz types.  Don't enter bar and baz
into c-found-types.

* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1) (CASE 6): When a
'maybe type triggers this case, set `unsafe-maybe' to non-nil.

2 years ago; Fix more quoting in w32fns.c.
Eli Zaretskii [Mon, 16 Jan 2023 14:55:01 +0000 (16:55 +0200)]
; Fix more quoting in w32fns.c.

2 years ago; Avoid byte-compiler warning in eglot.el
Eli Zaretskii [Mon, 16 Jan 2023 14:52:48 +0000 (16:52 +0200)]
; Avoid byte-compiler warning in eglot.el

* lisp/progmodes/eglot.el (eglot): Rename INTERACTIVE to avoid
byte-compiler warning.  Update the doc string.  (Bug#60557)

2 years ago; * lisp/progmodes/eglot.el: Remove stray space.
Eli Zaretskii [Mon, 16 Jan 2023 14:08:46 +0000 (16:08 +0200)]
; * lisp/progmodes/eglot.el: Remove stray space.

2 years ago; * src/w32fns.c: Fix quoting. Patch by Arash Esbati <arash@gnu.org>.
Eli Zaretskii [Mon, 16 Jan 2023 14:00:18 +0000 (16:00 +0200)]
; * src/w32fns.c: Fix quoting.  Patch by Arash Esbati <arash@gnu.org>.

2 years agoAdd sentence node regexp to json-ts-mode
Theodor Thornhill [Mon, 16 Jan 2023 13:48:56 +0000 (14:48 +0100)]
Add sentence node regexp to json-ts-mode

* lisp/progmodes/json-ts-mode.el (json-ts-mode): Add pair for sentence
movement.

2 years agoAdd some basic tests for java-ts-mode and typescript-ts-mode
Theodor Thornhill [Mon, 16 Jan 2023 13:33:27 +0000 (14:33 +0100)]
Add some basic tests for java-ts-mode and typescript-ts-mode

* test/lisp/progmodes/java-ts-mode-resources/indent.erts: New file
with tests for indentation.
* test/lisp/progmodes/java-ts-mode-resources/movement.erts: New file
with tests for movement.
* test/lisp/progmodes/java-ts-mode-tests.el: New tests.
* test/lisp/progmodes/typescript-ts-mode-resources/indent.erts: New
file with tests for indentation.
* test/lisp/progmodes/typescript-ts-mode-tests.el: New tests.

2 years agoAdd sentence-nodes to dockerfile-ts-mode
Theodor Thornhill [Mon, 16 Jan 2023 07:49:40 +0000 (08:49 +0100)]
Add sentence-nodes to dockerfile-ts-mode

* lisp/progmodes/dockerfile-ts-mode.el (dockerfile-ts-mode): Catch all
instructions.

2 years agoFix display of glyphs with word-sized component offsets on Android
Po Lu [Mon, 16 Jan 2023 12:06:01 +0000 (20:06 +0800)]
Fix display of glyphs with word-sized component offsets on Android

* src/sfnt.c (sfnt_decompose_compound_glyph): Handle correctly
the Y offset in components with ARG_1_AND_2_ARE_WORDS.
(main): Update debugging code.

2 years agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Mon, 16 Jan 2023 11:50:42 +0000 (19:50 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

2 years agoUpdate Android port
Po Lu [Mon, 16 Jan 2023 11:50:02 +0000 (19:50 +0800)]
Update Android port

* doc/emacs/android.texi (Android, Android Environment): Improve
documentation.
* doc/lispref/commands.texi (Touchscreen Events): Document
changes to touchscreen support.
* doc/lispref/display.texi (Defining Faces, Window Systems):
* doc/lispref/frames.texi (Frame Layout, Font and Color
Parameters):
* doc/lispref/os.texi (System Environment): Document Android in
various places.

* java/org/gnu/emacs/EmacsWindow.java (figureChange): Fix crash.
* lisp/loadup.el: ("touch-screen"): Load touch-screen.el.
* lisp/pixel-scroll.el: Autoload two functions.
* lisp/term/android-win.el: Add require 'touch-screen.
* lisp/touch-screen.el (touch-screen-current-tool)
(touch-screen-current-timer, touch-screen-delay)
(touch-screen-relative-xy, touch-screen-handle-scroll)
(touch-screen-handle-timeout, touch-screen-handle-point-update)
(touch-screen-handle-point-up, touch-screen-handle-touch)
(global-map, touch-screen): New file.
* src/android.c (android_run_debug_thread): Fix build on 64 bit
systems.
(JNICALL, android_put_pixel): Likewise.
(android_transform_coordinates, android_four_corners_bilinear)
(android_fetch_pixel_bilinear, android_project_image_bilinear)
(android_fetch_pixel_nearest_24, android_fetch_pixel_nearest_1)
(android_project_image_nearest): New functions.
* src/androidgui.h (struct android_transform): New structure.
* src/androidterm.c (android_note_mouse_movement): Remove
obsolete TODO.
(android_get_scale_factor): New function.
(android_draw_underwave): Scale underwave correctly.
* src/dispextern.h: Support native image transforms on Android.
* src/image.c (matrix_identity, matrix_rotate)
(matrix_mirror_horizontal, matrix_translate): New functions.
(image_set_transform): Implement native image transforms on
Android.
(Fimage_transforms_p): Implement on Android.

* src/keyboard.c (make_lispy_event, syms_of_keyboard): Handle
touch screen- menu bar events.
* src/sfnt.c: Fix typo in comment.
* src/sfntfont-android.c (sfntfont_android_blend, U255TO256)
(sfntfont_android_put_glyphs): Avoid redundant swizzling.
* src/sfntfont.c (sfntfont_lookup_char): Fix build on 64 bit
systems.

2 years agoFix M-x eglot prompt when connection already exists (bug#60557)
João Távora [Mon, 16 Jan 2023 11:48:09 +0000 (11:48 +0000)]
Fix M-x eglot prompt when connection already exists (bug#60557)

Before this change, if a current connection existed at the time of M-x
eglot, user would be first asked to enter into M-x eglot's interactive
spec details about new command line arguments, and only afterwards be
prompted about what to do with the current connection (which could be
to reconnect to it using the same arguments, or tear it down and make
a new one).

This is very confusing, as users may not be fully aware of the
distinction between "reconnect" vs "disconnect-and-connect".  They
might not know if any new command line arguments provided are taking
effect or not.

This change simplifies this and removes the option to "reconnect
instead" from M-x eglot (users can do that at any time via M-x
eglot-reconnect).  It also ensures that users are informed about a
current connection before asking to enter new command line arguments
and not the other way round.

* lisp/progmodes/eglot.el (eglot): Rework.

2 years agoFix tree-sitter indent preset function (bug#60270)
Yuan Fu [Mon, 16 Jan 2023 08:23:47 +0000 (00:23 -0800)]
Fix tree-sitter indent preset function (bug#60270)

* lisp/treesit.el (treesit-simple-indent-presets): Fix
prev-adaptive-prefix so it doesn't return nil if the previous line has
no prefix.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

2 years agoRun newsticker's ticker only periodically (bug#59856)
Alex Bochannek [Mon, 16 Jan 2023 07:14:36 +0000 (08:14 +0100)]
Run newsticker's ticker only periodically (bug#59856)

* doc/misc/newsticker.texi (Frontends, Configuration): Add
newsticker-ticker-period
* lisp/net/newst-ticker.el (newsticker--ticker-period-timer): New.
(newsticker--ticker-timer): Modify doc string.
(newsticker-ticker-interval): Modify doc string.
(newsticker-ticker-period): New
(newsticker--display-tick, newsticker--display-jump)
(newsticker--display-scroll, newsticker-start-ticker)
(newsticker-stop-ticker): Use newsticker--ticker-timer and
newsticker--ticker-period-timer.

2 years agoRename variables from last change
Theodor Thornhill [Mon, 16 Jan 2023 07:36:49 +0000 (08:36 +0100)]
Rename variables from last change

* lisp/progmodes/js.el (js--treesit-sentence-nodes): Rename variable
from 'js--treesit-sentence-type-regexp'.
(js-ts-mode): Refer to it.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--sentence-nodes): Rename variable from
'typescript-ts-mode--sentence-type-regexp'.
(typescript-ts-base-mode, tsx-ts-mode): Refer to it.

2 years agoruby-ts-mode: Support the option ruby-block-indent
Dmitry Gutov [Mon, 16 Jan 2023 03:17:05 +0000 (05:17 +0200)]
ruby-ts-mode: Support the option ruby-block-indent

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--block-indent-anchor):
New function.
(ruby-ts--indent-rules): Use it.

* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-block-indent.rb.

2 years agoAdd treesit-sentence-type-regexp
Theodor Thornhill [Sun, 15 Jan 2023 21:14:51 +0000 (22:14 +0100)]
Add treesit-sentence-type-regexp

* lisp/progmodes/js.el (js--treesit-sentence-type-regexp): New defvar
with sentence nodes.
(js-ts-mode): Use the new defvar for treesit-sentence-type-regexp.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--sentence-type-regexp): New defvar with sentence
nodes.
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-base-mode): Use
the new defvar for treesit-sentence-type-regexp.
(tsx-ts-mode): Extend treesit-sentence-type-regexp with jsx nodes.

2 years agoImprove indentation for jsx
Theodor Thornhill [Sun, 15 Jan 2023 20:31:16 +0000 (21:31 +0100)]
Improve indentation for jsx

* lisp/progmodes/js.el (js--treesit-indent-rules): Use more parent
anchors and fix typo with wrong indent offset variable.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Use more parent anchors.

2 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Sun, 15 Jan 2023 17:50:00 +0000 (18:50 +0100)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

2 years agoImprove Tramp robustness
Michael Albinus [Sun, 15 Jan 2023 17:49:37 +0000 (18:49 +0100)]
Improve Tramp robustness

* lisp/net/tramp-cmds.el (tramp-cleanup-connection):
Protect `delete-process'.

* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process)
(tramp-test30-make-process): Don't test disabled process filter.

2 years ago* lisp/subr.el (while-let): Fix docs if-let->if-let* (bug#60758).
Sean Whitton [Sun, 15 Jan 2023 17:01:41 +0000 (10:01 -0700)]
* lisp/subr.el (while-let): Fix docs if-let->if-let* (bug#60758).

2 years agoRevert "* lisp/subr.el (while-let): Use if-let, not if-let* (bug#60758)."
Sean Whitton [Sun, 15 Jan 2023 16:57:41 +0000 (09:57 -0700)]
Revert "* lisp/subr.el (while-let): Use if-let, not if-let* (bug#60758)."

This reverts commit 083badc9c122a802080552e7771e78ee47c01e3c.

2 years agoUpgrade to length* functions in Tramp
Michael Albinus [Sun, 15 Jan 2023 16:50:17 +0000 (17:50 +0100)]
Upgrade to length* functions in Tramp

* lisp/net/tramp-compat.el (tramp-compat-replace-regexp-in-region):
Move up.
(tramp-compat-length<, tramp-compat-length>)
(tramp-compat-length=): New defaliases.
(tramp-compat-file-name-unquote, tramp-compat-take)
(tramp-compat-ntake): Use them.

* lisp/net/tramp.el (tramp-string-empty-or-nil-p): New defsubst.
(tramp-find-host, tramp-buffer-name, tramp-make-tramp-file-name)
(tramp-completion-make-tramp-file-name, tramp-debug-buffer-name)
(tramp-completion-handle-file-name-all-completions)
(tramp-handle-directory-file-name)
(tramp-handle-expand-file-name)
(tramp-handle-file-name-as-directory)
(tramp-handle-file-name-completion)
(tramp-direct-async-process-p, tramp-call-process)
(tramp-read-passwd):
* lisp/net/tramp-adb.el (tramp-adb-get-device)
(tramp-adb-execute-adb-command, tramp-adb-maybe-open-connection):
* lisp/net/tramp-archive.el (tramp-archive-handle-directory-file-name):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name)
(tramp-gvfs-monitor-process-filter)
(tramp-gvfs-handle-get-home-directory)
(tramp-gvfs-handler-askpassword)
(tramp-gvfs-maybe-open-connection, tramp-get-media-devices):
* lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-directory-p)
(tramp-sh-handle-insert-directory)
(tramp-sh-handle-expand-file-name, tramp-sh-handle-make-process)
(tramp-sh-gio-monitor-process-filter, tramp-set-remote-path)
(tramp-open-connection-setup-interactive-shell)
(tramp-maybe-open-connection, tramp-make-copy-program-file-name):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-expand-file-name, tramp-smb-handle-file-acl)
(tramp-smb-handle-insert-directory)
(tramp-smb-handle-set-file-acl)
(tramp-smb-handle-get-home-directory)
(tramp-smb-maybe-open-connection):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-expand-file-name)
(tramp-sudoedit-handle-file-name-all-completions): Use the new
functions.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test43-file-system-info):
* test/lisp/net/tramp-tests.el (tramp-test26-file-name-completion)
(tramp-test31-memory-info, tramp-test35-remote-path)
(tramp-test43-file-system-info): Use new compat functions.

2 years agoBump use-package version for Emacs 29.1
Stefan Kangas [Sun, 15 Jan 2023 13:30:46 +0000 (14:30 +0100)]
Bump use-package version for Emacs 29.1

* lisp/use-package/use-package.el: Bump version to 2.4.5.

2 years agoMerge from origin/emacs-29
Stefan Kangas [Sun, 15 Jan 2023 12:08:06 +0000 (13:08 +0100)]
Merge from origin/emacs-29

9f5008b9b2a Improve error message from sqlite-mode.el
73b304bb740 ; Fix last change: remove unused @anchor.
d2efee31edb ; Update htmlfontify documentation
72d2604d1fd Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
cf311826841 ; * lisp/files.el (insert-directory-wildcard-in-dir-p): D...
3fa10f6e54d ; Add more c-ts-mode indent and filling tests
25a5575f161 Fix c-ts-mode block comment indentation (bug#60270)
252b2c01af0 Fix c-ts-mode label indent
189d976dbae Fix statement indent for c-ts-mode (bug#59686) (bug#60280)
c78e19d99c0 Allow offset in tree-sitter indent rules to be functions
d13a329acff ; Minor change in c-ts-mode--indent-styles
d428d510664 Support filling line comments in c-ts-mode
f02998939c6 ; Fix c-ts-mode filling
b365a7cc32e Fix expansion of wildcards in ls-lisp.el
b5e0260f425 Fix messages displayed when diary is shown

2 years ago; Merge from origin/emacs-29
Stefan Kangas [Sun, 15 Jan 2023 12:08:06 +0000 (13:08 +0100)]
; Merge from origin/emacs-29

The following commit was skipped:

256791edd48 ; Auto-commit of loaddefs files.

2 years agoMerge from origin/emacs-29
Stefan Kangas [Sun, 15 Jan 2023 12:08:02 +0000 (13:08 +0100)]
Merge from origin/emacs-29

920a7d38e96 ; Fix typos
48a62c55465 Add constructor_declaration as java-ts-mode defun
72c45fa9109 Further improvement for non-string values in pcomplete
1ef359095ec ; * etc/NEWS (--with-native-compilation=aot): Tweak wording.
a8eb9dd4006 Fix the case in first-completion revealed by minibuffer-t...

# Conflicts:
# doc/misc/modus-themes.org
# etc/NEWS

2 years agoImprove error message from sqlite-mode.el
Eli Zaretskii [Sun, 15 Jan 2023 10:06:54 +0000 (12:06 +0200)]
Improve error message from sqlite-mode.el

* lisp/sqlite-mode.el (sqlite-mode-open-file): Add error
checking.  (Bug#60490)

2 years ago; Fix last change: remove unused @anchor.
Eli Zaretskii [Sun, 15 Jan 2023 09:52:46 +0000 (11:52 +0200)]
; Fix last change: remove unused @anchor.

2 years ago; Update htmlfontify documentation
Xi Lu [Sun, 15 Jan 2023 09:49:45 +0000 (11:49 +0200)]
; Update htmlfontify documentation

* doc/misc/htmlfontify.texi (Customization): Remove 'hfy-find-cmd',
add 'hfy-exclude-file-rules'.
(Requirements): Remove text about 'find' program.

2 years agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Sun, 15 Jan 2023 09:19:20 +0000 (11:19 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

2 years ago; * lisp/files.el (insert-directory-wildcard-in-dir-p): Doc fix.
Eli Zaretskii [Sun, 15 Jan 2023 09:18:44 +0000 (11:18 +0200)]
; * lisp/files.el (insert-directory-wildcard-in-dir-p): Doc fix.

2 years ago; Add more c-ts-mode indent and filling tests
Yuan Fu [Sat, 14 Jan 2023 07:42:44 +0000 (23:42 -0800)]
; Add more c-ts-mode indent and filling tests

* test/lisp/progmodes/c-ts-mode-resources/filling.erts: New file.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: More tests.
* test/lisp/progmodes/c-ts-mode-tests.el:
(c-ts-mode-test-filling): new test.

2 years agoFix c-ts-mode block comment indentation (bug#60270)
Yuan Fu [Sun, 15 Jan 2023 09:01:38 +0000 (01:01 -0800)]
Fix c-ts-mode block comment indentation (bug#60270)

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--comment-2nd-line-anchor): Handle another edge case.

2 years agoFix c-ts-mode label indent
Yuan Fu [Sun, 15 Jan 2023 08:21:10 +0000 (00:21 -0800)]
Fix c-ts-mode label indent

Fix indentation of the statement right under a label.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Fix.
(c-ts-mode--top-level-label-matcher): Fix.

2 years agoFix statement indent for c-ts-mode (bug#59686) (bug#60280)
Yuan Fu [Sun, 15 Jan 2023 08:16:58 +0000 (00:16 -0800)]
Fix statement indent for c-ts-mode (bug#59686) (bug#60280)

Instead of trying to figure out the correct anchor, now we just count
the layers of {} blocks between the node and the root node.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Use new offset functions
c-ts-mode--close-bracket-offset and c-ts-mode--statement-offset.
(c-ts-mode--bracket-children-anchor): Remove function.
(c-ts-mode--top-level-label-matcher): New variable.
(c-ts-mode--statement-offset)
(c-ts-mode--close-bracket-offset): New offset functions.

2 years agoAllow offset in tree-sitter indent rules to be functions
Yuan Fu [Sun, 15 Jan 2023 08:15:25 +0000 (00:15 -0800)]
Allow offset in tree-sitter indent rules to be functions

This is needed for fixing C indentation.  See next comment.

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/treesit.el (treesit-simple-indent): Try evaluating OFFSET as a
function if it's not integer nor variable.

2 years ago; Minor change in c-ts-mode--indent-styles
Yuan Fu [Sun, 15 Jan 2023 04:53:10 +0000 (20:53 -0800)]
; Minor change in c-ts-mode--indent-styles

; * lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Move top-level label rule to GNU style.

2 years agoSupport filling line comments in c-ts-mode
Yuan Fu [Sat, 14 Jan 2023 07:31:18 +0000 (23:31 -0800)]
Support filling line comments in c-ts-mode

Now we handle line comments separately because for line comments, each
line is an individual node, unlike block comments, where the whole
block comment is a single node.  fill-comment-paragraph turns out to
do the job perfectly fine.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--fill-paragraph): Extract out most parts into
c-ts-mode--fill-block-comment.
(c-ts-mode--fill-block-comment): New extracted function.

2 years ago; Fix c-ts-mode filling
Yuan Fu [Sat, 14 Jan 2023 07:05:45 +0000 (23:05 -0800)]
; Fix c-ts-mode filling

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--comment-regexp): New variable.
(c-ts-mode--fill-paragraph): Use the new variable, and make sure
start-marker is always initialized.

2 years agoFix expansion of wildcards in ls-lisp.el
Eli Zaretskii [Sun, 15 Jan 2023 08:47:24 +0000 (10:47 +0200)]
Fix expansion of wildcards in ls-lisp.el

* lisp/ls-lisp.el (ls-lisp--dired): Fix error message text.
Handle the case of a wildcard specifying directories.  (Bug#60819)

2 years agoImplement submenus on Android
Po Lu [Sun, 15 Jan 2023 07:45:29 +0000 (15:45 +0800)]
Implement submenus on Android

* java/org/gnu/emacs/EmacsActivity.java (onCreate): Set the
default theme to Theme.DeviceDefault.NoActionBar if possible.
(onContextMenuClosed): Add hack for Android bug.
* java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu)
(onMenuItemClick): Set flag upon submenu selection.
(inflateMenuItems): Set onClickListener for submenus as well.
(display1): Clear new flag.
* java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Fix
rectangle bounds.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative):
* java/org/gnu/emacs/EmacsService.java (onCreate): Pass cache
directory.
(sync): New function.
* src/android.c (struct android_emacs_service): New method
`sync'.
(setEmacsParams, initEmacs): Handle cache directory.
(android_init_emacs_service): Initialize new method `sync'.
(android_sync): New function.
* src/androidfns.c (Fx_show_tip): Call both functions.
* src/androidgui.h: Update prototypes.
* src/androidmenu.c (struct android_menu_subprefix)
(android_free_subprefixes, android_menu_show): Handle submenu
prefixes correctly.
* src/androidterm.c (handle_one_android_event): Clear help echo
on MotionNotify like on X.
* src/menu.c (single_menu_item): Enable submenus on Android.

2 years agoFix messages displayed when diary is shown
Eli Zaretskii [Sun, 15 Jan 2023 06:10:33 +0000 (08:10 +0200)]
Fix messages displayed when diary is shown

* lisp/calendar/diary-lib.el (diary-list-entries): Display the
"...done" message only if there's no important message in the
echo-area.  (Bug#60795)