]> git.eshelyaron.com Git - emacs.git/log
emacs.git
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.

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 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 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 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 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 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)

2 years agohideif.el: Support C99 and GNU style variadic macros
Luke Lee [Sun, 15 Jan 2023 04:26:02 +0000 (12:26 +0800)]
hideif.el: Support C99 and GNU style variadic macros

* lisp/progmodes/hideif.el (hif-end-of-line, hif-cpp-prefix)
(hif-ifx-regexp, hif-macro-expr-prefix-regexp, hif-white-regexp)
(hif-macroref-regexp, hif-tokenize, hif-find-any-ifX)
(hif-find-next-relevant, hif-find-previous-relevant, hif-find-range)
(hif-parse-macro-arglist, hif-add-new-defines, hide-ifdef-guts):
Variadic macro parsing, comments and multi-line parsing.
(hif-line-concat, hif-etc-regexp): New regexp for better macro scans.
(hif-expand-token-list, hif-get-argument-list, hif-delimit)
(hif-macro-supply-arguments, hif-canonicalize, hif-find-define):
Variadic macro argument replacement and expansion.
(hif-display-macro): Display variadic macros.
(hif-is-in-comment, hif-search-ifX-regexp): New functions to better
handle macros in comments and comments in macros.

2 years ago; Auto-commit of loaddefs files.
Stefan Kangas [Sun, 15 Jan 2023 04:09:03 +0000 (05:09 +0100)]
; Auto-commit of loaddefs files.

2 years ago; Auto-commit of loaddefs files.
Stefan Kangas [Sun, 15 Jan 2023 04:08:49 +0000 (05:08 +0100)]
; Auto-commit of loaddefs files.

2 years agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Sun, 15 Jan 2023 03:57:20 +0000 (11:57 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

2 years agoImplement toolkit menus on Android
Po Lu [Sun, 15 Jan 2023 03:57:10 +0000 (11:57 +0800)]
Implement toolkit menus on Android

* java/org/gnu/emacs/EmacsActivity.java (onContextMenuClosed):
New function.
* java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu):
New field `itemAlreadySelected'.
(onMenuItemClick): New function.
(inflateMenuItems): Attach onClickListener as appropriate.
(display1): Clear itemAlreadySelected.
(display): Fix runnable synchronization.
* java/org/gnu/emacs/EmacsNative.java (sendContextMenu): New
function.
* java/org/gnu/emacs/EmacsView.java (popupMenu):
(cancelPopupMenu): Set popupactive correctly.

* src/android.c (android_run_select_thread): Fix android_select
again.
(android_wait_event): New function.
* src/android.h: Update prototypes.
* src/androidgui.h (enum android_event_type): New
`ANDROID_CONTEXT_MENU' event.
(struct android_menu_event, union android_event): Add new event.

* src/androidmenu.c (struct android_emacs_context_menu): New
structure.
(android_init_emacs_context_menu): Add `dismiss' method.
(struct android_dismiss_menu_data): New structure.
(android_dismiss_menu, android_process_events_for_menu): New
functions.
(android_menu_show): Set an actual item ID.
(popup_activated): Define when stubify as well.
(Fmenu_or_popup_active_p): New function.
(syms_of_androidmenu): New function.

* src/androidterm.c (handle_one_android_event): Handle context
menu events.
* src/androidterm.h (struct android_display_info): New field for
menu item ID.
* src/emacs.c (android_emacs_init): Call syms_of_androidmenu.
* src/xdisp.c (note_mouse_highlight): Return if popup_activated
on Android as well.

2 years agoFix the MS-DOS build
Po Lu [Sun, 15 Jan 2023 01:26:18 +0000 (09:26 +0800)]
Fix the MS-DOS build

* msdos/sed1v2.inp: Edit out QCOPY_ACL_LIB.

2 years ago; Fix typos
Stefan Kangas [Sun, 15 Jan 2023 01:10:32 +0000 (02:10 +0100)]
; Fix typos

2 years agoAdd constructor_declaration as java-ts-mode defun
Theodor Thornhill [Sat, 14 Jan 2023 21:39:08 +0000 (22:39 +0100)]
Add constructor_declaration as java-ts-mode defun

* lisp/progmodes/java-ts-mode.el (java-ts-mode): Extend
treesit-defun-type-regexp.

2 years agoUse treesit-sentence-type-regexp in java-ts-mode
Theodor Thornhill [Sat, 14 Jan 2023 21:41:00 +0000 (22:41 +0100)]
Use treesit-sentence-type-regexp in java-ts-mode

Initial support for forward/backward-sentence movement with
tree-sitter.  Include all statements, and some declarations.  Don't
include the bigger declarations we don't want to jump over too big
blocks of code.

* lisp/progmodes/java-ts-mode.el (java-ts-mode): Add relevant node
types to treesit-sentence-type-regexp.

2 years agoFurther improvement for non-string values in pcomplete
Gregory Heytings [Wed, 4 Jan 2023 16:48:03 +0000 (16:48 +0000)]
Further improvement for non-string values in pcomplete

* lisp/pcomplete.el (pcomplete-arg): Use the string representation
of the argument value instead of the text representation of the
argument.  Return the value, even when it is not a string, when
index is 'last'.  Fixes bug#60464.

2 years ago; * etc/NEWS (--with-native-compilation=aot): Tweak wording.
Sean Whitton [Sat, 14 Jan 2023 19:50:54 +0000 (12:50 -0700)]
; * etc/NEWS (--with-native-compilation=aot): Tweak wording.

I've observed people thinking that this is a completely new feature.

2 years agoUse the 'field' property to navigate through Eshell prompts
Jim Porter [Sun, 8 Jan 2023 21:50:50 +0000 (13:50 -0800)]
Use the 'field' property to navigate through Eshell prompts

* lisp/eshell/esh-mode.el (eshell-skip-prompt-function): Make
obsolete.

* lisp/eshell/em-prompt.el (eshell-prompt-regexp): Update docstring.
(eshell-prompt-initialize): Don't set 'eshell-skip-prompt-function'.
(eshell-next-prompt): Search for the 'field' property set to 'prompt'
to find the next prompt.
(eshell-previous-prompt): Move 'forward-line' call into
'eshell-next-prompt'.
(eshell-forward-matching-input, eshell-backward-matching-input):
Reimplement on top of 'eshell-next-prompt'.
(eshell-skip-prompt): Make obsolete.

* test/lisp/eshell/em-prompt-tests.el
(em-prompt-test/next-previous-prompt): New test.

2 years agoMake 'eshell-bol' obsolete
Jim Porter [Sun, 8 Jan 2023 21:05:59 +0000 (13:05 -0800)]
Make 'eshell-bol' obsolete

Now that Eshell uses fields for its output, 'eshell-bol' is no longer
needed, and we can just use 'beginning-of-line'.

* lisp/eshell/esh-mode.el (eshell-bol): Mark obsolete.
(eshell-mode-map): Remove 'C-a' mapping.
(eshell-command-map): Use 'move-beginning-of-line'.
(eshell-move-argument, eshell-kill-input): Use 'beginning-of-line'.
(eshell-get-old-input): Remove unnecessary call to
'eshell-skip-prompt-function'.

* lisp/eshell/em-rebind.el (eshell-rebind-keys-alist): Remove 'C-a'
and '<home>' mappings; the global mapping for these
('move-beginning-of-line') does the same thing now.

* lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments):
* lisp/eshell/em-elecslash.el (eshell-electric-forward-slash):
* lisp/eshell/em-hist.el (eshell-hist-word-reference)
(eshell-previous-matching-input-from-input, eshell-test-imatch):
* lisp/eshell/em-prompt.el (eshell-backward-matching-input):
* lisp/eshell/em-rebind.el (eshell-point-within-input-p):
* test/lisp/eshell/eshell-tests.el (eshell-test/forward-arg): Use
'beginning-of-line'.

* test/lisp/eshell/eshell-tests.el (eshell-test/run-old-command):
Rename to...
(eshell-test/get-old-input): ... this, and expand the test.

2 years agoSet the 'field' property for Eshell output
Jim Porter [Sun, 8 Jan 2023 21:00:47 +0000 (13:00 -0800)]
Set the 'field' property for Eshell output

This makes Eshell work more like 'M-x shell', and lets the <home> key
move to the beginning of the user's input at the prompt (bug#60666).

* lisp/eshell/em-prompt.el (eshell-emit-prompt): Add 'field' property
to prompt.
(eshell-bol-ignoring-prompt): New function.

* lisp/eshell/esh-io.el: Declare 'eshell-interactive-print'...
(eshell-output-object-to-target): ... use it.

* lisp/eshell/esh-mode.el (eshell-output-filter-functions): Update
docstring.
(eshell-interactive-print): Set the output to have a field value of
'command-output'.
(eshell-output-filter): Rename to...
(eshell-interactive-filter): ... this, and take a buffer instead of a
process.

* lisp/eshell/esh-proc.el (eshell-interactive-process-filter): New
function, adapted from 'eshell-output-filter'...
(eshell-gather-process-output): ... use it.

* test/lisp/eshell/em-prompt-tests.el: New file.

* etc/NEWS: Announce this change.

2 years agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 14 Jan 2023 18:56:58 +0000 (13:56 -0500)]
Merge from origin/emacs-29

fd77de542d8 ; * etc/NEWS: Fix typos.
195afb68e31 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
cd83bc930ca ; * lisp/htmlfontify.el (hfy-exclude-file-rules): Fix :ve...
8d7ad656658 Fix indent and font-lock for annotation_type

# Conflicts:
# etc/NEWS

2 years agoFix the case in first-completion revealed by minibuffer-tests
Juri Linkov [Sat, 14 Jan 2023 18:56:33 +0000 (20:56 +0200)]
Fix the case in first-completion revealed by minibuffer-tests

* lisp/simple.el (first-completion): Add the text-property 'first-completion'
when the first completion is at the beginning of the buffer.

* test/lisp/minibuffer-tests.el (completions-header-format-test):
Revert the recent change.

2 years ago; * etc/NEWS: Fix typos.
Michael Albinus [Sat, 14 Jan 2023 18:30:55 +0000 (19:30 +0100)]
; * etc/NEWS: Fix typos.

2 years agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Sat, 14 Jan 2023 16:30:05 +0000 (18:30 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

2 years ago; * lisp/htmlfontify.el (hfy-exclude-file-rules): Fix :version.
Eli Zaretskii [Sat, 14 Jan 2023 16:15:46 +0000 (18:15 +0200)]
; * lisp/htmlfontify.el (hfy-exclude-file-rules): Fix :version.

2 years agoFix android_select
Po Lu [Sat, 14 Jan 2023 14:48:28 +0000 (22:48 +0800)]
Fix android_select

* src/android.c (android_run_select_thread, android_select):
Handle EINTR in sem_wait and fix sigsets.

2 years ago(apropos-documentation): Don't try to parse .elc files
Stefan Monnier [Sat, 14 Jan 2023 14:26:17 +0000 (09:26 -0500)]
(apropos-documentation): Don't try to parse .elc files

The old code scanned for #@ in .elc files, assuming they're
docstrings and then looking around them to try and guess to which
definition that docstring belongs, making many assumptions about how
the code happens to be layed out by bytecomp.
Replace that with code which relies on the (FILE . POS) info to
extract the docstring knowing already where they are and what def they
belong to.

* lisp/apropos.el (apropos-documentation-check-elc-file): Delete function.
(apropos--documentation-add-from-elc): New function to replace it.
(apropos--documentation-add): New function, extracted from
`apropos-documentation`.
(apropos-documentation): Use them.  Let-bind `apropos-accumulator` and
`apropos-files-scanned`.
(apropos-documentation-internal): Don't handle the `cons` case any more.
(apropos-item): Don't declare as global var.
(apropos-documentation-check-doc-file): Use `apropos-item` as a local
var rather than a global var.
(apropos-print-doc): Receive `apropos-item` as arg rather than refer to
it as a global variable.
(apropos-print): Adjust calls accordingly.

2 years agoAdd temporary gnulib patch
Po Lu [Sat, 14 Jan 2023 14:23:08 +0000 (22:23 +0800)]
Add temporary gnulib patch

* xcompile/lib/fpending.c (__fpending): Fix gnulib problem.

2 years agoFix indent and font-lock for annotation_type
Theodor Thornhill [Sat, 14 Jan 2023 14:18:40 +0000 (15:18 +0100)]
Fix indent and font-lock for annotation_type

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Indent
inside body.
(java-ts-mode--font-lock-settings): Add rule for name in
annotation_type_element_declaration.

2 years agoMerge remote-tracking branch 'refs/remotes/origin/master'
Stefan Monnier [Sat, 14 Jan 2023 14:17:30 +0000 (09:17 -0500)]
Merge remote-tracking branch 'refs/remotes/origin/master'

2 years agoMerge from origin/emacs-29
Stefan Monnier [Sat, 14 Jan 2023 14:12:14 +0000 (09:12 -0500)]
Merge from origin/emacs-29

96601cd90ba apropos.el: Fix bug#60628
10032f424cc Fix indentation of some declarations and statements
e2e937300f5 Fix indentation of object_expressions in csharp-ts-mode
0116e27b26c ; Fix NEWS markup
435ba92ccc4 ; Fix last change in htmlfontify.el
7100ecd7a47 Replace 'hfy-find-cmd' with 'directory-files-recursively'.
f102145d381 ; * etc/PROBLEMS: Describe problems with MuPDF 1.21.  (Bu...

2 years agoDrop unneeded changes to gnulib
Po Lu [Sat, 14 Jan 2023 14:14:10 +0000 (22:14 +0800)]
Drop unneeded changes to gnulib

* xcompile/lib/fpending.c (__fpending):
* xcompile/lib/open.c:
* xcompile/lib/unistd.c (_GL_UNISTD_INLINE): Remove Android
patches.

2 years agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Sat, 14 Jan 2023 14:13:26 +0000 (22:13 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

2 years agoUpdate Android port
Po Lu [Sat, 14 Jan 2023 14:12:16 +0000 (22:12 +0800)]
Update Android port

* java/Makefile.in (clean): Fix distclean and bootstrap-clean rules.
* java/debug.sh (jdb_port):
(attach_existing):
(num_pids):
(line): Add new options to upload a gdbserver binary to the device.

* java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): Make
focusedActivities public.
* java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu):
New class.
* java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Fix
bounds computation.
* java/org/gnu/emacs/EmacsGC.java (markDirty): Set stroke width
explicitly.
* java/org/gnu/emacs/EmacsService.java (EmacsService)
(getLocationOnScreen, nameKeysym): New functions.
* java/org/gnu/emacs/EmacsView.java (EmacsView): Disable focus
highlight.
(onCreateContextMenu, popupMenu, cancelPopupMenu): New
functions.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): Implement a
kind of ``override redirect'' window for tooltips.
* src/android.c (struct android_emacs_service): New method
`name_keysym'.
(android_run_select_thread, android_init_events):
(android_select): Release select thread on semaphores instead of
signals to avoid one nasty race on SIGUSR2 delivery.
(android_init_emacs_service): Initialize new method.
(android_create_window): Handle CW_OVERRIDE_REDIRECT.
(android_move_resize_window, android_map_raised)
(android_translate_coordinates, android_get_keysym_name)
(android_build_string, android_exception_check): New functions.
* src/android.h: Update prototypes.

