1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00
Commit graph

5688 commits

Author SHA1 Message Date
Eli Zaretskii
35138b90dd ; * doc/lispref/parsing.texi (Parsing Program Source): Improve indexing. 2024-05-17 19:03:39 +03:00
Eli Zaretskii
3dd09516c9 ; Improve documentation of 'set-fontset-font'
* doc/lispref/display.texi (Fontsets):
* src/fontset.c (Fset_fontset_font): Doc fix (bug#70993).
2024-05-17 10:18:35 +03:00
Stefan Monnier
fea8d54c48 control.texi: Be a bit more explicit about the behavior of pcase-let
* doc/lispref/control.texi (Destructuring with pcase Patterns):
Clarify the kind of "unspecified" behavior that can occur when
the destructing pattern does not match the value.
2024-05-15 13:57:11 -04:00
Martin Rudalics
38fe837f83 ; * doc/lispref/windows.texi (Buffer Display Action Functions): Fix wording. 2024-05-15 09:49:14 +02:00
Robert Pluim
45ebb66ccf Document 'use-default-font-for-symbols' more
"why does my set-fontset-font call not work for symbols" is a common
question, and it's because 'use-default-font-for-symbols' is not
discoverable enough.

* doc/emacs/mule.texi (Modifying Fontsets): Mention it here.
* doc/lispref/display.texi (Fontsets): And here.
* src/fontset.c (Fset_fontset_font): And most importantly here.
2024-05-14 17:18:32 +02:00
Andrea Corallo
a39a806012 * doc/lispref/functions.texi (Declare Form): Rename and update 'ftype' entry. 2024-05-14 11:17:25 +02:00
Eli Zaretskii
f6d060b39a ; Fix documentation of recently-installed changes
* lisp/emacs-lisp/bytecomp.el (compilation-safety): Doc fix.

* etc/NEWS: Fix wording of the 'compilation-safety' entry.

* doc/lispref/functions.texi (Declare Form): Fix cross-reference
and wording.
* doc/lispref/compile.texi (Native-Compilation Variables): Add the
missing @anchor.  Fix wording.
2024-05-14 08:51:13 +03:00
Andrea Corallo
04e7078d5e Add some 'compilation-safety' documentation
* lisp/emacs-lisp/bytecomp.el (compilation-safety): Better doc.
* doc/lispref/functions.texi (Declare Form): Add 'safety'.
* doc/lispref/compile.texi (Native-Compilation Variables): Add
'compilation-safety'.
2024-05-13 23:09:09 +02:00
Eli Zaretskii
1e4cb12a81 Merge from origin/emacs-29
b392169e54 ; * doc/lispref/commands.texi (Event Mod): Add motivation...
e272fd3da9 ; Update description of 'mail-mode'
2024-05-04 08:10:54 -04:00
Juri Linkov
4078d0fd3e * doc/lispref/keymaps.texi (Creating Keymaps): Add :repeat :hints (bug#70576). 2024-05-03 09:22:39 +03:00
Eli Zaretskii
12e3ffcc97 ; Fix last change
* etc/NEWS: Fix wording of a recently-added item.

* doc/lispref/functions.texi (Declare Form): Fix markup.
2024-05-02 19:30:40 +03:00
Andrea Corallo
02690d95f9 * doc/lispref/functions.texi (Declare Form): Improve again declare type. 2024-05-02 16:58:59 +02:00
Andrea Corallo
390b606ffc * doc/lispref/functions.texi (Declare Form): Better warn about UB. 2024-05-02 16:39:57 +02:00
Eli Zaretskii
b392169e54 ; * doc/lispref/commands.texi (Event Mod): Add motivation (bug#70596). 2024-05-02 12:20:09 +03:00
Andrea Corallo
fccd35f2c8 * doc/lispref/functions.texi (Declare Form): Improve declare type. 2024-05-01 20:03:02 +02:00
Andrea Corallo
15016288ec * Document function type declarations
* doc/lispref/functions.texi (Declare Form): Document function type
declaration.
2024-04-29 19:33:18 +02:00
Mattias Engdegård
f906ce5543 ; * doc/lispref/objects.texi (Type Predicates): fix xrefs 2024-04-29 14:29:52 +02:00
Mattias Engdegård
8718a7c706 Add drop as alias for nthcdr
It's a common name for this function and symmetric with respect to
`take`.  It's also a lot less awkward to type and say.

* lisp/subr.el (drop): New alias.
* doc/lispref/lists.texi (List Elements): Document.  Mention the
equation tying `take` and `drop` together.
* etc/NEWS: Announce.
2024-04-29 14:29:52 +02:00
Po Lu
8cd9ca2236 Fix NEWS entries and documentation for underline styles
* doc/lispref/display.texi (Face Attributes):

* etc/NEWS: Revise to not mislead users as to where these
attributes are available.
2024-04-29 08:49:47 +08:00
Stefan Monnier
f2bccae22b Use a dedicated type to represent interpreted-function values
Change `function` so that when evaluating #'(lambda ...)
we return an object of type `interpreted-function` rather than
a list starting with one of `lambda` or `closure`.
The new type reuses the existing PVEC_CLOSURE (nee PVEC_COMPILED)
tag and tries to align the corresponding elements:

- the arglist, the docstring, and the interactive-form go in the
  same slots as for byte-code functions.
- the body of the function goes in the slot used for the bytecode string.
- the lexical context goes in the slot used for the constants of
  bytecoded functions.

The first point above means that `help-function-arglist`,
`documentation`, and `interactive-form`s don't need to
distinguish interpreted and bytecode functions any more.

Main benefits of the change:

- We can now reliably distinguish a list from a function value.
- `cl-defmethod` can dispatch on `interactive-function` and `closure`.
  Dispatch on `function` also works now for interpreted functions but still
  won't work for functions represented as lists or as symbols, of course.
- Function values are now self-evaluating.  That was alrready the case
  when byte-compiled, but not when interpreted since
  (eval '(closure ...)) signals a void-function error.
  That also avoids false-positive warnings about "don't quote your lambdas"
  when doing things like `(mapcar ',func ...)`.

* src/eval.c (Fmake_interpreted_closure): New function.
(Ffunction): Use it and change calling convention of
`Vinternal_make_interpreted_closure_function`.
(FUNCTIONP, Fcommandp, eval_sub, funcall_general, funcall_lambda)
(Ffunc_arity, lambda_arity): Simplify.
(funcall_lambda): Adjust to new representation.
(syms_of_eval): `defsubr` the new function.  Remove definition of `Qclosure`.

* lisp/emacs-lisp/cconv.el (cconv-make-interpreted-closure):
Change calling convention and use `make-interpreted-closure`.

* src/data.c (Fcl_type_of): Distinguish `byte-code-function`s from
`interpreted-function`s.
(Fclosurep, finterpreted_function_p): New functions.
(Fbyte_code_function_p): Don't be confused by `interpreted-function`s.
(Finteractive_form, Fcommand_modes): Simplify.
(syms_of_data): Define new type symbols and `defsubr` the two
new functions.

* lisp/emacs-lisp/cl-print.el (cl-print-object) <interpreted-function>:
New method.

* lisp/emacs-lisp/oclosure.el (oclosure): Refine the parent
to be `closure`.
(oclosure--fix-type, oclosure-type): Simplify.
(oclosure--copy, oclosure--get, oclosure--set): Adjust to
new representation.

* src/callint.c (Fcall_interactively): Adjust to new representation.

* src/lread.c (bytecode_from_rev_list):

* lisp/simple.el (function-documentation):
* lisp/help.el (help-function-arglist): Remove the old `closure` case
and adjust the byte-code case so it handles `interpreted-function`s.

* lisp/emacs-lisp/cl-preloaded.el (closure): New type.
(byte-code-function): Add it as a parent.
(interpreted-function): Adjust parent (the type itself was already
added earlier by accident).

* lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function): Adjust to
new representation.
(byte-compile): Use `interpreted-function-p`.

* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Adjust to
new representation.
(side-effect-free-fns): Add `interpreted-function-p` and `closurep`.

* src/profiler.c (trace_hash, ffunction_equal): Simplify.
* lisp/profiler.el (profiler-function-equal): Simplify.

* lisp/emacs-lisp/nadvice.el (advice--interactive-form-1):
Use `interpreted-function-p`; adjust to new representation; and take
advantage of the fact that function values are now self-evaluating.

* lisp/emacs-lisp/lisp-mode.el (closure):
Remove `lisp-indent-function` property.

* lisp/emacs-lisp/disass.el (disassemble-internal): Adjust to
new representation.
* lisp/emacs-lisp/edebug.el (edebug--strip-instrumentation):
Use `interpreted-function-p`.
* lisp/emacs-lisp/comp-common.el (comp-known-type-specifiers):
Add `closurep` and `interpreted-function-p`.

* test/lisp/help-fns-tests.el (help-fns-test-lisp-defun): Adjust to
more precise type info in `describe-function`.
* test/lisp/erc/resources/erc-d/erc-d-tests.el (erc-d--render-entries):
Use `interpreted-function-p`.
* test/lisp/emacs-lisp/macroexp-resources/vk.el (vk-f4, vk-f5):
Don't hardcode function values.

* doc/lispref/functions.texi (Anonymous Functions): Don't suggest that
function values are lists.  Reword "self-quoting" to reflect the
fact that #' doesn't return the exact same object.  Update examples
with the new shape of the return value.

* doc/lispref/variables.texi (Lexical Binding):
* doc/lispref/lists.texi (Rearrangement):
* doc/lispref/control.texi (Handling Errors): Update examples to reflect
new representation of function values.
2024-04-28 11:58:12 -04:00
Eli Zaretskii
687c4137fa Merge from origin/emacs-29
f37f01b504 Fix a typo in Introduction to Emacs Lisp (bug#70571).
d8687fd6cd Fix last change
494dfd9cf2 Fix indentation of if/else in 'csharp-ts-mode' (bug#70345)
1cc6322e61 ; * etc/PROBLEMS: Document crashes due to tree-sitter ABI...
42766f95e5 * build-aux/make-info-dir: Avoid bashism (bug#70484).
81476fa19e Improve documentation of selection and navigation in *xre...
2a53351492 Fix Widget manual typos, markup and omissions (bug#70502)
90be3015b4 ; Document bookmark fringe mark in the user manual
afd0b548fc Fix python-ts-mode built-in functions and attributes (bug...
dc720decc3 Fix markup and indexing in the Calendar chapter of user m...
f593bf79a9 Fix the user manual for `calendar-time-zone-style'
aed2b7a3d8 Avoid assertion violations in 'push_prefix_prop'
c929532b46 Remove ert-equal-including-properties from manual
e3aae5fd38 ; Document 'filtered-frame-list'
2024-04-27 06:23:46 -04:00
Mohsin Kaleem
9f589eb924 Add support for colored and styled underlines on tty frames
* src/dispextern.h (face, face_underline_type, syms_of_xfacse)
(internal-set-lisp-face-attribute)
(gui_supports_face_attributes_p): Add definitions for new
underline styles of Double-line, Dots and Dashes.  Rename
FACE_UNDER_LINE and FACE_UNDER_WAVE to make definitions
consistent.  Delete tty_underline_p from the face struct and use
just underline going forward.  Add a flag to check whether styled
underlines are available.
* lisp/cus-face.el (custom-face-attributes): Add entries for
Double-line, Dots and Dashes so they can be set through
`customize'.
* src/termchar.c (tty_display_info): Add an entry for the escape
sequence to set the underline style and color on terminal frames.
* src/term.c (init_tty, tty_capable_p, turn_on_face): Read and
save the underline style escape sequence from the Smulx termcap
(alternatively if the Su flag is set use a default sequence).
Allow checking for support of styled underlines in the current
terminal frame.  Output the necessary escape sequences to activate
a styled underline on turn_on_face; this is currently only used
for the new special underline styles, a default straight underline
will still use the "us" termcap.  Output escape sequence to set
underline color when set in the face and supported by the tty.
Save a default value for this sequence on init_tty when styled
underlines are supported.
* src/xfaces.c (tty_supports_face_attributes_p, realize_tty_face)
(map_tty_color): Assert whether styled underlines are supported by
the current terminal on display-supports-face-attributes-p checks.
Populate the correct underline style and color in the face spec
when realizing a face.  Allow map_tty_color to map underline
colors alongside foreground and background.  The interface of
map_tty_color was amended to allow the caller to supply the
underline color instead of accessing it through the face
attributes.  (bug#62994)
* src/xterm.c (x_draw_glyph_string): Updated to use renamed
FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type
enumerations.
2024-04-27 11:59:15 +03:00
Mattias Engdegård
88ebabe23a Better eval-when-compile example in manual
* doc/lispref/compile.texi (Eval During Compile):
`regexp-opt` makes for a poor example because as a pure function it
doesn't need `eval-when-compile` for constant inputs.
2024-04-25 11:39:21 +02:00
Andrea Corallo
3a8d94dec1 Run admin/syncdoc-type-hierarchy.el
* doc/lispref/elisp_type_hierarchy.jpg: Update.
* doc/lispref/elisp_type_hierarchy.txt: Likewise.
2024-04-23 15:39:28 +02:00
Eli Zaretskii
e3aae5fd38 ; Document 'filtered-frame-list'
* doc/lispref/frames.texi (Finding All Frames): Document
'filtered-frame-list'.
2024-04-20 14:52:02 +03:00
Eli Zaretskii
9ea415cde3 Merge from origin/emacs-29
ecb80e0e8a ; Improve wording in documentation of 'not and 'null'
5971aa1fd3 * lisp/dnd.el (dnd-handle-movement): Avoid errors (bug#70...
bbc5204a0f * doc/misc/calc.texi: Improve indexing.
2024-04-20 07:36:02 -04:00
Eli Zaretskii
42776dc5b7 ; Fix documentation of recent commits related to treesit
* src/treesit.c (Ftreesit_parser_changed_ranges):
* doc/lispref/parsing.texi (Using Parser): Fix wording.
2024-04-20 09:53:35 +03:00
Yuan Fu
996b957671
New function treesit-parser-changed-ranges
- Add a new field last_changed_ranges to tree-sitter parser object.
- Add a new function treesit-parser-changed-ranges

* doc/lispref/parsing.texi (Using Parser): Add the function in
tree-sitter manual.
* src/treesit.c (treesit_get_changed_ranges): New function, refactored
out of treesit_call_after_change_functions.
(treesit_call_after_change_functions): Pull out
treesit_get_changed_ranges.
(treesit_ensure_parsed): Save the changed ranges to the parser object.
(make_treesit_parser): Initialize the new parser field
last_changed_ranges.
(Ftreesit_parser_changed_ranges): New function.
(Qtreesit_unparsed_edits): New error.
* src/treesit.h (Lisp_TS_Parser): New field.
2024-04-19 19:04:44 -07:00
Yuan Fu
8166d9d174
; Minor fix in tree-sitter manual section
* doc/lispref/parsing.texi (User-defined Things): Mention
treesit-defun-type-regexp.
2024-04-19 19:04:44 -07:00
Eric Abrahamsen
e5b4d4dd1b ; Improve wording of manual entry for `peg-run'
* doc/lispref/peg.texi (Parsing Expression Grammars): "lambda form"
isn't really a meaningful term.  Prefer plain "function", though in this
case we've used "anonymous function" to avoid ambiguity.
2024-04-19 16:26:36 -07:00
Eric Abrahamsen
2141caca30 ; Improvements to PEG documentation (second attempt)
* doc/lispref/peg.texi: Make more use of defmac/defmacro, and try to
clarify the relationships between the various macros and functions.
* lisp/progmodes/peg.el (peg-parse): Remove claim that PEXS can also be
a single list of rules.
2024-04-16 17:26:47 -07:00
Mattias Engdegård
9a673c6914 Revert "; Improvements to PEG documentation"
This reverts commit 930c578c10.
Looks like an editing mistake ate a large part of the text.
2024-04-16 11:59:20 +02:00
Eric Abrahamsen
930c578c10 ; Improvements to PEG documentation
* doc/lispref/peg.texi: Make more use of defmac/defmacro, and try to
clarify the relationships between the various macros and functions.
* lisp/progmodes/peg.el (peg-parse): Remove claim that PEXS can also be
a single list of rules.
2024-04-15 20:14:50 -07:00
Eli Zaretskii
ecb80e0e8a ; Improve wording in documentation of 'not and 'null'
* doc/lispref/control.texi (Combining Conditions):
* doc/lispref/lists.texi (List-related Predicates): Clarify
wording of 'not' vs 'null'.  (Bug#70392)
2024-04-15 14:52:03 +03:00
Juri Linkov
568c174135 Add 'forward-sexp-default-function' to be used by 'treesit-forward-sexp'
* lisp/emacs-lisp/lisp.el (forward-sexp-default-function):
New function with body from 'forward-sexp' (bug#68993).
(forward-sexp-function): Change the default value from nil to
'forward-sexp-default-function'.
(forward-sexp): Use either 'forward-sexp-function' or
'forward-sexp-default-function'.

* lisp/treesit.el (treesit-forward-sexp): In nodes of type 'text'
fall back to 'forward-sexp-default-function'.  Improve docstring.

* doc/lispref/positions.texi (List Motion): Fix pxref.
2024-04-14 19:22:01 +03:00
Stefan Monnier
cd113d8c45 text.texi (Tracking changes): Fix warning
* doc/lispref/text.texi (Change Hooks): Add a menu to silence warnings.
(Tracking changes): Improve the title.
2024-04-14 12:07:23 -04:00
Stefan Monnier
17e26cf57e (define-globalized-minor-mode): Require the use of run-mode-hooks
When `define-globalized-minor-mode` was introduced (Emacs-22),
`run-mode-hooks` was brand new, so we could not expect all major
modes to use it and we had to rely on brittle workarounds to try
and approximate `after-change-major-mode-hook`.

These workarounds have undesirable side effects, and (we hope)
they're not needed any more now that virtually all major modes
have been changed to use `run-mode-hooks` (or
`define-derived-mode`).

* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Rely only on `after-change-major-mode-hook`, remove the "cmhh"
[typo for the intended "cmmh", BTW] workaround.

* doc/lispref/modes.texi (Mode Hooks): Clarify the importance of
`after-change-major-mode-hook` w.r.t `define-globalized-minor-mode`.
(Defining Minor Modes): Rewrite the explanation of which buffers
are affected, including adjusting it to the fact that
`fundamental-mode` has used run `run-mode-hooks` for last 10 years.
2024-04-13 10:31:28 -04:00
Stefan Monnier
d67e08d6c3 Merge branch 'track-changes' 2024-04-13 09:44:12 -04:00
Stefan Monnier
d7a83e23d4 lisp/emacs-lisp/track-changes.el: New file (bug#70077)
This new package provides an API that is easier to use right than
our `*-change-functions` hooks.

The patch includes changes to `diff-mode.el` and `eglot.el` to
make use of this new package.

* lisp/emacs-lisp/track-changes.el: New file.
* test/lisp/emacs-lisp/track-changes-tests.el: New file.
* doc/lispref/text.texi (Tracking changes): New subsection.

* lisp/progmodes/eglot.el: Require `track-changes`.
(eglot--virtual-pos-to-lsp-position): New function.
(eglot--track-changes): New var.
(eglot--managed-mode): Use `track-changes-register` i.s.o
`after/before-change-functions` when available.
(eglot--track-changes-signal): New function, partly extracted from
`eglot--after-change`.
(eglot--after-change): Use it.
(eglot--track-changes-fetch): New function.
(eglot--signal-textDocument/didChange): Use it.

* lisp/vc/diff-mode.el: Require `track-changes`.
Also require `easy-mmode` before the `eval-when-compile`s.
(diff-unhandled-changes): Delete variable.
(diff-after-change-function): Delete function.
(diff--track-changes-function): Rename from `diff-post-command-hook`
and adjust to new calling convention.
(diff--track-changes): New variable.
(diff--track-changes-signal): New function.
(diff-mode, diff-minor-mode): Use it with `track-changes-register`.
2024-04-13 09:43:11 -04:00
Eli Zaretskii
952f20fabe ; Fix documentation of last change.
* etc/NEWS:
* doc/lispref/display.texi (Other Display Specs):
* doc/lispref/text.texi (Special Properties): Fix last changes.
2024-04-13 14:20:16 +03:00
Vladimir Kazanov
5734047b81 Support tooltips for fringe indicators
* src/xdisp.c (note_fringe_highlight): New function.
(note_mouse_highlight): Call it when the mouse is on the fringes.
* src/frame.c (syms_of_frame) <left-fringe-help>
<right-fringe-help>: DEFSYM them.

* etc/NEWS:
* doc/lispref/text.texi (Special Properties):
* doc/lispref/display.texi (Other Display Specs): Document the new
properties.
* etc/TODO: Remove the todo item about this.
2024-04-13 14:14:04 +03:00
Eli Zaretskii
8b210a636f ; Improve documentation of tree-sitter "things"
* doc/lispref/parsing.texi (User-defined Things): Fix text,
punctuation, and markup.
(Tree-sitter Major Modes): Add the missing "things" reference.

* etc/NEWS: Fix "thing"-related entries.
2024-04-13 11:52:57 +03:00
Juri Linkov
103a2fdf18 * doc/lispref/parsing.texi (Parsing Program Source): Fix menu.
Add the new node "User-defined Things" to the menu.
2024-04-10 21:07:21 +03:00
Yuan Fu
4efe3b99a5
Document tree-sitter things feature (bug#70016) (bug#68824)
* doc/lispref/parsing.texi (Retrieving Nodes): Mention new kinds of
predicate argument that the tree-traversing functions accept (which are
thing symbols and thing definitions).
(User-defined Things): New node dedicated to thing definition and
navigation functions.
2024-04-07 23:22:44 -07:00
Eli Zaretskii
b4864ca4af Merge from origin/emacs-29
3d87d74a23 ; * etc/PROBLEMS: Entry about slow mouse-wheel with GTK3 ...
c6899603b9 ; * doc/lispref/tips.texi (Documentation Tips): Improve (...
bd2c4d825d ; Update admin/make-tarball.txt
f107dc26e3 ; * etc/PROBLEMS: Add an entry about WebKitGTK (bug#66068).
2024-04-06 11:13:35 -04:00
Eli Zaretskii
fab58ffc22 ; * doc/lispref/commands.texi (Focus Events): Fix markup of last change. 2024-04-06 13:13:27 +03:00
Jared Finder
9260904072 Add documentation for 'switch-window' event
* doc/lispref/commands.texi (Focus Events): Add
documentation for the structure of 'switch-window' events.
Make sure to be clear when referring to window system windows
vs Emacs windows.
* doc/lispref/windows.texi (Mouse Window Auto-selection):
Adding cross-reference to "Focus Events".  (Bug#69915)
2024-04-06 13:08:21 +03:00
Basil L. Contovounesios
64e1cfb98c ; Fix indentation in last change to windows.texi. 2024-04-05 09:55:58 +02:00
Eli Zaretskii
c6899603b9 ; * doc/lispref/tips.texi (Documentation Tips): Improve (bug#70163). 2024-04-04 16:28:31 +03:00
Mattias Engdegård
0670032c0d json-insert doc fixes
* src/json.c (Fjson_insert): Precise the behaviour when the current
buffer is multibyte and unibyte, respectively.
* doc/lispref/text.texi (Parsing JSON): Refer to the right function.
2024-04-02 19:06:39 +02:00