1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-25 07:28:20 +00:00

Distribute the real source for some doc/misc manuals (bug#45143)

* doc/misc/modus-themes.texi, doc/misc/org.texi:
Remove generated files from repository.
* doc/misc/Makefile.in: Add rules for building .texi from .org.
(ORG_SRC, abs_top_builddir, EMACS, emacs):
New variables.
(org_template): New template.
(orgclean): New phony target.
* Makefile.in (info): Depend on lisp.
* lisp/org/ox-texinfo.el (org-texinfo-export-to-texinfo-batch):
New function.
* doc/misc/org.org, doc/misc/org-setup.org: New files.
Import from https://code.orgmode.org d8e8a97a14.
This commit is contained in:
Glenn Morris 2021-02-26 19:28:43 -08:00
parent 3984044ad3
commit fddd63f8b8
7 changed files with 21999 additions and 25984 deletions

View File

@ -982,6 +982,8 @@ INFOS = lispref-info lispintro-info emacs-info misc-info
PDFS = lispref-pdf lispintro-pdf emacs-pdf misc-pdf
PSS = lispref-ps lispintro-ps emacs-ps misc-ps
## FIXME all of the misc- targets should really depend on lisp,
## like the info target.
DOCS = $(DVIS) $(HTMLS) $(INFOS) $(PDFS) $(PSS)
$(DOCS):
$(MAKE) -C doc/$(subst -, ,$@)
@ -1084,7 +1086,14 @@ uninstall-ps: $(UNINSTALL_PS)
# would require changing every rule in doc/ that builds an info file,
# and it's not worth it. This case is only relevant if you download a
# release, then change the .texi files.
info:
# The dependency is due to those doc/misc/ manuals that use .org sources.
# I would have preferred to just add this to the misc-info target,
# but that gave parallel build errors.
# Depending on src is sufficient, but ends up being slow, since the
# uncompiled lisp/org/*.el files are used to build the .texi files
# (which is slow even with the elc files).
info: lisp
ifneq ($(HAVE_MAKEINFO),no)
$(MAKE) info-real info-dir
endif

View File

@ -82,6 +82,11 @@ INFO_INSTALL = $(INFO_COMMON) $(DOCMISC_W32)
## because the info files are pre-built in release tarfiles.
INFO_TARGETS = $(INFO_COMMON) efaq-w32
## Some manuals have their source in .org format.
## This is discouraged because the .texi files it generates
## are not as well formatted as handwritten ones.
ORG_SRC = org modus-themes
# There are some naming differences between the info targets and the other
# targets, so let's resolve them here.
TARGETS_1 = $(INFO_INSTALL:ccmode=cc-mode)
@ -221,6 +226,26 @@ gnus.pdf: $(gnus_deps)
${buildinfodir}/tramp.info tramp.html: ${srcdir}/trampver.texi
abs_top_builddir = @abs_top_builddir@
EMACS = ${abs_top_builddir}/src/emacs
emacs = "${EMACS}" -batch --no-site-file --no-site-lisp
# Generated .texi files go in srcdir so they can be included in the
# release tarfile along with the others.
# Work in srcdir (and use abs_top_builddir) so that +setupfile and
# things like org-setup's "version" macro work. Sigh.
define org_template
$${srcdir}/$(1).texi: $${srcdir}/$(1).org
@rm -f $$@
$${AM_V_GEN}cd "$${srcdir}" && $${emacs} -l ox-texinfo \
-f org-texinfo-export-to-texinfo-batch $$< $$@
endef
$(foreach orgfile,${ORG_SRC},$(eval $(call org_template,$(orgfile))))
${srcdir}/org.texi: ${srcdir}/org-setup.org
.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean
mostlyclean:
@ -245,7 +270,12 @@ infoclean:
$(buildinfodir)/$${file}-[1-9][0-9]; \
done
bootstrap-clean maintainer-clean: distclean infoclean
.PHONY: orgclean
orgclean:
rm -f $(addprefix ${srcdir}/,${ORG_SRC:=.texi})
bootstrap-clean maintainer-clean: distclean infoclean orgclean
.PHONY: install-dvi install-html install-pdf install-ps install-doc

File diff suppressed because it is too large Load Diff

36
doc/misc/org-setup.org Normal file
View File

@ -0,0 +1,36 @@
# SETUPFILE for manuals
# XXX: We cannot use TODO keyword as a node starts with "TODO".
#+todo: REVIEW FIXME | DONE
#+property: header-args :eval no
#+startup: overview nologdone
# Use proper quote and backtick for code sections in PDF output
# Cf. Texinfo manual 14.2
#+texinfo_header: @set txicodequoteundirected
#+texinfo_header: @set txicodequotebacktick
# Contact Info
#+texinfo_header: @set MAINTAINERSITE @uref{https://orgmode.org,maintainers webpage}
#+texinfo_header: @set MAINTAINER Bastien Guerry
#+texinfo_header: @set MAINTAINEREMAIL @email{bzg@gnu.org}
#+texinfo_header: @set MAINTAINERCONTACT @uref{mailto:bzg@gnu.org,contact the maintainer}
#+options: H:4 num:t toc:t author:t \n:nil ::t |:t ^:nil -:t f:t *:t <:t e:t ':t
#+options: d:nil todo:nil pri:nil tags:not-in-toc stat:nil broken-links:mark
#+select_tags: export
#+exclude_tags: noexport
#+macro: cite @@texinfo:@cite{@@$1@@texinfo:}@@
#+macro: var @@texinfo:@var{@@$1@@texinfo:}@@
# The "version" macro extracts "Version" keyword from "org.el". It
# returns major.minor version number. This is sufficient since bugfix
# releases are not expected to add features and therefore imply manual
# modifications.
#+macro: version (eval (with-current-buffer (find-file-noselect "../lisp/org.el") (org-with-point-at 1 (if (re-search-forward "Version: +\\([0-9.]+\\)" nil t) (mapconcat #'identity (cl-subseq (split-string (match-string-no-properties 1) "\\.") 0 2) ".") (error "Missing \"Version\" keyword in \"org.el\"")))))
# The "kbd" macro turns KBD into @kbd{KBD}. Additionally, it
# encloses case-sensitive special keys (SPC, RET...) within @key{...}.
#+macro: kbd (eval (let ((case-fold-search nil) (regexp (regexp-opt '("SPC" "RET" "LFD" "TAB" "BS" "ESC" "DELETE" "SHIFT" "Ctrl" "Meta" "Alt" "Cmd" "Super" "UP" "LEFT" "RIGHT" "DOWN") 'words))) (format "@@texinfo:@kbd{@@%s@@texinfo:}@@" (replace-regexp-in-string regexp "@@texinfo:@key{@@\\&@@texinfo:}@@" $1 t))))

21905
doc/misc/org.org Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1627,6 +1627,23 @@ Return output file's name."
(org-export-to-file 'texinfo outfile
async subtreep visible-only body-only ext-plist)))
(defun org-texinfo-export-to-texinfo-batch ()
"Export Org file INFILE to Texinfo file OUTFILE, in batch mode.
Usage: emacs -batch -f org-texinfo-export-to-texinfo-batch INFILE OUTFILE"
(or noninteractive (user-error "Batch mode use only"))
(let ((infile (pop command-line-args-left))
(outfile (pop command-line-args-left))
(org-export-coding-system org-texinfo-coding-system))
(unless (file-readable-p infile)
(message "File `%s' not readable" infile)
(kill-emacs 1))
(when (file-exists-p outfile)
(message "File `%s' already exists" outfile)
(kill-emacs 1))
(with-temp-buffer
(insert-file-contents infile)
(org-export-to-file 'texinfo outfile))))
;;;###autoload
(defun org-texinfo-export-to-info
(&optional async subtreep visible-only body-only ext-plist)