* src/androidfns.c (android_set_parent_frame, Fx_create_frame)
(unwind_create_tip_frame, android_create_tip_frame)
(android_hide_tip, compute_tip_xy, Fx_show_tip, Fx_hide_tip)
(syms_of_androidfns): Implement tooltips and iconification
reporting.

* src/androidgui.h (enum android_window_value_mask): Add
CWOverrideRedirect.
(struct android_set_window_attributes): Add `override_redirect'.
(ANDROID_IS_MODIFIER_KEY): Recognize Caps Lock.

* src/androidmenu.c (struct android_emacs_context_menu): New
struct.
(android_init_emacs_context_menu, android_unwind_local_frame)
(android_push_local_frame, android_menu_show, init_androidmenu):
New functions.

* src/androidterm.c (handle_one_android_event): Fix NULL pointer
dereference.
(android_fullscreen_hook): Handle fullscreen correctly.
(android_draw_box_rect): Fix top line.
(get_keysym_name): Implement function.
(android_create_terminal): Remove scroll bar stubs and add menu
hook.

* src/androidterm.h: Update prototypes.
* src/emacs.c (android_emacs_init): Initialize androidmenu.c.
* xcompile/Makefile.in: Fix clean rules.

2 years ago; Merge from origin/emacs-29
Stefan Monnier [Sat, 14 Jan 2023 14:10:45 +0000 (09:10 -0500)]
; Merge from origin/emacs-29

The following commit was skipped:

79971ebacc7 Disable and document 'doc-view-mupdf-use-svg' (bug#58041)

2 years agoMerge from origin/emacs-29
Stefan Monnier [Sat, 14 Jan 2023 14:10:45 +0000 (09:10 -0500)]
Merge from origin/emacs-29

f1032bf24e7 Eglot: don't use "nil" as minibuffer initial input
1b9ffd28116 Fix dependency bug when building lwlib
dc33a122230 Fix use of build_pure_c_string in treesit.c

2 years ago; Merge from origin/emacs-29
Stefan Monnier [Sat, 14 Jan 2023 14:10:45 +0000 (09:10 -0500)]
; Merge from origin/emacs-29

The following commits were skipped:

59c3c53efa4 * lisp/subr.el (combine-change-calls-1): Fix bug#60467
9f8f8ed1baf Adapt tramp-tests.el  (do not merge with master)

2 years agoMerge from origin/emacs-29
Stefan Monnier [Sat, 14 Jan 2023 14:10:45 +0000 (09:10 -0500)]
Merge from origin/emacs-29

861556c1339 Fix minibuffer-completion tests
c0578edc8fc ; * doc/misc/eglot.texi (Troubleshooting Eglot): Fix typo...
c6bbf9cc270 Add c-ts-mode tests
a760364f5f3 Fix c-ts-mode--fill-paragraph
2a2b1d09ac7 Fix minor issues with 'pp' and related commands
dfb38fb2ee6 ; Improve documentation of tree-sitter node comparison
e8a89a18b69 ; Fix non-tree-sitter builds
f27a330b99e ; Fix typo in ert-with-temp-file
956889d8ff1 Equal now recognizes tree-sitter nodes (bug#60659)
8f446c2d397 Fix c-ts-mode comment indentation (bug#60270)
083badc9c12 * lisp/subr.el (while-let): Use if-let, not if-let* (bug#...
9ecebcdded1 * lisp/simple.el (next-completion): Handle first completi...
cfd2b3504ab Fix encoding with 'utf-8-auto'
53b47df8229 Report cursor correctly on PGTK when there is a margin

# Conflicts:
# etc/NEWS

2 years agoapropos.el: Fix bug#60628
Stefan Monnier [Sat, 14 Jan 2023 14:06:10 +0000 (09:06 -0500)]
apropos.el: Fix bug#60628

* lisp/apropos.el (apropos--map-preloaded-atoms): New function.
(apropos-documentation): Use it.
(apropos-documentation-check-elc-file): Don't presume #@ is preceded by
a newline (since that's not the case any more since commit
900b09c0235d54d5), but be more careful not to burp on false positives.

2 years agoFix indentation of some declarations and statements
Theodor Thornhill [Fri, 13 Jan 2023 10:33:58 +0000 (11:33 +0100)]
Fix indentation of some declarations and statements

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Add new
rules so that we don't anchor at col 0.

2 years agoFix indentation of object_expressions in csharp-ts-mode
Theodor Thornhill [Thu, 12 Jan 2023 08:06:45 +0000 (09:06 +0100)]
Fix indentation of object_expressions in csharp-ts-mode

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules): Make
sure the opening brace is indented at parent-bol, and everything else
is indented.

2 years ago; Fix NEWS markup
Eli Zaretskii [Sat, 14 Jan 2023 09:53:37 +0000 (11:53 +0200)]
; Fix NEWS markup

2 years agoTeach 'eww-open-file' about prefix argument
Eli Zaretskii [Sat, 14 Jan 2023 09:48:55 +0000 (11:48 +0200)]
Teach 'eww-open-file' about prefix argument

* lisp/net/eww.el (eww-open-file): Accept a new optional argument
NEW-BUFFER to show FILE in a new buffer.  (Bug#60809)

* etc/NEWS:
* doc/misc/eww.texi (Basics): Document the new feature.

2 years ago; Fix last change in htmlfontify.el
Eli Zaretskii [Sat, 14 Jan 2023 09:10:53 +0000 (11:10 +0200)]
; Fix last change in htmlfontify.el

2 years agoReplace 'hfy-find-cmd' with 'directory-files-recursively'.
Xi Lu [Sat, 7 Jan 2023 14:46:40 +0000 (22:46 +0800)]
Replace 'hfy-find-cmd' with 'directory-files-recursively'.

This removes a potential vulnerability to maliciously
named files.  (Bug#60562)
* lisp/htmlfontify.el (hfy-exclude-file-rules): New defcustom.
(hfy-list-files): Reimplement using 'directory-files-recursively'.

2 years ago; * etc/PROBLEMS: Describe problems with MuPDF 1.21. (Bug#60308)
Eli Zaretskii [Sat, 14 Jan 2023 08:52:06 +0000 (10:52 +0200)]
; * etc/PROBLEMS: Describe problems with MuPDF 1.21.  (Bug#60308)

2 years ago; * lisp/proced.el (proced--determine-pos): Fix doc string wording.
Eli Zaretskii [Sat, 14 Jan 2023 08:40:15 +0000 (10:40 +0200)]
; * lisp/proced.el (proced--determine-pos): Fix doc string wording.

2 years agoPreserve the window position with proced (bug#60381)
Laurence Warne [Thu, 22 Dec 2022 17:16:08 +0000 (17:16 +0000)]
Preserve the window position with proced (bug#60381)

Preserve the window position for windows which display a proced
buffer, but are not the selected window when a proced buffer is
updated.  Previously, the window position would be set to the
start of the buffer when a proced buffer was updated and it was
not displayed in the selected window.

Similarly, preserve the position in proced buffers which are not
displayed in any window by setting
'switch-to-buffer-preserve-window-point' to nil in proced buffers.

* lisp/proced.el (proced-auto-update-timer): Only update a given
proced buffer if it is displayed in a window.
(proced-update): Set the window position if the proced buffer is
displayed in a window.
(proced--position-info, proced--determine-pos): New Functions.
(proced-mode): Set 'switch-to-buffer-preserve-window-point' to
nil in proced buffers.
* test/lisp/proced-tests.el
(proced-update-preserves-pid-at-point-test): New test.

2 years ago; * lisp/doc-view.el (doc-view-mupdf-use-svg): Bump :version.
Eli Zaretskii [Sat, 14 Jan 2023 08:32:44 +0000 (10:32 +0200)]
; * lisp/doc-view.el (doc-view-mupdf-use-svg): Bump :version.

2 years agoDisable and document 'doc-view-mupdf-use-svg' (bug#58041)
Eli Zaretskii [Sat, 14 Jan 2023 08:26:40 +0000 (10:26 +0200)]
Disable and document 'doc-view-mupdf-use-svg' (bug#58041)

* lisp/doc-view.el (doc-view-mupdf-use-svg): Disable by default.
* etc/NEWS: Document.  Patch by Visuwesh <visuweshm@gmail.com>.
Do not merge to master.

2 years agoEglot: don't use "nil" as minibuffer initial input
Eshel Yaron [Sat, 14 Jan 2023 08:12:11 +0000 (10:12 +0200)]
Eglot: don't use "nil" as minibuffer initial input

Doing M-x eglot in a buffer for which buffer-file-name is nil, prompts
the user for a major mode to manage by invoking completing-read.  The
way completing-read was called would end up with the string "nil" as
the initial minibuffer input, which is not very useful nor is it a
valid input.
* lisp/progmodes/eglot.el (eglot--guess-contact): Tweak prompt for
major mode.  (Bug#60379)

Copyright-paperwork-exempt: yes

2 years agoFix dependency bug when building lwlib
Paul Eggert [Sat, 14 Jan 2023 02:22:47 +0000 (18:22 -0800)]
Fix dependency bug when building lwlib

* lwlib/Makefile.in (DEPFLAGS): Use OBJS to calculate dependency
file names, not ALLOBJS.  This fixes a typo introduced
in 2015-05-15 "Replace AC_SUBST_FILE in configure with include in
Makefiles" that caused lwlib/*.o to not be rebuilt sometimes
when that was needed.

2 years agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Sat, 14 Jan 2023 03:32:47 +0000 (19:32 -0800)]
Update from Gnulib by running admin/merge-gnulib

This adds a new file m4/xattr.m4 from Gnulib,
for NFS v4 attribute copying.
Also, do these changes by hand:
* configure.ac: Mention $LIB_XATTR" in ACL summary.
* src/Makefile.in (QCOPY_ACL_LIB): New macro.
(LIBES): Use it.

2 years agoImprove reliability of Android build system
Po Lu [Sat, 14 Jan 2023 01:34:53 +0000 (09:34 +0800)]
Improve reliability of Android build system

* .gitignore: Add new files.
* INSTALL.android: New file.
* Makefile.in (clean_dirs): Clean xcompile as well.
* admin/merge-gnulib (avoided_flags): Import gnulib into Android
directory as well.
* doc/emacs/android.texi (Android):
* doc/emacs/emacs.texi (Top): New node `Android'.
* java/org/gnu/emacs/EmacsThread.java (run): Use right
executable name.
* lib/Makefile.in (ANDROID_CFLAGS): Use better way to refer to
/src.
(vpath): Delete ugly block of vpath statements.
(mostlyclean): Remove Makefile.android.
* lib/fpending.c (__fpending):
* lib/open.c:
* lib/unistd.c (_GL_UNISTD_INLINE): Revert changes to gnulib in
lib/.
* src/android.h:
* src/androidterm.c: Fix build.
* xcompile/Makefile.in (LIB_SRCDIR):
(LIBSRC_BINARIES, src/verbose.mk):
(PRE_BUILD_DEPS, PHONY): Use gnulib in xcompile/lib/ as opposed
to lib/.
* xcompile/README: Adjust README.

