No description
Find a file
Rahul Martim Juliato b36a26bb3b
Improve 'markdown-ts-mode'
Overhaul 'markdown-ts-mode' with comprehensive fontification,
code block handling, editing commands, fill-paragraph support,
inline image previews, a mode menu, and table editing.  Add
'markdown-ts-mode-x.el' with conversion/export and TOC support.

* lisp/textmodes/markdown-ts-mode.el: Add Version,
Package-Requires, and Keywords header fields.  Expand Commentary
with documentation for code block language modes, code block
commands, bidirectional text, and known tree-sitter grammar
bugs.
(require 'goto-addr, xref, icons): New requirements.
(markdown-ts): New customization group with :version and
:package-version tags.
(markdown-ts-hide-markup): Add :version and :package-version.
(markdown-ts-ellipsis): New option for folded heading ellipsis.
(markdown-ts-menu-bar-show): New option to toggle mode menu.
(markdown-ts-default-folding): New option for default fold
level.
(markdown-ts-inline-images): New option to display inline
images.
(markdown-ts-image-max-width): New option for image max width.
(markdown-ts-display-remote-inline-images): New option for
remote image handling.
(markdown-ts--resolve-display-value): New helper to resolve
display values using char-displayable-p.
(markdown-ts-checked-checkbox): New option for checked checkbox
display string or icon.
(markdown-ts-checked-checkbox-icon): New icons.el icon for the
checked variant.
(markdown-ts-unchecked-checkbox): New option for unchecked
checkbox display string or icon.
(markdown-ts-unchecked-checkbox-icon): New icons.el icon for the
unchecked variant.
(markdown-ts-thematic-break-character): New option for thematic
break display character.
(markdown-ts-hard-line-break-backslash): New option for the
glyph shown in place of a trailing-backslash hard line break
when markup is hidden.
(markdown-ts-hard-line-break-space): New option for the glyph
shown in place of a trailing-spaces hard line break when markup
is hidden.
(markdown-ts-code-block-in-context-mode-lighter): New option for
code block context mode lighter string.
(markdown-ts-inhibit-code-block-mode-warnings): New option to
inhibit code-block major-mode messages and warnings.
(markdown-ts-table-default-column-width): New option for default
table column width.
(markdown-ts-enable-table-mode): New option to enable table
mode.
(markdown-ts-table-auto-align): New option for triggers that
cause automatic table alignment.
(markdown-ts-table-align-features): New option for table align
features.
(markdown-ts-in-table-mode-lighter): New option for
markdown-ts-in-table-mode lighter string.
(markdown-ts-emphasis, markdown-ts-bold)
(markdown-ts-strikethrough, markdown-ts-link)
(markdown-ts-link-destination, markdown-ts-code-span)
(markdown-ts-code-block, markdown-ts-code-block-markup-hidden)
(markdown-ts-indented-code-block, markdown-ts-html-tag)
(markdown-ts-html-block, markdown-ts-thematic-break)
(markdown-ts-entity-reference)
(markdown-ts-numeric-character-reference, markdown-ts-latex)
(markdown-ts-table-header, markdown-ts-table-cell)
(markdown-ts-table-delimiter-cell, markdown-ts-task-unchecked)
(markdown-ts-task-checked): New faces.
(markdown-ts-hard-line-break-backslash)
(markdown-ts-hard-line-break-backslash-hidden)
(markdown-ts-hard-line-break-space)
(markdown-ts-hard-line-break-space-hidden): New faces for the
two hard-line-break variants, with distinct shown/hidden
appearances.
(markdown-ts-in-code-block): New face for when point is inside a
fenced code block.
(markdown-ts-table): New face for Markdown pipe table
background.
(markdown-ts-in-table): New face for markdown-ts-in-table-mode
when point is in a table.
(markdown-ts--set-up-inline): New variable for lightweight setup
in embedded inline markdown-ts-mode buffers used by code block
commands.
(markdown-ts-default-code-block-mode): New variable to define
default mode for anonymous code blocks.
(markdown-ts-fontify-code-blocks-natively): New option to
enable/disable native fontification of fenced code block
contents.
(markdown-ts-enable-code-block-context-mode): New option to
enable/disable code block context integration.
(markdown-ts-code-block-modes): New variable replacing
markdown-ts--code-block-language-map and
markdown-ts-code-block-source-mode-map with unified language to
mode mapping including heuristic lookup.
(markdown-ts-code-block-force-conventional-modes): New variable
listing tree-sitter modes whose fontification of code block
content should be harvested via a temporary buffer.
(markdown-ts-table-export-buffer): New constant for table export
output buffer name.
(markdown-ts--table-row-types, markdown-ts--table-cell-types)
(markdown-ts--table-delimiter-cell-types)
(markdown-ts--table-delimiter-cell-subtypes): New constants for
pipe table node type classification.
(markdown-ts--make-link-button): New function to create
clickable link buttons with mailto, browse-url, and find-file
dispatch.
(markdown-ts--fontify-link-destination): New fontifier that
hides link destinations when markup is hidden.
(markdown-ts--link-ref-cache, markdown-ts--link-ref-cache-tick)
(markdown-ts--link-ref-definitions)
(markdown-ts--resolve-link-ref): New link reference definition
cache with case-insensitive matching per CommonMark spec.
(markdown-ts--fontify-link-node): New fontifier for inline,
reference, shortcut, and collapsed links as clickable buttons.
(markdown-ts--fontify-autolink): New fontifier for URI and email
autolinks with angle bracket hiding.
(markdown-ts--fontify-link-ref-label)
(markdown-ts--fontify-link-ref-destination): New fontifiers for
link reference definitions.
(markdown-ts--slug-github-strip-re, markdown-ts--slug-github)
(markdown-ts--slug-pandoc, markdown-ts--explicit-id-re)
(markdown-ts--heading-text-and-id)
(markdown-ts--heading-id-cache)
(markdown-ts--heading-id-cache-tick)
(markdown-ts--build-heading-ids, markdown-ts--heading-ids)
(markdown-ts--follow-fragment): New fragment link support with
GitHub and Pandoc slug algorithms.
(markdown-ts--latex-block-valid-p)
(markdown-ts--fontify-latex-block): New LaTeX/math fontifier
with cross-paragraph validation.
(markdown-ts--fontify-backslash-escape): New fontifier that
hides backslash in escapes except inside LaTeX blocks.
(markdown-ts--decode-entity, markdown-ts--fontify-entity): New
HTML entity decoder and fontifier using org-entities and
sgml-char-names with display property for decoded values.
(markdown-ts--fontify-checkbox): New fontifier showing the
configured checkbox glyph when markup is hidden.
(markdown-ts--fontify-hard-line-break): New fontifier for
'hard_line_break' nodes.
(markdown-ts--fontify-heading): New fontifier for ATX and Setext
headings.
(markdown-ts--fontify-thematic-break): New fontifier showing
horizontal line when markup is hidden.
(markdown-ts--fontify-code-block): New fontifier applying
background overlay to code blocks with language and mode
properties.
(markdown-ts-at-code-block-p)
(markdown-ts-code-block-language-at)
(markdown-ts-code-block-mode-at): New accessors for code block
overlay properties.
(markdown-ts--imenu-code-block-node-p): New helper for imenu
code block detection.
(markdown-ts--image-alone-on-line-p)
(markdown-ts--fontify-image): New inline image display with
standalone and inline positioning.
(markdown-ts--bare-url-regexp)
(markdown-ts--bare-email-uri-regexp)
(markdown-ts--fontify-bare-uri): New bare URL/email
fontification via jit-lock using goto-addr regexps.
(markdown-ts--treesit-settings): Rewrite with dedicated faces,
custom fontifiers, and new font-lock features for all inline and
block elements.  Also add a new 'error' font-lock feature
highlighting tree-sitter ERROR nodes.
(markdown-ts--code-block-languages)
(markdown-ts--code-block-non-ts-modes): New buffer-local alists
for code block language tracking.
(markdown-ts--harvest-mode-treesit-configuration): Rename from
markdown-ts--harvest-treesit-configs with delay-mode-hooks.
(markdown-ts--configure-current-buffer): Rename from
markdown-ts--add-config-for-mode.
(markdown-ts--language-at-node): New helper extracting language
symbol from code_fence_content node.
(markdown-ts--non-ts-fontify-cache): New buffer-local hash table
caching fontification results for non-tree-sitter code blocks.
(markdown-ts--fontify-non-ts-collect-faces): New function
harvesting face properties from a mode in an indirect or
temporary buffer.
(markdown-ts--fontify-non-ts-code-block): New fontifier for
non-tree-sitter modes via temporary buffer font-lock.
(markdown-ts--code-block-language-mode): New function with
heuristic mode name probing.
(markdown-ts--code-block-ts-language): Rename from
markdown-ts--convert-code-block-language with support for non-ts
modes and recursive markdown handling.
(markdown-ts-code-block-commands)
(markdown-ts-code-block-thing-commands)
(markdown-ts-code-block-region-commands): New command lists for
code-block context execution.
(markdown-ts--enable-code-block-in-context-mode)
(markdown-ts--maybe-run-command-in-code-block)
(markdown-ts--code-block-xref-find-definitions)
(markdown-ts--run-command-in-code-block): New code block minor
mode with temp-buffer command dispatch.
(markdown-ts--code-block-newline): New command for newline
inside code blocks, dispatching to the block's mode.
(markdown-ts--range-settings): Update range configuration;
remove :range-fn treesit-range-fn-exclude-children.
(markdown-ts--remove-image-overlays)
(markdown-ts--outline-view-change): New helpers for image
overlay management during outline fold/unfold.
(markdown-ts--outline-invisible-p): New helper testing whether a
position is inside an outline-folded region.
(markdown-ts--host-ranges-notifier): New function pruning stale
code block overlays when the host parse tree changes.
(markdown-ts--barf-if-not-mode): New helper signaling a
user-error when the current buffer is not derived from
markdown-ts-mode.
(markdown-ts-code-block-in-context-mode): New minor mode enabled
when point is within a fenced code block, activating
markdown-ts-code-block-in-context-mode-map so eligible commands
dispatch to the block's major mode.
(markdown-ts--set-hide-markup): Clear image overlays when
toggling markup visibility.
(markdown-ts--set-inline-images)
(markdown-ts-toggle-inline-images): New functions for toggling
inline image display.
(markdown-ts--parser-heading-max-level): New constant.
(markdown-ts--heading-at-point, markdown-ts--heading-level)
(markdown-ts--section-at-point): New heading navigation helpers.
(markdown-ts-promote, markdown-ts-demote): New commands for
heading and list item promotion/demotion with region support.
(markdown-ts--promote-or-demote)
(markdown-ts--promote-or-demote-region): New heading level
adjustment functions.
(markdown-ts-move-subtree-up, markdown-ts-move-subtree-down):
New commands for moving sections and list items.
(markdown-ts--section-folded-p)
(markdown-ts--move-subtree-up-or-down): New subtree move with
folding state preservation.
(markdown-ts-toggle-checkbox): New command to toggle task list
checkboxes.
(markdown-ts--list-item-at-point): New helper with block quote
marker handling.
(markdown-ts--list-marker-width, markdown-ts--list-item-region)
(markdown-ts--list-ordered-item-p): New list item helpers.
(markdown-ts--list-promote-or-demote): New function with ordered
list nesting guard.
(markdown-ts--list-node-bol, markdown-ts--list-move): New list
item movement functions.
(markdown-ts-renumber-list): New command for sequential list
renumbering with prefix argument support.
(markdown-ts--list-item-new-marker)
(markdown-ts--new-marker-for-line): New marker string generators
for list item insertion.
(markdown-ts--line-block-quote-depth): New helper counting block
quote depth.
(markdown-ts-newline): New RET command for context-aware
newline.
(markdown-ts-insert-list-item): New M-RET command that creates a
new list item.
(markdown-ts--fill-unfillable-block-query): New tree-sitter
query for unfillable blocks.
(markdown-ts--list-item-text-column): New helper for list item
text alignment.
(markdown-ts--fill-list-item): New function filling within list
items without merging adjacent items.
(markdown-ts--adaptive-fill): New adaptive fill function for
list item continuation.
(markdown-ts--fill-forward-paragraph): New paragraph motion
respecting list items and unfillable blocks.
(markdown-ts-fill-paragraph): New fill-paragraph-function with
cond* dispatch for lists, block quotes, HTML comments, and
unfillable blocks.
(markdown-ts--fill-html-comment): New HTML comment filler with
continuation alignment.
(markdown-ts--block-quote-prefix): New helper preserving
existing block quote marker style.
(markdown-ts--fill-block-quote): New block quote filler with
list item text column alignment.
(markdown-ts-emphasis-alist): New alist of emphasis markers.
(markdown-ts--emphasis-node-at-point): New tree-sitter based
emphasis detection.
(markdown-ts-remove-emphasis): New command removing emphasis at
point or region.
(markdown-ts-emphasize): New interactive emphasis insertion with
region wrapping and word-at-point support.
(markdown-ts-insert-structure): New command for inserting code
blocks, block quotes, and dividers.
(markdown-ts--insert-code-block): New function with language
completion from known modes.
(markdown-ts--insert-block-quote): New function with region
wrapping.
(markdown-ts--insert-divider): New function for horizontal
rules.
(markdown-ts--apply-ellipsis): New function applying custom
ellipsis via display table.
(markdown-ts--set-up): Rename from markdown-ts-setup.
(markdown-ts-outline-cycle): New TAB command cycling outline
visibility on headings.
(markdown-ts-mode-map): New keymap for code block navigation,
bindings for heading navigation, structure editing, emphasis,
and list operations.
(markdown-ts-code-block-in-context-mode-map): New keymap for
code block context.
(markdown-ts-mode-menu): New menu bar with Show/Hide, Navigate
Headings, Edit Structure, and Editing sections.
(markdown-ts-mode): Add outline-minor-mode, ellipsis, folding,
fill-paragraph integration, code-block-context-mode hooks,
comment settings, and outline-view-change-hook.  Use
markdown-ts-mode directly in auto-mode-alist instead of
markdown-ts-mode-maybe.
(markdown-ts-mode-install-parsers): New command for installing
required and optional tree-sitter language grammars.
(markdown-ts-code-block-context-mode): New minor mode for code
block context.
(markdown-ts--find-code-block-delimiter)
(markdown-ts--find-next-code-block-delimiter): New helpers for
locating fenced code block delimiter nodes.
(markdown-ts-move-to-next-code-block)
(markdown-ts-move-to-previous-code-block): New commands for
navigating between fenced code blocks.
(markdown-ts--table-abutting-pos, markdown-ts--table-node-cell)
(markdown-ts--table-node-row, markdown-ts--table-parse-error-p):
New pipe table node helpers.
(markdown-ts-at-table-p): New predicate returning non-nil when
point is at or within a pipe table.
(markdown-ts--enable-in-table-mode): New helper enabling
markdown-ts-in-table-mode from post-command-hook.
(markdown-ts--table-body-row-near-pos): New helper locating the
nearest body row to a position.
(markdown-ts--table-compute-node-column)
(markdown-ts-table--goto-column): New helpers for column-based
table navigation.
(markdown-ts--table-aligners, markdown-ts--table-make-aligner)
(markdown-ts--table-align-cell): New table cell alignment
helpers.
(markdown-ts-table-insert-table): New command to insert a pipe
table with configurable rows and columns.
(markdown-ts-table-delete-table): New command to delete the pipe
table at point.
(markdown-ts-table-previous-row, markdown-ts-table-next-row)
(markdown-ts-table-previous-cell, markdown-ts-table-next-cell):
New commands for navigating table rows and cells.
(markdown-ts-table-insert-row-below)
(markdown-ts-table-insert-row-above)
(markdown-ts-table-clone-row-below)
(markdown-ts-table-clone-row-above)
(markdown-ts-table-insert-row): New commands for inserting and
cloning table rows.
(markdown-ts-table-delete-row, markdown-ts-table-move-row-up)
(markdown-ts-table-move-row-down, markdown-ts-table-move-row):
New commands for deleting and moving table rows.
(markdown-ts-table-insert-column-left)
(markdown-ts-table-insert-column-right)
(markdown-ts-table-clone-column-left)
(markdown-ts-table-clone-column-right)
(markdown-ts-table-insert-column): New commands for inserting
and cloning table columns.
(markdown-ts-table-delete-column)
(markdown-ts-table-move-column-left)
(markdown-ts-table-move-column-right)
(markdown-ts-table-move-column): New commands for deleting and
moving table columns.
(markdown-ts-table-align-column-left)
(markdown-ts-table-align-column-center)
(markdown-ts-table-align-column-right)
(markdown-ts-table-align-column): New commands for setting
column alignment.
(markdown-ts-table-align-table): New command to align all
columns in the table at point.
(markdown-ts-table-transpose-table): New command to transpose
the table at point.
(markdown-ts-table-convert-csv-region)
(markdown-ts-table-convert-tsv-region)
(markdown-ts-table-convert-region): New commands to convert
delimited text regions to pipe tables.
(markdown-ts-table-export-table-csv)
(markdown-ts-table-export-table-tsv)
(markdown-ts-table-export-table): New commands to export the
pipe table at point to CSV or TSV format.
(markdown-ts-in-table-mode-map): New keymap for
markdown-ts-in-table-mode.
(markdown-ts--code-block-in-context-mode-ov): New buffer-local
variable for code block context overlay.
(markdown-ts--code-block-in-context-mode-update-ov): New
function updating the code block context overlay.
(markdown-ts-in-table-mode): New minor mode enabled when point
is within a pipe table, activating markdown-ts-in-table-mode-map.
(markdown-ts--in-table-mode-ov)
(markdown-ts--in-table-mode-get-ov)
(markdown-ts--table-tick-update)
(markdown-ts--table-tick-stale-p)
(markdown-ts--in-table-mode-update-ov): New helpers supporting
markdown-ts-in-table-mode overlay management.
(markdown-ts-table-mode): New minor mode providing table editing
commands and auto-alignment.
(markdown-ts-mode-maybe): Remove; auto-mode-alist now uses
markdown-ts-mode directly.
Auto-mode-alist: Add .markdown and .mdx extensions.

* lisp/textmodes/markdown-ts-mode-x.el: New file providing extra
features for markdown-ts-mode.
(markdown-ts-commonmark-spec-url, markdown-ts-gfm-spec-url): New
constants for CommonMark and GFM specification URLs.
(markdown-ts-browse-commonmark-spec)
(markdown-ts-browse-gfm-spec): New commands to browse the
CommonMark and GFM specifications.
(markdown-ts-convert): New customization group for Markdown
conversion/export features.
(markdown-ts-default-converter): New option to set the default
format and converter for Markdown export.
(markdown-ts-convert-display-function): New option specifying
the function used to display converted output.
(markdown-ts-converters): New variable listing format/converter
configurations for pandoc, cmark, cmark-gfm, markdown, and
markdown.pl.
(markdown-ts-convert-file, markdown-ts-convert): New commands to
convert Markdown buffers or files to HTML, PDF, and other
formats via external converters.
(markdown-ts-toc): New customization group for table of contents
features.
(markdown-ts-toc-generate-warn-if-none): New option controlling
behavior when no TOC is found during generation.
(markdown-ts-toc-update-before-save-mode-lighter): New option
for the before-save TOC update minor mode lighter string.
(markdown-ts-toc-slug-function): New option to select the slug
algorithm used for TOC heading anchors.
(markdown-ts--toc-handles, markdown-ts--toc-handle-classes): New
variables defining TOC handle types and classes.
(markdown-ts--toc-expand-candidate-handles, markdown-ts--tocs)
(markdown-ts--tocs-sanity-check)
(markdown-ts--toc-collect-candidates)
(markdown-ts--toc-list-item-depth)
(markdown-ts--toc-atx_header-normalize)
(markdown-ts--toc-text-normalizers)
(markdown-ts--toc-text-normalize): New internal helpers for TOC
parsing and text normalization.
(markdown-ts-toc-update-before-save-mode): New minor mode that
regenerates tables of contents before saving.
(markdown-ts-toc-clear-and-remove, markdown-ts-toc-clear): New
commands to remove or clear TOC bodies.
(markdown-ts-toc-insert-template): New command to insert a TOC
template at point.
(markdown-ts-toc-generate): New command to generate tables of
contents in the current buffer.

Includes fixes for: (bug#80613) (bug#80625) (bug#80690)

Co-authored-by: Stéphane Marks <shipmints@gmail.com>
2026-05-05 00:22:46 -07:00
admin ; * admin/notes/jargon: Add entries. 2026-05-04 16:08:43 +02:00
build-aux Ignore Emacs developer’s global core.whitespace 2026-03-13 10:27:49 -07:00
cross ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
doc nadvice.el: Make it easier to find how to change an interactive-form 2026-05-04 20:21:51 -04:00
etc nadvice.el: Make it easier to find how to change an interactive-form 2026-05-04 20:21:51 -04:00
exec ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
java ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
leim ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
lib Update from Gnulib by running admin/merge-gnulib 2026-03-01 10:41:54 -08:00
lib-src ; Improve documentation of Emacs server-client protocol 2026-05-02 12:35:48 +03:00
lisp Improve 'markdown-ts-mode' 2026-05-05 00:22:46 -07:00
lwlib butttonTrans need not be extern 2026-02-08 17:02:55 -08:00
m4 Update from Gnulib by running admin/merge-gnulib 2026-03-01 10:41:54 -08:00
modules ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
msdos ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
nextstep ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
nt Fix MinGW64 build broken by changes in emacsclient.c 2026-04-13 16:31:16 +03:00
oldXMenu ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
src keyboard.c: Allow SIGINT to quit in batch mode, instead of exit 2026-05-04 12:49:35 -04:00
test keyboard.c: Allow SIGINT to quit in batch mode, instead of exit 2026-05-04 12:49:35 -04:00
.clang-format ; Configure ObjC for clang-format 2023-10-06 16:52:19 +02:00
.clangd Tweak .clangd to work with gcc-compiled Emacs (bug#78367) 2025-05-11 11:14:32 +01:00
.dir-locals.el Review some attribute macro usage 2026-03-14 15:08:15 +01:00
.gitattributes Merge branch 'main' into icalendar 2026-02-08 16:05:31 -05:00
.gitignore ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
.gitlab-ci.yml ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
.mailmap ; * .mailmap: Add email alias 2026-01-18 21:59:38 +01:00
autogen.sh ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
BUGS * BUGS: Minor copy edit. 2024-09-21 13:29:36 +02:00
ChangeLog.1 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ChangeLog.2 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ChangeLog.3 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ChangeLog.4 ; Spelling fixes. 2026-04-29 22:45:51 -07:00
ChangeLog.5 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ChangeLog.android ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
config.bat ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
configure.ac Work around GCC bug 125116 2026-05-01 18:39:56 -07:00
CONTRIBUTE ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
COPYING
GNUmakefile ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
INSTALL ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
INSTALL.REPO ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
make-dist ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
Makefile.in Fix "make install-nt" in parallel builds 2026-03-19 17:19:44 +02:00
README ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Copyright (C) 2001-2026 Free Software Foundation, Inc.
See the end of the file for license conditions.


This directory tree holds version 31.0.50 of GNU Emacs, the extensible,
customizable, self-documenting real-time display editor.

The file INSTALL in this directory says how to build and install GNU
Emacs on various systems, once you have unpacked or checked out the
entire Emacs file tree.

See the file etc/NEWS for information on new features and other
user-visible changes in recent versions of Emacs.

The file etc/PROBLEMS contains information on many common problems that
occur in building, installing and running Emacs.

The file CONTRIBUTE contains information on contributing to Emacs as a
developer.

You may encounter bugs in this release.  If you do, please report
them; your bug reports are valuable contributions to the FSF, since
they allow us to notice and fix problems on machines we don't have, or
in code we don't use often.  Please send bug reports to the mailing
list bug-gnu-emacs@gnu.org.  If possible, use M-x report-emacs-bug.

See the "Bugs" section of the Emacs manual for more information on how
to report bugs.  (The file 'BUGS' in this directory explains how you
can find and read that section using the Info files that come with
Emacs.)  For a list of mailing lists related to Emacs, see
<https://savannah.gnu.org/mail/?group=emacs>.  For the complete
list of GNU mailing lists, see <https://lists.gnu.org/>.

The 'etc' subdirectory contains several other files, named in capital
letters, which you might consider looking at when installing GNU
Emacs.

The file 'configure' is a shell script to acclimate Emacs to the
oddities of your processor and operating system.  It creates the file
'Makefile' (a script for the 'make' program), which automates the
process of building and installing Emacs.  See INSTALL for more
detailed information.

The file 'configure.ac' is the input used by the autoconf program to
construct the 'configure' script.

The shell script 'autogen.sh' generates 'configure' and other files by
running Autoconf (which in turn uses GNU m4), and configures files in
the .git subdirectory if you are using Git.  If you want to use it,
you will need to install recent versions of these build tools.  This
should be needed only if you edit files like 'configure.ac' that
specify Emacs's autobuild procedure.

The file 'Makefile.in' is a template used by 'configure' to create
'Makefile'.

The file 'make-dist' is a shell script to build a distribution tar
file from the current Emacs tree, containing only those files
appropriate for distribution.  If you make extensive changes to Emacs,
this script will help you distribute your version to others.

There are several subdirectories:

'src'       holds the C code for Emacs (the Emacs Lisp interpreter and
            its primitives, the redisplay code, and some basic editing
            functions).
'lisp'      holds the Emacs Lisp code for Emacs (most everything else).
'leim'      holds the original source files for the generated files
            in lisp/leim.  These form the library of Emacs input methods,
            required to type international characters that can't be
            directly produced by your keyboard.
'lib'       holds source code for libraries used by Emacs and its utilities
'lib-src'   holds the source code for some utility programs for use by or
            with Emacs, like movemail and etags.
'lwlib'     holds the sources of the Lucid Widget Library used on X.
'oldXMenu'  source files from X11R2 XMenu library, used in non-toolkit builds.
'etc'       holds miscellaneous architecture-independent data files Emacs
            uses, like the tutorial text and tool bar images.
            The contents of the 'lisp', 'leim', 'info', and 'doc'
            subdirectories are architecture-independent too.
'info'      holds the Info documentation tree for Emacs.
'doc/emacs' holds the source code for the Emacs Manual.  If you modify the
            manual sources, you will need the 'makeinfo' program to produce
            an updated manual.  'makeinfo' is part of the GNU Texinfo
            package; you need a suitably recent version of Texinfo.
'doc/lispref'   holds the source code for the Emacs Lisp reference manual.
'doc/lispintro' holds the source code for the Introduction to Programming
                in Emacs Lisp manual.
'msdos'     holds configuration files for compiling Emacs under MS-DOS.
'nextstep'  holds instructions and some other files for compiling the
            Nextstep port of Emacs, for GNUstep and macOS Cocoa.
'nt'        holds code and documentation for building Emacs on MS-Windows.
'test'      holds tests for various aspects of Emacs's functionality.
'modules'   holds the modhelp.py helper script.
'admin'     holds files used by Emacs developers, and Unicode data files.
'build-aux' holds auxiliary files used during the build.
'm4'        holds Autoconf macros used for generating the configure script.
'java'	    holds the Java code for the Emacs port to Android.
'cross'	    holds Makefiles and an additional copy of gnulib used to build
	    Emacs for Android devices.
'exec'	    holds the source code to several helper executables used to run
	    user-installed programs on Android.

   Building Emacs on non-Posix platforms requires tools that aren't part
of the standard distribution of the OS.  The platform-specific README
files and installation instructions should list the required tools.


NOTE ON COPYRIGHT YEARS

In copyright notices where the copyright holder is the Free Software
Foundation, then where a range of years appears, this is an inclusive
range that applies to every year in the range.  For example: 2005-2008
represents the years 2005, 2006, 2007, and 2008.


This file is part of GNU Emacs.

GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.