1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-04 08:47:11 +00:00
Commit Graph

171054 Commits

Author SHA1 Message Date
Mattias Engdegård
3ea77c735d Use the new obarray type for the initial obarray
This can improve performance a lot, especially after the obarray has
been fed many symbols.

* src/lread.c (OBARRAY_SIZE): Remove.
(load_path_check): Create an obarray object instead of a vector.
2024-02-23 13:02:27 +01:00
Mattias Engdegård
462d8ba813 Add a proper type for obarrays
The new opaque type replaces the previous use of vectors for obarrays.
`obarray-make` now returns objects of this type.  Functions that take
obarrays continue to accept vectors for compatibility, now just using
their first slot to store an actual obarray object.

obarray-size and obarray-default-size now obsolete.

* lisp/obarray.el (obarray-default-size, obarray-size):
Declare obsolete.
(obarray-make, obarrayp, obarray-clear): Remove from here.
* src/fns.c (reduce_emacs_uint_to_hash_hash): Remove from here.
* src/lisp.h (struct Lisp_Obarray, OBARRAYP, XOBARRAY, CHECK_OBARRAY)
(make_lisp_obarray, obarray_size, check_obarray)
(obarray_iter_t, make_obarray_iter, obarray_iter_at_end)
(obarray_iter_step, obarray_iter_symbol, DOOBARRAY, knuth_hash): New.
(reduce_emacs_uint_to_hash_hash): Moved here.
* src/lread.c (check_obarray): Renamed and reworked as...
(checked_obarray_slow): ...this.
(intern_sym, Funintern, oblookup, map_obarray)
(Finternal__obarray_buckets): Adapt to new type.
(obarray_index, allocate_obarray, make_obarray, grow_obarray)
(obarray_default_bits, Fobarray_make, Fobarrayp, Fobarray_clear): New.
* etc/emacs_lldb.py (Lisp_Object):
* lisp/emacs-lisp/cl-macs.el (`(,type . ,pred)):
* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types):
* lisp/emacs-lisp/comp-common.el (comp-known-type-specifiers):
* lisp/emacs-lisp/comp.el (comp-known-predicates):
* src/alloc.c (cleanup_vector, process_mark_stack):
* src/data.c (Ftype_of, syms_of_data):
* src/minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
* src/pdumper.c (dump_obarray_buckets, dump_obarray, dump_vectorlike):
* src/print.c (print_vectorlike_unreadable):
* test/lisp/abbrev-tests.el (abbrev-make-abbrev-table-test):
* test/lisp/obarray-tests.el (obarrayp-test)
(obarrayp-unchecked-content-test, obarray-make-default-test)
(obarray-make-with-size-test):
Adapt to new type.
2024-02-23 13:02:27 +01:00
Mattias Engdegård
6a182658a5 Add obarray-clear and use it
* lisp/obarray.el (obarray-clear): New.
* lisp/abbrev.el (clear-abbrev-table):
* lisp/vc/vc.el (vc-clear-context): Use it instead of assuming the
obarray is a vector that can be 0-filled.
* test/lisp/obarray-tests.el (obarray-clear): New test.
2024-02-23 13:02:27 +01:00
Mattias Engdegård
3beaa3131e Use obarrayp, not vectorp, to detect obarrays
* lisp/abbrev.el (abbrev--active-tables):
* lisp/mail/mailabbrev.el (mail-abbrevs-setup, build-mail-abbrevs)
(define-mail-abbrev, mail-resolve-all-aliases)
(mail-abbrev-insert-alias):
* lisp/mail/rmail.el (rmail-resend):
* lisp/minibuffer.el (completion-table-with-context):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
(etags--xref-apropos-additional):
Use obarrayp as predicate for obarrays.
2024-02-23 13:02:27 +01:00
Mattias Engdegård
aa82fe9931 Use obarray-make instead of make-vector to create obarrays
This prepares for the introduction of an actual obarray type.

* lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-dynamic-map)
(semantic-lex-spp-dynamic-map-stack, semantic-lex-make-spp-table):
* lisp/cedet/semantic/lex.el (semantic-lex-make-keyword-table)
(semantic-lex-make-type-table):
* lisp/completion.el (cmpl-prefix-obarray, cmpl-obarray)
(clear-all-completions):
* lisp/emacs-lisp/checkdoc.el (checkdoc-defun-info):
* lisp/emacs-lisp/eldoc.el (eldoc-message-commands)
(eldoc-edit-message-commands):
* lisp/mail/mail-extr.el (mail-extr-all-top-level-domains):
* lisp/mail/rmailkwd.el (rmail-label-obarray):
* lisp/net/dns.el (dns-cache):
* lisp/net/eww.el (eww-suggested-uris):
* lisp/net/imap.el (imap-open, imap-mailbox-select-1)
(imap-message-copyuid-1, imap-message-appenduid-1):
* lisp/obsolete/pgg.el (pgg-passphrase-cache, pgg-pending-timers):
* lisp/play/cookie1.el (cookie-cache):
* lisp/progmodes/cc-defs.el (c-lang-constants, c-define-lang-constant):
* lisp/progmodes/cc-langs.el (c-keywords-obarray):
* lisp/vc/vc-hooks.el (vc-file-prop-obarray):
* test/lisp/obarray-tests.el (obarrayp-test):
* test/src/minibuf-tests.el (minibuf-tests--strings-to-obarray):
Use obarray-make instead of obarray-make.
2024-02-23 13:02:27 +01:00
Andrea Corallo
32843c7b36 * src/pdumper.c (dump_subr): Rename 'native_comp' -> 'non_primitive'. 2024-02-23 11:40:56 +01:00
Mattias Engdegård
6a53836a24 * src/fns.c (sxhash_bignum): Include sign bit in hash. 2024-02-23 11:26:45 +01:00
Mattias Engdegård
53e60fb004 * src/fns.c (hash_string): Suppress warning on 32-bit platforms
Remove a shift-too-wide complaint by GCC in code that is never reached
on platforms where that shift is too wide.
2024-02-23 11:09:49 +01:00
Mattias Engdegård
f85280503a Tone down python-mode warning to a simple message (bug#68559)
* lisp/progmodes/python.el
(python-shell-completion-native-turn-on-maybe):
There is no need for an alarming warning when using an inferior Python
without GNU readline; a calm message will do.
2024-02-23 11:09:31 +01:00
Po Lu
b868690fef Fix bug#69140
* src/window.c (grow_mini_window): Don't adjust frame matrices
or force redisplay if the provided window cannot be
resized.  (bug#69140)
2024-02-23 10:18:17 +08:00
Andrea Corallo
58ca91fe07 * Fix 'parse-colon-path' entry in 'comp-known-type-specifiers'
* lisp/emacs-lisp/comp-common.el (comp-known-type-specifiers): Fix
'parse-colon-path'.
2024-02-22 20:49:55 +01:00
Juri Linkov
cc58626f64 * lisp/help-fns.el (describe-mode-outline): New user option (bug#64684).
(describe-mode, describe-mode--minor-modes): Use 'describe-mode-outline'.

* lisp/help-mode.el (help-setup-xref): After disabling outline-minor-mode
also kill all outline-related local variables.  So that they won't affect
the output of other help commands in the same help buffer.
2024-02-22 19:38:17 +02:00
Jörg Bornemann
6b6761d534 Recognize functions and macros as defuns in 'cmake-ts-mode'
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--function-name):
Renamed to 'cmake-ts-mode--defun-name' since the function handles
now functions and macros.
(cmake-ts-mode--defun-name): Return text of the first 'argument'
node below 'function_def' and 'macro_def' nodes.
(cmake-ts-mode): Set up treesit-defun-type-regexp and
'treesit-defun-name-function'.  Change the imenu setup to
recognize macros too.  Since we have set up
'treesit-defun-name-function', we don't have to
pass 'cmake-ts-mode--function-name' anymore.  (Bug#69186)

To make `treesit-defun-at-point' work properly, we have to recognize
function_def/macro_def nodes, not the lower-level *_command nodes.
2024-02-22 15:02:20 +02:00
Po Lu
8e0f134653 ; Insert missing JNI prologues
* src/android.c (shouldForwardMultimediaButtons)
(shouldForwardCtrlSpace, notifyPixelsChanged, setupSystemThread):

* src/androidvfs.c (safSyncAndReadInput, safSync, safPostRequest)
(ftruncate): Insert absent JNI prologues.
2024-02-22 13:30:18 +08:00
Po Lu
ee6343556a ; * admin/CPP-DEFINES: Fix typos. 2024-02-22 10:21:12 +08:00
Po Lu
f024b63ecf ; * admin/CPP-DEFINES: Update with Android defines. 2024-02-22 10:08:12 +08:00
Po Lu
39a8423270 Enable inotify on systems with inotify_init yet no init1 variant
* configure.ac (HAVE_INOTIFY): Check for the presence of
inotify_init in addition to inotify_init1.

* src/inotify.c (Finotify_add_watch): Implement with
inotify_init if inotify_init1 is absent.
2024-02-22 09:53:48 +08:00
Andrea Corallo
b214cb2843 ; * lisp/emacs-lisp/comp-run.el: Fix typo. 2024-02-21 21:38:11 +01:00
Andrea Corallo
44d5c667d7 * lisp/emacs-lisp/comp.el (comp--compute-function-types): Fix missing doc. 2024-02-21 17:52:52 +01:00
Eshel Yaron
e6882a5cc8
; Fix mid-symbol updating/cycling completion preview
This fixes an issue where 'completion-preview-next-candidate'
would fail to take into account the part of the symbol that
follows point (the suffix) when point is at the middle of a
symbol, as well as a similar issue in 'completion-preview--show'
that would manifest with slow 'completion-at-point-functions'.

* lisp/completion-preview.el (completion-preview-next-candidate)
(completion-preview--show): Ensure that the completion preview
remains at the end of a symbol, when updating it while point is
in the middle of that symbol.

* test/lisp/completion-preview-tests.el
(completion-preview-mid-symbol-cycle): New test.  (Bug#68875)
2024-02-21 17:47:12 +01:00
john muhl
35d99b1ec7 ; Update URL of the tree-sitter-lua grammar
* admin/notes/tree-sitter/build-module/build.sh:
* lisp/progmodes/lua-ts-mode.el:
* test/infra/Dockerfile.emba: Use the new URL.  (bug#69304)
2024-02-21 18:45:46 +02:00
Andrea Corallo
88abbf00af ; Add two comments on comp-known-predicates cl-deftype-satisfies
* lisp/emacs-lisp/comp.el (comp-known-predicates): Add comment.
* lisp/emacs-lisp/cl-macs.el: Likewise.
2024-02-21 17:42:58 +01:00
Andrea Corallo
c65a59a9e9 * Add few missing entries in 'comp-known-predicates'
* lisp/emacs-lisp/comp.el (comp-known-predicates): Add framep, markerp,
number-or-marker-p, overlayp, processp, subrp and windowp and sort it
alphabetically.
2024-02-21 17:42:58 +01:00
Andrea Corallo
5aeea8dc2c * lisp/emacs-lisp/comp-cstr.el (comp-cstr): Rename constructors. 2024-02-21 17:42:58 +01:00
Andrea Corallo
1e1d3f3acd ; * lisp/emacs-lisp/comp.el (native-comp-debug): Fix spacing. 2024-02-21 17:42:58 +01:00
Andrea Corallo
7215c63fc0 * Make 'comp--compute-function-types' a pass
* lisp/emacs-lisp/comp.el (comp-passes): Add comp--compute-function-types.
(comp--compute-function-types): New function.
(comp--compute-function-type): Move it.
(comp--final): Update it.
2024-02-21 17:42:58 +01:00
Eli Zaretskii
8987e1b093 Remove redundant call to 'eln_load_path_final_clean_up'
* src/emacs.c (shut_down_emacs): Remove redundant call to
'eln_load_path_final_clean_up'.  We call it from 'kill-emacs'
right before the call to 'exit'.
2024-02-21 17:16:45 +02:00
Mattias Engdegård
a2eb123fb6 ; * src/lisp.h: Add Lisp_Object tagging scheme overview 2024-02-21 15:50:35 +01:00
kobarity
d575717846 Set tty mode to raw when setting up Inferior Python
* lisp/progmodes/python.el (python-shell-setup-code): New constant.
(python-shell-comint-watch-for-first-prompt-output-filter): Send
`python-shell-setup-code' to the Inferior Python process.
* test/lisp/progmodes/python-tests.el (python-ffap-module-path-1):
Eliminate skipping on Mac. (Bug#68559)
2024-02-21 15:23:59 +01:00
Po Lu
0a4d4781dd * java/org/gnu/emacs/EmacsContextMenu.java (display): Reduce timeout. 2024-02-21 21:55:48 +08:00
Stefan Monnier
3b34c5e4a5 * lisp/emacs-lisp/map.el (map--make-pcase-bindings): Fix use in Emacs<30 2024-02-21 08:49:15 -05:00
Po Lu
7b0d750188 Work around premature dismissals of submenus under Android
* java/org/gnu/emacs/EmacsContextMenu.java (display): If between
HONEYCOMB and N, set wasSubmenuSelected.
2024-02-21 11:49:47 +08:00
Jonas Bernoulli
1acc7cb851
Do not attempt to check declarations in lock files
* lisp/emacs-lisp/check-declare.el (check-declare-directory): Do
not attempt to check declarations in lock files.  (Bug#69084)
2024-02-20 22:49:07 +01:00
Jonas Bernoulli
167d9b9040 Allow trivially autoloading uses of transient's define macros
Since 49e41991b2 transient-define-prefix itself was autoloaded, but
that meant that when ever an autoload file was loaded, which contained
an autoload for a command defined using that macro, transient itself
had to be loaded.

That shouldn't be necessary.  For commands using these macros, an
autoload that is identical to what would have been generated if it
had been defined using defun, works just fine.

* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--make-autoload): Allow uses of
transient-define-prefix, transient-define-suffix,
transient-define-infix and transient-define-argument
to be autoloaded using just ";;;autoload".

* lisp/transient.el (transient-define-prefix): No longer autoload.
2024-02-20 22:04:51 +01:00
Andrea Corallo
bbf0b7d040 * Fix missing entry in 'cl--typeof-types'
* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add
'native-comp-unit'.
2024-02-20 19:52:37 +01:00
Jonas Bernoulli
d9afa1f30f
Make find-function-regexp also find transient-define-*
* lisp/emacs-lisp/find-func.el (find-function-regexp): Also find
transient-define-prefix, transient-define-suffix,
transient-define-infix and transient-define-argument.
2024-02-20 13:58:32 +01:00
Michael Albinus
d5775ae4d3 ; Copyedits 2024-02-20 12:53:15 +01:00
Michael Albinus
4e9993cada Add Tramp methods dockercp and podmancp
* doc/misc/tramp.texi (External methods):  Add dockercp and podmancp.

* etc/NEWS: Add Tramp methods "dockercp" and "podmancp".

* lisp/net/tramp.el (tramp-handle-make-process):
* lisp/net/tramp-adb.el (tramp-adb-maybe-open-connection):
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band)
(tramp-maybe-open-connection):
* lisp/net/tramp-sshfs.el (tramp-sshfs-handle-process-file)
(tramp-sshfs-maybe-open-connection):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-send-command): Adapt
`tramp-expand-args' calls.

* lisp/net/tramp-container.el (tramp-dockercp-method)
(tramp-podmancp-method): New defconst.
(tramp-methods) <dockercp, podmancp>: Add new methods.
(tramp-container--completion-function): Adapt docstring.  Use it
for "dockercp" and "podmancp" completion.

* lisp/net/tramp.el (tramp-get-remote-tmpdir):
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
* lisp/net/tramp-sh.el (tramp-maybe-open-connection): Use a default
value with `tramp-get-method-parameter'.

* lisp/net/tramp-sh.el (tramp-methods) <nc>: Add `tramp-copy-file-name'.
(tramp-default-copy-file-name): New defconst.
(tramp-make-copy-file-name): Rename from
`tramp-make-copy-program-file-name'.  Use method parameter
`tramp-copy-file-name'.  (Bug#69085)
(tramp-do-copy-or-rename-file-out-of-band): Adapt callees.

* lisp/net/tramp.el (tramp-methods): Adapt docstring.
(tramp-get-method-parameter, tramp-expand-args): New optional
argument DEFAULT.

* test/lisp/net/tramp-tests.el (tramp--test-container-p): Adapt.
(tramp--test-container-oob-p): New defun.
(tramp-test17-dired-with-wildcards, tramp-test35-remote-path)
(tramp-test41-special-characters): Use it.
(tramp--test-set-ert-test-documentation): Use `split-string'.
2024-02-20 12:52:40 +01:00
Eli Zaretskii
a1cbc4d810 ; * doc/misc/gnus.texi (Other modes): Fix last change. 2024-02-19 21:34:43 +02:00
Philip Kaludercic
6893106fe9 Allow attaching files at point using 'gnus-dired-attach'
* lisp/gnus/gnus-dired.el (gnus-dired-attach-at-end): Add option.
(gnus-dired-attach): Respect it.
* doc/misc/gnus.texi (Other modes): Document it.  (Bug#69141)
2024-02-19 19:54:25 +01:00
Mattias Engdegård
2379360077 Slight switch byte op speedup
* src/bytecode.c (exec_byte_code): Hoist symbols_with_pos_enabled check
from fast loop, and eliminate the initial index check.
2024-02-19 15:57:49 +01:00
Mattias Engdegård
188fe6bffa Replace XSET_HASH_TABLE with make_lisp_hash_table
* src/lisp.h (XSET_HASH_TABLE): Remove, replace with...
(make_lisp_hash_table): ...this.  All callers adapted.
2024-02-19 15:57:05 +01:00
Mattias Engdegård
ddfba511c1 Check shortdoc keywords and fix one mistake
* lisp/emacs-lisp/shortdoc.el (shortdoc--check)
(define-short-documentation-group): Check that used keywords exist.
* lisp/emacs-lisp/shortdoc.el (list): Fix a typo.
2024-02-19 15:57:05 +01:00
Eli Zaretskii
70dc170056 ; Further copyedits of doc/translations/README. 2024-02-19 15:19:54 +02:00
Jean-Christophe Helary
5d3ecd7358 ; Proofreading changes in doc/translations/README. 2024-02-19 15:14:19 +02:00
Ihor Radchenko
be8f3e68a8 * test/src/eval-tests.el (eval-tests/default-value): Add new test case.
Bug#66117
2024-02-19 15:12:42 +02:00
Yuan Fu
8f260bb93f
Don't update ranges for the whole buffer in treesit--pre-redisplay
* lisp/treesit.el (treesit--pre-redisplay): Only update two
screen-full of text around point.
2024-02-18 21:43:47 -08:00
Eric Abrahamsen
f6743099cc Back out part of commit db5e84af20
* lisp/gnus/gnus-agent.el (gnus-category-make-function-1): This code is
untested and was not meant to be part of the earlier commit.
2024-02-18 18:08:51 -08:00
Paul Eggert
4a8d3c5b75 Use -Wanalyzer-deref-before-check in GCC 14
* src/marker.c: Work around GCC bug 113253 only if GCC 13.
The GCC bug reportedly will be fixed in GCC 14.
2024-02-18 00:38:16 -08:00
Paul Eggert
659770fdf5 Do not ignore -Wanalyzer-allocation-size in GCC 14
* src/lisp.h (SAFE_ALLOCA_LISP_EXTRA): Use pragma to ignore the
warning only in GCC 13, as the GCC developers say GCC bug 109577
is fixed in GCC 14.
2024-02-18 00:38:15 -08:00