2 years agoFix use of build_pure_c_string in treesit.c
Yuan Fu [Sat, 14 Jan 2023 01:26:08 +0000 (17:26 -0800)]
Fix use of build_pure_c_string in treesit.c

This is brought up in bug#60691.  build_pure_c_string should only be
used in places such as syms_of_treesit, which are called just once,
during dumping.

* src/treesit.c (Vtreesit_str_libtree_sitter):
(Vtreesit_str_tree_sitter):
(Vtreesit_str_dot):
(Vtreesit_str_question_mark):
(Vtreesit_str_star):
(Vtreesit_str_plus):
(Vtreesit_str_pound_equal):
(Vtreesit_str_pound_match):
(Vtreesit_str_pound_pred):
(Vtreesit_str_open_bracket):
(Vtreesit_str_close_bracket):
(Vtreesit_str_open_paren):
(Vtreesit_str_close_paren):
(Vtreesit_str_space):
(Vtreesit_str_equal):
(Vtreesit_str_match):
(Vtreesit_str_pred): New variables.

(treesit_load_language):
(Ftreesit_pattern_expand):
(Ftreesit_query_expand):
(treesit_eval_predicates): Use new varaibles.

(treesit_check_buffer_size):
(treesit_compose_query_signal_data):
(treesit_check_range_argument):
(Ftreesit_parser_set_included_ranges):
(treesit_predicate_capture_name_to_node):
(treesit_predicate_equal):
(treesit_predicate_match):
(treesit_predicate_pred): Use build_string for signal message.

