Commit graph

177925 commits

Author SHA1 Message Date
Stephen Gildea
01f4a0cb6c MH-E: set default-directory to HOME on entry
* lisp/mh-e/mh-e.el (mh-default-directory, mh-set-default-directory):
New variable (defaults to "~/"), new function to use it.
* lisp/mh-e/mh-folder.el (mh-rmail, mh-nmail): Call
mh-set-default-directory on entry to MH-E (closes: bug#77263).
2025-03-27 14:57:14 -07:00
Daniel Colascione
364c3dbc12 Help find-function find methods defined inside macros
* doc/lispref/functions.texi (Finding Definitions): Document the
expanded definition-finding extension mechanism.
* etc/NEWS: Briefly describe the new feature.
* lisp/emacs-lisp/cl-generic.el
(cl--generic-find-defgeneric-regexp): Use defconst now that we
no longer have purespace.
(cl--generic-search-method-make-form-matcher): New function.
* lisp/emacs-lisp/find-func.el (find-function-regexp-alist)
(find-function-search-for-symbol): Parse out the new
factory function.
(find-function--search-by-expanding-macros): Try using it when
searching for definitions by expanding macros.
2025-03-27 16:21:13 -04:00
Jimmy Aguilar Mena
59fd8c26be Add jump action to margin indicators in flymake
(flymake--indicator-overlay-spec): Receive type instead of prepossessed
indicator.
(flymake--resize-margins): Update reference call to
flymake--indicator-overlay-spec.
(flymake-show-buffer-diagnostics-at-event-line):
(flymake-diagnostics-at-mouse-event):
(flymake-show-buffer-diagnostics-at-event-position): New functions.
(flymake-after-show-buffer-diagnostics-hook): New custom with actions
when jumping to an error line.
(flymake-pulse-momentary-highlight-region):
(flymake-show-buffer-diagnostics): Receive new optional argument with
current diagnostic information.  Add code to jump and execute the new hook
after jumping (bug#75841).
2025-03-27 20:15:45 +02:00
Michael Albinus
37b8acf378 Handle better changed default-directory in shell-command
* lisp/simple.el (shell-command): Kill buffer-local values of
`shell-file-name' and `shell-command-switch', there could be left
connection-local values.  (Bug#76888)
2025-03-27 17:48:20 +01:00
Philipp Stephani
f22af15aef ; Reorder initialization of module environment functions.
* src/emacs-module.c (initialize_environment): Reorder assignments to
match declaration order in emacs-module.h.
2025-03-27 14:08:55 +01:00
Eli Zaretskii
97fc54c693 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2025-03-27 15:03:09 +02:00
Cecilio Pardo
33a46ff565 w32: fail gracefully when using invalid glyphs on DWrite
* src/w32dwrite.c (text_extents_internal): Return false instead
of crashing with bad glyph indexes.  (Bug#77196)
2025-03-27 15:01:53 +02:00
Stefan Monnier
0cbe17cdb6 lisp/help-fns.el (help-fns--signature): Pretty print type 2025-03-27 08:59:33 -04:00
Yue Yi
ba409f3712 peg.texi: Fix bug#76555 even a bit more
* doc/lispref/peg.texi (Parsing Expression Grammars):
Fix other part of the grammar of `define-peg-ruleset` example.
2025-03-27 08:59:33 -04:00
Yue Yi
1d7fe589fa peg.texi: Fix bug#76555 even a bit more
* doc/lispref/peg.texi (Parsing Expression Grammars):
Fix grammar of `define-peg-ruleset` example.
2025-03-27 08:59:32 -04:00
Stefan Monnier
1db7aaceb9 PEG: Fix bug#76555
* doc/lispref/peg.texi (Parsing Expression Grammars):
Fix `define-peg-ruleset` example.

* lisp/progmodes/peg.el (define-peg-rule): Fix indent rule.
2025-03-27 08:59:32 -04:00
Eli Zaretskii
a702f29a00 ; Fix package-version values
* lisp/textmodes/rst.el (rst-compile-toolsets):
* lisp/which-key.el (which-key-idle-delay): Fix package-version.
2025-03-27 13:52:22 +02:00
Eli Zaretskii
a1fbc51dc7 ; * lisp/which-key.el (which-key-idle-delay): Fix package-version. 2025-03-27 13:49:10 +02:00
Alan Mackenzie
555ec43a32 C++ Mode: Fix some indentation bugs. FIxes bug#19867
1. Fix closing paren aligning with trailing comment on line
with matching open paren.
2. Fix indentation of first identifier inside a comma separated
list aligning with the type rather than the subsequent
identifiers.
3. Fix lambda expressions inside a brace list aligning like a
single statement.

* lisp/progmodes/cc-align.el (c-lineup-arglist): Take into
account any preceding comments when lining up the arguments in
the arglist.
(c-lineup-arglist-intro-after-paren): Handle comments properly,
and don't line up the closing parenthesis with a trailing
comment on the first line.
(c-lineup-item-after-paren-at-boi): Also allow a paren to count
as being at BOI when it is preceded only by open parens on that
line.
(c-lineup-runin-statements, c-lineup-ObjC-method-call): Hanle
comments better.

* lisp/progmodes/cc-engine.el (c-forward-comments) Introduce an
optional limit parameter.  Use this limit in calls from
cc-align.el and cc-mode.el.
(c-just-after-func-arglist-p): Handle the presence of a
protection keyword such as "public".
(c-at-bracelist-p): Renamed from c-inside-bracelist-p, after
dropping the accept-in-paren parameter, having removed its
functionality.
(c-looking-at-statement-block-1): New function, based on the
old c-looking-at-statement-block.  Enhanced to handle C++
lambda expressions, and to return the symbol `maybe' when the
contents of a brace delimited block fail to determine whether
it is a statement block.
(c-looking-at-statement-block): Enhanced to examine the context
of a brace delimited block when the contents are ambiguous.
(c-looking-at-c++-lambda-expression): Check the character after
point is a < before calling c-forward-<>-arglist.
(c-add-stmt-syntax): Make the context more accurate by calling
c-looking-at-statement-block.
(c-guess-basic-syntax, CASE 5D.5): Replace the syntactic symbol
topmost-intro-cont with the new symbol class-field-cont,
additionally determining the position of the enclosing brace as
an extra anchor point.
(c-guess-basic-syntax, CASE 5V): New case for an identifier
following a type inside class braces.
(c-guess-basic-syntax, CASE 9): Use
c-looking-at-statement-block to detect a brace list more
accurately.

* lisp/progmodes/cc-fonts.el (c-get-fontification-context):
Rename the call to c-inside-bracelist-p to c-at-bracelist-p.

* lisp/progmodes/cc-langs.el (c-protection-kwds): Add an entry
for java-mode.
(c-stmt-block-only-keywords-regexp): Prevent this regexp also
matching a character preceding the keyword.

* /lisp/progmodes/cc-mode.el (c-before-change-include-<>)
(c-after-change-include-<>): Use the new limit argument to
c-forward-comments.

* lisp/progmodes/cc-styles.el (c-style-alist, "gnu" and "java"
styles): Change the offset for arglist-close to
c-lineup-arglist-close-under-paren.

* lisp/progmodes/cc-vars.el (c-offsets-alist): Introduce the
new syntactic symbol class-field-cont, giving it default
offset +.

* doc/misc/cc-mode.texi (Syntactic Symbols, Class Symbols):
Document the new syntactic symbol class-field-cont.
2025-03-27 10:24:48 +00:00
Juri Linkov
27c41d026f * lisp/treesit-x.el: Remove unnecessary treesit-generic-mode.
(treesit-generic-mode-list): Remove variable.
(define-treesit-generic-mode): Remove docstring text about hook
that is already added by 'define-derived-mode'.
(treesit-generic-mode): Remove command.
2025-03-27 09:33:45 +02:00
Gerd Möllmann
1883a5c717 Don't write to bottom-right cell on ttys with AutoWrap (bug#77233)
* src/term.c (tty_write_glyphs): Handle case of writing only one
character in the last column.
2025-03-27 06:10:46 +01:00
Stefan Kangas
c00170e92c Signal user-error in info--ensure-not-in-directory-node
* lisp/info.el (info--ensure-not-in-directory-node): Change from 'error'
to 'user-error' to reduce 'debug-on-error' frustration.
2025-03-26 21:39:18 +01:00
Eli Zaretskii
1e68351d56 Fix vertical cursor motion with wide images and line numbers
* src/xdisp.c (produce_image_glyph): When cropping an image that
exceeds the window's right edge, account for the screen estate
taken by line-number display.  (Bug#77217)
2025-03-26 19:04:16 +02:00
Po Lu
8f7790a95e ; Remove obsolete file `java/incrementing-version-code'. 2025-03-26 20:47:07 +08:00
Eli Zaretskii
3d5def2677 ; Fix OOM kill in ert-tests
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-run-tests-batch-expensive): Mark it 'unstable', as it
might run out of memory on GNU/Linux and on Windows.
2025-03-26 14:31:41 +02:00
Eli Zaretskii
f1715f6411 ; Fix 'ert-tests' on MS-Windows
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-run-tests-batch-expensive): Skip the test on MS-Windows.
2025-03-26 14:22:30 +02:00
Martin Rudalics
001359ce76 Further amendments of child frame handling and documentation
* src/frame.c (frame_subsumes_p): New static function
(delete_frame): On ttys refuse to delete a frame that could be
used as surrogate minibuffer frame by surviving frames.
(store_frame_param): Make sure 'minibuffer' parameter does not
reference a deleted window.  If on a tty it references a live
window, make sure its frame has the same root frame as the frame
where the parameter shall be installed.  Also on ttys make sure
that storing the 'parent-frame' parameter does not assign a
surrogate minibuffer frame a different root frame than that of
any of its client frames.  Further on ttys assert that making a
child a new root frame gives it the dimensions of the terminal.
(Fmouse_position_in_root_frame): Don't use XFRAME before
it's clear that FRAME is a frame.
* doc/lispref/elisp.texi (Top): Add menu for Child Frames section.
* doc/lispref/frames.texi (Buffer Parameters): Mention that
value 'child-frame' is not special for 'minibuffer' parameter on
text terminals.
(Visibility of Frames): Fix description of 'iconify-frame'.
(Raising and Lowering): 'minibuffer-auto-raise' is an option.
(Child Frames): Major rewrite using subsections.  Explain new
and deviant features on text terminals - menu bar access,
reparenting, deleting, visibility and minibuffer-only child
frames.
* etc/NEWS: Remove remark that child frames cannot be
arbitrarily reparented on ttys.
2025-03-26 09:04:49 +01:00
Philipp Stephani
2d278a0f2e Use numeric time zone suffix in ERT explainer.
This is more robust since the time zone name is system-dependent.

* lisp/emacs-lisp/ert.el (ert--explain-time-equal-p): Use numeric time
zone suffix.

* test/lisp/emacs-lisp/ert-tests.el (ert-test-explain-time-equal-p):
Adapt test.
2025-03-26 03:32:46 +01:00
Yue Yi
816a17a711 peg.texi: Fix bug#76555 even a bit more
* doc/lispref/peg.texi (Parsing Expression Grammars):
Fix other part of the grammar of `define-peg-ruleset` example.
2025-03-25 22:22:13 -04:00
Yue Yi
4d396138b4 peg.texi: Fix bug#76555 even a bit more
* doc/lispref/peg.texi (Parsing Expression Grammars):
Fix grammar of `define-peg-ruleset` example.
2025-03-25 22:20:56 -04:00
Stefan Monnier
fb4db5c1a7 PEG: Fix bug#76555
* doc/lispref/peg.texi (Parsing Expression Grammars):
Fix `define-peg-ruleset` example.

* lisp/progmodes/peg.el (define-peg-rule): Fix indent rule.
2025-03-25 22:17:32 -04:00
Stefan Kangas
9a07d64f5c ; Minor update in ack.texi
* doc/emacs/ack.texi (Acknowledgments): Mention eglot in entry for João
Távora.
2025-03-26 01:09:54 +01:00
Stefan Kangas
b3881ac443 ; Improve type specifier documentation
* doc/lispref/functions.texi (Declare Form): Clarify wording for
precision and consistency; note consequences of incorrect declarations.
* doc/lispref/objects.texi (Type Specifiers): Mention use by the native
compiler; tighten wording.
2025-03-25 23:44:01 +01:00
Michael Albinus
56248fad53 * test/lisp/gnus/message-tests.el (message-default-buffer-type): New test. 2025-03-25 19:48:06 +01:00
Stefan Monnier
ce0c1f4442 backtrace.el: Remove redundant put and :group
* lisp/emacs-lisp/backtrace.el: Remove redundant `:group` args.
Prefer # to quote function arguments.
(backtrace-mode): Remove redundant `put`.
2025-03-25 14:16:03 -04:00
Stefan Monnier
bb62e43563 bs.el: Janitorial work; most importantly use special-mode
* lisp/bs.el: Prefer # to quote function arguments.
(bs-mode-font-lock-keywords): Use backquote; quote face names; and use
a list of faces instead of two applications at the same spot.
(bs-sort-buffer-interns-are-last, bs-config--files-and-scratch)
(bs-configurations, bs--intern-show-never): Fix ^$-vs-\`\' confusion.
(bs-mode-map): Remove bindings made redundant by inheritance.
(bs--redisplay): Use `line-number-at-pos`.
(bs--goto-current-buffer): Use `regexp-opt`.
(bs-mode): Inherit from `special-mode`.
(bs--current-buffer, bs--up): Use `point-min`.
(bs--create-header-line): Remove redundant arg.
2025-03-25 14:06:32 -04:00
Stefan Monnier
bc2b815f09 bookmark.el: Cosmetic changes
* lisp/bookmark.el: Prefer # to quote function arguments.
(bookmark-watch-bookmark-file): Remove redundant `:group`.
(bookmark-bmenu-mode): Let `define-derived-mode` take care of
`mode-class` property.
2025-03-25 13:44:15 -04:00
Juri Linkov
050325da30 * lisp/treesit-x.el: New file.
* lisp/treesit.el (treesit--copy-queries): New function.
(treesit--install-language-grammar-1): Use it.

https://lists.gnu.org/archive/html/emacs-devel/2025-03/msg01312.html
2025-03-25 19:41:33 +02:00
Stefan Monnier
e67f03bf35 lisp/gnus/mm-encode.el (mm-default-buffer-type): Obey the mode hierarchy 2025-03-25 11:23:48 -04:00
Michael Albinus
a15534f32e * lisp/gnus/mm-encode.el (mm-default-buffer-type): Check `major-mode'. 2025-03-25 15:13:16 +01:00
Philipp Stephani
0b1102a704 Rename 'buffer-too-small' to 'memory-buffer-too-small'.
This clarifies that the error isn't talking about an editing buffer.

* src/emacs-module.c (module_memory_buffer_too_small): Rename from
'module_buffer_too_small'.
(module_copy_string_contents, module_extract_big_integer): Adapt
callers.
(syms_of_module): Rename symbol 'buffer-too-small' to
'memory-buffer-too-small'.
2025-03-25 14:24:04 +01:00
Eli Zaretskii
6a3e2b88d2 ; Improve documentation of "function types"
* doc/lispref/functions.texi (Declare Form):
* doc/lispref/objects.texi (Type Specifiers): Improve wording and
indexing.
2025-03-25 14:37:17 +02:00
Michael Albinus
2adc912d0e Use better attachment defaults for *diff* buffers
* lisp/gnus/mm-encode.el (mm-default-buffer-type): New defun.

* lisp/gnus/mml.el (mml-attach-buffer): Use it.
2025-03-25 11:45:29 +01:00
Michael Albinus
d6c7a77465 * test/infra/Dockerfile.emba (emacs-tree-sitter): Add gowork grammar. 2025-03-25 09:28:43 +01:00
James Cherti
40bf281c64 outline-move-subtree-down/up: Fix for non-nil outline-blank-line
* lisp/outline.el (outline-move-subtree-down):
Include blank line when outline-blank-line is t
(bug#77238).

Copyright-paperwork-exempt: yes
2025-03-25 09:45:37 +02:00
Stefan Monnier
7ec0ee742d (built-in-class--make): Take list of types rather than classes
Consolidate the conversion from types to classes into
`built-in-class--make` instead of duplicating it in ever caller.

* lisp/emacs-lisp/cl-preloaded.el (built-in-class--make): Take list of
types rather than classes.
(cl--define-built-in-type): Simplify accordingly.
2025-03-25 02:09:48 -04:00
Po Lu
c3492b969d ; * msdos/emacs.djl: Don't interfere with the order of other symbols. 2025-03-25 10:38:43 +08:00
Po Lu
49eab999f1 Fix the DJGPP build
* msdos/emacs.djl (.bss): Guarantee that lread.o is 8-byte
aligned.

* msdos/sed2v2.inp (ALIGNOF_INT, ALIGNOF_LONG)
(ALIGNOF_LONG_LONG): Correct typos.

* src/term.c (tty_free_frame_resources): Synchronize with
non-DOS variant.
2025-03-25 10:38:43 +08:00
Philipp Stephani
8efcdcab86 Mimic behavior of 'aref' when signalling out-of-range errors.
The convention used by 'aref' and friends is that for
'args-out-of-range', the error data is a list (SEQ INDEX).  Use the same
convention for the vector-related module functions.

* src/emacs-module.c (check_vec_index): Use vector and index as error
data.
2025-03-25 02:56:01 +01:00
Philipp Stephani
96a1a07fb1 Don't use 'args-out-of-range' error for too-small buffers.
'args-out-of-range' means that some index argument isn't valid for a
given sequence/range, which isn't the case here.  Instead, define a new
error symbol to mean "user-supplied buffer is too small."  Since we
never specified nor tested which error symbol was signalled in this
case, changing it shouldn't cause severe breakages.

* src/emacs-module.c (module_buffer_too_small): New helper function.
(module_copy_string_contents, module_extract_big_integer): Use it.
(syms_of_module): Define 'buffer-too-small' error symbol.
2025-03-25 02:54:08 +01:00
Philipp Stephani
8be7e98557 Add an ERT explainer for 'time-equal-p'.
* lisp/emacs-lisp/ert.el (ert--explain-time-equal-p): New explainer
function.

* test/lisp/emacs-lisp/ert-tests.el (ert-test-explain-time-equal-p): New
test.
2025-03-25 00:12:20 +01:00
Stefan Monnier
cf6d0b48d8 lisp/loadup.el (max-lisp-eval-depth): Bump up a bit
This is to accommodate the deep backquoted thingy in `cus-start.el`.
2025-03-24 17:31:35 -04:00
Stefan Monnier
f66c92a793 Expose some lambdas currently hidden in quoted data
* lisp/language/chinese.el ("Chinese-GB", "Chinese-BIG5")
("Chinese-CNS", "Chinese-EUC-TW", "Chinese-GBK"):
* lisp/isearch.el (isearch-menu-bar-map):
* lisp/international/mule-cmds.el (language-info-custom-alist):
* lisp/font-lock.el (cpp-font-lock-keywords):
* lisp/cus-start.el (<toplevel>): Expose lambda-expressions to the compiler.
2025-03-24 17:14:26 -04:00
Stefan Monnier
c26862a6c9 (byte-compile-maybe-guarded): Make its code edebuggable
* lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function): Hoist
subexpression out of `if`.
(byte-compile-variadic-numeric, byte-compile--cond-vars)
(byte-compile--cond-switch-prefix, byte-compile-file-form-defalias):
Obey `lexical-binding` when evaluating the code we're compiling.
(byte-compile--maybe-guarded): New function, extracted from
`byte-compile-maybe-guarded`.
(byte-compile-maybe-guarded): Use it so we can edebug the code.
2025-03-24 17:12:16 -04:00
Stefan Monnier
e343055f63 (buffer-local-set-state): Optimize away unused data
* lisp/subr.el (buffer-local-set-state--get): Simplify by making it
take only the vars rather than the pairs.
(buffer-local-set-state): Adjust accordingly so we don't needlessly keep
part of the source code in the compiled code.
2025-03-24 17:08:26 -04:00