1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-05 03:20:39 -08:00
Commit graph

168842 commits

Author SHA1 Message Date
Po Lu
ee4b6a4a2d Update Android port
* java/org/gnu/emacs/EmacsContextMenu.java (display): Return
false if the list of menu buttons is empty, lest Android cease
displaying menus on the assumption that Emacs is defective.

* java/org/gnu/emacs/EmacsView.java (popupMenu): Likewise.

* src/fns.c (sort_list): Render sentence motion commands
functional within commentary

* src/sfntfont.c (sfntfont_list_family): Sort and deduplicate
the returned family list and make it a list of symbols.
(syms_of_sfntfont) <Qstring_lessp>: New defsym.
2023-09-16 10:38:46 +08:00
Jim Porter
bc25d76650 Fix documented Eshell behavior of ignoring leading nils in commands
* lisp/eshell/esh-var.el (eshell-handle-local-variables): Simplify,
and move leading-nil handling to...
* lisp/eshell/esh-cmd.el (eshell-named-command): ... here.

* test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/skip-leading-nils):
* test/lisp/eshell/esh-var-tests.el
(esh-var-test/local-variables/skip-nil): New tests.

* doc/misc/eshell.texi (Expansion): Document this behavior.
2023-09-15 13:43:07 -07:00
Stefan Monnier
e7e925f062 (mutually_exclusive_p): Fix the regression from commit 6fad73d7cc
Commit 6fad73d7cc throws away some useful optimization because
it misfired in some cases (as seen in bug#657260).  Here we try to
recover those useful optimizations with a slightly more careful
algorithm.

* src/regex-emacs.c (mutually_exclusive_aux): Rename from
`mutually_exclusive_p`.  Add two new args.  Improve the
case where we need to recurse.
(mutually_exclusive_p): New function defined on top of it.

* test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization):
Re-enable the test.
2023-09-15 14:53:24 -04:00
Stefan Monnier
9610aaeb9e * src/regex-emacs.c (mutually_exclusive_p): Refactor
Minor refactoring to avoid swapping p1/p2.