(syms_of_treesit): Initialize new variables.

2 years agoCheck in gnulib with Android patches
Po Lu [Sat, 14 Jan 2023 01:27:33 +0000 (09:27 +0800)]
Check in gnulib with Android patches

* xcompile/lib: Check-in gnulib with patches for Android.

2 years ago* lisp/apropos.el (apropos-safe-documentation): Use `function-documentation`
Stefan Monnier [Fri, 13 Jan 2023 23:00:29 +0000 (18:00 -0500)]
* lisp/apropos.el (apropos-safe-documentation): Use `function-documentation`

2 years ago(function-documentation): Make it work for the remaining cases
Stefan Monnier [Fri, 13 Jan 2023 22:56:04 +0000 (17:56 -0500)]
(function-documentation): Make it work for the remaining cases

* lisp/simple.el (function-documentation):
Use `internal-subr-documentation` and make it work also with symbols
and macros.

* src/doc.c (Fsubr_documentation): New function, extracted
from Fdocumentation.
(syms_of_doc): defsubr it.
(Fdocumentation): Don't handle subrs and module functions here.

2 years ago* lisp/reveal.el (reveal-open-new-overlays): Use `invisible-p`
Stefan Monnier [Fri, 13 Jan 2023 22:52:23 +0000 (17:52 -0500)]
* lisp/reveal.el (reveal-open-new-overlays): Use `invisible-p`

