* [gentoo-pms] [PATCH] How about a \ChangeWhenAddingAnEAPI marker?
@ 2012-05-06 15:33 Ciaran McCreesh
2012-05-06 19:40 ` Ulrich Mueller
0 siblings, 1 reply; 5+ messages in thread
From: Ciaran McCreesh @ 2012-05-06 15:33 UTC (permalink / raw
To: gentoo-pms; +Cc: Ciaran McCreesh
It's easy to miss some places that have to be updated when adding a new
EAPI. This hack fixes that. It works like this:
In pms.tex, at the top, we say
\CurrentEAPIIs{4}
Then everywhere where we have EAPI dependent content, we put
\ChangeWhenAddingAnEAPI{4}
which we can then grep for. Also, if you change the current EAPI, and
forget to change any of the markers, an error is produced.
I've not updated everywhere that needs this yet; there's just one
example. There might be a better way of getting the same effect. If not,
I'll go through carefully and put these in before we start work on 5.
---
dependencies.tex | 1 +
pms.cls | 5 +++++
pms.tex | 3 +++
3 files changed, 9 insertions(+)
diff --git a/dependencies.tex b/dependencies.tex
index 0f74b3b..5f91eb5 100644
--- a/dependencies.tex
+++ b/dependencies.tex
@@ -76,6 +76,7 @@ be surrounded on both sides by whitespace, except at the start and end of the st
In particular, note that whitespace is not optional.
+\ChangeWhenAddingAnEAPI{4}
\begin{centertable}{EAPIs supporting \t{SRC\_URI} arrows} \label{tab:uri-arrows-table}
\begin{tabular}{ l l }
\toprule
diff --git a/pms.cls b/pms.cls
index db2fd48..a37d78a 100644
--- a/pms.cls
+++ b/pms.cls
@@ -147,6 +147,11 @@
% margin.
\areaset[-30mm]{400pt}{700pt}
+% To find everywhere that needs updating when we add an EAPI
+\newcommand{\CurrentEAPIIs}[1]{\def\TheCurrentEAPI{#1}}
+\newcommand{\ChangeWhenAddingAnEAPI}[1]{\ifthenelse{\equal{\TheCurrentEAPI}{#1}}{}{\errmessage{This
+needs to be updated for EAPI \TheCurrentEAPI}}}
+
% vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :
%%% Local Variables:
diff --git a/pms.tex b/pms.tex
index 4ada8ec..1c9ed30 100644
--- a/pms.tex
+++ b/pms.tex
@@ -1,5 +1,8 @@
\documentclass{pms}
+\CurrentEAPIIs{4}
+\ChangeWhenAddingAnEAPI{4}
+
\begin{document}
\maketitle
--
1.7.10.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [gentoo-pms] [PATCH] How about a \ChangeWhenAddingAnEAPI marker?
2012-05-06 15:33 [gentoo-pms] [PATCH] How about a \ChangeWhenAddingAnEAPI marker? Ciaran McCreesh
@ 2012-05-06 19:40 ` Ulrich Mueller
2012-05-06 19:42 ` Ciaran McCreesh
0 siblings, 1 reply; 5+ messages in thread
From: Ulrich Mueller @ 2012-05-06 19:40 UTC (permalink / raw
To: gentoo-pms; +Cc: Ciaran McCreesh
>>>>> On Sun, 6 May 2012, Ciaran McCreesh wrote:
> It's easy to miss some places that have to be updated when adding a new
> EAPI. This hack fixes that. It works like this:
> In pms.tex, at the top, we say
> \CurrentEAPIIs{4}
> Then everywhere where we have EAPI dependent content, we put
> \ChangeWhenAddingAnEAPI{4}
> which we can then grep for. Also, if you change the current EAPI, and
> forget to change any of the markers, an error is produced.
This looks a bit over-engineered to me. Wouldn't simple comments serve
the same purpose?
Ulrich
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-pms] [PATCH] How about a \ChangeWhenAddingAnEAPI marker?
2012-05-06 19:40 ` Ulrich Mueller
@ 2012-05-06 19:42 ` Ciaran McCreesh
2012-05-06 22:33 ` Brian Harring
2012-05-06 22:50 ` Ulrich Mueller
0 siblings, 2 replies; 5+ messages in thread
From: Ciaran McCreesh @ 2012-05-06 19:42 UTC (permalink / raw
To: Ulrich Mueller; +Cc: gentoo-pms
[-- Attachment #1: Type: text/plain, Size: 777 bytes --]
On Sun, 6 May 2012 21:40:42 +0200
Ulrich Mueller <ulm@gentoo.org> wrote:
> > It's easy to miss some places that have to be updated when adding a
> > new EAPI. This hack fixes that. It works like this:
>
> > In pms.tex, at the top, we say
>
> > \CurrentEAPIIs{4}
>
> > Then everywhere where we have EAPI dependent content, we put
>
> > \ChangeWhenAddingAnEAPI{4}
>
> > which we can then grep for. Also, if you change the current EAPI,
> > and forget to change any of the markers, an error is produced.
>
> This looks a bit over-engineered to me. Wouldn't simple comments serve
> the same purpose?
Comments don't force a failure when you forget about them. Being
self-validating makes it hard to screw up accidentally.
--
Ciaran McCreesh
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-pms] [PATCH] How about a \ChangeWhenAddingAnEAPI marker?
2012-05-06 19:42 ` Ciaran McCreesh
@ 2012-05-06 22:33 ` Brian Harring
2012-05-06 22:50 ` Ulrich Mueller
1 sibling, 0 replies; 5+ messages in thread
From: Brian Harring @ 2012-05-06 22:33 UTC (permalink / raw
To: gentoo-pms; +Cc: Ulrich Mueller
On Sun, May 06, 2012 at 08:42:34PM +0100, Ciaran McCreesh wrote:
> On Sun, 6 May 2012 21:40:42 +0200
> Ulrich Mueller <ulm@gentoo.org> wrote:
> > > It's easy to miss some places that have to be updated when adding a
> > > new EAPI. This hack fixes that. It works like this:
> >
> > > In pms.tex, at the top, we say
> >
> > > \CurrentEAPIIs{4}
> >
> > > Then everywhere where we have EAPI dependent content, we put
> >
> > > \ChangeWhenAddingAnEAPI{4}
> >
> > > which we can then grep for. Also, if you change the current EAPI,
> > > and forget to change any of the markers, an error is produced.
> >
> > This looks a bit over-engineered to me. Wouldn't simple comments serve
> > the same purpose?
>
> Comments don't force a failure when you forget about them. Being
> self-validating makes it hard to screw up accidentally.
Seconded; in the sphinx version of pms I've been playing w/ I was
planning on using similar functionality (including deprecation markers
so we make damn sure we remove stuff in later eapi's).
~brian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-pms] [PATCH] How about a \ChangeWhenAddingAnEAPI marker?
2012-05-06 19:42 ` Ciaran McCreesh
2012-05-06 22:33 ` Brian Harring
@ 2012-05-06 22:50 ` Ulrich Mueller
1 sibling, 0 replies; 5+ messages in thread
From: Ulrich Mueller @ 2012-05-06 22:50 UTC (permalink / raw
To: Ciaran McCreesh; +Cc: gentoo-pms
>>>>> On Sun, 6 May 2012, Ciaran McCreesh wrote:
> On Sun, 6 May 2012 21:40:42 +0200
> Ulrich Mueller <ulm@gentoo.org> wrote:
>> > In pms.tex, at the top, we say
>>
>> > \CurrentEAPIIs{4}
>>
>> > Then everywhere where we have EAPI dependent content, we put
>>
>> > \ChangeWhenAddingAnEAPI{4}
>>
>> > which we can then grep for. Also, if you change the current EAPI,
>> > and forget to change any of the markers, an error is produced.
>>
>> This looks a bit over-engineered to me. Wouldn't simple comments serve
>> the same purpose?
> Comments don't force a failure when you forget about them. Being
> self-validating makes it hard to screw up accidentally.
Then use at least names for these commands that are easier to type.
Shorter and without capital letters, please.
How about \latesteapi and \eapichange?
Ulrich
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-05-06 22:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-06 15:33 [gentoo-pms] [PATCH] How about a \ChangeWhenAddingAnEAPI marker? Ciaran McCreesh
2012-05-06 19:40 ` Ulrich Mueller
2012-05-06 19:42 ` Ciaran McCreesh
2012-05-06 22:33 ` Brian Harring
2012-05-06 22:50 ` Ulrich Mueller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox