[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Provide address@hidden' for numbered displays
From: |
Ludovic Courtès |
Subject: |
[PATCH] Provide address@hidden' for numbered displays |
Date: |
Sun, 24 Jun 2007 16:58:24 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
Hi,
The attached patch provides an address@hidden' option for numbered
displays. Although it works fine, there's certainly room for
improvement, e.g., renaming address@hidden' to something more
meaningful.
Thanks,
Ludovic.
--- orig/include/bsf
+++ mod/include/bsf
@@ -295,6 +295,25 @@
###########################################################################
# #
+ # x @Dft y #
+ # #
+ # This returns x unless its value is "dft", in which case it returns y. #
+ # Useful for defaulting the value of one parameter to another. #
+ # #
+ ###########################################################################
+
+ def @Dft
+ left x
+ right y
+ {
+ x @Case {
+ "dft" @Yield y
+ else @Yield x
+ }
+ }
+
+ ###########################################################################
+ # #
# @Pipe, @PipeVerbatim, and @PipeRawVerbatim #
# #
###########################################################################
@@ -1363,11 +1382,17 @@
}
def @NumDispCounterIncrement
+ named @BypassNumber { "dft" }
right tag
{
+ def @DisplayNumber
+ {
+ @BypassNumber @Dft { @NumDispNum tag }
+ }
+
@NumDispCounterMarker&&preceding @Tagged tag
- @NumDispCounterMarker val { @NumDispNum tag }
- @NumberMarker @Tag { tag } @Value { @NumDispNum tag }
+ @NumDispCounterMarker val { @DisplayNumber }
+ @NumberMarker @Tag { tag } @Value { @DisplayNumber }
}
def @NN
@@ -1409,10 +1434,11 @@
def @NDisp into { @DispPlace&&preceding }
named @Tag {}
+ named @BypassNumber { "dft" }
right x
{
@OneRow {
- @NumDispCounterIncrement @Tag
+ @NumDispCounterIncrement @BypassNumber { @BypassNumber } @Tag
@PageMark @Tag
^//
@OneRow x
@@ -1427,10 +1453,11 @@
def @ANDisp into { @AlignedPlace&&preceding }
named @Tag {}
+ named @BypassNumber { "dft" }
right x
{
@OneRow {
- @NumDispCounterIncrement @Tag
+ @NumDispCounterIncrement @BypassNumber { @BypassNumber } @Tag
@PageMark @Tag
^/
@OneRow x
- [PATCH] Provide address@hidden' for numbered displays,
Ludovic Courtès <=