Also change window-tool-mode to not pay attention to if
tool-bar-map has a buffer local value or not as that made the
documentation complicated. Documentation added in Emacs manual,
Elisp manual, package commentary, and docstrings. Also extend
window-tool-bar support to Emacs 27 and newer. (bug#68765)
* doc/emacs/emacs.texi (Top):
* doc/emacs/frames.texi (Menu Bars):
* doc/emacs/glossary.texi (Glossary):
* doc/emacs/modes.texi (Minor Modes):
* doc/emacs/windows.texi (Windows, Tab Line): Mention Window
Tool Bar.
(Window Tool Bar): New documentation.
* doc/lispref/elisp.texi (Top):
* doc/lispref/modes.texi (Mode Line Format, Mode Line Basics)
(Mode Line Data): Mention Tab Lines.
(Tab Lines): New documentation.
* etc/NEWS: Mention newly added variable and package.
* lisp/window-tool-bar.el (window-tool-bar-mode): Don't display
tool bar when tool-bar-map is nil.
* lisp/window-tool-bar.el (tool-bar-always-show-default): Define
variable for older Emacs versions.
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.
* doc/emacs/text.texi (Outline Format): Add 'outline-search-function'.
* doc/lispref/elisp.texi (Top): Add new menu item "Outline Minor Mode"
after "Imenu".
* doc/lispref/modes.texi (Modes): Add new menu item "Outline Minor Mode"
after "Imenu".
(Major Mode Conventions): Mention "Outline Minor Mode" with @pxref.
(Outline Minor Mode): New node.
* doc/lispref/parsing.texi (Tree-sitter Major Modes): Mention
'treesit-outline-predicate' with @pxref.
* lisp/treesit.el (treesit-outline-predicate): New buffer-local variable.
(treesit-outline-predicate--from-imenu): New internal function.
(treesit-outline-search, treesit-outline-level): New functions.
(treesit-major-mode-setup): Set up treesit-outline-predicate,
outline-search-function and outline-level.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--outline-predicate):
New internal function.
(c-ts-base-mode): Set 'treesit-outline-predicate' to
'c-ts-mode--outline-predicate'.
* lisp/progmodes/heex-ts-mode.el (heex-ts-mode): Kill inherited
local variables 'outline-heading-end-regexp', 'outline-regexp',
'outline-level'.
* lisp/progmodes/lua-ts-mode.el (lua-ts-mode): Remove 'outline-regexp'.
Suggested by john muhl <jm@pub.pink>.
* lisp/textmodes/html-ts-mode.el (html-ts-mode): Kill inherited
local variables 'outline-heading-end-regexp', 'outline-regexp',
'outline-level'.
The obsolete lazy-loaded bytecode feature, enabled by
`byte-compile-dynamic`, slows down Lisp execution even when not in use
because every call to a bytecode function has to check that function
for laziness.
This change forces up-front loading of all lazy bytecode so that we
can remove all those checks. (Dynamically loaded doc strings are not
affected.)
There is no point in generating lazy bytecode any more so we stop
doing that; this simplifies the compiler. `byte-compile-dynamic` now
has no effect.
This is a fully compatible change; the few remaining users of
`byte-compile-dynamic` should not notice any difference.
* src/lread.c (bytecode_from_rev_list): Force eager loading of
lazy bytecode.
* src/bytecode.c (exec_byte_code): Remove lazy bytecode checks.
* src/eval.c (fetch_and_exec_byte_code, Ffetch_bytecode): Remove.
(funcall_lambda): Call exec_byte_code directly, avoiding checks.
* lisp/subr.el (fetch-bytecode): New definition, obsolete no-op.
* lisp/emacs-lisp/disass.el (disassemble-1):
* lisp/emacs-lisp/bytecomp.el (byte-compile-unfold-bcf):
Remove calls to fetch-bytecode.
(byte-compile-dynamic): Update doc string.
(byte-compile-close-variables, byte-compile-from-buffer)
(byte-compile-insert-header, byte-compile-output-file-form)
(byte-compile--output-docform-recurse, byte-compile-output-docform)
(byte-compile-file-form-defmumble):
Remove effects of byte-compile-dynamic.
* doc/lispref/compile.texi (Dynamic Loading): Remove node now that
the entire `byte-compile-dynamic` facility has been rendered inert.
* etc/NEWS: Announce changes.
* doc/lispref/variables.texi (Variable Scoping)
(Lexical Binding, Dynamic Binding):
Alter the presentation order from the point of view that lexical
binding is the standard discipline (if not always the default) and
dynamic binding an alternative, which corresponds better to Elisp
today. Modernise parts of the text.
* doc/lispref/elisp.texi (Top): Update menu.
* doc/lispref/elisp.texi (Top):
* doc/lispref/frames.texi (Frames): Add ``Accessing Selections''
to menu.
(Accessing Selections, X Selections, Other Selections): New
nodes.
"Language grammar" is apparently the more widely used term among
people talking about tree-sitter. To avoid confusion, I think it's
good to use that rather than "language definition", which is a term
that I made up :-)
Feel free to revert this if it is too much change.
* doc/lispref/elisp.texi:
* doc/lispref/modes.texi:
* doc/lispref/parsing.texi:
* lisp/treesit.el: Change "language definition" to "language grammar".
* doc/lispref/parsing.texi (Parsing Program Source):
* doc/lispref/modes.texi (Font Lock Mode)
(Parser-based Font Lock): Fix wording, punctuation, and markup.
Add index entries.
* lisp/treesit.el (treesit-node-at, treesit-language-at): Rename
argument POINT to POS.
* doc/lispref/functions.texi (Advice and Byte Code): New node.
* lisp/help-fns.el (help-fns--compiler-macro): Also output data on
other byte compilation things, and link to the manual (bug#23264).
* configure.ac (HAVE_TREE_SITTER, TREE_SITTER_OBJ): New variables.
(DYNAMIC_LIB_SUFFIX): new variable, I copied code from MODULES_SUFFIX
so the diff looks this way.
* doc/lispref/elisp.texi (Top): Add tree-sitter manual.
* doc/lispref/modes.texi (Font Lock Mode): mention tree-sitter.
(Parser-based Font Lock): New section.
(Auto-Indentation): Mention tree-sitter.
(Parser-based Indentation): New section.
* doc/lispref/parsing.texi (Parsing Program Source): New chapter.
* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add
treesit-parser and treesit-node type.
* lisp/treesit.el: New file.
* src/Makefile.in (TREE_SITTER_LIBS, TREE_SITTER_FLAGS,
TREE_SITTER_OBJ): New variables.
* src/alloc.c:
(cleanup_vector): Add cleanup code for treesit-parser and
treesit-node.
* src/casefiddle.c (casify_region): Notify tree-sitter parser of
buffer change.
* src/data.c (Ftype_of): Add treesit-parser and treesit-node type
(Qtreesit_parser, Qtreesit_node): New symbol.
* src/emacs.c (main): Add symbols in treesit.c.
* src/eval.c (define_error): Move the function to here.
* src/insdel.c (insert_1_both, insert_from_string_1, insert_from_gap,
insert_from_buffer_1, replace_range, del_range_2): Notify tree-sitter
parser of buffer change.
* src/json.c (define_error): Move this function out.
* src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN): Add treesit-parser and
treesit-node.
* src/lread.c (Vdynamic_library_suffixes): New variable.
* src/print.c (print_vectorlike): Add code for printing
treesit-parser and treesit-node.
* src/treesit.c: New file.
* src/treesit.h: New file.
* test/src/treesit-tests.el: New file.
* lisp/cedet/semantic/fw.el (semantic-alias-obsolete)
(semantic-varalias-obsolete): Replace calls to byte-compile-warn with calls to
byte-compile-warn-x (when it exists).
* lisp/emacs-lisp/bytecomp.el (byte-compile-log-warning-function)
(byte-compile--log-warning-for-byte-compile): Make the POSITION parameter no
longer &optional (for the benefit of flymake on *.el).
(byte-compile-log-warning): Replace a nil POSITION argument with an actual
position.
(byte-compile-file-form-require): Push the required symbol onto
byte-compile-form-stack, for the benefit of `do-after-load-evaluation'.
* lisp/keymap.el (define-keymap--compile): Replace four calls to
byte-compile-warn with byte-compile-warn-x.
* doc/lispref/elisp.texi (master menu): Add entries for Shorthands and Symbols
with position.
* doc/lispref/streams.texi (Input Functions): Document
read-positioning-symbols.
* doc/lispref/symbols.texi (Symbols): Add new menu entry.
(Symbols with Position): New @section.
* configure.ac: Add check for the sqlite library.
* doc/lispref/text.texi (Database): Document it.
* lisp/sqlite.el: New file.
* lisp/term/w32-win.el (dynamic-library-alist): Add a mapping.
* src/Makefile.in (SQLITE3_LIBS): Add the libraries.
* src/alloc.c (union emacs_align_type): Add a Lisp_Sqlite struct.
* src/data.c (Ftype_of): Add sqlite.
* src/emacs.c (main): Load the syms.
* src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN): Add PVEC_SQLITE.
(GCALIGNED_STRUCT): New struct to keep data for sqlite database
objects and statement objects.
(SQLITEP, SQLITE, CHECK_SQLITE, XSQLITE): New macros for accessing
the objects.
* src/pdumper.c (dump_vectorlike): Update hash.
(dump_vectorlike): Don't dump it.
* src/print.c (print_vectorlike): Add a printer for the sqlite
object.
* src/sqlite.c: New file.
* test/src/sqlite-tests.el: Add tests.
* doc/lispref/elisp.texi: Add Xwidget Type to the menu.
* doc/lispref/objects.texi (Editing Types): Add Xwidget Type to the
menu.
(Xwidget Type): New node.
* doc/emacs/killing.texi (Clipboard): Refer to it.
* doc/lispref/frames.texi (Yanking Media): Document the mechanism.
* lisp/yank-media.el: New file.
* lisp/gnus/message.el (message-mode): Register a yank handler for
images.
(message-insert-screenshot): Factor out image code from here...
(message--yank-media-image-handler): ... to here.
Help users affected by our NFA engine's stack overflows and occasional
poor performance, replacing old text that was more limited in scope.
* doc/lispref/elisp.texi (Top):
* doc/lispref/searching.texi (Regular Expressions): Add menu entries.
(Regexp Problems): New node.
(Regexp Special):
* etc/PROBLEMS: Remove superseded text.
* doc/lispref/buffers.texi (Current Buffer, Buffer List): Update
references to 'selected-window'.
* doc/lispref/elisp.texi (Top): Move up Selecting Windows section
in front of Window Sizes section.
* doc/lispref/frames.texi (Creating Frames): Say window system
instead of windowing system.
(Frame Layout): Add Tab Bar to layout.
(Layout Parameters): Add 'tab-bar-lines'.
(Input Focus): Say window system window instead of window
manager window. Fix reference to 'selected-window'.
* doc/lispref/objects.texi (Window Type): Minor rewrite.
* doc/lispref/windows.texi (Basic Windows): Rewrite. Settle on
term 'window system window' for disambiguation with our windows.
Move 'selected-window' description to Selecting Windows section.
Move schematic of window structure here. Use 'decorations' for
objects outside the window body. Say that the areas reserved
for continuation and truncation glyphs, vertical dividers and
line numbers are part of the window body.
(Windows and Frames): Minor rewrite, adding and fixing some
cross references. Move live window schematic to 'Basic Windows'
section.
(Selecting Windows): Move section in front of Window Sizes
section. Move description of 'selected-window' here. Move up
description of 'frame-selected-window' and
'set-frame-selected-window'. Update and move description of
'window-bump-use-time' here.
(Window Sizes): Throughout use the term 'decorations' instead of
enumerating them individually. Add 'window-tab-line-height'
description.
(Resizing Windows): Again use the term 'decorations' instead of
enumerating them individually.
(Splitting Windows): Minor fix.
(Cyclic Window Ordering): Improve descriptions of 'get-lru-window'
and 'get-mru-window'. Move 'window-bump-use-time' to Selecting
Windows section.
(Coordinates and Windows, Window Configurations): Once more use
the term 'decorations' instead of enumerating them individually.
* src/window.c (Fwindow_bump_use_time): Move after
'window-use-time'. Make it work for live windows only. Make
WINDOW argument optional. Update doc-string.
These days, a "home page" is understood to be only "the main web page
of a website" or "landing page", whereas a "website" is "a collection
of web pages and related content" (Wikipedia).
* doc/emacs/emacs.texi (Top):
* doc/emacs/package.texi (Package Menu):
* doc/lispintro/emacs-lisp-intro.texi (Top):
* doc/lispref/elisp.texi (Top):
* doc/lispref/tips.texi (Documentation Tips):
* doc/misc/ede.texi (ede-project):
* doc/misc/efaq-w32.texi (More information):
* doc/misc/gnus-faq.texi (FAQ 5-7):
* doc/misc/gnus.texi (About mairix):
* doc/misc/mairix-el.texi (About):
* doc/misc/reftex.texi (AUCTeX, Imprint):
* lisp/cedet/ede/base.el (ede-project):
* lisp/cedet/ede/system.el (ede-web-browse-home):
* lisp/emacs-lisp/package.el (package-menu-mode-menu)
(package-browse-url):
* lisp/erc/erc-button.el (erc-emacswiki-url):
* lisp/filesets.el (filesets-goto-homepage):
* lisp/net/mairix.el:
* lisp/net/webjump.el (webjump-sample-sites):
* lisp/obsolete/vc-arch.el:
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode):
* lisp/progmodes/idlwave.el (idlwave, idlwave-mode):
* lisp/textmodes/reftex-vars.el (reftex):
Prefer "website" to "home page".
* doc/lispref/tips.texi (Documentation Tips):
Sort the "URL" header comment before "Homepage".
* lisp/emacs-lisp/lisp-mnt.el
(lm-website): Rename from 'lm-homepage'.
(lm-homepage): Make into alias for 'lm-website'.
* doc/lispref/commands.texi (Command Modes): Add index entries.
* doc/lispref/elisp.texi (Top): Add entry for the Command Modes
node to the detailed node listing.
* doc/lispref/loading.texi (How Programs Do Loading)
(Library Search): Update for native-compilation features.
* doc/lispref/compile.texi (Native Compilation)
(Native-Compilation Functions, Native-Compilation Variables): New
chapter and sections.
* doc/lispref/elisp.texi (Top): Update the top-level menus.
* etc/NEWS: Add a reference to the ELisp manual.
Thorough redesign of the Bindat system, which makes it possible
to define new Bindat type forms, define recursive types, control
the values returned when unpacking, freely mix arbitrary computations
with type definitions, as well as support for arbitrary sized
integers.
This also reverts the recent addition of the `bindat-spec` macro and
the support for 64bit integers in the old Bindat language since that
is now considered obsolete anyway.
* doc/lispref/processes.texi (Bindat Types): Rename from `Bindat Spec`
and rewrite for the new sublanguage.
(Bindat Functions): Adjust to the new terminology.
(Bindat Computed Types): New node.
* lisp/emacs-lisp/bindat.el (bindat--type): New type.
(bindat--unpack-u64, bindat--unpack-u64r): Delete functions.
(bindat--unpack-item, bindat--pack-item, bindat--fixed-length-alist):
Revert addition of support for 64bit integers.
(bindat--unpack-group, bindat--length-group, bindat--pack-group):
Handle the new `bindat--type` values.
(bindat-spec): Revert addition of this macro.
(bindat--unpack-uint, bindat--unpack-uintr, bindat--pack-uint)
(bindat--pack-uintr): New functions.
(bindat-type, bindat-defmacro, bindat--pcase): New macros.
(bindat-type): New Edebug elem.
(bindat--type): New generic function.
(bindat--primitives): New constant.
(bindat--macroenv, bindat--op): New vars.
(bindat--make-docstring, bindat--fun, bindat--makefun, bindat--toplevel):
New functions.
* test/lisp/emacs-lisp/bindat-tests.el: Use `bindat-type`.
(ip): New Bindat type.
(header-bindat-spec, data-bindat-spec, packet-bindat-spec): Adjust to
new `bindat-type` macro.
(bindat-test-unpack): Simplify now that the order of fields is preserved.
(bindat-test--int-websocket-type, bindat-test--LEB128): New consts.
(bindat-test--pack-val, bindat-test--sint, bindat-test--recursive):
New tests.
Inspired by patch proposed by Dmitry Gutov (Bug#40671#393)
and by further comments by him and by Michael Heerdegen
in the same bug report.
* doc/lispintro/emacs-lisp-intro.texi (setcar):
Don’t push mutability here.
* doc/lispref/eval.texi (Self-Evaluating Forms, Quoting)
(Backquote):
* doc/lispref/lists.texi (Modifying Lists):
* doc/lispref/objects.texi (Lisp Data Types, Mutability):
* doc/lispref/sequences.texi (Array Functions, Vectors):
* doc/lispref/strings.texi (String Basics, Modifying Strings):
Don’t use the word “constant” to describe all values that
a program should not change.
* doc/lispref/objects.texi (Mutability):
Rename from “Constants and Mutability”. All uses changed.
In a footnote, contrast the Emacs behavior with that of Common
Lisp, Python, etc. for clarity, and say the goal is to be nicer.
This change was inspired by comments from Štěpán Němec in:
https://lists.gnu.org/r/emacs-devel/2020-04/msg01063.html
* doc/lispref/objects.texi (Lisp Data Types): Mention mutability.
(Constants and mutability): New section.
* doc/lispintro/emacs-lisp-intro.texi (Lists diagrammed)
(Indent Tabs Mode): Improve wording.
* doc/lispref/eval.texi (Self-Evaluating Forms):
Say that they return constants.
* doc/lispref/lists.texi (Sets And Lists):
Fix memql mistake/confusion that I recently introduced.
This redoes the 2019-11-02T00:24:02!eggert@cs.ucla.edu patch,
updated after consultation with John Sullivan.
Omit printed edition numbers in online manuals while keeping
them in printed manuals. In online manuals the edition
numbers seem to cause more confusion than they cure; e.g.,
https://shop.fsf.org/books/gnu-emacs-manual-18th-edition-v-261
currently advertises "18th edition" even as it points to
https://www.gnu.org/software/emacs/manual/pdf/emacs.pdf which
says "Seventeenth Edition". It is simpler and less confusing
to stick to one version number like "27.0" in online manuals.
For printed manuals people can run, e.g., "texi2any -D
'EDITION Nineteenth'" when generating the 19th printed edition
of the Emacs manual.
* doc/emacs/emacs.texi (EDITION):
* doc/lispintro/emacs-lisp-intro.texi (edition-number, update-date):
* doc/lispref/elisp.texi (VERSION, DATE):
Remove definitions. Instead, let the person printing the book
specify these values, with the default being the online version
which does not have printed edition numbers.
* doc/lispintro/emacs-lisp-intro.texi (titlepage-edition-number):
New flag, for the edition number as it appears on the title page.