1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

170456 commits

Author SHA1 Message Date
Eli Zaretskii
79a150ffa4 Merge from origin/emacs-29
d58d0fa52f Introduce 'let' using lexical binding in the Lisp Introdu...
1b12397263 ; Don't record multiple versions of use-package
8729a2a10d Fix 'rmail-summary-by-thread'
2a8c00bfc0 * doc/emacs/back.texi: Fix a typo.
2024-01-13 05:36:15 -05:00
Lars Brinkhoff
740953d1a2 Fix 'what-page'
* lisp/textmodes/page.el (page--what-page): Adjust for 1st
line on page, and use 'count-lines' again.  (Bug#68215)

* test/lisp/textmodes/page-tests.el (page-tests-what-page):
Update test.
2024-01-13 12:07:34 +02:00
Steven Allen
9b8b352ebc Set the 'name' prop in 'define-advice'
In addition to naming the advice function `symbol@name', set
the 'name' property to NAME.
* lisp/emacs-lisp/nadvice.el (define-advice): set the 'name'
property to NAME (requested in Bug#68114).  Fixes Bug#68294.

* doc/lispref/functions.texi (Advising Named Functions): Document
that 'define-advice' installs the advice with the specified name.
2024-01-13 11:43:01 +02:00
kobarity
f2cc8ee2a1 Fix 'python-info-docstring-p' bug in the 2nd line of a buffer
* lisp/progmodes/python.el (python-info-docstring-p): Add
'looking-at-p' check when bobp.
* test/lisp/progmodes/python-tests.el (python-font-lock-operator-1)
(python-font-lock-operator-2): Restoration of ERTs deleted by
mistake.
(python-font-lock-escape-sequence-bytes-newline)
(python-font-lock-escape-sequence-hex-octal)
(python-font-lock-escape-sequence-unicode)
(python-font-lock-raw-escape-sequence): Change 'font-lock-doc-face'
to 'font-lock-string-face' and remove :expected-result :failed.
(python-info-docstring-p-8): New test.  (Bug#68284)
2024-01-13 11:33:19 +02:00
Stefan Kangas
893829021b Fix NULL dereference in w32notify.c
* src/w32notify.c (start_watching): Return NULL instead of freed
pointer.
(add_watch): Fix NULL dereference.
2024-01-13 10:21:41 +01:00
Stefan Kangas
1bfc7fd33d Prefer AREF in GET_TRANSLATION_TABLE
* src/ccl.c (GET_TRANSLATION_TABLE): Prefer using AREF to depending on
vector internals.
2024-01-13 10:18:03 +01:00
Eli Zaretskii
ec16b69e7f * src/fns.c (maybe_resize_hash_table): Fix EMACS_INT format specifier. 2024-01-13 08:30:50 +02:00
Po Lu
4edb77132d Properly sort results for partial font specs
* src/sfntfont.c (sfntfont_compare_font_entities): New function.
(sfntfont_list): Sort matching font entities by the number of
fields set, and mention why.
2024-01-13 09:51:59 +08:00
Mattias Engdegård
8b7a6d7b6d ; * src/lisp.h (struct Lisp_Hash_Table): Add ASCII art. 2024-01-12 18:03:05 +01:00
Mattias Engdegård
4b7985db11 ; * src/fns.c (Fmake_hash_table): ensure test is a bare symbol 2024-01-12 18:03:05 +01:00
Mattias Engdegård
29e3d1c56f Abstract predicate and constant for unused hash keys
Qunbound is used for many things; using a predicate and constant for
the specific purpose of unused hash entry keys allows us to locate
them and make changes much more easily.

* src/lisp.h (HASH_UNUSED_ENTRY_KEY, hash_unused_entry_key_p):
New constant and function.
* src/comp.c (compile_function, Fcomp__compile_ctxt_to_file):
* src/composite.c (composition_gstring_cache_clear_font):
* src/emacs-module.c (module_global_reference_p):
* src/fns.c (make_hash_table, maybe_resize_hash_table, hash_put)
(hash_remove_from_table, hash_clear, sweep_weak_table, Fmaphash):
* src/json.c (lisp_to_json_nonscalar_1):
* src/minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
* src/print.c (print, print_object):
Use them.
2024-01-12 18:03:02 +01:00
Mattias Engdegård
484e04efa4 ; * src/alloc.c (purecopy_hash_table): Simplify
Copy the entire struct, then take care of fields needing special
treatment.
2024-01-12 18:02:15 +01:00
Mattias Engdegård
43127e5ec1 Refactor hash table vector reallocation
* src/fns.c (larger_vecalloc): Remove.
(larger_vector): Simplify.
(alloc_larger_vector): New.
(maybe_resize_hash_table): Use alloc_larger_vector as a simpler and
faster replacement for larger_vecalloc.
2024-01-12 18:02:15 +01:00
Mattias Engdegård
462b3e6ae4 Refactor: extract hash and index computations to functions
* src/lisp.h (hash_from_key):
* src/fns.c (hash_index_index): New.
(hash_table_rehash, hash_lookup, hash_remove_from_table):
(maybe_resize_hash_table, hash_put):
* src/composite.c (composition_gstring_put_cache): Use them.
2024-01-12 18:02:15 +01:00
Mattias Engdegård
0bc13945ac ; * src/fns.c (collect_interval): Move misplaced function. 2024-01-12 18:02:14 +01:00
Mattias Engdegård
3da324fbd3 Refactor: less layering violation in composite.h
Avoid using hash table internals directly.

* src/composite.h (COMPOSITION_KEY): New.
(COMPOSITION_GLYPH, COMPOSITION_RULE): Use COMPOSITION_KEY.
2024-01-12 18:02:14 +01:00
Mattias Engdegård
22201dde77 Decouple profiler from Lisp hash table internals
The profiler stored data being collected in Lisp hash tables but
relied heavily on their exact internal representation, which made it
difficult and error-prone to change the hash table implementation.

In particular, the profiler has special run-time requirements that are
not easily met using standard Lisp data structures: accesses and
updates are made from async signal handlers in almost any messy
context you can think of and are therefore very constrained in what
they can do.

The new profiler tables are designed specifically for their purpose
and are more efficient and, by not being coupled to Lisp hash tables,
easier to keep safe.

The old profiler morphed internal hash tables to ones usable from Lisp
and thereby made them impossible to use internally; now export_log
just makes new hash table objects for Lisp.  The Lisp part of the
profiler remains entirely unchanged.

* src/alloc.c (garbage_collect): Mark profiler tables.
* src/eval.c (get_backtrace): Fill an array of Lisp values instead of
a Lisp vector.
* src/profiler.c (log_t): No longer a Lisp hash table but a custom
data structure: a fully associative fixed-sized cache that maps
fixed-size arrays of Lisp objects to counts.
(make_log): Build new struct.
(mark_log, free_log, get_log_count, set_log_count, get_key_vector)
(log_hash_index, remove_log_entry, trace_equal, trace_hash)
(make_profiler_log, free_profiler_log, mark_profiler): New.
(cmpfn_profiler, hashtest_profiler, hashfn_profiler)
(syms_of_profiler_for_pdumper): Remove.
(approximate_median, evict_lower_half, record_backtrace, export_log)
(Fprofiler_cpu_log, Fprofiler_memory_log, syms_of_profiler):
Adapt to the new data structure.
2024-01-12 18:02:14 +01:00
Mattias Engdegård
8acd89e955 ; * src/pdumper.c (dump_hash_table): Remove unused argument. 2024-01-12 18:02:14 +01:00
Mattias Engdegård
228e900018 Add internal hash-table debug functions
These are useful for measuring hashing and collisions.

* src/fns.c (Finternal__hash_table_histogram)
(Finternal__hash_table_buckets, Finternal__hash_table_index_size):
New.
2024-01-12 18:02:14 +01:00
Michael Albinus
10cfbda884 * src/nsfont.m (nsfont_open): Fix Ffont_xlfd_name args. 2024-01-12 16:19:42 +01:00
Stefan Monnier
eac3f2a807 sh-script.el: Add support for case FOO {...} (bug#55764)
* lisp/progmodes/sh-script.el (sh-font-lock-paren): Also recognize
`FOO)` after `{`.
(sh-smie-sh-rules): Make `for` rule apply to `case FOO { ...}` as well.

* test/manual/indent/shell.sh: Add new test case.
2024-01-11 22:12:34 -05:00
Slava Akhmechet
bfb486d802 Eglot: Simplify overlay handling in manual example
* doc/misc/eglot.texi (Extending Eglot): Simplify.

Copyright-paperwork-exempt: yes
2024-01-11 15:50:08 -06:00
Alyssa Ross
e4e89e2cb6 Add autoload cookie to vc-git-grep
* lisp/vc/vc-git.el (vc-git-grep): Add autoload cookie.  (Bug#67018)
2024-01-11 22:16:31 +01:00
john muhl
a66069c50c Support indented continuation lines in lua-ts-mode
* lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules):
Add a rule to indent multi-line assignments and if statements.
(lua-ts-indent-continuation-lines): New user option.
* test/lisp/progmodes/lua-ts-mode-resources/indent.erts: Add
tests.  (Bug#68279)
2024-01-11 21:51:23 +01:00
Alan Mackenzie
07bb8dc0af Bind cross-buffer buffer-local variable correctly.
This fixes bug#68200.

* lisp/emacs-lisp/bytecomp.el (byte-compile-output-docform):
Note that let-binding a buffer local variable leaves it buffer
local, hence to transfer the binding of
byte-compile-dynamic-docstrings to the output buffer, an
intermediate variable is needed.  Implement this.
2024-01-11 17:54:47 +00:00
Eli Zaretskii
fbc4a3c7de Fix man-tests.el
* test/lisp/man-tests.el (man-tests-Man-translate-references): Fix
test for MS-Windows and MS-DOS.
2024-01-11 17:27:04 +02:00
Stephen Berman
aa26852f31 Revert "Fix typo in lispref 'Creating Strings' section"
This reverts commit b825962ea8
which was mistakenly installed in master instead of emacs-29.
2024-01-11 15:12:00 +01:00
Xiyue Deng
b825962ea8 Fix typo in lispref "Creating Strings" section
* doc/lispref/strings.texi (String Basics): Fix typo.
2024-01-11 14:41:41 +01:00
Michael Albinus
5df57f1792 Adapt test names in auth-source-tests.el
* test/lisp/auth-source-tests.el (auth-source-test-netrc-credentials)
(auth-source-test-netrc-credentials-2)
(auth-source-test-macos-keychain-search): Adapt test names.
2024-01-11 12:45:03 +01:00
Michael Albinus
ef08f94cbe Support numeric port numbers in auth-source-macos-keychain
* lisp/auth-source.el (auth-source-macos-keychain-search):
Support numeric port numbers (bug#68376).
(auth-source-macos-keychain-search-items): Make regexp more robust.

* test/lisp/auth-source-tests.el (test-macos-keychain-search):
Extend test.
2024-01-11 12:30:05 +01:00
Jared Finder
c7aa5c6d2b Populate tool-bar bindings on text terminals
* lisp/tool-bar.el (tool-bar-make-keymap-1): Populate on text
terminals.  (Bug#68334)
2024-01-11 12:49:27 +02:00
Gabriel do Nascimento Ribeiro
dc1f18e9d0 Consider outline-heading-end-regexp in outline-font-lock-keywords
* lisp/outline.el (outline-font-lock-keywords): Add
outline-heading-end-regexp to regexp (bug#66166).
2024-01-11 09:11:18 +02:00
F. Jason Park
cfa64bdc84 ; Fix overridden erc--input-split slot definition
* lisp/erc/erc-common.el (erc--input-split): Don't set the
default value to `:read-only'.

* test/lisp/erc/erc-tests.el (erc--channel-modes,
erc--channel-modes/graphic-p): Use `char-displayable-p' instead of
`display-graphic-p' to prevent the first test from failing on Unicode
terminal emulators.
2024-01-10 21:01:08 -08:00
Dmitry Gutov
c7c143b019 ; (vc-print-log-internal): Update docstring further 2024-01-11 01:24:17 +02:00
Dmitry Gutov
1ecb53ad2f vc-log-mergebase: Fix the printing of buttons at the bottom
* lisp/vc/vc.el (vc-print-log-setup-buttons):
Fix when LIMIT is a string (bug#68364).
(vc-print-log-internal): Update docstring.
2024-01-11 01:21:41 +02:00
Stefan Kangas
6a645cd532 ; Clarify message in last change
* lisp/info.el (Info-goto-emacs-key-command-node): Clarify message in
last change.
2024-01-10 23:50:16 +01:00
Eshel Yaron
9eed00c8e5 Handle anonymous commands in C-h K
* lisp/info.el (Info-goto-emacs-key-command-node): Don't call
Info-goto-emacs-command-node for anonymous commands.  (Bug#61505)
2024-01-10 23:48:24 +01:00
Augusto Stoffel
c12166de38 Use auth-info-mode for non-hidden authinfo and netrc files
* files.el (auto-mode-alist): Match non-hidden authinfo and netrc
files, since it is reasonable to store passwords in
~/.emacs.d/authinfo.gpg or a similarly named file.  (Bug#66241)
2024-01-10 23:07:09 +01:00
john muhl
a0133f6345 Add Ruby to the tree-sitter build-module script
* admin/notes/tree-sitter/build-module/batch.sh (languages): Add
Ruby.  (Bug#65739)
2024-01-10 22:41:44 +01:00
Xi Lu
820f0793f0 Fix man.el shell injection vulnerability
* lisp/man.el (Man-translate-references): Fix shell injection
vulnerability.  (Bug#66390)
* test/lisp/man-tests.el (man-tests-Man-translate-references): New
test.
2024-01-10 22:16:24 +01:00
Stefan Kangas
093ecb2aca ; Clarify detail in Start Emacs maximized FAQ
* doc/misc/efaq.texi (Start Emacs maximized): Explain that the sexp
should be put at the top of the file.
2024-01-10 18:21:50 +01:00
Richard M. Stallman
c78e2f3412 Esplain how to turn off GDB display of inferior-events 2024-01-10 12:15:36 -05:00
Mattias Engdegård
d7d9bf1fe3 Lua compilation-mode rules adjustments (bug#60830)
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Translate `lua' and `lua-stack' to rx, and change two unnecessary
non-greedy operators to greedy.
2024-01-10 17:24:42 +01:00
Thierry Volpiatto
492ba5721c
Fix window setting in register preview (bug#67882)
and allow configuring it if needed.

* lisp/register.el (register-preview-display-buffer-alist): New user
  var.
(register-preview,register-preview-1): Use it.
2024-01-10 17:02:52 +01:00
Rudolf Adamkovič
cd0eb055fd Make Compilation mode recognize Lua errors
Emacs comes with built-in support for the Lua programming language in
the form of the Lua mode and now also the Lua Tree-sitter mode.  This
patch further improves Lua support in Emacs by making the Compilation
mode recognize Lua errors and stack traces.

* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Add regexps to aid Lua development, namely the 'lua' regexp that
matches Lua errors and the 'lua-stack' regexp that matches Lua stack
frames.  (Bug#60830)
* etc/compilation.txt (Lua): Add an example of a Lua error message
with a stack trace.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data):
(compile-test-error-regexps): Test the new 'lua' and 'lua-stack'
regexps added to the 'compilation-error-regexp-alist-alist'.
2024-01-10 14:48:00 +01:00
Stefan Kangas
3d41239524 Fix use after free in androidvfs.c
* src/androidvfs.c (android_afs_opendir, android_saf_tree_opendir):
Fix use after free.
2024-01-10 14:48:00 +01:00
Stefan Kangas
1a2fa8f413 Remove redundant casts from void* with malloc functions
* src/msdos.c (IT_menu_make_room):
* src/pgtkterm.c (pgtk_define_fringe_bitmap):
* src/w16select.c (set_clipboard_data):
* src/w32term.c (w32_define_fringe_bitmap):
* src/w32uniscribe.c (uniscribe_shape): Remove redundant cast from
void* with xrealloc.
* admin/coccinelle/alloc_cast.cocci: New semantic patch.
2024-01-10 14:48:00 +01:00
Michael Albinus
83ee584052 ; Adapt TODO list of tramp-compat.el 2024-01-10 12:49:46 +01:00
Michael Albinus
cf887b7eb0 Fix file name completion with Tramp on MS Windoes
* doc/misc/trampver.texi:
* lisp/net/trampver.el (tramp-version): Adapt Tramp versions.

* lisp/net/tramp.el (tramp-build-completion-file-name-regexp):
Do not use `tramp-volume-letter-regexp'.  (Bug#68320)
(tramp-completion-handle-expand-file-name): Simplify regexp.

* test/lisp/net/tramp-tests.el (tramp-test26-file-name-completion)
(tramp-test26-interactive-file-name-completion): Run also on MS Windows.
2024-01-10 12:49:08 +01:00
Philip Kaludercic
eb913c7501 Handle package versions that are not version strings
* lisp/emacs-lisp/package.el (package-menu--version-predicate): Ignore
any errors raised by 'version-to-list', thus falling back to the
default version list.  (Bug#68317)
2024-01-10 09:25:41 +01:00