1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-24 13:32:41 -08:00
Commit graph

171420 commits

Author SHA1 Message Date
Spencer Baugh
abc2d39e01 Use 'regexp-opt' in 'dired-omit-regexp'
In my benchmarking, for large dired buffers, using 'regexp-opt'
provides around a 3x speedup in omitting.

'regexp-opt' takes around 5 milliseconds, so to avoid slowing
down omitting in small dired buffers we cache the return value.

Since omitting is now 3x faster, increase 'dired-omit-size-limit'
by 3x.  Also, document 'dired-omit-size-limit' better.

* doc/misc/dired-x.texi (Omitting Variables): Document
'dired-omit-size-limit'.
* etc/NEWS: Announce increase of 'dired-omit-size-limit'.
* lisp/dired-x.el (dired-omit--extension-regexp-cache): Add.
(dired-omit-regexp): Use 'regexp-opt'.  (Bug#69775)
(dired-omit-size-limit): Increase and improve docs.
2024-03-23 19:07:49 +02:00
Eli Zaretskii
8d7a3ed349 * src/coding.c (produce_chars): Fix a thinko (bug#69966). 2024-03-23 18:54:39 +02:00
Eli Zaretskii
3bd7a90dde Merge from origin/emacs-29
e95a862226 ; * lisp/keymap.el (key-parse): Fix processing of "[TAB]"...
afb7a23e7b ; Improve documentation of 'backup-by-copying'
2024-03-23 06:51:40 -04:00
Eli Zaretskii
a530b8d366 ; Merge from origin/emacs-29
The following commit was skipped:

51848e4731 * Fix missing `comp-files-queue' update (bug#63415).
2024-03-23 06:51:40 -04:00
Eli Zaretskii
e813c0fa3a Merge from origin/emacs-29
689f04a2dd Clarify description of format-spec truncation
759dedfab0 More accurate documentation of 'rmail-mail-new-frame'
fa79de7c6b ; * lisp/calendar/calendar.el: Remove extra space.
7f6e335f4b Fix documentation of M-SPC in user manual
5bdc2436c6 ; * lisp/emacs-lisp/cl-macs.el (cl-labels): Fix stray dif...
8014dbb2ad * admin/notes/bugtracker: Minor copyedit.
06a991e7e8 ; * admin/notes/bugtracker: Minor copyedit.
c890622e1a Tweak regexp for object initializers in csharp-mode (bug#...
f48babb112 `term-mode': mention the keymap to add keybindings to
8cf05d9be1 Fix 'shortdoc-copy-function-as-kill'
d5901f3f05 Improve documentation of 'edebug-print-*' variables
2024-03-23 06:51:39 -04:00
Po Lu
d7a6a6941b Merge remote-tracking branch 'savannah/master' into master-android-1 2024-03-23 18:15:28 +08:00
Po Lu
0e83cbd90e Enable calling decode_coding_object with both SRC and DST_OBJECT Qnil
* src/coding.c (growable_destination): A C destination is also
reallocable.
(produce_chars): Don't consider source and destination identical
if they are EQ but Qnil.
2024-03-23 18:14:12 +08:00
Po Lu
023a5fe5a3 Minor adjustments to last change
* src/androidvfs.c (android_vfs_convert_name): Simplify.
(android_saf_tree_readdir, android_root_name): Remove redundant
statements.
2024-03-23 18:12:56 +08:00
Eli Zaretskii
5769a10530 ; Fix doc strings of some treesit-related functions
* lisp/treesit.el (treesit-defun-tactic)
(treesit-defun-name-function, treesit-thing-at-point)
(treesit-defun-at-point):
* lisp/progmodes/c-ts-common.el (c-ts-common-statement-offset):
* lisp/progmodes/c-ts-mode.el (c-ts-mode-toggle-comment-style)
(c-ts-mode-indent-style, c-ts-mode-emacs-sources-support)
(c-ts-mode--syntax-propertize, c-ts-mode--anchor-prev-sibling)
(c-ts-mode--standalone-parent-skip-preproc)
(c-ts-mode--standalone-grandparent, c-ts-mode--else-heuristic)
(c-ts-mode--declarator-identifier)
(c-ts-mode--fontify-declarator, c-ts-mode--fontify-variable)
(c-ts-mode--defun-valid-p)
(c-ts-mode--defun-for-class-in-imenu-p)
(c-ts-mode--defun-skipper, c-ts-mode--emacs-defun-p)
(c-ts-mode--emacs-defun-at-point)
(c-ts-mode--emacs-current-defun-name, c-ts-mode--reverse-ranges)
(c-ts-mode, c++-ts-mode, c-or-c++-ts-mode): Doc fixes.
2024-03-23 11:50:55 +02:00
Eli Zaretskii
2fb6f252bf Improve support for preprocessor macros in 'c/c++-ts-mode'
* lisp/progmodes/c-ts-mode.el (c-ts-mode--defun-name)
(c-ts-base-mode): Support preprocessor macros as defuns.  This
fixes both navigation by defuns and add-log when cpp macros are at
point.
2024-03-23 11:09:57 +02:00
Eli Zaretskii
e52bc9ef6f Avoid infinite recursion in 'image-mode--display'
* lisp/image-mode.el (image-mode): Suspend major mode only if it
is not already 'image-mode'.  (Bug#69785)
2024-03-23 09:51:47 +02:00
Dionisio E Alonso
6235212d73 Add BasedPyright LSP server alternative for Eglot's 'python-mode'
* lisp/progmodes/eglot.el (eglot-server-programs): Add
BasedPyright, a new server for python, forked from the
unmaintained 'pyright' LSP server.  (Bug#69925)

Copyright-paperwork-exempt: yes
2024-03-23 09:37:45 +02:00
Po Lu
e39cb515a1 Correctly handle non-BMP characters in Android content file names
* lisp/term/android-win.el (android-encode-jni)
(android-decode-jni, android-jni): New coding system, for
Android file names and runtime data.

* src/androidterm.h (syms_of_androidvfs): New function.

* src/androidvfs.c (struct android_special_vnode): New field
special_coding_system.
(android_saf_tree_readdir): Decode the file name using the
android-jni coding system.
(special_vnodes): <contents>: Specify a file name coding system.
(android_vfs_convert_name): New function.
(android_root_name): If a special coding system be specified for
a special vnode, convert components to it before invoking its
name function.
(syms_of_androidvfs): New symbol Qandroid_jni.

* src/emacs.c (android_emacs_init): Call syms_of_androidvfs.
2024-03-23 15:37:43 +08:00
john muhl
f412892b79 ; Remove unneeded group in lua-ts-mode defcustoms
* lisp/progmodes/lua-ts-mode.el (lua-ts-mode-hook):
(lua-ts-indent-offset):
(lua-ts-luacheck-program):
(lua-ts-inferior-buffer):
(lua-ts-inferior-program):
(lua-ts-inferior-options):
(lua-ts-inferior-startfile):
(lua-ts-inferior-prompt):
(lua-ts-inferior-prompt-continue):
(lua-ts-inferior-history):
(lua-ts-indent-continuation-lines): Remove :group.  (bug#69910)
2024-03-23 09:24:18 +02:00
john muhl
d3ca7c68c7 ; Open inferior Lua buffer in a window, not a frame
* lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua): Replace
'display-buffer-pop-up-window' with
'display-buffer-pop-up-frame'.  (bug#69909)
2024-03-23 09:23:21 +02:00
Stefan Monnier
7e32e8392a Fix recent test regressions
* lisp/emacs-lisp/pp.el (pp-fill): Don't cut between `#` and `(`.

* test/lisp/help-fns-tests.el (help-fns-test-built-in)
(help-fns-test-interactive-built-in, help-fns-test-lisp-defun)
(help-fns-test-lisp-defsubst):
* test/src/emacs-module-tests.el (module/describe-function-1):
Adjust tests to new wording in `describe-function`.
2024-03-22 18:44:54 -04:00
Stefan Monnier
3197d7015b etc/NEWS: Document the new behavior of describe-function
I pushed commit accd79c939 by accident.
Related to bug#69935
2024-03-22 17:03:15 -04:00
Stefan Monnier
7269a2f158 (pp-fill): Cut before parens and dots
The `pp-fill` code sometimes end up generating things like:

    (foo .
         bar)

instead of

    (foo
     .  bar)

so make sure we cut before rather than after the dot (and open
parens while we're at it).

* lisp/emacs-lisp/pp.el (pp-fill): Cut before parens and dots.

* test/lisp/emacs-lisp/pp-tests.el (pp-tests--dimensions): New function.
(pp-tests--cut-before): New test.
2024-03-22 16:46:28 -04:00
Stefan Monnier
accd79c939 (help-fns-function-description-header): Print functions' type
Instead of choosing English words to describe the kind of function,
use the actual type of the function object (from `cl-type-of`)
directly, and make it a button to display info about that type.

* lisp/help-fns.el (help-fns-function-description-header): Use the
function's type name in the description instead of "prose".
Use `insert` instead of `princ`, so as to preserve the text-properties
of the button.

* lisp/emacs-lisp/cl-extra.el (cl-help-type): Move to `help-mode.el`
and rename to `help-type`.
(cl--describe-class): Adjust accordingly.

* lisp/help-mode.el (help-type): New type, moved and renamed from
`cl-extra.el`.
2024-03-22 08:47:13 -04:00
Eli Zaretskii
c1530a2e49 ; * lisp/help-fns.el (help-fns-function-name): Doc fix. 2024-03-22 09:54:37 +02:00
Po Lu
0c321ddbd3 Fix display of custom menus after putative cosmetic change
* lisp/wid-edit.el (widget-setup): Restore version from before
the previous commit.
2024-03-22 15:24:28 +08:00
Stefan Monnier
60c9702972 * lisp/help.el (help--analyze-key): Use help-fns-function-name 2024-03-21 21:44:04 -04:00
Stefan Monnier
a1f8702e83 (help-fns-function-name): New function
Consolidate code used in profiler and help--describe-command,
and improve it while we're at it.
Also use #' to quote a few function names along the way.

* lisp/help-fns.el (help-fns--function-numbers, help-fns--function-names):
New vars.
(help-fns--display-function): New aux function.
(help-fns-function-name): New function, inspired from
`help--describe-command`.

* lisp/help.el (help--describe-command): Use `help-fns-function-name`.
(help--for-help-make-sections): Remove redundant "" arg to `mapconcat`.

* lisp/profiler.el (profiler-format-entry, profiler-fixup-entry):
Delete functions.
(profiler-report-make-entry-part): Use `help-fns-function-name` instead.
(profiler-report-find-entry): Use `push-button`.

* lisp/transient.el (transient--debug): Use `help-fns-function-name`
when available.
2024-03-21 19:40:20 -04:00
Stefan Monnier
946280365d (make-help-screen): Move most of the code out to a function
This avoids problems like variable-name capture and lets compiler messages
point to the actual source code.

* lisp/help-macro.el (help--help-screen): New function, extracted from
`make-help-screen`.
(make-help-screen): Use it.
2024-03-21 19:26:33 -04:00
Jonas Bernoulli
c214fc9626
Update to Transient v0.6.0-1-gcaef3347 2024-03-21 23:55:38 +01:00
Stefan Monnier
2000d6e0f2 (describe-symbol-backends): Fix addition of the "type" backend
That backend was added from `cl-extra.el` with no autoload, so
(describe-symbol `advice) failed to show the info about
the `advice` type unless `cl-extra.el` had been loaded beforehand.
`C-h o RET advice RET` worked by accident because the completion
table uses `cl-some` which is autoloaded from `cl-extra.el`.

* lisp/help-mode.el (describe-symbol-backends): Add the "type" backend.
* lisp/emacs-lisp/cl-extra.el (describe-symbol-backends): Don't add the
"type" backend here.
2024-03-21 18:27:03 -04:00
Stefan Monnier
05b8de54e3 byte-opt.el: Remove test that's not applicable any more
* lisp/emacs-lisp/byte-opt.el: Remove left-over test for ancient
byte-compiled representation.
2024-03-21 18:16:41 -04:00
Eli Zaretskii
e95a862226 ; * lisp/keymap.el (key-parse): Fix processing of "[TAB]". (Bug#69893) 2024-03-21 22:12:40 +02:00
Eli Zaretskii
afb7a23e7b ; Improve documentation of 'backup-by-copying'
* doc/emacs/files.texi (Backup Copying): Recommend
'backup-by-copying' for files on file-hosting services.  (Bug#69930)
2024-03-21 21:35:24 +02:00
Stefan Monnier
e819413e24 Speed up describe-char when a property has a large value
Doing `C-u C-x =` on a buffer position where the overlay/text
properties hold large values (e.g. inside the profiler report)
can be surprisingly slow because it pretty prints all those properties.
Change the code to do the pretty printing more lazily.
While at it, share that duplicated code between `descr-text.el` and
`wid-browse.el`.

* lisp/emacs-lisp/pp.el (pp-insert-short-sexp): New function.

* lisp/descr-text.el (describe-text-sexp): Delete function.
(describe-property-list): Use `pp-insert-short-sexp` instead.

* lisp/wid-browse.el (widget-browse-sexp): Use `pp-insert-short-sexp`
and `widget--allow-insertion`.
2024-03-21 12:28:54 -04:00
Stefan Monnier
129bc91a2c wid-edit.el: Cosmetic changes
* lisp/wid-edit.el: Use #' to quote function names.
(widget--simplify-menu, widget-echo-help): Explicitly specify the
lexenv to `eval`.
(widget-choose, widget-get-sibling, widget-setup, widget-field-find)
(widget-choice-action, widget-checklist-value-get)
(widget-radio-value-create, widget-radio-value-set)
(widget-radio-action, widget-editable-list-delete-at)
(widget-group-value-create, widget-choice-prompt-value): Use `dolist`.
(widget-convert): Hoist `(setq current` out of the ifs.
(widget-convert): Hoist `(setq keys` out of the if.
(widget-after-change): Hoist `(setq begin` out of the if.
(widget-default-completions): Use `cond`.
(widget-default-value-set): Hoist `goto-char` out of the if.
(widget-choice-action): Hoist `nth` out of the if.
(widget-checkbox-action): Hoist `widget-apply` out of the if.
(widget-editable-list-value-create): Hoist `car` out of the if.
(widget-editable-list-entry-create): Hoist `(setq child ...` out of the if.
(widget-documentation-link-action): Fold `if` into `cond`.
(widget-key-sequence-value-to-external): Use `key-parse`.
(widget-plist-convert-option, widget-alist-convert-option):
Hoist `(setq key-type` out of the if.
2024-03-21 12:08:02 -04:00
Stefan Monnier
3a902db97a (widget--allow-insertion): New macro
* lisp/wid-edit.el (widget--allow-insertion): New macro.
(widget-specify-insert, widget-insert, widget-setup)
(widget-default-delete, widget-editable-list-insert-before)
(widget-editable-list-delete-at): Use it.
2024-03-21 11:38:12 -04:00
Po Lu
5a09cc111f ; * src/xterm.c (syms_of_xterm): Document x-*-keysym's default values. 2024-03-21 20:45:48 +08:00
Andrea Corallo
51848e4731 * Fix missing `comp-files-queue' update (bug#63415).
* lisp/emacs-lisp/comp.el (native--compile-async): Update
`comp-files-queue' for real.
2024-03-21 12:02:33 +01:00
Adam Porter
393f58c85a 'vtable-update-object' can now be called with one argument
It's often necessary to update the representation of a single
object in a table (e.g a struct, whose identity does not change
when its slots'
values are changed).  To do so, now the function may be called
like this:

  (vtable-update-object table object)

Instead of like this:

  (vtable-update-object table object object)

This also documents the behavior of the just-discovered limitation filed
as bug#69837.
* lisp/emacs-lisp/vtable.el (vtable-update-object): Make 'old-object'
argument optional.  (Bug#69666)

* doc/misc/vtable.texi (Interface Functions): Update documentation.

* etc/NEWS: Add news entry.
2024-03-21 12:41:44 +02:00
Basil L. Contovounesios
689f04a2dd Clarify description of format-spec truncation
* doc/lispref/strings.texi (Custom Format Strings): Mention that
precision specifier affects both '<' and '>' truncation (bug#69822).
* lisp/format-spec.el (format-spec, format-spec--do-flags): Use same
terminology as 'format', especially when referring to its behavior.
2024-03-21 10:43:17 +01:00
Eli Zaretskii
759dedfab0 More accurate documentation of 'rmail-mail-new-frame'
* doc/emacs/rmail.texi (Rmail Reply): More accurate documentation
of the effects of 'rmail-mail-new-frame'.  (Bug#69738)
2024-03-21 10:55:59 +02:00
Eli Zaretskii
fe24a8c3c0 Speed up display of RTL text with many character compositions
* src/bidi.c (bidi_level_start): New function.
* src/dispextern.h (bidi_level_start): Add prototype.
* src/xdisp.c (compute_stop_pos, set_iterator_to_next)
(get_visually_first_element, next_element_from_buffer): Call
'bidi_level_start' when looking for composed characters backwards,
to set limit of searching back, instead of looking all the way to
BOB.  (Bug#69385)
2024-03-21 10:25:56 +02:00
Juri Linkov
fa79de7c6b ; * lisp/calendar/calendar.el: Remove extra space. 2024-03-21 09:49:34 +02:00
Adam Porter
b3f04eb684 Avoid recomputing the whole table in 'vtable--recompute-numerical'
Each element of LINE being tested is a list, the first element of
which is the value actually being represented in the table.
Previously, the 'numberp' test would always fail, because it was
being compared with the list rather than the intended value in it;
that could cause the whole table to be recomputed, sometimes
unnecessarily.
* lisp/emacs-lisp/vtable.el (vtable--recompute-numerical): Test the
car of ELEM, not ELEM itself, which is a list.  (Bug#69927)
2024-03-21 09:43:07 +02:00
Po Lu
ad0492c5a9 Android compatibility fixes
* doc/emacs/android.texi (Android Windowing): Document
restrictions on number of windows under Android 4.4 and earlier.

* java/AndroidManifest.xml.in <EmacsActivity>
<EmacsOpenActivity, EmacsMultitaskActivity>: Assign each class
of activity a unique task affinity.

* java/org/gnu/emacs/EmacsDesktopNotification.java (display1):
Remove redundant priority assignment.

* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Handle
file URIs when processing attachments from a mailto URI, and
check for KitKat before opening content ones.

* java/org/gnu/emacs/EmacsWindow.java <pointerMap>
(figureChange): Replace coordinate HashMap with a SparseArray.

* java/org/gnu/emacs/EmacsWindowAttachmentManager.java
(registerWindow): Don't specify FLAG_ACTIVITY_NEW_DOCUMENT on
systems where it is absent.
2024-03-21 14:23:40 +08:00
Andrea Corallo
0df28dc00e ; * lisp/emacs-lisp/comp-run.el (comp-run-async-workers): Fix indentation. 2024-03-20 16:59:33 +01:00
Eli Zaretskii
ae9d8eedfd ; Minor copyedits of last change. 2024-03-20 16:08:15 +02:00
Andrea Corallo
e2fec514fd ; * lisp/emacs-lisp/comp.el: Add a simple sanitizer usage example. 2024-03-20 14:55:44 +01:00
Eli Zaretskii
7f6e335f4b Fix documentation of M-SPC in user manual
* doc/emacs/killing.texi (Deletion): Fix documentation of
'cycle-spacing'.  (Bug#69905)
2024-03-20 14:45:24 +02:00
Eli Zaretskii
1475e3c3b5 ; Fix doc strings of recent changes
* src/comp.c (syms_of_comp) <comp-sanitizer-active>:
* lisp/emacs-lisp/comp.el (comp-sanitizer-emit): Doc fixes.
2024-03-20 14:27:25 +02:00
Andrea Corallo
e8d2bc7531 ; * lisp/emacs-lisp/comp-cstr.el (comp--normalize-typeset0): Fix comment. 2024-03-20 12:01:10 +01:00
Andrea Corallo
0b0c7da8c8 Add native compiler sanitizer
* src/comp.c (ABI_VERSION): Bump new version.
(CALL0I): Uncomment.
(helper_link_table, declare_runtime_imported_funcs): Add
'helper_sanitizer_assert'.
(Fcomp__init_ctxt): Register emitter for
'helper_sanitizer_assert'.
(helper_sanitizer_assert): New function.
(syms_of_comp): 'helper_sanitizer_assert' defsym.
(syms_of_comp): 'comp-sanitizer-error' define error.
(syms_of_comp): 'comp-sanitizer-active' defvar.

* lisp/emacs-lisp/comp.el (comp-passes): Add 'comp--sanitizer'.
(comp-sanitizer-emit): Define var.
(comp--sanitizer): Define function.

* lisp/emacs-lisp/comp-run.el (comp-run-async-workers): Forward
'comp-sanitizer-emit'.
2024-03-20 09:51:10 +01:00
Robert Pluim
5bdc2436c6 ; * lisp/emacs-lisp/cl-macs.el (cl-labels): Fix stray diff marker. 2024-03-20 09:37:09 +01:00
Po Lu
e72f17e462 Respect file display names during Android drag-and-drop
* java/org/gnu/emacs/EmacsService.java (buildContentName):
Remove redundant projection argument to resolver.query.

* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): If a
content resolver is available, attempt to convert content URIs
into file names in advance.

* lisp/term/android-win.el (android-handle-dnd-event): Adjust
correspondingly.
2024-03-20 10:23:42 +08:00