]> git.eshelyaron.com Git - emacs.git/log
emacs.git
23 months agoAllow other text editors to edit files in Emacs' home directory
Po Lu [Thu, 9 Feb 2023 14:56:41 +0000 (22:56 +0800)]
Allow other text editors to edit files in Emacs' home directory

* java/AndroidManifest.xml.in: Declare the new documents
provider.
* java/README: Describe the meaning of files in res/values.
* java/org/gnu/emacs/EmacsDocumentsProvider.java
(EmacsDocumentsProvider): New file.
* java/res/values-v19/bool.xml:
* java/res/values/bool.xml: New files.

23 months ago; * src/sfnt.c (main): Update tests.
Po Lu [Thu, 9 Feb 2023 12:32:58 +0000 (20:32 +0800)]
; * src/sfnt.c (main): Update tests.

23 months agoImplement instructing compound glyphs
Po Lu [Thu, 9 Feb 2023 12:13:42 +0000 (20:13 +0800)]
Implement instructing compound glyphs

* src/sfnt.c (sfnt_read_simple_glyph, sfnt_read_compound_glyph)
(sfnt_read_glyph): Take size_t offsets.
(struct sfnt_compound_glyph_context)
(sfnt_expand_compound_glyph_context)
(sfnt_decompose_compound_glyph): Take size_t contour offsets.
(sfnt_decompose_glyph): Always close contour even if the first
point isn't on-curve.
(sfnt_build_outline_edges): Fix coding style.
(sfnt_interpret_iup): Skip phantom points during IUP.
(sfnt_decompose_instructed_outline): Clarify documentation.
Always close contour even if the first point isn't on-curve.
(struct sfnt_test_dcontext, sfnt_test_move_to, sfnt_test_line_to)
(sfnt_test_curve_to, sfnt_transform_f26dot6, sfnt_test_get_glyph)
(sfnt_test_free_glyph, sfnt_test_span, sfnt_test_edge_ignore)
(sfnt_interpret_compound_glyph_2, sfnt_test_edges, main): Update
tests.

* src/sfnt.h: Export new function.

* src/sfntfont.c (sfntfont_get_glyph_outline): Handle compound
glyphs.
(sfntfont_measure_instructed_pcm, sfntfont_measure_pcm)
(sfntfont_draw): Update accordingly.

23 months agoUpdate Android port
Po Lu [Wed, 8 Feb 2023 15:39:46 +0000 (23:39 +0800)]
Update Android port

* src/sfnt.c (SCFS): Fix order of arguments.
(sfnt_normalize_vector): Make sure vx and vy are within a
reasonable range.
(sfnt_move): Don't move when vectors are orthogonal.
(main): Update.

23 months agoUpdate Android port
Po Lu [Wed, 8 Feb 2023 14:51:43 +0000 (22:51 +0800)]
Update Android port

* doc/emacs/android.texi (Android Startup): Fix typos.
* src/sfnt.c (sfnt_interpret_msirp): Fix order in which operands
to MSIRP are popped.
(main): Reduce ppem values.