2 years agoundo-tests.el: Tests for bug#60467
Gregory Heytings [Fri, 13 Jan 2023 22:43:31 +0000 (17:43 -0500)]
undo-tests.el: Tests for bug#60467

* test/src/undo-tests.el (undo-test-combine-change-calls-1)
(undo-test-combine-change-calls-2, undo-test-combine-change-calls-3):
New tests.

2 years ago* lisp/subr.el (combine-change-calls-1): Fix bug#60467
Stefan Monnier [Fri, 13 Jan 2023 22:41:37 +0000 (17:41 -0500)]
* lisp/subr.el (combine-change-calls-1): Fix bug#60467

Don't stop at timestamps.
Also Don't burp about breakage just because (cdr old-bul) is nil.

2 years ago* lisp/subr.el (combine-change-calls-1): Fix bug#60467
Stefan Monnier [Fri, 13 Jan 2023 22:38:04 +0000 (17:38 -0500)]
* lisp/subr.el (combine-change-calls-1): Fix bug#60467

Don't stop at timestamps.  Strip them for now, to be on the safe side.
Don't merge into `master` where we'll use a better fix.

2 years agoAdapt tramp-tests.el
Michael Albinus [Fri, 13 Jan 2023 18:41:08 +0000 (19:41 +0100)]
Adapt tramp-tests.el

* test/lisp/net/tramp-tests.el (tramp--test-container-p):
Rename from `tramp--test-docker-p'.  Handle also "podman" method.
Adapt callees.

2 years agoAdapt tramp-tests.el (do not merge with master)
Michael Albinus [Fri, 13 Jan 2023 18:35:52 +0000 (19:35 +0100)]
Adapt tramp-tests.el  (do not merge with master)

* test/lisp/net/tramp-tests.el (tramp--test-container-p):
Rename from `tramp--test-docker-p'.  Handle also "podman" method.
Adapt callees.

2 years agoFix minibuffer-completion tests
Eli Zaretskii [Fri, 13 Jan 2023 13:36:00 +0000 (15:36 +0200)]
Fix minibuffer-completion tests

* test/lisp/minibuffer-tests.el (completions-header-format-test):
Fix the test which first fired, and then drew the target...

