1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-16 03:43:50 -07:00
Commit graph

6241 commits

Author SHA1 Message Date
Stefan Monnier
e2004eb56f Merge remote-tracking branch 'origin/scratch/error-API' 2026-03-15 17:17:21 -04:00
Sean Whitton
e770ddb5e8 ; Tweak documentation for ensure-proper-list. 2026-03-15 20:27:41 +00:00
Eshel Yaron
3921af5e5e
; Minor doc improvements for 'let-alist'.
* doc/lispref/lists.texi:
* lisp/emacs-lisp/let-alist.el (let-alist): Improve docs.
Namely, clarify that 'let-alist' does not "see" symbols
introduced by macro-expansion in its body, and that the
generated code looks up symbols in the alist whether or not
they are actually used in runtime.

See also bug#79706 for some relevant discussion.
2026-03-15 13:15:36 +01:00
Philip Kaludercic
55f0f2056c
Add new function 'ensure-proper-list' (bug#80598)
* doc/lispref/lists.texi (Building Lists): Document it.
* etc/NEWS: Mention it.
* lisp/emacs-lisp/shortdoc.el (list): Demonstrate it.
* lisp/subr.el (ensure-proper-list): Add it.
2026-03-15 10:52:01 +01:00
Stefan Monnier
fa6f2cb63c (error-data): Delete function
Remove `error-data` from the new error API: it is not really
compatible with a more abstract view of error descriptors, and
in practice it seems to be used only in two ways (both of them rare):

- To add some contextual info to an error.  We should maybe add
  a dedicated support for that, but it's not clear what shape it
  should take, ideally (there was a discussion about with Alan
  and myself in emacs-devel a few years ago).
- To do some other massaging whose correctness is dubious anyway.

* doc/lispref/control.texi (Handling Errors): Remove `error-data`.

* lisp/epa-file.el (epa-file--find-file-not-found-function): Don't use
`error-data`.
(epa-file--error-add-context): New function, extracted from
`epa-file-insert-file-contents`.
(epa-file-insert-file-contents): Use it instead of `error-data`.

* lisp/subr.el (error-data): Delete function.
2026-03-10 10:48:22 -04:00
Stefan Monnier
a1358530f5 Improve the error API
Define new functions to manipulate error descriptors and
add support for `signal` to *re*signal a previous error.

 * src/eval.c (Fsignal): Make the second arg optional and document
the possibility of passing a whole error descriptor to re-signal it.
(signal_or_quit): Fix a few corner case issues when
DATA is `nil` and ERROR_SYMBOL is an error descriptor.

* lisp/subr.el (error-type-p, error--p, error-type, error-data)
(error-has-type-p, error-slot-value): New function.

* doc/lispref/control.texi (Handling Errors): Prefer "error descriptor"
to "error description".  Use the new single-arg call to `signal` to
re-throw an error.
Document `error-type`, `error-data` and `error-slot-value`.
(Error Symbols): Document the new functions `error-type-p` and
`error-has-type-p`.
2026-03-10 10:48:10 -04:00
Sean Whitton
39abb7ec8f ; Move unfill-paragraph to fill.el. Document it in (elisp)Filling. 2026-03-05 15:48:03 +00:00
Sean Whitton
a54e10baeb ; * doc/lispref/control.texi (Conditionals): Improve explanation. 2026-03-05 13:31:10 +00:00
Stéphane Marks
192d4fc1f7 Make 'frame-use-time' more reliable. (bug#80397)
Walking the window tree is more reliable than using the selected
window.  Implement 'get-mru-frame' on top of 'get-mru-frames'
using 'frame-use-time'.

* lisp/frame.el (frame-use-time): Change to walk the window tree
for the specified frame.
(get-mru-frames): New defun.
(get-mru-frame): Change to call 'get-mru-frames'.
* doc/lispref/frames.texi: Update documentation.
* etc/NEWS: Update announcement.
2026-03-05 09:58:03 +01:00
Sean Whitton
7d63d267f2 Rename 'any' to 'member-if' and deprecate 'cl-member-if'
* lisp/subr.el (any): Rename from this ...
(member-if): ... to this.  All uses changed.
(any): New function alias.
* lisp/emacs-lisp/cl-seq.el (cl-member-if): Mark obsolete.
* lisp/obsolete/cl.el (member-if): Delete obsolete function
alias.
* doc/lispref/lists.texi (List Elements):
* doc/misc/cl.texi (Lists as Sets):
* etc/NEWS: Document the change.
2026-03-04 14:43:05 +00:00
Mattias Engdegård
7eba545a4e Revert "Rename 'any' to 'member-if' and deprecate 'cl-member-if'"
This reverts commit 2bdf15f6d8.

There is no consensus for this change.
2026-03-03 17:21:35 +01:00
Sean Whitton
9563101c47 ; * doc/lispref/control.texi (Conditionals): Improve example. 2026-03-03 14:02:49 +00:00
Sean Whitton
2bdf15f6d8 Rename 'any' to 'member-if' and deprecate 'cl-member-if'
* lisp/subr.el (any): Rename from this ...
(member-if): ... to this.  All uses changed.
Implement '&key KEY-FN' for backwards compatibility.
(any): New function alias.
* lisp/emacs-lisp/cl-seq.el (cl-member-if): Make an alias for
'member-if'.
* lisp/obsolete/cl.el (member-if): Delete obsolete function
alias.
* doc/lispref/lists.texi (List Elements):
* doc/misc/cl.texi (Lists as Sets):
* etc/NEWS: Document the change.
2026-03-03 13:57:07 +00:00
Eli Zaretskii
73a2a5cd05 ; Fix documentation of recent changes in treesit.el
* etc/NEWS:
* doc/lispref/parsing.texi (User-defined Things): Fix punctuation,
markup and typos.
2026-03-03 15:21:12 +02:00
Sean Whitton
1fb515e79f ; Suggest not using if-let* and friends to bind never-nil values. 2026-03-03 12:58:08 +00:00
Yuan Fu
18c24866af
Make tree-sitter thing navigation handle nested parsers
Not a bug report, but this is from the emacs-devel thread
"Tree-sitter: Transcendental things".

Improve tree-sitter thing navigation functions to handle the
case where there are multiple nested parsers in the
buffer. Previously these functions just grab the node at point
and are limited to the parser of that node.  Now these functions
will thoUrouly search through all parsers that covers point
before giving up.

* doc/lispref/parsing.texi: Mention the change.
* lisp/treesit.el (treesit--some): New macro.
(treesit--thing-sibling): Use the new macro, add a new PARSER
parameter.
(treesit-thing-prev):
(treesit-thing-next): Add PARSER parameter.
(treesit-thing-at):
(treesit-navigate-thing): Use the new macro, add a new PARSER
parameter.  Also pass the PARSER arg to recursive calls and
calls to treesit-thing-prev, etc.
2026-03-02 23:59:46 -08:00
Paul Eggert
aed1c8b536 Don’t stuff keyboard input uselessly
Also, document stuffing better.
* src/keyboard.c (stuff_buffered_input):
Give up on stuffing if it fails.
* src/sysdep.c (stuff_char): Return failure indication.
2026-02-28 09:09:22 -08:00
Mattias Engdegård
a3411c8b86 Correct manual entry for string-lessp
* doc/lispref/strings.texi (Text Comparison):
The old text was wrong: non-ASCII unibyte chars overlap part of Unicode.
2026-02-28 16:38:27 +01:00
Eli Zaretskii
b540c45bc5 Document that string ARG of 'kill-emacs' might not work
* src/emacs.c (Fkill_emacs):
* doc/lispref/os.texi (Killing Emacs): Document that EXIT-DATA
being a string doesn't always work.  (Bug#80435)
2026-02-28 16:10:08 +02:00
Eli Zaretskii
0d017fc7ce ; Fix the documentation of 'overlays-in' etc.
* src/buffer.c (Foverlays_in):
* lisp/subr.el (remove-overlays):
* doc/lispref/display.texi (Finding Overlays, Managing Overlays):
* etc/NEWS: Improve the documentation of recent changes in
behavior of 'overlays-in' and 'remove-overlays'.  (Bug#80242)
2026-02-28 15:36:07 +02:00
Sean Whitton
215e07d9d3 New function multiple-command-partition-arguments
* lisp/subr.el (command-line-max-length): New variable.
(multiple-command-partition-arguments): New function.
* doc/lispref/processes.texi (Shell Arguments):
* etc/NEWS: Document them.
* test/lisp/subr-tests.el
(subr-multiple-command-partition-arguments): New test.
2026-02-25 16:29:05 +00:00
Mattias Engdegård
2505af27c6 Compare circular lists in 'equal' without error (bug#80456)
* src/lisp.h (FOR_EACH_TAIL_INTERNAL): Divvy up the code into...
(FOR_EACH_TAIL_BASIC, FOR_EACH_TAIL_STEP_CYCLEP): ...these macros,
so that they can be used in more flexible ways.
* src/fns.c (internal_equal_1): Detect circular lists and call...
(internal_equal_cycle): ...this function that keeps comparing
but now detecting cycles in the other argument.

* lisp/emacs-lisp/testcover.el (testcover-after):
Remove unnecessary error handling.
* test/src/fns-tests.el (test-cycle-equal): Adapt and extend.
* test/lisp/emacs-lisp/testcover-resources/testcases.el
(testcover-testcase-cyc1): Remove case that no longer applies.

* doc/lispref/objects.texi (Equality Predicates): Update.
* etc/NEWS: Announce.
2026-02-24 12:47:52 +01:00
Collin Funk
29440eedac Add SHA-3 support to secure-hash
* admin/merge-gnulib (GNULIB_MODULES): Add crypto/sha3-buffer.
* lib/sha3.c: New file, imported by running admin/merge-gnulib.
* lib/sha3.h: Likewise.
* m4/sha3.m4: Likewise.
* lib/gnulib.mk.in: Updated by admin/merge-gnulib.
* m4/gnulib-comp.m4: Likewise.
* src/fns.c: Include sha3.h
(Fsecure_hash_algorithms): Add Qsha3_224, Qsha3_256, Qsha3_384, and
Qsha3_512.
(secure_hash): Likewise.
(Fsecure_hash): List the SHA-3 algorithms in the docstring.
(syms_of_fns): Define Qsha3_224, Qsha3_256, Qsha3_384, and Qsha3_512.
* test/lisp/net/gnutls-tests.el (gnutls-tests-internal-macs-upcased):
Filter out the new SHA-3 algorithms since they are currently not
implemented in gnutls.
* test/src/fns-tests.el (test-secure-hash): Add test cases for the new
algorithms.
* doc/lispref/text.texi (Checksum/Hash): List the SHA-3 algorithms.
Mention that they are considered secure.
* etc/NEWS: Mention the new feature.
2026-02-23 00:22:17 -08:00
Eli Zaretskii
138ee9b09e ; Make the document language in Info manuals explicitly stated
* doc/misc/woman.texi:
* doc/misc/wisent.texi:
* doc/misc/widget.texi:
* doc/misc/vtable.texi:
* doc/misc/viper.texi:
* doc/misc/vhdl-mode.texi:
* doc/misc/use-package.texi:
* doc/misc/url.texi:
* doc/misc/tramp.texi:
* doc/misc/todo-mode.texi:
* doc/misc/srecode.texi:
* doc/misc/speedbar.texi:
* doc/misc/smtpmail.texi:
* doc/misc/sieve.texi:
* doc/misc/ses.texi:
* doc/misc/semantic.texi:
* doc/misc/sc.texi:
* doc/misc/sasl.texi:
* doc/misc/remember.texi:
* doc/misc/reftex.texi:
* doc/misc/rcirc.texi:
* doc/misc/pgg.texi:
* doc/misc/pcl-cvs.texi:
* doc/misc/octave-mode.texi:
* doc/misc/nxml-mode.texi:
* doc/misc/newsticker.texi:
* doc/misc/mh-e.texi:
* doc/misc/message.texi:
* doc/misc/mairix-el.texi:
* doc/misc/info.texi:
* doc/misc/ido.texi:
* doc/misc/idlwave.texi:
* doc/misc/htmlfontify.texi:
* doc/misc/gnus.texi:
* doc/misc/forms.texi:
* doc/misc/flymake.texi:
* doc/misc/eww.texi:
* doc/misc/eudc.texi:
* doc/misc/eshell.texi:
* doc/misc/ert.texi:
* doc/misc/erc.texi:
* doc/misc/epa.texi:
* doc/misc/emacs-gnutls.texi:
* doc/misc/eieio.texi:
* doc/misc/eglot.texi:
* doc/misc/efaq-w32.texi:
* doc/misc/efaq.texi:
* doc/misc/edt.texi:
* doc/misc/ediff.texi:
* doc/misc/ede.texi:
* doc/misc/ebrowse.texi:
* doc/misc/dired-x.texi:
* doc/misc/dbus.texi:
* doc/misc/cl.texi:
* doc/misc/cc-mode.texi:
* doc/misc/calc.texi:
* doc/misc/bovine.texi:
* doc/misc/autotype.texi:
* doc/misc/auth.texi:
* doc/lispintro/emacs-lisp-intro.texi:
* doc/lispref/elisp.texi:
* doc/emacs/emacs.texi: Add @documentlanguage where it was
missing.  This makes the language explicit given the change in
behavior expected in Texinfo 7.3.
2026-02-21 15:29:13 +02:00
Eli Zaretskii
f8075bc523 ; * doc/lispref/edebug.texi (Using Edebug): Fix a typo (bug#80459). 2026-02-21 10:29:45 +02:00
Sean Whitton
2bf2855b57 Restore 'cond' one element clauses to 'cond*'
* lisp/emacs-lisp/cond-star.el (cond*-non-exit-clause-p)
(cond*-non-exit-clause-substance): Treat only one element
clauses beginning with match*/pcase* pseudoforms as non-exit.
(cond*-convert-condition): Handle exiting clauses with only one
element, that is a regular Lisp expression.
(cond*):
* doc/lispref/control.texi (cond* Macro): Document the change.
2026-02-19 09:45:21 +00:00
Stéphane Marks
54d0764665 Add frame-use-time, get-mru-frame, use mru frame in delete-frame (bug#80397)
* lisp/frame.el (get-mru-frame): New defun.
* src/frame.c (delete_frame): Call 'get-mru-frame' (when force
is not Qnoelisp) to select the most recently used frame that is
not the deleted frame as the candidate to select.
(syms_of_frame): Qget_mru_frame new DEFSYM.
* doc/lispref/frames.texi: Document the new functions.
* etc/NEWS: Announce the new functions.
2026-02-18 19:28:21 +02:00
Michael Albinus
750d46536e * doc/lispref/commands.texi (Special Events): Fix insert-special-event defun. 2026-02-16 10:34:05 +01:00
Basil L. Contovounesios
8f76396da4 ; Mention when make_unibyte_string was introduced. 2026-02-14 20:41:20 +01:00
Basil L. Contovounesios
080ee7f7ec ; Fix define-obsolete-face-alias entry in manual. 2026-02-14 20:32:31 +01:00
Eli Zaretskii
869ad24216 ; Improve documentation of Edebug
* doc/lispref/edebug.texi (Edebug, Using Edebug, Instrumenting)
(Source Breakpoints, Specification List): Improve indexing and
tell how to end debugging.
2026-02-14 14:51:41 +02:00
Eli Zaretskii
6aefaca819 Adjust documentation to changes in 'overlays-in' and 'overlays-at'
* src/buffer.c (overlays_in): Fix commentary to match the code.
(Foverlays_in, Foverlays_at): Doc fixes.  (Bug#80242)

* test/src/buffer-tests.el (test-overlays-at-2): Add one test.

* doc/lispref/display.texi (Finding Overlays): Update and improve
the documentation of 'overlays-in' and 'overlays-at'.

* etc/NEWS: Announce the changes.
2026-02-14 11:37:52 +02:00
Morgan Willcock
a1e32130de Fix typo in smie-rules-function documentation
Fix a typo in the documentation for the expected arguments when
calling smie-rules-function to set the indentation offset of
function arguments.

* doc/lispref/modes.texi (SMIE Indentation):
* lisp/emacs-lisp/smie.el (smie-rules-function): Fix typo in
documentation for smie-rules-function arguments.
2026-02-11 15:35:29 -05:00
Sean Whitton
90fbadb3b1 cond*: bind-and* is not always a non-exit clause!
* lisp/emacs-lisp/cond-star.el (cond*-non-exit-clause-p)
(cond*-non-exit-clause-substance): Don't consider a bind-and*
clause without ':non-exit' to be a non-exit clause (bug#80376).
(cond*):
* doc/lispref/control.texi (cond* Macro): Fix docs accordingly.
2026-02-11 14:23:38 +00:00
Stéphane Marks
6967a8ac54 ; system-sleep texi markup fix (bug#80348)
* doc/lispref/os.texi (System Sleep): Minor markup fixes.
2026-02-11 14:32:02 +01:00
Eli Zaretskii
e464052a28 ; Fix recently installed changes
* src/w32fns.c (w32_register_for_sleep_notifications)
(sleep_notification_callback): Fix signatures.
* src/w32term.h (w32_register_for_sleep_notifications): Fix
prototype.  These changes avoid compilation warnings.

* lisp/system-sleep.el: Remove stray non-ASCII character.

* doc/lispref/os.texi (System Sleep): Remove non-ASCII character,
and fix wording and markup.

* etc/NEWS: Fix wording of recently-added entry.
2026-02-11 14:44:09 +02:00
Stéphane Marks
0bee754a72 system-sleep sleep blocker and sleep/wake event package (bug#80348)
This package provides platform-neutral interfaces to block your
system from entering idle sleep and a hook to process pre-sleep
and post-wake events.

Implementations are for D-Bus on GNU/Linux, macOS/GNUstep, and
MS-Windows.

* lisp/system-sleep.el: New package.
* src/fns.c: Qpre_sleep, Qpost_wake: New DEFSYM.
* src/nsfns.m (Fns_block_system_sleep, Fns_unblock_system_sleep)
(syms_of_nsfns): New functions.
* src/nsterm.m (applicationDidFinishLaunching): Subscribe to
pre-sleep and post-wake notifications.
(systemWillSleep, systemDidWake): New function.
* src/w32fns.c (Fw32_block_system_sleep)
(Fw32_unblock_system_sleep, Fw32_system_sleep_block_count)
(sleep_notification_callback)
(w32_register_for_sleep_notifications): New function.
(syms_of_w32fns): Sw32_unblock_system_sleep
Sw32_block_system_sleep Sw32_system_sleep_block_count: New
defsubr.
* src/w32term.h (Fw32_block_system_sleep): New extern.
* src/w32term.c (w32_initialize): Call
w32_register_for_sleep_notifications.
* doc/lispref/os.texi: Document the system-sleep package.
* doc/lispref/commands.texi: Update sleep-event special
documentation.
* etc/NEWS: Announce the new package.
2026-02-11 09:52:38 +01:00
Michael Albinus
c65a4e6a43 ; * doc/lispref/os.texi (Timers): Fix typo. 2026-02-09 18:31:04 +01:00
Sean Whitton
2437a45144 ; Further fixes to core documentation for cond*. 2026-02-08 15:11:08 +00:00
Sean Whitton
51b883719b ; Fix some issues in core documentation for cond*. 2026-02-08 15:06:00 +00:00
Eli Zaretskii
f430166f7d ; * doc/lispref/commands.texi (Special Events): Add cross-reference. 2026-02-08 08:34:36 +02:00
Eli Zaretskii
419ac8148f ; Document creation of strings from copies of other strings
* doc/lispref/strings.texi (Creating Strings): Document how to
create a string from N copies of another string.  (Bug#80256)
2026-02-07 14:22:12 +02:00
Eli Zaretskii
16b10d7617 ; Improve indexing in the ELisp manual
* doc/lispref/functions.texi (Function Names):
* doc/lispref/variables.texi (Tips for Defining): Improve
indexing.
2026-02-02 15:24:21 +02:00
Jens Schmidt
e08efecd96 Improve documentation of 'seq-difference'
* doc/lispref/sequences.texi (Sequence Functions):
* lisp/emacs-lisp/seq.el (seq-difference): Clarify the documentation of
'seq-difference'.  (Bug#80257)
2026-01-31 16:08:52 +02:00
Michael Albinus
346f1bda6b Improve connection-local variables documentation.
* doc/emacs/custom.texi (Connection Variables):
* doc/lispref/variables.texi (Applying Connection Local Variables):
Improve documentation.
2026-01-31 13:37:56 +01:00
Jens Schmidt
1652e36c6c ; Fix documentaion of 'seq-intersection'
* doc/lispref/sequences.texi (Sequence Functions):
* lisp/emacs-lisp/seq.el (seq-intersection): Fix documentaion of
'seq-intersection'.  (Bug#80257)
2026-01-31 11:52:27 +02:00
Eli Zaretskii
f081afe23d ; Improve documentation of 'condition-case-unless-debug'
* doc/lispref/control.texi (Handling Errors):
* lisp/subr.el (condition-case-unless-debug): Improve the
documentation of 'condition-case-unless-debug'.  (Bug#80234)
2026-01-31 11:24:53 +02:00
Stéphane Marks
a0748d9791 New function 'truncate-string-pixelwise' (bug#80244)
This function will truncate a string on a pixelwise basis in a
work buffer and using a binary search rather than brute force.

* lisp/emacs-lisp/subr-x.el (work-buffer--prepare-pixelwise):
New defun helper function.
(string-pixel-width): Use the helper function.
(truncate-string-pixelwise): New defun.
* test/lisp/misc-tests.el (misc-test-truncate-string-pixelwise):
(misc-test-truncate-string-pixelwise-unicode): New test.
* doc/lispref/display.texi (Size of Displayed Text): Document
the function.
* etc/NEWS: Announce the function.
2026-01-31 11:04:40 +02:00
Eli Zaretskii
eca025334e ; Fix last change
* etc/NEWS:
* doc/lispref/windows.texi (Choosing Window Options):
* doc/emacs/windows.texi (Window Choice): Improve documentation of
'split-window-preferred-direction'.
2026-01-29 22:13:02 +02:00
Stéphane Marks
99abaa70bf Document frame id related commands and tweak a return value (Bug#80192)
* doc/lispref/frames.texi (Input Focus): Document the commands
'select-frame-by-id' and 'undelete-frame-by-id'.
* lisp/frame.el (select-frame-by-id): Clarify return value and
add missing optional argument 'noerror' in sympathy with
'undelete-frame-by-id'.
2026-01-27 10:23:34 +01:00