* src/regex-emacs.c (mutually_exclusive_exactn)
(mutually_exclusive_charset): New functions, extracted from
`mutually_exclusive_p`.
(mutually_exclusive_p): Use them.
2023-09-15 14:16:48 -04:00
Stefan Kangas
1d952078c0 Mark two tests as expensive
* test/lisp/calendar/todo-mode-tests.el
(todo-test-add-and-delete-file):
* test/lisp/simple-tests.el (simple-tests-shell-command-39067):
Mark tests taking more than 10 seconds to run on a MacBook Pro from
2015 as expensive.
2023-09-15 11:28:25 +02:00
Stefan Kangas
826d383c92 Fix describing packages where maintainer lacks email
* lisp/emacs-lisp/package.el (describe-package-1): Fix describing
packages with one maintainer without an email address.  (Bug#65987)
2023-09-15 09:49:26 +02:00
Yuan Fu
7717ff1c94
Add dot SVG icons
The advantage of SVG dots over Unicode dots is that their size is
fixed.  With Unicode dots, the size varies with the font.

Dot icons can be useful for status indicator: green dot for online,
red dot for offline, etc.

* etc/images/symbols/dot_large_16.pbm:
* etc/images/symbols/dot_large_16.svg:
* etc/images/symbols/dot_medium_16.pbm:
* etc/images/symbols/dot_medium_16.svg:
* etc/images/symbols/dot_small_16.pbm:
* etc/images/symbols/dot_small_16.svg: New file.
2023-09-15 00:44:23 -07:00
Yuan Fu
04fd8b173b
Allow treesit-font-lock-recompute-features to be language-specific
* lisp/treesit.el:
(treesit-font-lock-recompute-features): Add LANGUAGE parameter.
2023-09-15 00:44:23 -07:00
Eli Zaretskii
160b4c295d ; * src/process.c (child_signal_notify): Avoid compiler warning (bug#65919). 2023-09-15 09:05:14 +03:00
Po Lu
1442f4043a ; * src/xterm.c (handle_one_xevent): Cite the bug meant to be fixed. 2023-09-15 10:35:06 +08:00
Po Lu
e1a730017d Correct bug#65919
* src/process.c (child_signal_notify): Expunge call to
non-reentrant function from signal handler.

* src/xfns.c (setup_xi_event_mask): Cease selecting for
XI_FocusIn and XI_FocusOut under X toolkit builds.

* src/xterm.c (xi_handle_interaction, xi_handle_focus_change)
(xi_handle_focus_change): Make conditional on GTK 3 or no
toolkit builds.
(xi_handle_delete_frame, x_free_frame_resources): Adjust
correspondingly.
(handle_one_xevent) <EnterNotify, LeaveNotify>: Examine
EnterNotify and LeaveNotify events for focus changes
irrespective of whether XI2 is enabled under the X toolkit and
GTK 2.x.
2023-09-15 10:30:12 +08:00
Jim Porter
cadd332662 Collapse 'if' forms in Eshell iterative evaluation
* lisp/eshell/esh-cmd.el (eshell-do-eval): After evaluating 'if'
conditional, replace the form with the THEN or ELSE body.
2023-09-14 17:54:41 -07:00
Jim Porter
7e50861ca7 ; Simplify how to use 'eshell-debug-command'
Now, 'eshell-debug-command' works more like 'format-message', which is
how we usually use it.

* lisp/eshell/esh-util.el (eshell-always-debug-command): New function.
(eshell-debug-command): Simplify.  Update callers.
2023-09-14 17:54:26 -07:00
Michael Albinus
2f2f934208 Fix Tramp test on NetBSD
* test/lisp/net/tramp-tests.el (tramp--test-netbsd-p): New defun.
(tramp--test-check-files): Use it.
2023-09-14 14:38:27 +02:00
Po Lu
6ffb0a1719 Avert a crash in the Android last resort font driver
* java/org/gnu/emacs/EmacsFontDriver.java (FONT_INVALID_CODE):
New constant.
(hasChar, encodeChar): Accept a jint character code rather than
a jchar.

* java/org/gnu/emacs/EmacsSdk23FontDriver.java (hasChar)
(encodeChar): Return 0 or FONT_INVALID_CODE if the character is
not representable in a Java char.

* java/org/gnu/emacs/EmacsSdk7FontDriver.java (hasChar): Ditto.

* src/androidfont.c (android_init_font_driver): Adjust signature
to match.
2023-09-14 16:53:21 +08:00
Yuan Fu
f13b08be11
; * src/treesit.c (Ftreesit_parser_set_included_ranges): Minor fix. 2023-09-13 21:41:56 -07:00
Yuan Fu
de6a652a03
Refactor treesit-font-lock-fontify-region
* lisp/treesit.el (treesit-font-lock-fontify-region): Extract out
treesit--font-lock-fontify-region-1.
2023-09-13 21:04:18 -07:00
Yuan Fu
b1291a2f84
; * admin/notes/tree-sitter/performance (Facts): Fix filling. 2023-09-13 21:01:19 -07:00
Yuan Fu
63766b49e2
Fix treesit-font-lock-fontify-region wrt local parsers
* lisp/treesit.el (treesit--update-ranges-local): Minor change.
(treesit-font-lock-fontify-region): Don't try to fontify if node is
nil.  Don't use alist-get to get the root node for a language: there
might be multiple root nodes (from multiple local parsers) for the
same language.
(treesit-major-mode-setup): Remove existing local parsers when major
mode is activated.
2023-09-13 21:00:29 -07:00
Po Lu
921c0a16ce Improve the Android last resort font driver
* java/org/gnu/emacs/EmacsSdk7FontDriver.java (Sdk7Typeface):
Rename fileName to familyName and cease attempting to infer a
style from it.
(EmacsSdk7FontDriver): Employ preset typefaces rather than
enumerating each typeface within the system fonts directory.
(draw): Circumvent kerning difficulties by advancing past each
character individually.
2023-09-14 09:59:45 +08:00
Jim Porter
ef2bd5e487 Improve process instrumentation in Eshell
* lisp/eshell/esh-proc.el (eshell-insertion-filter): Add more logging,
and try to bulletproof the implementation.
(eshell-sentinel): Add more logging.
2023-09-13 18:19:18 -07:00
Yuan Fu
8facdb62d3
Improve docstring for treesit-language-at
* lisp/treesit.el (treesit-language-at-point-function)
(treesit-language-at): Several people has confused over this, make it
extra clear than treesit-language-at requires
treesit-language-at-point-function to work.
2023-09-13 18:15:28 -07:00
Yuan Fu
c916f471ca
Add tree-sitter performance note 2023-09-13 18:15:28 -07:00
Yuan Fu
ad624b961b
Update tree-sitter traversing functions' docstrings
* src/treesit.c (Ftreesit_search_subtree)
(Ftreesit_search_forward)
(Ftreesit_induce_sparse_tree): Update docstring.
2023-09-13 18:15:27 -07:00
F. Jason Park
d8c0bfb265 ; * test/lisp/erc/erc-stamp-tests.el (erc-echo-timestamp): Tag unstable. 2023-09-13 16:05:55 -07:00
Stephen Berman
9d9570bfbf Fix last Ibuffer change and improve feedback messages
* lisp/ibuf-macs.el (define-ibuffer-op): Emit grammatically
correct message on finishing operation, and don't operate when
there are no marked buffer lines and point is not on a buffer
line.  (bug#64230, Message #21)

* lisp/ibuffer.el (ibuffer-map-lines): Take acting on only one
buffer line and using non-nil 'ibuffer-expert' into account.
2023-09-13 23:43:54 +02:00
Jim Porter
9838f786de When waiting for processes in Eshell, wait until all the I/O is complete
This should fix bug#59103, bug#65590, and bug#65601.

* lisp/eshell/esh-proc.el (eshell-sentinel): Set ':eshell-handles' to
nil when finished with I/O.
(eshell-wait-for-process): Wait until ':eshell-handles' is nil.
2023-09-13 13:37:38 -07:00
Jim Porter
922d76e856 ; Fix an Eshell error when calling a lambda with form logging enabled
* lisp/eshell/esh-cmd.el (eshell-do-eval): Don't call 'symbol-name';
the function might be a closure.
2023-09-13 12:48:52 -07:00
Alan Third
4b44178e72 Fix build error on older macOS versions
* src/nsterm.m (ns_scroll_run): Use srcRect instead of destRect.
2023-09-13 20:27:49 +01:00
Jim Porter
0fe1cd4929 ; * lisp/eshell/esh-cmd.el (eshell-do-eval): Fix 'eshell-manipulate' call. 2023-09-13 11:31:36 -07:00
Stefan Kangas
32ded573cc ; Fix bootstrap
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Don't use void variable.
2023-09-13 18:22:51 +02:00
Mauro Aranda
012f9c2805 Fix defcustom :type in replace.el (Bug#65920)
* lisp/replace.el (list-matching-lines-face)
(list-matching-lines-buffer-name-face): Allow a nil value.
2023-09-13 18:01:41 +02:00
Damien Cassou
1f7113e689 Shorten docstrings generated by cl-defstruct
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Split the first line of
generated docstrings if either the struct name or a field name is very
long.  This reduces the likelihood of "docstring wider than 80
characters" errors.  (Bug#65790)
2023-09-13 16:34:45 +02:00
Damien Cassou
f045750fa5 Shorten docstrings generated by cl-defsubst
* lisp/emacs-lisp/cl-macs.el (cl-defsubst): Split the first line of
the docstring into 2 lines if the function name is very long.
Additionally, remove the word "inlining" in the generated docstring as
it is not very useful and increases the likelihood of "docstring wider
than 80 characters" errors.  (Bug#65790)
2023-09-13 16:34:45 +02:00
Damien Cassou
d436c559a4 bytecomp-tests.el: Add new helper function
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp--without-warning-test): Add helper function.
(bytecomp-warn--ignore): Use the helper.
2023-09-13 16:34:44 +02:00
Michael Albinus
2d703432a8 Fix problem with long file names in Tramp
* lisp/net/tramp-sh.el (tramp-ls-file-attributes): New defconst.
(tramp-do-file-attributes-with-ls): Use it.  (Bug#65324)
2023-09-13 16:21:13 +02:00
Po Lu
a6c29365a5 Reorganize Android permissions documentation
* doc/emacs/android.texi (Android Environment): Illustrate the
behavior of modern Android versions first.  Reported by Stefan
Kangas <stefankangas@gmail.com>.
2023-09-13 21:39:22 +08:00
Po Lu
3ef5f10b19 Exclude ``regular'' from font adstyle
* src/sfntfont.c (sfnt_parse_style): Disregard tokens matching
Regular entirely.
2023-09-13 13:42:29 +08:00
Po Lu
dfaaedfba8 Request additional permissions on Android
* doc/emacs/android.texi (Android Environment): List two
additional permissions within the summary of permissions granted
by default.

* java/AndroidManifest.xml.in: Request READ_CALENDAR and
WRITE_CALENDAR.
2023-09-13 09:30:14 +08:00
Po Lu
9500fbe231 Facilitate opening content:// files without a linked file name
* java/org/gnu/emacs/EmacsOpenActivity.java
(checkReadableOrCopy): If FILE is NULL, return a matching
content URI if possible, else generate a file name with the URI
as a reference.
(onCreate): Catch SecurityException around calls to
openFileDescriptor.
2023-09-13 09:30:14 +08:00
Jim Porter
f542a4537e ; Improve recent change to printing exit status in Eshell
* lisp/eshell/esh-proc.el (eshell-interactive-filter): Declare.
(eshell-interactive-process-filter): Simplify.
(eshell-sentinel): Call 'eshell-interactive-filter'.

* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/kill-process/redirect-message): Use
'eshell-with-temp-buffer'.
2023-09-12 18:13:52 -07:00
Yuan Fu
d1d311a3b2
Avoid unnecessary tree-sitter reparse when setting the same range
* src/treesit.h (Lisp_TS_Parser)
* src/treesit.c (make_treesit_parser): Remove has_range field, add
last_set_ranges field.
(Ftreesit_parser_set_included_ranges): Return early if the new range
is the same as the old one.
(Ftreesit_parser_included_ranges): Change has_range to
last_set_ranges.
2023-09-12 13:16:42 -07:00
Yuan Fu
b392d05089
Make sure undefined tree-sitter thing doesn't raise an error
A previous change should've achived this, but that wasn't enough.
This one actually achieves the intended effect, namely,
treesit-node-match-p doesn't raise an error if IGNORE-MISSING is
non-nil, and traverse functions don't raise error by default.

* src/treesit.c (treesit_traverse_validate_predicate): Remove
ignore_missing parameter, return error symbol.
(Ftreesit_node_match_p)
(Ftreesit_search_subtree)
(Ftreesit_search_forward)
(Ftreesit_induce_sparse_tree): Check returned error symbol.
(syms_of_treesit): New symbol.
2023-09-12 13:16:41 -07:00
Jim Porter
fad91b56d1 Ensure that Eshell doesn't consider a process complete until stderr is done
This will hopefully help resolve some timing issues with subprocesses
in Eshell.  There's now much less chance of output going missing when
using redirects.

* lisp/eshell/esh-proc.el (eshell-gather-process-output): Set
':eshell-stderr-live'...
(eshell-sentinel): ... use it.
2023-09-12 11:44:27 -07:00
Jim Porter
a0c8b45820 Be more careful about when to print abnormal exit status in Eshell
* lisp/eshell/esh-proc.el (eshell-sentinel): Only output abnormal
status when stderr is interactive.

* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/kill-process/redirect-message): New test.
2023-09-12 11:44:27 -07:00
Jim Porter
bffdb84cda Don't do anything in 'eshell-sentinel' if the process status is "run"
This doesn't change anything right now, but it will prevent future
issues when we add the ability to resume suspended processes in
Eshell.

* lisp/eshell/esh-proc.el (eshell-sentinel): Check for "run" status
earlier.
2023-09-12 11:44:27 -07:00
Stefan Monnier
1e1f3e30ef * src/alloc.c (garbage_collect): Run post-gc-hook later (bug#65700) 2023-09-12 14:06:54 -04:00
Stefan Monnier
ff87aecf85 Address "Useless clause following default cond clause" warnings
* lisp/gnus/message.el (message-position-point): Fix paren typo.

* lisp/org/org.el: Remove dead-code.
2023-09-12 12:59:03 -04:00
Stefan Monnier
68dd520e39 (read-char-from-minibuffer): Allow use of quoted-insert (bug#65805)
* lisp/subr.el (read-char-from-minibuffer-map): No need to remap
`self-insert-command` any more.
(read-char-from-minibuffer): Use `post-command-hook` to exit as soon as
a char is provided.
2023-09-12 12:55:54 -04:00
Alan Mackenzie
bfa958bb2c Correct the XEmacs version of c-put-char-properties
* lisp/progmodes/cc-defs.el (c-put-char-properties): Use the
put-text-property interface rather than make-extent for XEmacs
as well as Emacs.
2023-09-12 14:45:47 +00:00