2 years ago; * doc/misc/eglot.texi (Troubleshooting Eglot): Fix typo (bug#60780).
Arash Esbati [Fri, 13 Jan 2023 13:24:25 +0000 (15:24 +0200)]
; * doc/misc/eglot.texi (Troubleshooting Eglot): Fix typo (bug#60780).

2 years agoAdd c-ts-mode tests
Daniel Martín [Sun, 8 Jan 2023 13:04:24 +0000 (14:04 +0100)]
Add c-ts-mode tests

* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New .erts file
to test indentation of typical C constructs and prevent regression of
bug fixes.
* test/lisp/progmodes/c-ts-mode-tests.el: New file with c-ts-mode
tests.

2 years agoFix c-ts-mode--fill-paragraph
Yuan Fu [Fri, 13 Jan 2023 01:29:14 +0000 (17:29 -0800)]
Fix c-ts-mode--fill-paragraph

Example:

       doc: /* Return non-nil if NODE1 and NODE2 are the same node.
If any one of NODE1 and NODE2 is nil, return nil.
This function uses the same equivalence metric as `equal'.  */

* lisp/progmodes/c-ts-mode.el (c-ts-mode--fill-paragraph): Fix the
case where there are words before the /*, like the example above.

2 years agoFix minor issues with 'pp' and related commands
Eli Zaretskii [Fri, 13 Jan 2023 08:39:58 +0000 (10:39 +0200)]
Fix minor issues with 'pp' and related commands

* etc/NEWS:
* lisp/emacs-lisp/pp.el (pp-use-max-width, pp-emacs-lisp-code):
Mention in doc string that formatting via 'pp-emacs-lisp-code'
could be slow.
(pp-eval-expression, pp-macroexpand-expression): Honor
'pp-use-max-width'.  (Bug#58687)

2 years agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Fri, 13 Jan 2023 08:08:29 +0000 (16:08 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

2 years agoFix crashes in Android port
Po Lu [Fri, 13 Jan 2023 08:08:11 +0000 (16:08 +0800)]
Fix crashes in Android port

* java/org/gnu/emacs/EmacsService.java (queryTree): Fix NULL
pointer dereference.
* src/android.c (android_query_tree): Set *nchildren_return.

2 years ago* .gitignore: Add AndroidManifest.xml.
Po Lu [Fri, 13 Jan 2023 08:05:55 +0000 (16:05 +0800)]
* .gitignore: Add AndroidManifest.xml.

2 years ago* java/AndroidManifest.xml: Remove file that is now generated.
Po Lu [Fri, 13 Jan 2023 08:05:08 +0000 (16:05 +0800)]
* java/AndroidManifest.xml: Remove file that is now generated.

2 years ago* src/frame.c (make_monitor_attribute_list): Allow source to be NULL.
Po Lu [Fri, 13 Jan 2023 07:53:22 +0000 (15:53 +0800)]
* src/frame.c (make_monitor_attribute_list): Allow source to be NULL.

2 years agoUpdate Android port
Po Lu [Fri, 13 Jan 2023 07:53:08 +0000 (15:53 +0800)]
Update Android port

* configure.ac (ANDROID_MIN_SDK): New variable.
(DX): Remove and replace with D8.
(XCONFIGURE): Check for the minimum version of Android the cross
compiler compiles for.  Generate java/AndroidManifest.xml from
java/AndroidManifest.xml.in.  Allow using Zlib on Android.

* java/AndroidManifest.xml.in: New file.  Use the minimum SDK
detected by configure.

* java/Makefile.in (top_srcdir, version): New variables.
(DX, D8): Replace with D8.
(ANDROID_MIN_SDK, APK_NAME): New variables.
(.PHONY):
(.PRECIOUS):
(classes.dex):
(emacs.apk): Generate $(APK_NAME) instead of `emacs.apk'.

* java/debug.sh: New option --attach-existing.  Attach to an
existing Emacs instance when specified.

* java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): New
field `isPaused'.
(invalidateFocus1): Fix infinite recursion.
(detachWindow): Deiconify window.
(attachWindow): Iconify the window if the activity is paused.
(onCreate): Use the ``no title bar'' theme.
(onPause, onResume): New functions.
* java/org/gnu/emacs/EmacsNative.java (sendTouchUp, sendTouchDown)
(sendTouchMove, sendWheel, sendIconified, sendDeiconified): New
functions.
* java/org/gnu/emacs/EmacsSdk7FontDriver.java (Sdk7Typeface):
(list): Remove logging for code that is mostly going to be unused.
* java/org/gnu/emacs/EmacsService.java (ringBell, queryTree)
(getScreenWidth, getScreenHeight, detectMouse): New functions.
* java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView)
(surfaceChanged, surfaceCreated, surfaceDestroyed): Add extra
debug logging.  Avoid deadlock in surfaceCreated.

* java/org/gnu/emacs/EmacsView.java (EmacsView): Try very hard
to make the SurfaceView respect Z order.  It didn't work.
(handleDirtyBitmap): Copy over the contents from the old bitmap.
(explicitlyDirtyBitmap): New function.
(onLayout): Don't dirty bitmap if unnecessary.
(damageRect, swapBuffers): Don't synchronize so hard.
(onTouchEvent): Call window.onTouchEvent instead.
(moveChildToBack, raise, lower): New functions.

* java/org/gnu/emacs/EmacsWindow.java (Coordinate): New
subclass.
(pointerMap, isMapped, isIconified, dontFocusOnMap)
(dontAcceptFocus): New fields.
(EmacsWindow): Don't immediately register unmapped window.
(viewLayout): Send configure event outside the lock.
(requestViewLayout): Explicitly dirty the bitmap.
(mapWindow): Register the window now.  Respect dontFocusOnMap.
(unmapWindow): Unregister the window now.
(figureChange, onTouchEvent): New functions.
(onSomeKindOfMotionEvent): Handle scroll wheel events.
(reparentTo, makeInputFocus, raise, lower, getWindowGeometry)
(noticeIconified, noticeDeiconified, setDontAcceptFocus)
(setDontFocusOnMap, getDontFocusOnMap): New functions.
* java/org/gnu/emacs/EmacsWindowAttachmentManager.java
(registerWindow, detachWindow): Synchronize.
(noticeIconified, noticeDeiconified): New functions.
(copyWindows): New function.

* lisp/frame.el (frame-geometry, frame-edges)
(mouse-absolute-pixel-position, set-mouse-absolute-pixel-position)
(frame-list-z-order, frame-restack, display-mouse-p)
(display-monitor-attributes-list): Implement on Android.

* lisp/mwheel.el (mouse-wheel-down-event):
(mouse-wheel-up-event):
(mouse-wheel-left-event):
(mouse-wheel-right-event): Define on Android.

* src/android.c (struct android_emacs_service): New methods
`ringBell', `queryTree', `getScreenWidth', `getScreenHeight',
and `detectMouse'.
(struct android_event_queue, android_init_events)
(android_next_event, android_write_event): Remove write limit.
(android_file_access_p): Handle directories correcty.
(android_close): Fix coding style.
(android_fclose): New function.
(android_init_emacs_service): Initialize new methods.
(android_reparent_window): Implement function.
(android_bell, android_set_input_focus, android_raise_window)
(android_lower_window, android_query_tree, android_get_geometry)
(android_get_screen_width, android_get_screen_height)
(android_get_mm_width, android_get_mm_height, android_detect_mouse)
(android_set_dont_focus_on_map, android_set_dont_accept_focus):
New functions.
(struct android_dir): New structure.
(android_opendir, android_readdir, android_closedir): New
functions.
(emacs_abort): Implement here on Android and poke debuggerd into
generating a tombstone.

* src/android.h: Update prototypes.

* src/androidfns.c (android_set_parent_frame): New function.
(android_default_font_parameter): Use sane font size by default.
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_mm_width, Fx_display_mm_height)
(Fx_display_monitor_attributes_list): Rename to start with
`android-'.  Implement.  Fiddle with documentation to introduce
Android specific nuances.
(Fandroid_display_monitor_attributes_list): New function.
(Fx_frame_geometry, frame_geometry): New function.
(Fandroid_frame_geometry): Implement correctly.
(Fx_frame_list_z_order): Rename to start with `android-'.
(android_frame_list_z_order, Fandroid_frame_list_z_order):
Implement.
(Fx_frame_restack): Rename to start with `android-'.
(Fandroid_frame_restack): ``Implement''.
(Fx_mouse_absolute_pixel_position): Rename to start with
`android-'.
(Fandroid_mouse_absolute_pixel_position): ``Implement''.
(Fx_set_mouse_absolute_pixel_position): Rename to start with
`android-'.
(Fandroid_set_mouse_absolute_pixel_position): ``Implement''.
(Fandroid_detect_mouse): New function.
(android_set_menu_bar_lines): Use FRAME_ANDROID_DRAWABLE when
clearing area.
(android_set_no_focus_on_map, android_set_no_accept_focus): New
functions.
(android_frame_parm_handlers): Register new frame parameter
handlers.
(syms_of_androidfns): Update appropriately.

* src/androidfont.c (androidfont_draw): Use
FRAME_ANDROID_DRAWABLE instead of FRAME_ANDROID_WINDOW.

* src/androidgui.h (enum android_event_type): New events.
(struct android_touch_event, struct android_wheel_event)
(struct android_iconify_event): New structures.
(union android_event): Add new events.

* src/androidterm.c (android_clear_frame): Use
FRAME_ANDROID_DRAWABLE instead of FRAME_ANDROID_WINDOW.
(android_flash, android_ring_bell): Implement bell ringing.
(android_toggle_invisible_pointer): Don't TODO function that
can't be implemented.
(show_back_buffer, android_flush_dirty_back_buffer_on): Check if
a buffer flip is required before doing the flip.
(android_lower_frame, android_raise_frame): Implement functions.
(android_update_tools, android_find_tool): New functions.
(handle_one_android_event): Handle new iconification, wheel and
touch events.
(android_read_socket): Implement pending-autoraise-frames.
(android_frame_up_to_date): Implement bell ringing.
(android_buffer_flipping_unblocked_hook): Check if a buffer flip
is required before doing the flip.
(android_focus_frame, android_frame_highlight)
(android_frame_unhighlight): New function.
(android_frame_rehighlight): Implement functions.
(android_iconify_frame): Always display error.
(android_set_alpha): Update commentary.
(android_free_frame_resources): Free frame touch points.
(android_scroll_run, android_flip_and_flush)
(android_clear_rectangle, android_draw_fringe_bitmap)
(android_draw_glyph_string_background, android_fill_triangle)
(android_clear_point, android_draw_relief_rect)
(android_draw_box_rect, android_draw_glyph_string_bg_rect)
(android_draw_image_foreground, android_draw_stretch_glyph_string)
(android_draw_underwave, android_draw_glyph_string_foreground)
(android_draw_composite_glyph_string_foreground)
(android_draw_glyphless_glyph_string_foreground)
(android_draw_glyph_string, android_clear_frame_area)
(android_clear_under_internal_border, android_draw_hollow_cursor)
(android_draw_bar_cursor, android_draw_vertical_window_border)
(android_draw_window_divider): Use FRAME_ANDROID_DRAWABLE
instead of FRAME_ANDROID_WINDOW for drawing operations.

* src/androidterm.h (struct android_touch_point): New structure.
(struct android_output): New fields.
(FRAME_ANDROID_NEED_BUFFER_FLIP): New macro.

* src/dired.c (emacs_readdir, open_directory)
(directory_files_internal_unwind, read_dirent)
(directory_files_internal, file_name_completion): Add
indirection over readdir and opendir.  Use android variants on
Android.

* src/dispnew.c (Fopen_termscript):
* src/fileio.c (fclose_unwind): Use emacs_fclose.
(Faccess_file): Call android_file_access_p.
(file_accessible_directory_p): Append right suffix to Android
assets directory.
(do_auto_save_unwind): Use emacs_fclose.
* src/keyboard.c (lispy_function_keys): Use right function key
for page up and page down.
(Fopen_dribble_file): Use emacs_fclose.

* src/lisp.h: New prototype emacs_fclose.

* src/lread.c (close_infile_unwind): Use emacs_fclose.

* src/sfnt.c (sfnt_curve_is_flat): Fix area-squared computation.
(sfnt_prepare_raster): Compute raster width and height
consistently with outline building.
(sfnt_build_outline_edges): Use the same offsets used to set
offy and offx.
(main): Adjust debug code.

* src/sfntfont-android.c (sfntfont_android_saturate32): Delete
function.
(sfntfont_android_blend, sfntfont_android_blendrgb): Remove
unnecessary debug code.
(sfntfont_android_composite_bitmap): Prevent out of bounds
write.
(sfntfont_android_put_glyphs): Use FRAME_ANDROID_DRAWABLE.
(init_sfntfont_android): Initialize Monospace Serif font to
something sensible.
* src/sfntfont.c (sfntfont_text_extents): Clear glyph metrics
before summing up pcm.
(sfntfont_draw): Use s->font instead of s->face->font.

* src/sysdep.c (emacs_fclose): Wrap around android_fclose on
android.

* src/term.c (Fsuspend_tty):
(delete_tty): Use emacs_fclose.
* src/verbose.mk.in (AM_V_DX): Replace with D8 version.

2 years ago; Improve documentation of tree-sitter node comparison
Eli Zaretskii [Fri, 13 Jan 2023 07:13:24 +0000 (09:13 +0200)]
; Improve documentation of tree-sitter node comparison

* doc/lispref/parsing.texi (Accessing Node Information):
* src/treesit.c (Ftreesit_node_eq): Improve documentation of node
comparison.

2 years ago; Fix non-tree-sitter builds
Eli Zaretskii [Fri, 13 Jan 2023 06:58:03 +0000 (08:58 +0200)]
; Fix non-tree-sitter builds

* src/fns.c (internal_equal): Call treesit_node_eq only if
tree-sitter was compiled in.