1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-08 07:12:15 -07:00
Commit graph

13548 commits

Author SHA1 Message Date
Stéphane Marks
faf1932875 New macro setopt-local and function set-local (bug#80709)
'setopt-local' is the buffer local equivalent of 'setopt'.

Unify 'setopt', 'setopt-local', 'setq-local',
'buffer-local-set-state' with 'setq' to signal
'wrong-number-of-arguments'.

* lisp/cus-edit.el (setopt): Change error signal to
'wrong-number-of-arguments'.
(setopt-local): New macro.
(setopt--set-local): New function.
* lisp/subr.el (set-local): New function.
(setq-local, buffer-local-set-state): Signal
'wrong-number-of-arguments' rather than 'error'.
* doc/emacs/custom.texi (Examining): Document 'setopt-local'.
* etc/NEWS: Announce the new macro and function.
2026-04-02 13:47:36 -04:00
Eli Zaretskii
377e3f441f ; * doc/emacs/custom.texi (Examining): Fix last change. 2026-04-02 17:26:14 +03:00
Eli Zaretskii
4ad9cd74c6 ; * doc/emacs/custom.texi (Examining): Fix indexing and example. 2026-04-02 15:11:28 +03:00
Sean Whitton
4baa427ee4 ; * doc/emacs/custom.texi (Newcomers Theme): Strengthen language. 2026-04-01 10:02:23 +01:00
Dmitry Gutov
aacf510fe5 Change "XREF" to "Xref" in mode lighter
* lisp/progmodes/xref.el (xref--xref-buffer-mode)
(xref--transient-buffer-mode, xref-edit-save-changes):
Change "XREF" to "Xref" for internal consistency.

* doc/emacs/maintaining.texi (Xref Commands):
Same.
2026-04-01 04:04:54 +03:00
Dmitry Gutov
cda65ffa58 Add xref-edit-mode (bug#80616)
Based on the existing grep-edit-mode code.

* lisp/progmodes/xref.el (xref-edit--prepare-buffer): New function.
(xref-edit-mode-map, xref-edit-mode-hook): New variables.
(xref-edit-mode, xref-change-to-xref-edit-mode)
(xref-edit-save-changes): New functions.
(xref--xref-buffer-mode-map): New binding ("e").

* doc/emacs/maintaining.texi (Identifier Search):
Mention xref-change-to-xref-edit-mode.

* etc/NEWS: Describe the addition.
2026-04-01 04:04:39 +03:00
Michael Albinus
9c75d761a5 Allow format specifiers in `tramp-login-program'
* doc/misc/tramp.texi (Extension packages): Explain how to use own
format specifiers.

* lisp/net/tramp.el (tramp-expand-args): Make DEFAULT argument
optional.  Handle also ARGS being an atom.
(tramp-handle-make-process):
* lisp/net/tramp-container.el (tramp-skeleton-completion-function):
* lisp/net/tramp-sh.el (tramp-ssh-or-plink-options)
(tramp-maybe-open-connection):
* lisp/net/tramp-sshfs.el (tramp-sshfs-handle-process-file):
Call `tramp-expand-args' for `tramp-login-program'.
2026-03-30 08:18:00 +02:00
Eli Zaretskii
8c481ac944 ; Fix a typo in 'emacs-lisp-intro.texi'
* doc/lispintro/emacs-lisp-intro.texi (lengths-list-file): Fix doc
string of 'lengths-list-file' and surrounding text.  (Bug#80686)
2026-03-29 12:32:05 +03:00
Stefan Monnier
e6c1e87c1e Merge remote-tracking branch 'bug#80297-extend-shortdoc-infrastructure' 2026-03-28 12:12:34 -04:00
Basil L. Contovounesios
d780007283 Add predicate for initial_terminal
This introduces the predicate frame-initial-p, which uses
struct frame.output_method or struct terminal.type to detect
initial_terminal without relying on its name (bug#80629).
For some prior discussion, see:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00480.html
https://lists.gnu.org/r/emacs-devel/2020-01/msg00120.html

* doc/lispref/frames.texi (Frames): Document frame-initial-p.
(Finding All Frames): Fix grammar.
* etc/NEWS (Lisp Changes in Emacs 31.1): Announce frame-initial-p.
* lisp/desktop.el (desktop--check-dont-save):
* lisp/emacs-lisp/debug.el (debug):
* lisp/frameset.el (frameset-restore):
* lisp/menu-bar.el (menu-bar-update-buffers):
* lisp/xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal):
Use frame-initial-p instead of checking the "initial_terminal" name.
* lisp/emacs-lisp/byte-opt.el: Mark frame-initial-p as error-free.

* src/pgtkterm.c (pgtk_focus_changed): Use IS_DAEMON in place of
Fdaemonp, thus also accepting a named daemon session.
* src/terminal.c (decode_tty_terminal): Clarify commentary.
(Fframe_initial_p): New function.
(syms_of_terminal): Expose it.
(init_initial_terminal): Update commentary now that
menu-bar-update-buffers uses frame-initial-p (bug#53740).

* test/lisp/xt-mouse-tests.el (with-xterm-mouse-mode): Simulate the
lack of an initial terminal by overriding frame-initial-p now
that turn-on-xterm-mouse-tracking-on-terminal uses it.
* test/src/terminal-tests.el: New file.
2026-03-26 15:19:56 +01:00
Jens Schmidt
82882db8ed Split up shortdoc functions and groups, fix their format
Move shortdoc group definitions from shortdoc.el to a separate file
shortdoc-doc.el.  Document shortdoc group format in a future-proof way
and guide package authors on how to use shortdoc groups across past
Emacs versions.

* lisp/emacs-lisp/shortdoc-doc.el: New file.
* lisp/emacs-lisp/shortdoc.el: Document shortdoc group format in a
future-proof way.  Require 'shortdoc-doc'.
(shortdoc--keyword-plist-p): New function.
(shortdoc--check): Update to check the documented shortdoc group format.
(shortdoc--groups, define-short-documentation-group): Pull out of
autoloaded 'progn'.
(define-short-documentation-group): Report errors in terms of byte
compiler warnings.
(alist, map, string, file-name, file, hash-table, list, symbol)
(comparison, vector, regexp, sequence, buffer, overlay, process, number)
(text-properties, keymaps): Move group to shortdoc-doc.el.
(shortdoc): Move alias to after function.
(shortdoc-add-function): Add argument checks.
* doc/lispref/tips.texi (Documentation Group Tips): New section.
* doc/lispref/elisp.texi (Top):
* doc/lispref/tips.texi (Tips): Add references to it.
* doc/lispref/help.texi (Documentation Groups): Ditto, and add some
concept index entries.  (bug#80297)
2026-03-25 22:31:57 +01:00
Eli Zaretskii
9adc553ab9 ; * doc/lispintro/emacs-lisp-intro.texi: Fix parens (bug#80646). 2026-03-21 13:27:56 +02:00
Stéphane Marks
48d65afa32 vtable truncate-string-pixelwise, ellipsis can be a string (bug#80026)
Eliminate 'vtable--limit-string' in favor of the more efficient
'truncate-string-pixelwise'.  Remove extraneous pre-measurement
calls to 'string-pixel-width' and ellipsis concatenation as
'truncate-string-pixelwise' does both.
The 'make-vtable' 'ellipsis' keyword can be a string to override
the default returned by 'truncate-string-ellipsis'.

* lisp/emacs-lisp/vtable.el (vtable--ellipsis): New defun.
(vtable-insert-object, vtable--insert): Use 'vtable--ellipsis'.
(vtable--insert-line, vtable--insert-header-line): Call
'truncate-string-pixelwise' instead of 'vtable--limit-string'.
(vtable--limit-string): Remove function.

* test/lisp/emacs-lisp/vtable-tests.el
(test-vtable--limit-string-with-face-remapped-buffer): Remove
test, obsoleted by misc-test-truncate-string-pixelwise.

* doc/misc/vtable.texi: Document that :ellipsis can be a string.
2026-03-21 12:50:04 +02:00
Eli Zaretskii
4901015055 ; * doc/lispref/variables.texi (Void Variables): Add cross-reference. 2026-03-21 09:05:59 +02:00
Stefan Monnier
378cfb8660 (Fmakunbound): Break aliasing, if present (bug#80538)
* src/data.c (Fmakunbound): Break aliasing, if present.
* doc/lispref/variables.texi (Void Variables): Document it.
2026-03-20 17:21:05 -04:00
Eli Zaretskii
ee42c392d2 ; Fix documentation of window-dimension functions
* doc/lispref/windows.texi (Window Sizes):
* src/window.c (Fwindow_body_height, Fwindow_total_height)
(Fwindow_total_width, Fwindow_body_width): Clarify that window
dimensions are returned in canonical columns and lines.
(Bug#80620)
2026-03-19 17:40:31 +02:00
Elias Gabriel Perez
5c961f4903 hideshow: Fix 'hs-hide-block-behavior' set to 'after-cursor'.
Bug#80455.

* etc/NEWS: Document changed behavior.

* lisp/progmodes/hideshow.el (hs-get-near-block): Remove
'forward-line'.
(hs-hide-block-behavior): Update docstring.

* doc/emacs/programs.texi (Hideshow): Update.

Suggested-by: Dima Kogan <dima@secretsauce.net>
2026-03-19 17:27:57 +02:00
Elías Gabriel Pérez
c911495fb1 hideshow: New minor mode 'hs-indentation-mode'. (Bug#80179)
This minor mode configures hs-minor-mode to use
indentation-based folding.

* lisp/progmodes/hideshow.el (hs-hideable-block-p): New
function.
(hs-indentation-respect-end-block): New option.
(hs-indentation--store-vars): New variable.
(hs-cycle-filter, hs-get-first-block-on-line, hs-get-near-block)
(hs-find-block-beg-fn--default): Adapt code to use
'hs-hideable-block-p'.
(hs-block-positions): Update.
(hs-indentation-mode): New minor mode.

* doc/emacs/programs.texi (Hideshow): Update documentation.

* etc/NEWS: Announce changes

* test/lisp/progmodes/hideshow-tests.el: Add 'require'.
(hideshow-check-indentation-folding): New test.
2026-03-19 17:11:54 +02:00
Stefan Monnier
e2004eb56f Merge remote-tracking branch 'origin/scratch/error-API' 2026-03-15 17:17:21 -04:00
Sean Whitton
fe9f6a5872 ; Tweak wording of newcomer instructions. 2026-03-15 20:29:08 +00: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
Philip Kaludercic
6901173e44
; Ensure hint to close "Newcomers Theme" is visible
* doc/emacs/custom.texi (Newcomers Theme): Move to the beginning
of the node, so as to be visible even when the Emacs frame is
too small and wrap it in a conditional to not print the message
in non-Info outputs.
2026-03-15 10:52:01 +01:00
Philip Kaludercic
c7d4056539
Give an example of how to use use-package+:vc without :rev
* doc/misc/use-package.texi (Install package): Add an example
block that doesn't use :rev, and instead shows that you can just
pass a URL as a string to :vc.
2026-03-13 23:50:05 +01:00
Philip Kaludercic
d019b5ec71
Add 'xref-mouse-mode' minor mode
* doc/emacs/maintaining.texi (Looking Up Identifiers): Document
it.
* etc/NEWS (bindings): Mention it.
* etc/themes/newcomers-presets-theme.el (newcomers-presets): Add
it.
* lisp/progmodes/xref.el (xref-mouse-mode-map, xref-mouse-mode)
(global-xref-mouse-mode): Implement it.
2026-03-12 09:01:08 +01:00
Philip Kaludercic
6f337499e6
; Add missing documentation for new 'cus-edit' bindings
* doc/emacs/custom.texi (Changing a Variable):
* etc/NEWS: Mention them.
2026-03-11 22:12:55 +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
Eli Zaretskii
618653aed0 ; * doc/lispintro/emacs-lisp-intro.texi (Lists diagrammed): Fix last change. 2026-03-08 14:57:34 +02:00
Eli Zaretskii
468dad2c5a Use images in Emacs Lisp Intro manual (bug#80519)
* doc/lispintro/emacs-lisp-intro.texi (Lists diagrammed)
(Symbols as Chest, kill-ring-yank-pointer, lambda): Use @image and
remove ASCII-art diagrams, which are now on separate *.txt files.
(header): Remove print-postscript-figures and its commentary.

* doc/lispintro/Makefile.in (auxfiles): New file list.
(${buildinfodir}/%.txt, ${buildinfodir}/%.png): New targets.
(${buildinfodir}/eintr.info): Depend on ${auxfiles}.
(infoclean): Remove ${auxfiles}.

* doc/lispintro/cons-1.png:
* doc/lispintro/cons-1.txt:
* doc/lispintro/cons-2.png:
* doc/lispintro/cons-2.txt:
* doc/lispintro/cons-2a.png:
* doc/lispintro/cons-2a.txt:
* doc/lispintro/cons-3.png:
* doc/lispintro/cons-3.txt:
* doc/lispintro/cons-4.png:
* doc/lispintro/cons-4.txt:
* doc/lispintro/cons-5.png:
* doc/lispintro/cons-5.txt:
* doc/lispintro/drawers.png:
* doc/lispintro/drawers.txt:
* doc/lispintro/lambda-1.png:
* doc/lispintro/lambda-1.txt:
* doc/lispintro/lambda-2.png:
* doc/lispintro/lambda-2.txt:
* doc/lispintro/lambda-3.png:
* doc/lispintro/lambda-3.txt: New files, from Matto Fransen
<matto@matto.nl>.
2026-03-08 14:51:13 +02:00
Eli Zaretskii
caca15a42d ; * doc/emacs/vc1-xtra.texi (General VC Options): Fix a typo. 2026-03-05 19:43:16 +02: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
Sean Whitton
b12190778c ; * doc/emacs/vc1-xtra.texi (General VC Options): Fix last change. 2026-03-05 13:29:31 +00:00
Sean Whitton
8d16a0557d New user option vc-display-failed-async-commands
* lisp/vc/vc-dispatcher.el (vc-display-failed-async-commands):
New user option.
(vc-do-async-command): Use it.
* doc/emacs/vc1-xtra.texi (General VC Options):
* etc/NEWS: Document it.
* lisp/vc/vc-dispatcher.el (vc-do-command): Adjust message to
begin "Failed" not "Done" when command exits non-zero.
* lisp/vc/vc.el (vc-checkin): Adjust message to end in
"...failed" not "...done" when async command exits non-zero.
2026-03-05 13:24:27 +00:00
Eli Zaretskii
f398a4d299 ; Fix indexing in viper.texi.
* doc/misc/viper.texi: Fix weird use of indexing, whereby many
index entries were placed _after_ the table which described the
functions or variables or keys, or even in the end of a @node
describing some subject.  The index entries were moved to _before_
the text to which they pertain.  Also, fix some incorrect
cross-references.
2026-03-05 15:17:50 +02:00
Sean Whitton
bdc4a93535 ; Fix documentation of vc-command-messages. 2026-03-05 12:06:12 +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
Sean Whitton
4ce94139ae New command 'unfill-paragraph'
* lisp/simple.el (unfill-paragraph): New command.
* doc/emacs/indent.texi (Indentation Commands):
* etc/NEWS: Document it.
2026-03-04 14:20:47 +00:00
Stephen Gildea
ae45bb10e0 ; * doc/emacs/files.texi (Time Stamps): Small wording fix. 2026-03-03 11:02:22 -08: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
Eli Zaretskii
75f6b5fe09 ; * doc/emacs/frames.texi (Multiple Displays): Improve markup. 2026-03-03 15:08:42 +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
Sean Whitton
d9611a7686 ; Tweak splash screen some more. Fix some punctuation. 2026-03-03 12:06:39 +00:00
Sean Whitton
1f9b6223e1 ; Move documentation for multiple-terminals-merge-keyboards. 2026-03-03 11:14:10 +00:00