23 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Wed, 8 Feb 2023 14:41:46 +0000 (22:41 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

23 months agoUpdate Android port
Po Lu [Wed, 8 Feb 2023 14:40:10 +0000 (22:40 +0800)]
Update Android port

* doc/lispref/frames.texi (On-Screen Keyboards): Describe return
value of `frame-toggle-on-screen-keyboard'.
* java/org/gnu/emacs/EmacsSurfaceView.java (surfaceChanged)
(surfaceCreated, EmacsSurfaceView): Remove unuseful
synchronization code.  The framework doesn't seem to look at
this at all.

* java/org/gnu/emacs/EmacsView.java (EmacsView):
(onLayout): Lay out the window after children.
(swapBuffers): Properly implement `force'.
(windowUpdated): Delete function.

* lisp/frame.el (frame-toggle-on-screen-keyboard): Return
whether or not the on screen keyboard might've been displayed.

* lisp/minibuffer.el (minibuffer-on-screen-keyboard-timer):
(minibuffer-on-screen-keyboard-displayed):
(minibuffer-setup-on-screen-keyboard):
(minibuffer-exit-on-screen-keyboard): Improve OSK dismissal when
there are consecutive minibuffers.

* lisp/touch-screen.el (touch-screen-window-selection-changed):
New function.
(touch-screen-handle-point-up): Register it as a window
selection changed function.

* src/android.c (struct android_emacs_window)
(android_init_emacs_window): Remove references to
`windowUpdated'.
(android_window_updated): Delete function.
* src/android.h (struct android_output): Remove
`last_configure_serial'.
* src/androidterm.c (handle_one_android_event)
(android_frame_up_to_date):
* src/androidterm.h (struct android_output): Remove frame
synchronization, as that does not work on Android.

23 months agoFlatten nested `concat` calls
Mattias Engdegård [Wed, 8 Feb 2023 12:45:57 +0000 (13:45 +0100)]
Flatten nested `concat` calls

* lisp/emacs-lisp/byte-opt.el (byte-optimize-concat):
Flatten nested forms; concat is associative.  This reduces the number
of calls and may coalesce adjacent constant strings.

23 months agoSimplify and speed up parts of elisp optimiser
Mattias Engdegård [Wed, 8 Feb 2023 12:18:32 +0000 (13:18 +0100)]
Simplify and speed up parts of elisp optimiser

* lisp/emacs-lisp/byte-opt.el (byte-optimize-constant-args): Simplify.
(byte-optimize--constant-symbol-p): Speed up.
(byteopt--eval-const): New.
(byte-optimize-member, byte-optimize-concat, byte-optimize-append):
Use byteopt--eval-const instead of eval which is much slower.

23 months agoFix graphics state when instructing glyphs
Po Lu [Wed, 8 Feb 2023 12:03:19 +0000 (20:03 +0800)]
Fix graphics state when instructing glyphs

* src/sfntfont.c (sfntfont_get_glyph_outline): Take new argument
STATE and restore it prior to instructing the glyph.
(sfntfont_measure_instructed_pcm, sfntfont_measure_pcm)
(sfntfont_draw): Adjust accordingly.

23 months agoCorrectly round bearing values while computing pcm
Po Lu [Wed, 8 Feb 2023 09:04:42 +0000 (17:04 +0800)]
Correctly round bearing values while computing pcm

* src/sfntfont.c (sfntfont_measure_instructed_pcm)
(sfntfont_measure_pcm): Ceil rbearing value.

23 months agoImprove text display on Android port
Po Lu [Wed, 8 Feb 2023 08:34:29 +0000 (16:34 +0800)]
Improve text display on Android port

* src/sfnt.c (sfnt_build_glyph_outline): Clear
build_outline_context.
(sfnt_poly_coverage): Extend coverage map.
(sfnt_prepare_raster): Always floor coordinates, since the
increase in coverage makes this hack unnecessary.
(sfnt_build_outline_edges): Likewise.
(sfnt_compare_edges): Remove function.
(sfnt_edge_sort): New function.  Since edges are already
partially sorted, and there are not many, insertion sort
suffices.
(sfnt_poly_edges): Use sfnt_edge_sort.
(sfnt_fill_span): Stop rounding x0 and x1 to the grid, and make
coverage computation static.
(sfnt_lookup_glyph_metrics): Fix return code for unscaled
metrics.
(sfnt_scale_metrics): New function.
(SFNT_ENABLE_HINTING): Remove define.
(struct sfnt_cvt_table, struct sfnt_fpgm_table)
(struct sfnt_prep_table): Move to sfnt.h.
(sfnt_read_cvt_table):
(sfnt_read_fpgm_table, sfnt_read_prep_table): Make TEST_STATIC.
(struct sfnt_unit_vector, struct sfnt_interpreter_definition)
(struct sfnt_interpreter_zone, struct sfnt_graphics_state):
(struct sfnt_interpreter): Move to sfnt.h.
(sfnt_make_interpreter): Make TEST_STATIC.
(POP, PUSH, DELTAP1, DELTAP2, DELTAP3): When TEST, define to
regular push and pop.
(sfnt_deltac):
(sfnt_deltap): Fix order of arguments.
(IUP_SINGLE_PAIR): Fix interpolation loop wraparound.
(sfnt_interpret_font_program):
(sfnt_interpret_control_value_program): Make TEST_STATIC.
(struct sfnt_instructed_outline): Move to sfnt.h.
(sfnt_build_instructed_outline): Make TEST_STATIC.
(sfnt_interpret_simple_glyph):
(sfnt_x_raster):
(sfnt_test_raster):
(all_tests):
(sfnt_verbose):
(main): Improve test code.

* src/sfnt.h (SFNT_ENABLE_HINTING, struct sfnt_cvt_table)
(struct sfnt_fpgm_table, struct sfnt_prep_table)
(struct sfnt_unit_vector, struct sfnt_interpreter_definition)
(struct sfnt_interpreter_zone, struct sfnt_graphics_state)
(struct sfnt_interpreter, struct sfnt_instructed_outline)
(PROTOTYPE): New definitions.
* src/sfntfont-android.c (sfntfont_android_put_glyphs): Make
coordinate generation more straightforward.
* src/sfntfont.c (sfntfont_get_glyph_outline): New arguments
INTERPRETER and METRICS.
(struct sfnt_font_info): New tables.
(sfntfont_setup_interpreter): New function.
(sfntfont_open): Avoid memory leak.  Set up interpreter.
(sfntfont_measure_instructed_pcm): New function.
(sfntfont_measure_pcm): Delegate to measure_instructed_pcm where
appropriate.
(sfntfont_close): Free new tables.
(sfntfont_draw): Scale metrics properly.

23 months ago* lisp/progmodes/xref.el (xref--insert-xrefs): Remove extra space (bug#61340).
Juri Linkov [Wed, 8 Feb 2023 07:34:49 +0000 (09:34 +0200)]
* lisp/progmodes/xref.el (xref--insert-xrefs): Remove extra space (bug#61340).

23 months agoMerge from origin/emacs-29
Stefan Kangas [Wed, 8 Feb 2023 05:30:15 +0000 (06:30 +0100)]
Merge from origin/emacs-29

c9ba05af8df Fix crashes inside 'xfree' called from treesit.c
746748f5c28 Make java-ts-mode use the c-ts-common-indent-type-regexp-...
87d39a30b12 Fix c-ts-mode indentation
7cb92b53987 Fix c-ts-mode indentation
d68ff6016d0 Fix c-ts-mode indentation (bug#61291)
2ac8c4bbd6f (eglot-completion-at-point): Return correct values in :co...
321cbd9a601 Tighten and simplify typescript compilation-mode regexps ...
97533e73ad6 ; * lisp/progmodes/c-ts-common.el (treesit-node-prev-sibl...
9dfccb89fc5 Clarify bug-reference-auto-setup-functions docstring.
17ab426670a * lisp/treesit.el (treesit): Fix shortdoc example form (b...
5a6dfab1e4d Use c-ts-common-statement-offset in java-ts-mode (bug#61142)
c3262216abb Add array_initializer to java-ts-mode
79ab62e0bb5 go-ts-mode: Highlight variable declarations
1fab91d852e go-ts-mode: Fix highlighting of function name in call_exp...
07ffe902c63 c-ts-mode: Highlight "property functions" as functions
a529b0d6463 rust-ts-mode: Fix highlighting of function name in call_e...
088425538f2 rust-ts-mode--font-lock-settings: Improve consistency
793c24a6ac7 Make sure 'M-x show-paren-local-mode' turns on right away
60089dcfe06 Add to bug-reference-auto-setup-functions after its decla...
26e947ccb14 * lisp/vc/vc.el (vc-find-revision-no-save): Fix parens (b...
948e343496b ; Fix byte-compilation warning
6568a1aaf9a Fix inability to turn show-paren-local-mode on manually (...
24085ba6105 ; go-ts-mode--indent-rules: Indent to 0 at top level
0862a79fef5 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
bb999df5d6f ; Fix whitespace of last change
929daafa1d6 ; Fix trivial mistake in emoji--choose-emoji
d7b4a8487f6 ; * lisp/isearch.el (emoji--read-emoji): Avoid compilatio...
e38ff004631 rust-ts-mode: Highlight variable declarations
d12727057d4 rust-ts-mode--indent-rules: Indent to 0 at top level
85705a7059f ; Move misplaces parenthesis in emoji--choose-emoji
18c43bb9d6c Ensure upper bound of font-lock region is less than point...
94f291d1505 ; * lisp/paren.el (show-paren-predicate): Doc fix.  (Bug#...
3ffd0eddce6 Highlight more complex function parameters
58dc03ba7e4 No longer use transient in isearch-emoji-by-name
0c125fcc67a Make highlighting more regular across TS modes (bug#61205)
1dd751c3ac4 ; Improve documentation of 'proper-list-p'
96181ed3f09 Document 'plistp'
03d9d18513b Fix display of raised/lowered composed text
f13479d9556 Fix installation of tree-sitter grammar on MS-Windows
0358267204d Update the Emacs FAQ for Emacs 29
2c33e2889b4 Fix byte-compilation of *-ts-mode.el files
b40a929a3f2 ; ruby-ts--syntax-propertize: Amend commentary
b80f36b88c7 Make c-ts-mode-set-style's effect local (bug#61245)
671e5d9fad5 ; * lisp/treesit.el (treesit--font-lock-level-setter): Mi...
69380a88e92 c-ts-mode: Highlight name in parameter declarations
89b550eac29 Fix switch statement indentation for go-ts-mode (bug#61238)
1a123feb181 Fix bidi reordering of sequence of whitespace characters ...
8870b54db99 Add tests for compilation support for TypeScript (bug#61104)
873a0a15085 Add support for TypeScript compilation to compile.el (bug...
3a64f81ebc1 Don't clobber match data in 'y-or-n-p'
4c765d93ab3 Refine the previous change
d99b5151f8c Add syntax-propertize-function to ruby-ts-mode
f25c15ceb7d ; Fix typos
35e238cae8b Improve documentation of 'header-line-indent-mode'
c3f58a66514 Don't casemap erc-sasl-user when set to :nick
e444115d026 Improve keymap-global-set and keymap-local-set interactiv...

# Conflicts:
# etc/NEWS

23 months ago* lisp/edmacro.el (edit-kbd-macro): Fix thinko (bug#61333)
Stefan Monnier [Tue, 7 Feb 2023 23:10:33 +0000 (18:10 -0500)]
* lisp/edmacro.el (edit-kbd-macro): Fix thinko (bug#61333)

23 months ago(cconv-convert): Fix regression
Stefan Monnier [Tue, 7 Feb 2023 23:03:22 +0000 (18:03 -0500)]
(cconv-convert): Fix regression

* lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form):
Since we can't always remove the wrapper, make sure the wrapper
accepts the expected calling convention (i.e. called with no args).

23 months agoFix crashes inside 'xfree' called from treesit.c
Eli Zaretskii [Tue, 7 Feb 2023 19:53:05 +0000 (21:53 +0200)]
Fix crashes inside 'xfree' called from treesit.c

* src/treesit.c (treesit_load_language): Always xstrdup 'c_name',
to avoid crashes inside xfree.  (Bug#61351)

23 months agoRemove unnecessary cons in lexical eval
Mattias Engdegård [Tue, 7 Feb 2023 12:16:40 +0000 (13:16 +0100)]
Remove unnecessary cons in lexical eval

* src/eval.c (list_of_t): New.
(Feval): Use list_of_t instead of consing every time.
(syms_of_eval): Set list_of_t to (t) and staticpro it.

23 months agoFix last Tramp commit
Michael Albinus [Tue, 7 Feb 2023 18:28:15 +0000 (19:28 +0100)]
Fix last Tramp commit

* lisp/net/tramp.el (tramp-completion-file-name-handler): Run only
when `minibuffer-completing-file-name' is non-nil.

* test/lisp/net/tramp-tests.el (tramp-test26-file-name-completion):
Fix test.

23 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Tue, 7 Feb 2023 15:06:46 +0000 (23:06 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

23 months agoRemove junk from instruction table
Po Lu [Tue, 7 Feb 2023 15:03:46 +0000 (23:03 +0800)]
Remove junk from instruction table

* src/sfnt.c (sfnt_name_instruction): Do so.

23 months agoRemove bresenham stuff
Po Lu [Tue, 7 Feb 2023 15:03:08 +0000 (23:03 +0800)]
Remove bresenham stuff

* src/sfnt.c (sfnt_step_edge, sfnt_step_edge_n)
(sfnt_build_outline_edges, sfnt_test_edge, main):
* src/sfnt.h (struct sfnt_edge): Stop using error corrected line
drawing, as it's actually slower.

23 months agoUpdate Android port
Po Lu [Tue, 7 Feb 2023 14:25:54 +0000 (22:25 +0800)]
Update Android port

* INSTALL.android: Describe patches for BoringSSL on ARM.

* src/sfnt.c (sfnt_build_glyph_outline): Remove redundant
multiplication.
(sfnt_prepare_raster): Update offset calculation for changes.
(sfnt_step_edge, sfnt_step_edge_n): Handle bresenham terms.
(sfnt_build_outline_edges): Don't subtract floored xmin, just
xmin.
(sfnt_saturate_short): Make clang generate better code.
(sfnt_fill_span): Stop rounding coordinates.
(sfnt_poly_span): Poly consecutive on transitions all in one go.
(sfnt_lookup_glyph_metrics): Remove redundant multiplication.
(struct sfnt_interpreter): New hooks for debugging.
(sfnt_large_integer_add): New function.
(sfnt_mul_f26dot6_fixed): Round product.
(sfnt_make_interpreter): Remove redundant multiplication.

(CHECK_STACK_ELEMENTS, POP_UNCHECKED, PUSH_UNCHECKED): New
macros.
(MOVE, POP, SWAP, CINDEX, RS, RCVT, LT, LTEQ, GT, GTEQ, EQ, NEQ)
(EVEN, AND, OR, NOT, ADD, SUB, DIV, MUL, ABS, NEG, FLOOR, CEILING)
(GETINFO, ROLL, _MAX, _MIN, ROUND, NROUND, GC, MD): Don't check
SP redundantly, especially when pushing an element right after
popping one.
(sfnt_move_glyph_zone): Don't touch points by passing NULL as
flags.
(sfnt_direct_move_zp2): Touch P in the directions of the
movement.
(sfnt_interpret_scfs): Fix coding style.
(sfnt_interpret_simple_glyph): Don't round Y coordinates.
(sfnt_test_span, sfnt_test_edges, sfnt_debug_edges, sfnt_test_edge)
(sfnt_x_raster, sfnt_test_raster, rcvt_test_args)
(deltac1_test_args, deltac2_test_args, deltac3_test_args)
(roll_1_test_args, sfnt_run_hook, sfnt_identify_instruction)
(sfnt_verbose, main): Improve debug code and tests.

* src/sfnt.h (struct sfnt_edge): Add bresenham terms.

23 months agoMake java-ts-mode use the c-ts-common-indent-type-regexp-alist
Yuan Fu [Tue, 7 Feb 2023 02:48:04 +0000 (18:48 -0800)]
Make java-ts-mode use the c-ts-common-indent-type-regexp-alist

* lisp/progmodes/java-ts-mode.el:
(java-ts-mode): Setup c-ts-common-indent-type-regexp-alist.

23 months agoFix c-ts-mode indentation
Yuan Fu [Mon, 6 Feb 2023 03:32:24 +0000 (19:32 -0800)]
Fix c-ts-mode indentation

Sign, ok, there's another edge case: else if statements.  Because
"else if" is usually implemented as just another if statement nested
in the else branch, this creates additional levels that indentation
needs to ignore.

I converted c-ts-common-indent-block-type-regexp +
c-ts-common-indent-bracketless-type-regexp into a new, more flexible
variable, c-ts-common-indent-type-regexp-alist, to avoid adding yet
more variables in order to recognize else and if statements.

* lisp/progmodes/c-ts-common.el:
(c-ts-common-indent-type-regexp-alist): New variable.
(c-ts-common-indent-block-type-regexp)
(c-ts-common-indent-bracketless-type-regexp): Remove variables.
(c-ts-common--node-is): New function.
(c-ts-common-statement-offset): Use the new variable, and add the
"else if" special case.  Also merge the code of
c-ts-mode--fix-bracketless-indent, because now the code is much more
succinct.
(c-ts-mode--fix-bracketless-indent): Merge into
c-ts-common-statement-offset.

* lisp/progmodes/c-ts-mode.el:
(c-ts-base-mode): Setup c-ts-common-indent-type-regexp-alist.

* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

23 months agoFix c-ts-mode indentation
Yuan Fu [Mon, 6 Feb 2023 01:05:21 +0000 (17:05 -0800)]
Fix c-ts-mode indentation

Turns out I shouldn't have removed the explicit rules.  Anyway, now it
indents properly.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Add rules.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Add tests

23 months agoFix c-ts-mode indentation (bug#61291)
Yuan Fu [Sun, 5 Feb 2023 23:20:52 +0000 (15:20 -0800)]
Fix c-ts-mode indentation (bug#61291)

Fix indentation for the semicolon in

while (str_a[i++] == str_b[j++])
  ;

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): New rule.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

23 months ago(eglot-completion-at-point): Return correct values in :company-kind
Dmitry Gutov [Mon, 6 Feb 2023 22:28:25 +0000 (00:28 +0200)]
(eglot-completion-at-point): Return correct values in :company-kind

* lisp/progmodes/eglot.el (eglot-completion-at-point): Return the
correct values in :company-kind for "EnumMember" and "TypeParameter".
The convention is to use kebab case rather than plain downcasing.
Reported in https://github.com/company-mode/company-mode/issues/1370.

23 months agoImprove Tramp file name completion
Michael Albinus [Mon, 6 Feb 2023 17:13:22 +0000 (18:13 +0100)]
Improve Tramp file name completion

This fixes Bug#51386, Bug#52758, Bug#53513, Bug#54042 and Bug#60505.

* doc/misc/tramp.texi (File name completion): Remove completion
styles restrictions.

* lisp/minibuffer.el (completion-styles): Fix docstring.

* lisp/net/tramp.el (tramp-methods) <->: Add.
(tramp-completion-file-name-handler-alist):
Add `expand-file-name', `file-exists-p', `file-name-directory' and
`file-name-nondirectory'.
(tramp-dissect-file-name): Do not extra check for
`tramp-default-method-marker'.
(tramp-completion-handle-expand-file-name)
(tramp-completion-handle-file-exists-p)
(tramp-completion-handle-file-name-directory)
(tramp-completion-handle-file-name-nondirectory): New defuns.
(tramp-completion-handle-file-name-all-completions): Remove duplicates.

* test/lisp/net/tramp-tests.el
(tramp-test26-interactive-file-name-completion): New test.

23 months agoTighten and simplify typescript compilation-mode regexps (bug#61104)
Mattias Engdegård [Mon, 6 Feb 2023 10:45:33 +0000 (11:45 +0100)]
Tighten and simplify typescript compilation-mode regexps (bug#61104)

* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Tighten regexps and simplify.  Translate to rx.
* etc/compilation.txt: Add examples.

In collaboration with Jostein Kjønigsen.

23 months ago; * lisp/progmodes/c-ts-common.el (treesit-node-prev-sibling): Declare.
Eli Zaretskii [Mon, 6 Feb 2023 16:34:39 +0000 (18:34 +0200)]
; * lisp/progmodes/c-ts-common.el (treesit-node-prev-sibling): Declare.

23 months agoFix 'hack-local-variables' when EOL conversion is inhibited
Eli Zaretskii [Mon, 6 Feb 2023 16:28:21 +0000 (18:28 +0200)]
Fix 'hack-local-variables' when EOL conversion is inhibited

* lisp/files.el (hack-local-variables--find-variables): Replace
CRs with newlines only if the original buffer is under explicit
selective-display.  (Bug#61321)

23 months agoClarify bug-reference-auto-setup-functions docstring.
Tassilo Horn [Mon, 6 Feb 2023 16:09:40 +0000 (17:09 +0100)]
Clarify bug-reference-auto-setup-functions docstring.

* lisp/progmodes/bug-reference.el (bug-reference-auto-setup-functions):
Add clarification to docstring that this variable is for packages, not
for users.

23 months agoPort emacsclient wrapper to Android 7.1 and earlier
Po Lu [Mon, 6 Feb 2023 14:55:42 +0000 (22:55 +0800)]
Port emacsclient wrapper to Android 7.1 and earlier

* java/org/gnu/emacs/EmacsNative.java (EmacsNative): Load every
native library on which Emacs depends prior to loading libemacs
itself.

* java/org/gnu/emacs/EmacsOpenActivity.java (readEmacsClientLog)
(EmacsOpenActivity, startEmacsClient): Don't use redirectError
on Android 7.1 and earlier.

23 months ago* lisp/treesit.el (treesit): Fix shortdoc example form (bug#61318).
Aleksandr Vityazev [Mon, 6 Feb 2023 10:39:10 +0000 (13:39 +0300)]
* lisp/treesit.el (treesit): Fix shortdoc example form (bug#61318).

23 months agoAdjust ndk-build implementation for old NDK versions
Po Lu [Mon, 6 Feb 2023 14:26:45 +0000 (22:26 +0800)]
Adjust ndk-build implementation for old NDK versions

* configure.ac: Pass ANDROID_CFLAGS to ndk_INIT.
* cross/ndk-build/Makefile.in (NDK_BUILD_CFLAGS):
* cross/ndk-build/ndk-build-shared-library.mk
($(call objname,$(LOCAL_MODULE),$(basename $(1)))):
($$(error Unsupported suffix):
* cross/ndk-build/ndk-build-static-library.mk
($(call objname,$(LOCAL_MODULE),$(basename $(1)))):
($$(error Unsupported suffix): Use NDK_BUILD_CFLAGS.
* m4/ndk-build.m4 (ndk_INIT): Accept cflags.
(ndk_CONFIG_FILES): Export NDK_BUILD_CFLAGS.

23 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Mon, 6 Feb 2023 14:03:40 +0000 (22:03 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

23 months agoUpdate Android port
Po Lu [Mon, 6 Feb 2023 14:00:08 +0000 (22:00 +0800)]
Update Android port

* java/AndroidManifest.xml.in: Prevent the Emacs activity from
being overlayed by the emacsclient wrapper.
* java/org/gnu/emacs/EmacsOpenActivity.java (run): Likewise.
(onCreate): Set an appropriate theme on ICS and up.

* java/org/gnu/emacs/EmacsWindow.java (onTouchEvent): Handle
ACTION_CANCEL correctly.

23 months agoUpdate Android port
Po Lu [Mon, 6 Feb 2023 13:19:04 +0000 (21:19 +0800)]
Update Android port

* src/sfnt.c (struct sfnt_build_glyph_outline_context)
(sfnt_build_glyph_outline, sfnt_fill_span): Improve glyph
appearance by rounding coordinate values.

(struct sfnt_interpreter): New fields `twilight_original_x',
`twilight_original_y'.
(sfnt_make_interpreter): Set new fields.
(DELTAP1, DELTAP2, DELTAP3, SVTCAy, SPVTL, SFVTL, MD): Implement
instructions.
(sfnt_save_projection_vector): New argument `dual_only'.  All
callers changed.
(sfnt_address_zp2, sfnt_address_zp1, sfnt_address_zp0): Obtain
original positions in the twilight zone as well.
(sfnt_check_zp1, sfnt_interpret_fliprgoff, sfnt_interpret_fliprgon)
(sfnt_interpret_flippt, sfnt_interpret_scfs, sfnt_interpret_miap)
(sfnt_interpret_alignrp, sfnt_line_to_vector, P)
(sfnt_interpret_msirp, sfnt_interpret_ip, sfnt_interpret_call)
(load_point, sfnt_interpret_iup_1, sfnt_interpret_iup)
(sfnt_interpret_run, struct sfnt_scaled_outline)
(struct sfnt_instructed_outline, sfnt_decompose_instructed_outline)
(sfnt_build_instructed_outline, sfnt_compute_phantom_points)
(sfnt_interpret_simple_glyph, all_tests, sfnt_setup_debugger)
(sfnt_name_instruction, sfnt_draw_debugger, sfnt_run_hook)
(sfnt_verbose, main): Make glyph instructing work.

* src/sfnt.h (SFNT_POLY_ROUND): New enumerator.

23 months agoUse c-ts-common-statement-offset in java-ts-mode (bug#61142)
Theodor Thornhill [Sun, 5 Feb 2023 07:49:08 +0000 (08:49 +0100)]
Use c-ts-common-statement-offset in java-ts-mode (bug#61142)

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Add new
matchers to enable c-ts-common machinery.
(java-ts-mode): Add regexps.
* lisp/progmodes/c-ts-common.el (c-ts-common-statement-offset): Fix
typo in documentation and use the new if statement helpers.
(c-ts-common-if-statement-regexp): New defvar.
(c-ts-common-nestable-if-statement-p): New defvar.
(c-ts-common--fix-nestable-if-statement): New helper.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Add test for
complicated bracket matching indentation.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Add indent
rules for bracketless statements.

23 months agoAdd array_initializer to java-ts-mode
Theodor Thornhill [Sun, 5 Feb 2023 07:24:14 +0000 (08:24 +0100)]
Add array_initializer to java-ts-mode

Indent strings inside arrray_initializer one step:

public class Java {
    void foo() {
        return new String[]{
            "foo", // These
            "bar"
        }
    }
}

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): New
matcher.

23 months agogo-ts-mode: Highlight variable declarations
Dmitry Gutov [Mon, 6 Feb 2023 02:42:12 +0000 (04:42 +0200)]
go-ts-mode: Highlight variable declarations

* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Highlight variable declarations in 'definition' feature.

23 months agogo-ts-mode: Fix highlighting of function name in call_expression
Dmitry Gutov [Mon, 6 Feb 2023 02:12:25 +0000 (04:12 +0200)]
go-ts-mode: Fix highlighting of function name in call_expression

* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Remove :override from the 'property' rules and move them above
'variable' (bug#61302).  Just like in rust-ts-mode.

23 months agoc-ts-mode: Highlight "property functions" as functions
Dmitry Gutov [Mon, 6 Feb 2023 02:05:19 +0000 (04:05 +0200)]
c-ts-mode: Highlight "property functions" as functions

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
Highlight "property functions" as functions (bug#61302).

23 months agorust-ts-mode: Fix highlighting of function name in call_expression
Dmitry Gutov [Sun, 5 Feb 2023 21:42:18 +0000 (23:42 +0200)]
rust-ts-mode: Fix highlighting of function name in call_expression

* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
Remove :override from the 'property' rules and move them above
'variable' (bug#61302).

23 months agorust-ts-mode--font-lock-settings: Improve consistency
Dmitry Gutov [Sun, 5 Feb 2023 19:34:12 +0000 (21:34 +0200)]
rust-ts-mode--font-lock-settings: Improve consistency

* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
Remove the rule that highlighted scope identifier in a function call
as type.  The existing rules will handle it when it does look like a
type (capitalized).

23 months agoMake sure 'M-x show-paren-local-mode' turns on right away
Dmitry Gutov [Sun, 5 Feb 2023 19:07:45 +0000 (21:07 +0200)]
Make sure 'M-x show-paren-local-mode' turns on right away

* lisp/paren.el (show-paren--enabled-p): Extract from
'show-paren-function'.
(show-paren-local-mode): Use it in the :variable getter (bug#61098).

23 months agoAdd to bug-reference-auto-setup-functions after its declaring defvar
Tassilo Horn [Sun, 5 Feb 2023 18:54:17 +0000 (19:54 +0100)]
Add to bug-reference-auto-setup-functions after its declaring defvar

If it's the init-value of the defvar, add-hook from a third-party
package will suppress the default functions if it takes place before
bug-reference is loaded.

* lisp/progmodes/bug-reference.el (bug-reference-auto-setup-functions):
Add to bug-reference-auto-setup-functions after its declaring defvar.

23 months ago* lisp/vc/vc.el (vc-find-revision-no-save): Fix parens (bug#61256).
Juri Linkov [Sun, 5 Feb 2023 18:23:57 +0000 (20:23 +0200)]
* lisp/vc/vc.el (vc-find-revision-no-save): Fix parens (bug#61256).

Move '(setq failed nil)' from UNWINDFORMS of 'unwind-protect' to BODYFORM.

23 months agoCC Mode: Prevent infinite recursion in c-determine-limit.
Alan Mackenzie [Sun, 5 Feb 2023 18:01:09 +0000 (18:01 +0000)]
CC Mode: Prevent infinite recursion in c-determine-limit.

This was happening particularly with long-lines, possibly because the position
was inside a literal when calling c-determine-limit.

* lisp/progmodes/cc-engine.el (c-determine-limit): Guard a recursive call by
checking (- base try-size).

23 months ago; Fix byte-compilation warning
Eli Zaretskii [Sun, 5 Feb 2023 17:10:39 +0000 (19:10 +0200)]
; Fix byte-compilation warning

* lisp/progmodes/rust-ts-mode.el (treesit-query-compile): Avoid
byte-compilation warning.

23 months agoFix inability to turn show-paren-local-mode on manually (bug#61098)
Dmitry Gutov [Sun, 5 Feb 2023 17:06:47 +0000 (19:06 +0200)]
Fix inability to turn show-paren-local-mode on manually (bug#61098)

* lisp/paren.el (show-paren-local-mode): Don't kill the local
value when both local and global are t.  Because the
show-paren-predicate check in show-paren-function also checks
whether a local (non-nil) value of this variable exists.

23 months ago; go-ts-mode--indent-rules: Indent to 0 at top level
Dmitry Gutov [Sun, 5 Feb 2023 16:52:57 +0000 (18:52 +0200)]
; go-ts-mode--indent-rules: Indent to 0 at top level

23 months agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Sun, 5 Feb 2023 16:53:36 +0000 (18:53 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

23 months ago; Fix whitespace of last change
Eli Zaretskii [Sun, 5 Feb 2023 16:52:59 +0000 (18:52 +0200)]
; Fix whitespace of last change

23 months ago; Fix trivial mistake in emoji--choose-emoji
Jonas Bernoulli [Sun, 5 Feb 2023 16:50:10 +0000 (17:50 +0100)]
; Fix trivial mistake in emoji--choose-emoji

* lisp/international/emoji.el (emoji--choose-emoji): The derived
versions are in the cdr not cadr.

23 months ago; * lisp/isearch.el (emoji--read-emoji): Avoid compilation warning.
Eli Zaretskii [Sun, 5 Feb 2023 16:51:11 +0000 (18:51 +0200)]
; * lisp/isearch.el (emoji--read-emoji): Avoid compilation warning.

23 months agorust-ts-mode: Highlight variable declarations
Dmitry Gutov [Sun, 5 Feb 2023 16:49:24 +0000 (18:49 +0200)]
rust-ts-mode: Highlight variable declarations

(rust-ts-mode--font-lock-settings): Change scoped_type_identifier
highlight to match similar cases.  Highlight variable declarations
inside all kinds of destructuring patterns, not just function
definitions.
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--fontify-pattern):
Rename from 'rust-ts-mode--fontify-parameter'.  Check the id node's
parent to avoid touching type identifiers.

23 months agorust-ts-mode--indent-rules: Indent to 0 at top level
Dmitry Gutov [Sun, 5 Feb 2023 16:19:04 +0000 (18:19 +0200)]
rust-ts-mode--indent-rules: Indent to 0 at top level

23 months ago; Move misplaces parenthesis in emoji--choose-emoji
Jonas Bernoulli [Sun, 5 Feb 2023 16:19:15 +0000 (17:19 +0100)]
; Move misplaces parenthesis in emoji--choose-emoji

* lisp/international/emoji.el (emoji--choose-emoji): Move misplaced
parenthesis.

23 months agoEnsure upper bound of font-lock region is less than point-max
Alan Mackenzie [Sun, 5 Feb 2023 15:59:44 +0000 (15:59 +0000)]
Ensure upper bound of font-lock region is less than point-max

This fixes bug #61298.  The new long-lines code may have narrowed a buffer
before font-lock-default-fontify-region gets called.

* lisp/font-lock.el (font-lock-default-fontify-region): Set `end' to point-max
if it is greater that it.

23 months ago; * lisp/paren.el (show-paren-predicate): Doc fix. (Bug#61098)
Eli Zaretskii [Sun, 5 Feb 2023 15:27:43 +0000 (17:27 +0200)]
; * lisp/paren.el (show-paren-predicate): Doc fix.  (Bug#61098)

23 months agoFix misleading LAP optimiser debug log message
Mattias Engdegård [Sun, 5 Feb 2023 11:27:32 +0000 (12:27 +0100)]
Fix misleading LAP optimiser debug log message

* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Correct message in a conditional jump threading rule.

23 months agoAllow unbind to commute with discardN and discardN-preserve-tos
Mattias Engdegård [Sun, 5 Feb 2023 11:14:23 +0000 (12:14 +0100)]
Allow unbind to commute with discardN and discardN-preserve-tos

* lisp/emacs-lisp/byte-opt.el (byte-after-unbind-ops):
Add discardN and discardN-preserve-tos, both of which
commute with unbind.  This enables subsequent optimisations.

23 months agoRemove compatibility hacks in LAP optimiser
Mattias Engdegård [Sun, 5 Feb 2023 10:56:06 +0000 (11:56 +0100)]
Remove compatibility hacks in LAP optimiser

* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Remove code forcing forward motion after applying certain
transformations; these were only there to keep output identical across
refactorings.

23 months agoLAP optimiser: bind local variables instead of mutating them
Mattias Engdegård [Sun, 5 Feb 2023 10:18:26 +0000 (11:18 +0100)]
LAP optimiser: bind local variables instead of mutating them

This is a refactoring step: there is no change in how the optimiser
works.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Instead of re-using local variables through mutation, bind them at
point of use.  This ensures that there is no value leakage by mistake
and actually reduces the static size of the bytecode of this function
somewhat.
The lousy variable names (tmp, tmp2 etc) are retained but
can at least now be changed into something more descriptive.

23 months agoGet rid of delq in LAP optimiser
Mattias Engdegård [Sat, 4 Feb 2023 17:58:48 +0000 (18:58 +0100)]
Get rid of delq in LAP optimiser

* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Instead of using the O(n) `delq' to remove single instructions, use
the O(1) `setcdr'. To do this, anchor the instruction list in a cons
cell and use the predecessor cell in iteration.

23 months agoUpdate Android port
Po Lu [Sun, 5 Feb 2023 15:02:14 +0000 (23:02 +0800)]
Update Android port

* INSTALL.android: Explain how to build selinux.
* configure.ac: Enable selinux on Android.
* cross/ndk-build/ndk-build-shared-library.mk: ($(call
objname,$(LOCAL_MODULE),$(basename $(1))))::($$(error
Unsupported suffix)::(NDK_CFLAGS_$(LOCAL_MODULE)):
* cross/ndk-build/ndk-build-static-library.mk: ($(call
objname,$(LOCAL_MODULE),$(basename $(1))))::($$(error
Unsupported suffix)::(NDK_CFLAGS_$(LOCAL_MODULE)): Correctly
handle files with a .cc suffix, and clang-specific asflags.
* cross/ndk-build/ndk-clear-vars.mk: Handle AOSP extensions
LOCAL_ADDITIONAL_DEPENDENCIES,
LOCAL_CLANG_ASFLAGS_$(NDK_BUILD_ARCH) and LOCAL_IS_HOST_MODULE.

* doc/emacs/android.texi (Android Startup): Explain emacsclient
wrapper.

* java/org/gnu/emacs/EmacsView.java (EmacsView): New flag
`isCurrentlyTextEditor'.
(showOnScreenKeyboard, hideOnScreenKeyboard): Set as
appropriate.
(onCheckIsTextEditor): Return its value.

* lisp/touch-screen.el (touch-screen-handle-scroll): Don't ding
at buffer limits.
* m4/ndk-build.m4: Improve doc.

* src/Makefile.in (LIBSELINUX_CFLAGS): New variable.
(EMACS_CFLAGS): Add it.

23 months agoHighlight more complex function parameters
Dmitry Gutov [Sun, 5 Feb 2023 14:43:59 +0000 (16:43 +0200)]
Highlight more complex function parameters

* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--fontify-parameter): New function.
(rust-ts-mode--font-lock-settings): Use it.

23 months ago* lisp/emacs-lisp/cconv.el (cconv-convert): Fix thinko
Stefan Monnier [Sun, 5 Feb 2023 14:04:51 +0000 (09:04 -0500)]
* lisp/emacs-lisp/cconv.el (cconv-convert): Fix thinko

23 months agoNo longer use transient in isearch-emoji-by-name
Jonas Bernoulli [Wed, 1 Feb 2023 19:25:15 +0000 (20:25 +0100)]
No longer use transient in isearch-emoji-by-name

* lisp/isearch.el (isearch-emoji-by-name): Use 'emoji--read-emoji'
and if that returns derivations, 'completing-read' to select one
of them.  This fixes bug#60740.
* lisp/international/emoji.el (emoji--init): Autoload.
(emoji--read-emoji): New function, which doesn't use transient
and returns a list of the glyph and all derivations, if any.
(emoji--choose-emoji): Use 'emoji--read-emoji'.

23 months agoMake highlighting more regular across TS modes (bug#61205)
Dmitry Gutov [Sun, 5 Feb 2023 13:46:28 +0000 (15:46 +0200)]
Make highlighting more regular across TS modes (bug#61205)

* doc/emacs/display.texi (Parser-based Font Lock):
Update description of treesit-font-lock-level, moving 'property' to
level 4.

* lisp/treesit.el (treesit-font-lock-level): Likewise, in docstring.

* lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Do that here.

* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode): Add a comment.

* lisp/progmodes/go-ts-mode.el (go-ts-mode): Add 'definition' to
level 1.  Move 'function', 'property' and 'variable' to level 4.
(go-ts-mode--font-lock-settings): Move a bunch of existing rules
to 'definition'.  Add highlighting of function parameters.

* lisp/progmodes/rust-ts-mode.el (rust-ts-mode)
(rust-ts-mode--font-lock-settings): Same.  And also change "scoped
identifiers" highlights to only match capitalized names.

23 months ago; Improve documentation of 'proper-list-p'
Eli Zaretskii [Sun, 5 Feb 2023 13:15:35 +0000 (15:15 +0200)]
; Improve documentation of 'proper-list-p'

* doc/lispref/lists.texi (Cons Cells): Add cross-reference
to 'proper-list-p' documentation.

23 months agoUpdate from gnulib
Po Lu [Sun, 5 Feb 2023 13:06:11 +0000 (21:06 +0800)]
Update from gnulib

* admin/merge-gnulib (avoided_flags):
* cross/lib/cdefs.h (__bos):
(__glibc_unsigned_or_positive):
(__glibc_unsafe_len):
(__glibc_fortify):
(__glibc_fortify_n):
* cross/lib/isnan.c:
* cross/lib/libc-config.h:
* cross/lib/openat-proc.c (openat_proc_name):
* cross/lib/vasnprintf.c (VASNPRINTF):
* cross/lib/verify.h (_Static_assert):
(_GL_SA3):
* lib/gnulib.mk.in (HAVE_GRANTPT):
(HAVE_SPAWN_H):
(NEXT_AS_FIRST_DIRECTIVE_LIMITS_H):
(NEXT_LIMITS_H):
(REPLACE_GETSUBOPT):
(REPLACE_ILOGB):
(SYSTEM_TYPE):
(BUILT_SOURCES):
* lib/isnan.c:
* lib/vasnprintf.c (VASNPRINTF):
* lib/verify.h (_GL_SA3):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
* m4/gnulib-comp.m4 (gl_INIT): Update from gnulib.

23 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Sun, 5 Feb 2023 12:55:21 +0000 (20:55 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

23 months agoUpdate Android port
Po Lu [Sun, 5 Feb 2023 12:49:19 +0000 (20:49 +0800)]
Update Android port

* src/sfnt.c (struct sfnt_graphics_state):
(LOOPCALL):
(DELTAC3):
(PROJECT):
(SHPIX):
(sfnt_save_projection_vector):
(sfnt_check_zp0):
(sfnt_dual_project_vector):
(sfnt_interpret_scfs):
(sfnt_round_symmetric):
(sfnt_interpret_miap):
(sfnt_interpret_alignrp_1):
(sfnt_interpret_alignrp):
(sfnt_measure_distance):
(sfnt_interpret_msirp):
(sfnt_interpret_ip):
(sfnt_interpret_mdap):
(sfnt_deltap):
(sfnt_dual_project_onto_any_vector):
(sfnt_validate_gs):
(sfnt_set_projection_vector):
(sfnt_interpret_shp):
(sfnt_interpret_run):
(sfnt_check_sloop):
(main): Check in more WIP font code.

23 months agoDocument 'plistp'
Eli Zaretskii [Sun, 5 Feb 2023 12:09:35 +0000 (14:09 +0200)]
Document 'plistp'

* doc/lispref/lists.texi (Property Lists): Document 'plistp'.
(Bug#61293)

23 months agoFix display of raised/lowered composed text
Eli Zaretskii [Sun, 5 Feb 2023 11:57:10 +0000 (13:57 +0200)]
Fix display of raised/lowered composed text

* src/xdisp.c (fill_gstring_glyph_string): Adjust the base line of
the glyph string due to subscript/superscript.  (Bug#61290)

23 months agoFix installation of tree-sitter grammar on MS-Windows
Eli Zaretskii [Sun, 5 Feb 2023 09:14:25 +0000 (11:14 +0200)]
Fix installation of tree-sitter grammar on MS-Windows

* lisp/treesit.el (treesit--install-language-grammar-1): Fix a
failure on MS-Windows when the old DLL is still being used.
(Bug#61289)

23 months agoUpdate the Emacs FAQ for Emacs 29
Eli Zaretskii [Sun, 5 Feb 2023 08:50:12 +0000 (10:50 +0200)]
Update the Emacs FAQ for Emacs 29

* doc/misc/efaq.texi (New in Emacs 29, History of Emacs): Add new
section about Emacs 29.

23 months agoFix byte-compilation of *-ts-mode.el files
Eli Zaretskii [Sun, 5 Feb 2023 06:24:32 +0000 (08:24 +0200)]
Fix byte-compilation of *-ts-mode.el files

* lisp/treesit.el (treesit-font-lock-settings): Move to before
use, to prevent failure in byte-compiling modes which require this
file.  (Bug#61282)

23 months ago; ruby-ts--syntax-propertize: Amend commentary
Dmitry Gutov [Sun, 5 Feb 2023 00:42:52 +0000 (02:42 +0200)]
; ruby-ts--syntax-propertize: Amend commentary

23 months agoUpdate some commentary for C23
Paul Eggert [Sat, 4 Feb 2023 23:53:40 +0000 (15:53 -0800)]
Update some commentary for C23

23 months agoMake c-ts-mode-set-style's effect local (bug#61245)
Yuan Fu [Sat, 4 Feb 2023 02:35:33 +0000 (18:35 -0800)]
Make c-ts-mode-set-style's effect local (bug#61245)

Now c-ts-mode-set-style's effect is local, and there is a new function
c-ts-mode-set-global-style that changes the global setting.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-style-setter): Use c-ts-mode-set-style.
(c-ts-mode-indent-style)
(c-ts-mode--prompt-for-style): Minor change in docstring.
(c-ts-mode-set-global-style): New function (from c-ts-mode-set-style).
(c-ts-mode-set-local-style): Remove function (became c-ts-mode-set-style).
(c-ts-mode-set-style): Renamed from c-ts-mode-set-local-style.
* test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts:
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Use
c-ts-mode-set-style.

23 months ago; * lisp/treesit.el (treesit--font-lock-level-setter): Minor change.
Yuan Fu [Fri, 3 Feb 2023 02:54:49 +0000 (18:54 -0800)]
; * lisp/treesit.el (treesit--font-lock-level-setter): Minor change.

23 months agoUse Gnulib module alignasof instead of stdalign
Paul Eggert [Sat, 4 Feb 2023 22:55:12 +0000 (14:55 -0800)]
Use Gnulib module alignasof instead of stdalign

* admin/merge-gnulib (GNULIB_MODULES):
Replace obsolescent Gnulib module stdalign with alignasof.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/stdalign.in.h: Remove; no longer needed.

23 months agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Sat, 4 Feb 2023 22:45:11 +0000 (14:45 -0800)]
Update from Gnulib by running admin/merge-gnulib

23 months agoPrefer https: to git: URIs
Paul Eggert [Sat, 4 Feb 2023 22:24:37 +0000 (14:24 -0800)]
Prefer https: to git: URIs

Prefer https: to git: URIs on Savannah.
The idea is to avoid some adversary-in-the-middle attacks
on developers.

23 months agoc-ts-mode: Highlight name in parameter declarations
Dmitry Gutov [Sat, 4 Feb 2023 20:46:41 +0000 (22:46 +0200)]
c-ts-mode: Highlight name in parameter declarations

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
Uncomment parameter declaration highlighting (bug#61275).
(c-ts-mode--fontify-declarator): Check that identifier was found.
Some declarations can miss identifier name.

23 months agoFix switch statement indentation for go-ts-mode (bug#61238)
Davide Masserut [Thu, 2 Feb 2023 20:00:02 +0000 (21:00 +0100)]
Fix switch statement indentation for go-ts-mode (bug#61238)

* lisp/progmodes/go-ts-mode.el (go-ts-mode--indent-rules): Add
indentation for type switch and select case blocks
* test/lisp/progmodes/go-ts-mode-resources/indent.erts: New .erts file
to test indentation of Go constructs and prevent regression of bug
fixes.
* test/lisp/progmodes/go-ts-mode-tests.el: New file with go-ts-mode
tests.

23 months agonadvice: Fix bug#61179
Stefan Monnier [Sat, 4 Feb 2023 16:23:31 +0000 (11:23 -0500)]
nadvice: Fix bug#61179

Advising interactive forms relies on the ability to distinguish
interactive forms that do nothing else than return a function.
So, be careful to preserve this info.
Furthermore, interactive forms are expected to be evaluated in
the lexical context captured by the closure to which they belong,
so be careful to preserve that context when manipulating those forms.

* lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form) <lambda>:
Preserve the info that an interactive form does nothing else than
return a function.

* lisp/emacs-lisp/nadvice.el (advice--interactive-form-1): New function.
(advice--interactive-form): Use it.
(advice--make-interactive-form): Refine to also accept function values
quoted with `quote`.  Remove obsolete TODO.

* test/lisp/emacs-lisp/nadvice-tests.el: Don't disallow byte-compilation.
(advice-test-bug61179): New test.

* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper): Allow
the `if` arg to be a form.
* lisp/simple.el (oclosure-interactive-form): Adjust accordingly.

23 months agoAdd emacsclient desktop file equivalent on Android
Po Lu [Sat, 4 Feb 2023 15:32:07 +0000 (23:32 +0800)]
Add emacsclient desktop file equivalent on Android

* doc/emacs/android.texi (Android File System):
* java/AndroidManifest.xml.in: Update with new activity.  Remove
Android 10 restrictions through a special flag.

* java/org/gnu/emacs/EmacsNative.java (getProcName): New
function.
* java/org/gnu/emacs/EmacsOpenActivity.java (EmacsOpenActivity):
New file.
* java/org/gnu/emacs/EmacsService.java (getLibraryDirection):
Remove unused annotation.
* lib-src/emacsclient.c (decode_options): Set alt_display on
Android.
* src/android.c (android_proc_name): New function.
(NATIVE_NAME): Export via JNI.

23 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Sat, 4 Feb 2023 11:50:00 +0000 (19:50 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

23 months agoAdd additional permissions to Android port
Po Lu [Sat, 4 Feb 2023 11:49:51 +0000 (19:49 +0800)]
Add additional permissions to Android port

* doc/emacs/android.texi (Android Environment):
* java/AndroidManifest.xml.in: Add network state permissions.

23 months agoUpdate Android port
Po Lu [Sat, 4 Feb 2023 11:47:54 +0000 (19:47 +0800)]
Update Android port

* src/sfnt.c (sfnt_multiply_divide_signed):
(struct sfnt_interpreter_zone):
(struct sfnt_graphics_state):
(struct sfnt_interpreter):
(sfnt_mul_f2dot14):
(sfnt_interpret_trap):
(WCVTF):
(ALIGNPTS):
(sfnt_scale_by_freedom_vector):
(sfnt_interpret_utp):
(sfnt_address_zp2):
(sfnt_address_zp1):
(sfnt_address_zp0):
(sfnt_check_zp2):
(sfnt_move_zp0):
(sfnt_move_zp1):
(sfnt_move_glyph_zone):
(sfnt_move_twilight_zone):
(sfnt_direct_move_zp2):
(sfnt_interpret_alignpts):
(sfnt_interpret_isect):
(sfnt_line_to_vector):
(sfnt_deltac):
(sfnt_interpret_mdap):
(sfnt_interpret_call):
(sfnt_dot_fix_14):
(sfnt_move_x):
(sfnt_move_y):
(sfnt_move):
(sfnt_validate_gs):
(sfnt_interpret_shz):
(sfnt_interpret_shc):
(sfnt_interpret_shp):
(sfnt_interpret_iup_1):
(sfnt_interpret_iup):
(sfnt_interpret_run):
(sfnt_interpret_font_program):
(sfnt_interpret_control_value_program):
(sfnt_interpret_simple_glyph):
(jrot_test_args):
(jrof_test_args):
(all_tests):
(main): Check in more WIP code.

23 months agoFix bidi reordering of sequence of whitespace characters before a TAB
Eli Zaretskii [Sat, 4 Feb 2023 11:34:42 +0000 (13:34 +0200)]
Fix bidi reordering of sequence of whitespace characters before a TAB

* src/bidi.c (bidi_level_of_next_char): Test the current level
only for characters whose original type is BN.  (Bug#61269)

23 months agoAdd test for java indentation (bug#61115)
Theodor Thornhill [Fri, 3 Feb 2023 08:09:49 +0000 (09:09 +0100)]
Add test for java indentation (bug#61115)

* test/lisp/progmodes/java-ts-mode-resources/indent.erts: Add new test
case.

23 months agoAdd tests for compilation support for TypeScript (bug#61104)
Theodor Thornhill [Fri, 3 Feb 2023 08:05:13 +0000 (09:05 +0100)]
Add tests for compilation support for TypeScript (bug#61104)

* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data): Add new test-cases.
(compile-test-error-regexps): Increase expected errors

23 months agoAdd support for TypeScript compilation to compile.el (bug#61104)
Jostein Kjønigsen [Sat, 28 Jan 2023 14:23:11 +0000 (15:23 +0100)]
Add support for TypeScript compilation to compile.el (bug#61104)

* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Add regexps.

23 months agoDon't clobber match data in 'y-or-n-p'
Eli Zaretskii [Sat, 4 Feb 2023 08:15:18 +0000 (10:15 +0200)]
Don't clobber match data in 'y-or-n-p'

* lisp/subr.el (y-or-n-p): Avoid clobbering caller's match data.
(Bug#61091)