emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] doc/Makefile: Auto-generate org-version.tex for orgcard
@ 2017-06-23 19:58 Kyle Meyer
  2017-06-24  8:49 ` Bastien Guerry
  0 siblings, 1 reply; 2+ messages in thread
From: Kyle Meyer @ 2017-06-23 19:58 UTC (permalink / raw)
  To: Org-mode; +Cc: Bastien Guerry

Hello,

It seems that the only place where we hardcode the Org version is
orgcard.tex.  Any objections to auto-generating this as well?

-- >8 --
* doc/Makefile: Add rule to generate org-version.tex.
* doc/orgcard.tex: Include org-version.tex rather than explicitly
setting version and year.

This removes the only instance in the repo where the Org version is
hardcoded.
---
 .gitignore      |  1 +
 doc/Makefile    | 11 +++++++++--
 doc/orgcard.tex |  4 +---
 mk/targets.mk   |  1 +
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index 70980cede..68d94d595 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,6 +33,7 @@ org
 org-loaddefs.el
 org-version.el
 doc/org-version.inc
+doc/org-version.tex
 org-*.tar*
 orgplus-*.tar*
 org-*.zip
diff --git a/doc/Makefile b/doc/Makefile
index 2c8a3c58c..87f8c2781 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -33,13 +33,20 @@ org-version.inc:	org.texi
 	@echo "@set VERSION $(ORGVERSION) ($(GITVERSION))" >> org-version.inc
 	@echo "@set DATE $(DATE)" >> org-version.inc
 
+org-version.tex:	orgcard.tex
+	@echo "org-version: $(ORGVERSION) ($(GITVERSION))"
+	@echo "% automatically generated, do not edit"  > org-version.tex
+	@echo "\def\orgversionnumber{$(ORGVERSION)}" >> org-version.tex
+	@echo "\def\versionyear{$(YEAR)}" >> org-version.tex
+	@echo "\def\year{$(YEAR)}" >> org-version.tex
+
 install:	org
 	if [ ! -d $(DESTDIR)$(infodir) ]; then $(MKDIR) $(DESTDIR)$(infodir); else true; fi ;
 	$(CP) org $(DESTDIR)$(infodir)
 	$(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) org
 
 clean:
-	$(RM) org *.pdf *.html *_letter.tex org-version.inc \
+	$(RM) org *.pdf *.html *_letter.tex org-version.inc org-version.tex \
 	      *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs \
 	      *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps
 cleanall:	clean
@@ -59,7 +66,7 @@ clean-install:
 %.pdf:		LANG=C
 %.pdf:		%.texi org-version.inc
 	$(TEXI2PDF) $<
-%.pdf:		%.tex
+%.pdf:		%.tex org-version.tex
 	PDFLATEX=$(PDFTEX) $(TEXI2PDF) $<
 
 %.html:		%.texi org-version.inc
diff --git a/doc/orgcard.tex b/doc/orgcard.tex
index 7f300633f..9659c5b4b 100644
--- a/doc/orgcard.tex
+++ b/doc/orgcard.tex
@@ -1,7 +1,5 @@
 % Reference Card for Org Mode
-\def\orgversionnumber{9.0.4}
-\def\versionyear{2017}          % latest update
-\def\year{2017}                 % latest copyright year
+\input org-version.tex
 
 %**start of header
 \newcount\columnsperpage
diff --git a/mk/targets.mk b/mk/targets.mk
index 0ccb6eafb..de4b8b861 100644
--- a/mk/targets.mk
+++ b/mk/targets.mk
@@ -20,6 +20,7 @@ else
   ORGVERSION ?= N/A
 endif
 DATE          = $(shell date +%Y-%m-%d)
+YEAR          = $(shell date +%Y)
 ifneq ($(GITSTATUS),)
   GITVERSION := $(GITVERSION:.dirty=).dirty
 endif
-- 
2.13.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] doc/Makefile: Auto-generate org-version.tex for orgcard
  2017-06-23 19:58 [PATCH] doc/Makefile: Auto-generate org-version.tex for orgcard Kyle Meyer
@ 2017-06-24  8:49 ` Bastien Guerry
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien Guerry @ 2017-06-24  8:49 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: Org-mode

Hi Kyle,

Kyle Meyer <kyle@kyleam.com> writes:

> It seems that the only place where we hardcode the Org version is
> orgcard.tex.  Any objections to auto-generating this as well?

None from me, thanks for this.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-24  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-23 19:58 [PATCH] doc/Makefile: Auto-generate org-version.tex for orgcard Kyle Meyer
2017-06-24  8:49 ` Bastien Guerry

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).