From dcf8834baca7d4e1761483b9ea74206cadb8b114 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 17 Sep 2012 00:22:17 -0700 Subject: [PATCH] Reduce version number duplication in etc/refcards * etc/refcards/emacsver.tex: New file. * etc/refcards/calccard.tex, etc/refcards/cs-dired-ref.tex: * etc/refcards/cs-refcard.tex, etc/refcards/cs-survival.tex: * etc/refcards/de-refcard.tex, etc/refcards/dired-ref.tex: * refcards/emacsver.tex, etc/refcards/fr-dired-ref.tex: * etc/refcards/fr-refcard.tex, etc/refcards/fr-survival.tex: * etc/refcards/orgcard.tex, etc/refcards/pl-refcard.tex: * etc/refcards/pt-br-refcard.tex, etc/refcards/refcard.tex: * etc/refcards/sk-dired-ref.tex, etc/refcards/sk-refcard.tex: * etc/refcards/sk-survival.tex, etc/refcards/survival.tex: * etc/refcards/vipcard.tex, etc/refcards/viperCard.tex: Include emacsver.tex. * refcards/calccard.tex (\emacsversionnumber): Rename to \versionemacs, same as all the other refcards. * etc/refcards/Makefile (ENVADD): New variable. (sk-dired-ref.pdf, sk-survival.pdf, pl-refcard.pdf) (%.pdf, %,dvi, sk-dired-ref.dvi, sk-survival.dvi, pl-refcard.dvi): Depend on emacsver.tex. Add "." to TEXINPUTS for TeX commands. * admin/admin.el (set-version): Set major version in etc/refcards/ru-refcard.tex and etc/refcards/emacsver.tex. (set-copyright): In etc/refcards, only change ru-refcard.tex and emacsver.tex. * admin.el (cusver-scan, cusver-check): Bind local variables. * .bzrignore: Add etc/refcards TeX intermediate files. --- admin/ChangeLog | 7 +++++++ admin/admin.el | 32 ++++++++++++++++++-------------- etc/ChangeLog | 20 ++++++++++++++++++++ etc/refcards/Makefile | 27 ++++++++++++++------------- etc/refcards/calccard.tex | 5 ++--- etc/refcards/cs-dired-ref.tex | 3 +-- etc/refcards/cs-refcard.tex | 3 +-- etc/refcards/cs-survival.tex | 3 +-- etc/refcards/de-refcard.tex | 3 +-- etc/refcards/dired-ref.tex | 3 +-- etc/refcards/emacsver.tex | 4 ++++ etc/refcards/fr-dired-ref.tex | 3 +-- etc/refcards/fr-refcard.tex | 3 +-- etc/refcards/fr-survival.tex | 3 +-- etc/refcards/orgcard.tex | 2 +- etc/refcards/pl-refcard.tex | 3 +-- etc/refcards/pt-br-refcard.tex | 3 +-- etc/refcards/refcard.tex | 3 +-- etc/refcards/sk-dired-ref.tex | 3 +-- etc/refcards/sk-refcard.tex | 3 +-- etc/refcards/sk-survival.tex | 3 +-- etc/refcards/survival.tex | 3 +-- etc/refcards/vipcard.tex | 2 +- etc/refcards/viperCard.tex | 2 +- 24 files changed, 83 insertions(+), 63 deletions(-) create mode 100644 etc/refcards/emacsver.tex diff --git a/admin/ChangeLog b/admin/ChangeLog index 6d3118d8ba6..cef27f3f52e 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,5 +1,12 @@ 2012-09-17 Glenn Morris + * admin.el (cusver-scan, cusver-check): Bind local variables. + + * admin.el (set-version): Set major version in + etc/refcards/ru-refcard.tex and etc/refcards/emacsver.tex. + (set-copyright): In etc/refcards, only change ru-refcard.tex + and emacsver.tex. + * admin.el (set-copyright): No more need to set copyrights for nextstep, or .c files. Add configure.ac and config.nt. diff --git a/admin/admin.el b/admin/admin.el index 4d68fca97b2..536236c3f70 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -126,7 +126,16 @@ Root must be the root of an Emacs source tree." (set-version-in-file root "nt/emacsclient.rc" comma-space-version (rx (and "\"ProductVersion\"" (0+ space) ?, (0+ space) ?\" (submatch (1+ (in "0-9, "))) - "\\0\""))))) + "\\0\""))) + (when (string-match "\\([0-9]\\{2,\\}\\)" version) + (setq version (match-string 1 version)) + (set-version-in-file root "etc/refcards/ru-refcard.tex" version + "\\\\newcommand{\\\\versionemacs}\\[0\\]\ +{\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs") + (set-version-in-file root "etc/refcards/emacsver.tex" version + "\\\\def\\\\versionemacs\ +{\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs")))) + ;; Note this makes some assumptions about form of short copyright. (defun set-copyright (root copyright) @@ -150,19 +159,14 @@ Root must be the root of an Emacs source tree." (set-version-in-file root "lib-src/rcs2log" copyright (rx (and "Copyright" (0+ space) ?= (0+ space) ?\' (submatch (1+ nonl))))) - ;; This one is a nuisance, as it needs to be split over two lines. - (string-match "\\(.*[0-9]\\{4\\} *\\)\\(.*\\)" copyright) (when (string-match "\\([0-9]\\{4\\}\\)" copyright) (setq copyright (match-string 1 copyright)) - (dolist (file (directory-files (expand-file-name "etc/refcards" root) - t "\\.tex\\'")) - (unless (string-match "gnus-refcard\\.tex" file) - (set-version-in-file - root file copyright - (concat (if (string-match "ru-refcard\\.tex" file) - "\\\\newcommand{\\\\cyear}\\[0\\]{" - "\\\\def\\\\year{") - "\\([0-9]\\{4\\}\\)}.+%.+copyright year")))))) + (set-version-in-file root "etc/refcards/ru-refcard.tex" copyright + "\\\\newcommand{\\\\cyear}\\[0\\]\ +{\\([0-9]\\{4\\}\\)}.+%.+copyright year") + (set-version-in-file root "etc/refcards/emacsver.tex" copyright + "\\\\def\\\\year\ +{\\([0-9]\\{4\\}\\)}.+%.+copyright year"))) ;;; Various bits of magic for generating the web manuals @@ -443,7 +447,7 @@ If optional argument OLD is non-nil, also scan for defvars." (let ((m (format "Scanning %s..." file)) (re (format "^[ \t]*\\((def%s\\)[ \t\n]" (if old "\\(?:custom\\|var\\)" "custom"))) - alist var ver) + alist var ver form) (message "%s" m) (with-temp-buffer (insert-file-contents file) @@ -502,7 +506,7 @@ changes (in a non-trivial way). This function does not check for that." (mapcar (lambda (file) (cons file (cusver-scan file))) newfiles))) - oldcus result thisfile) + oldcus result thisfile file) (message "Reading old defcustoms...") (dolist (file oldfiles) (setq oldcus (append oldcus (cusver-scan file t)))) diff --git a/etc/ChangeLog b/etc/ChangeLog index 5a14c523cf3..6f2b178fcd7 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,23 @@ +2012-09-17 Glenn Morris + + * refcards/emacsver.tex: New file. + * refcards/calccard.tex, refcards/cs-dired-ref.tex: + * refcards/cs-refcard.tex, refcards/cs-survival.tex: + * refcards/de-refcard.tex, refcards/dired-ref.tex: + * refcards/emacsver.tex, refcards/fr-dired-ref.tex: + * refcards/fr-refcard.tex, refcards/fr-survival.tex: + * refcards/orgcard.tex, refcards/pl-refcard.tex: + * refcards/pt-br-refcard.tex, refcards/refcard.tex: + * refcards/sk-dired-ref.tex, refcards/sk-refcard.tex: + * refcards/sk-survival.tex, refcards/survival.tex: + * refcards/vipcard.tex, refcards/viperCard.tex: Include emacsver.tex. + * refcards/calccard.tex (\emacsversionnumber): + Rename to \versionemacs, same as all the other refcards. + * refcards/Makefile (ENVADD): New variable. + (sk-dired-ref.pdf, sk-survival.pdf, pl-refcard.pdf) + (%.pdf, %,dvi, sk-dired-ref.dvi, sk-survival.dvi, pl-refcard.dvi): + Depend on emacsver.tex. Add "." to TEXINPUTS for TeX commands. + 2012-09-16 Paul Eggert Remove configure's --without-sync-input option (Bug#12450). diff --git a/etc/refcards/Makefile b/etc/refcards/Makefile index 64e2d8638f8..ef810da6022 100644 --- a/etc/refcards/Makefile +++ b/etc/refcards/Makefile @@ -47,26 +47,27 @@ VIPER_CARDS_PDF = vipcard.pdf viperCard.pdf viper-cards_pdf: ${VIPER_CARDS_PDF} viper-cards_ps: ${VIPER_CARDS_PDF:.pdf=.ps} +ENVADD = TEXINPUTS=".:" ## PDF files. ## The page layouts (a4/letter) are written directly in the .tex files. cs-refcard.pdf cs-dired-ref.pdf cs-survival.pdf sk-refcard.pdf \ -sk-dired-ref.pdf sk-survival.pdf: %.pdf: %.tex +sk-dired-ref.pdf sk-survival.pdf: %.pdf: %.tex emacsver.tex if pdfcsplain --version > /dev/null 2> /dev/null; then \ - pdfcsplain $<; \ + ${ENVADD} pdfcsplain $<; \ else \ - csplain "\pdfoutput=1\input $<"; \ + ${ENVADD} csplain "\pdfoutput=1\input $<"; \ fi ## Some versions of pdfmex seem to create dvi by default, hence output-format. -pl-refcard.pdf: %.pdf: %.tex +pl-refcard.pdf: %.pdf: %.tex emacsver.tex if ! kpsewhich -format=fmt mex > /dev/null && \ ! pdfmex --version > /dev/null 2> /dev/null; then \ echo "No mex format found."; false; \ fi - pdftex -output-format=pdf $< + ${ENVADD} pdftex -output-format=pdf $< ru-refcard.pdf: %.pdf: %.tex pdflatex $< @@ -81,21 +82,21 @@ gnus-booklet.pdf: gnus-refcard.tex gnus-logo.pdf pdflatex -jobname=gnus-booklet '\def\booklettrue{}\def\letterpapertrue{}\input{gnus-refcard}' ## Everything not explicitly listed above. -%.pdf: %.tex - pdftex $< +%.pdf: %.tex emacsver.tex + ${ENVADD} pdftex $< ## dvi files. cs-refcard.dvi cs-dired-ref.dvi cs-survival.dvi sk-refcard.dvi \ -sk-dired-ref.dvi sk-survival.dvi: %.dvi: %.tex - csplain $< +sk-dired-ref.dvi sk-survival.dvi: %.dvi: %.tex emacsver.tex + ${ENVADD} csplain $< -pl-refcard.dvi: %.dvi: %.tex +pl-refcard.dvi: %.dvi: %.tex emacsver.tex if ! kpsewhich -format=fmt mex > /dev/null; then \ echo "No mex format found."; false; \ fi - tex $< + ${ENVADD} tex $< ru-refcard.dvi gnus-refcard.dvi: %.dvi: %.tex latex $< @@ -105,8 +106,8 @@ gnus-booklet.dvi: gnus-refcard.tex mv gnus-refcard.dvi $@ ## Everything not explicitly listed above. -%.dvi: %.tex - tex $< +%.dvi: %.tex emacsver.tex + ${ENVADD} tex $< ## PostScript files. diff --git a/etc/refcards/calccard.tex b/etc/refcards/calccard.tex index fd3d45b8da4..04c88befeea 100644 --- a/etc/refcards/calccard.tex +++ b/etc/refcards/calccard.tex @@ -63,8 +63,7 @@ % UUCP: mit-erl!gildea % Internet: gildea@stop.mail-abuse.org -\def\emacsversionnumber{24} -\def\year{2012} % latest copyright year +\input emacsver.tex \def\shortcopyrightnotice{\vskip 1ex plus 2 fill \centerline{\small \copyright\ \year\ Free Software Foundation, Inc. @@ -276,7 +275,7 @@ are preserved on all copies. \title{GNU Calc Reference Card} -\centerline{(for GNU Emacs version \emacsversionnumber)} +\centerline{(for GNU Emacs version \versionemacs)} \section{Starting and Stopping} diff --git a/etc/refcards/cs-dired-ref.tex b/etc/refcards/cs-dired-ref.tex index ee7acaf416d..45867e11d44 100644 --- a/etc/refcards/cs-dired-ref.tex +++ b/etc/refcards/cs-dired-ref.tex @@ -41,8 +41,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/cs-refcard.tex b/etc/refcards/cs-refcard.tex index d17e5c6ddeb..98842dd08e0 100644 --- a/etc/refcards/cs-refcard.tex +++ b/etc/refcards/cs-refcard.tex @@ -59,8 +59,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/cs-survival.tex b/etc/refcards/cs-survival.tex index 5aa111c0297..4050cf0a1ab 100644 --- a/etc/refcards/cs-survival.tex +++ b/etc/refcards/cs-survival.tex @@ -54,8 +54,7 @@ % Czech hyphenation rules applied \chyph -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex \def\copyrightnotice{\penalty-1\vfill \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter diff --git a/etc/refcards/de-refcard.tex b/etc/refcards/de-refcard.tex index ca3141b8390..906895b358a 100644 --- a/etc/refcards/de-refcard.tex +++ b/etc/refcards/de-refcard.tex @@ -60,8 +60,7 @@ \input german.sty \mdqoff % deactivates the "-char -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed below this line. diff --git a/etc/refcards/dired-ref.tex b/etc/refcards/dired-ref.tex index 9ccf57682ff..b85bef1ce0b 100644 --- a/etc/refcards/dired-ref.tex +++ b/etc/refcards/dired-ref.tex @@ -43,8 +43,7 @@ \input pdflayout.sty \pdflayout=(1) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/emacsver.tex b/etc/refcards/emacsver.tex new file mode 100644 index 00000000000..620ee8ef9e0 --- /dev/null +++ b/etc/refcards/emacsver.tex @@ -0,0 +1,4 @@ +%% This file is not generated by configure, because then the provided +%% pdf files would always appear out-of-date. +\def\versionemacs{24} % major version of emacs +\def\year{2012} % latest copyright year diff --git a/etc/refcards/fr-dired-ref.tex b/etc/refcards/fr-dired-ref.tex index 2819bbaa25b..457ee2db472 100644 --- a/etc/refcards/fr-dired-ref.tex +++ b/etc/refcards/fr-dired-ref.tex @@ -35,8 +35,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/fr-refcard.tex b/etc/refcards/fr-refcard.tex index ed82f00a85d..4fe94d79075 100644 --- a/etc/refcards/fr-refcard.tex +++ b/etc/refcards/fr-refcard.tex @@ -56,8 +56,7 @@ \input pdflayout.sty \pdflayout=(0l) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed below this line. diff --git a/etc/refcards/fr-survival.tex b/etc/refcards/fr-survival.tex index 1cd9cc4cf05..16d67f6b1cd 100644 --- a/etc/refcards/fr-survival.tex +++ b/etc/refcards/fr-survival.tex @@ -49,8 +49,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex \def\copyrightnotice{\penalty-1\vfill \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index 3c0584d6db4..60e81f36d3e 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,7 +1,7 @@ % Reference Card for Org Mode \def\orgversionnumber{7.8.11} \def\versionyear{2012} % latest update -\def\year{2012} % latest copyright year +\input emacsver.tex %**start of header \newcount\columnsperpage diff --git a/etc/refcards/pl-refcard.tex b/etc/refcards/pl-refcard.tex index 9cc6fc6a6cd..db814cfa8c2 100644 --- a/etc/refcards/pl-refcard.tex +++ b/etc/refcards/pl-refcard.tex @@ -69,8 +69,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/pt-br-refcard.tex b/etc/refcards/pt-br-refcard.tex index c16d5096f30..d3fbe54ce87 100644 --- a/etc/refcards/pt-br-refcard.tex +++ b/etc/refcards/pt-br-refcard.tex @@ -62,8 +62,7 @@ \input pdflayout.sty \pdflayout=(0l) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed below this line. diff --git a/etc/refcards/refcard.tex b/etc/refcards/refcard.tex index 70788e8c67b..6ca9856085d 100644 --- a/etc/refcards/refcard.tex +++ b/etc/refcards/refcard.tex @@ -63,8 +63,7 @@ % Nothing else needs to be changed below this line. -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % copyright year +\input emacsver.tex \def\shortcopyrightnotice{\vskip 1ex plus 2 fill \centerline{\small \copyright\ \year\ Free Software Foundation, Inc. diff --git a/etc/refcards/sk-dired-ref.tex b/etc/refcards/sk-dired-ref.tex index 4b12b0b42eb..50d17409072 100644 --- a/etc/refcards/sk-dired-ref.tex +++ b/etc/refcards/sk-dired-ref.tex @@ -42,8 +42,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/sk-refcard.tex b/etc/refcards/sk-refcard.tex index 5105e8ca986..e617387fad1 100644 --- a/etc/refcards/sk-refcard.tex +++ b/etc/refcards/sk-refcard.tex @@ -60,8 +60,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/sk-survival.tex b/etc/refcards/sk-survival.tex index 7597c63f5c7..2e7ac9b9298 100644 --- a/etc/refcards/sk-survival.tex +++ b/etc/refcards/sk-survival.tex @@ -55,8 +55,7 @@ % Slovak hyphenation rules applied \shyph -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex \def\copyrightnotice{\penalty-1\vfill \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter diff --git a/etc/refcards/survival.tex b/etc/refcards/survival.tex index 92d178a130a..09151e9801c 100644 --- a/etc/refcards/survival.tex +++ b/etc/refcards/survival.tex @@ -44,8 +44,7 @@ \input pdflayout.sty \pdflayout=(1) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex \def\copyrightnotice{\penalty-1\vfill \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter diff --git a/etc/refcards/vipcard.tex b/etc/refcards/vipcard.tex index 13b43dbab73..2a709dc79f2 100644 --- a/etc/refcards/vipcard.tex +++ b/etc/refcards/vipcard.tex @@ -49,8 +49,8 @@ \input pdflayout.sty \pdflayout=(1) +\input emacsver.tex \def\versionemacs{18} % version of Emacs this is for -\def\year{2012} % latest copyright year \def\versionvip{3.5} % Nothing else needs to be changed. diff --git a/etc/refcards/viperCard.tex b/etc/refcards/viperCard.tex index a8694dd3bed..c6ab31cdb83 100644 --- a/etc/refcards/viperCard.tex +++ b/etc/refcards/viperCard.tex @@ -52,8 +52,8 @@ \input pdflayout.sty \pdflayout=(1) +\input emacsver.tex \def\versionemacs{21} % version of Emacs this is for -\def\year{2012} % latest copyright year \def\versionxemacs{20} % version of XEmacs this is for \def\versionviper{3.0} % version of Viper this is for -- 2.39.2