mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Sort PSFILE and PS reminders with same priority (Ticket #17581)
This commit is contained in:
15
src/rem2ps.c
15
src/rem2ps.c
@@ -32,6 +32,17 @@
|
||||
#define SPECIAL_WEEK 5
|
||||
#define SPECIAL_SHADE 6
|
||||
|
||||
/* Array holding how specials sort */
|
||||
static int SpecialSortOrder[] = {
|
||||
0, /* NORMAL */
|
||||
1, /* POSTSCRIPT */
|
||||
1, /* PSFILE */
|
||||
2, /* MOON */
|
||||
0, /* COLOR */
|
||||
4, /* WEEK */
|
||||
5 /* SHADE */
|
||||
};
|
||||
|
||||
typedef struct calentry {
|
||||
struct calentry *next;
|
||||
int special;
|
||||
@@ -338,11 +349,11 @@ void DoPsCal(void)
|
||||
d = PsEntries[DayNum];
|
||||
p = NULL;
|
||||
/* Slot it into the right place */
|
||||
while (d->next && (c->special <= d->special)) {
|
||||
while (d->next && (SpecialSortOrder[c->special] <= SpecialSortOrder[d->special])) {
|
||||
p = d;
|
||||
d = d->next;
|
||||
}
|
||||
if (c->special <= d->special) {
|
||||
if (SpecialSortOrder[c->special] <= SpecialSortOrder[d->special]) {
|
||||
c->next = d->next;
|
||||
d->next = c;
|
||||
} else {
|
||||
|
||||
1
tests/file.ps
Normal file
1
tests/file.ps
Normal file
@@ -0,0 +1 @@
|
||||
(Second-Bit-Of-PS)
|
||||
1
tests/file2.ps
Normal file
1
tests/file2.ps
Normal file
@@ -0,0 +1 @@
|
||||
(Fourth-Bit-Of-PS)
|
||||
@@ -15,6 +15,11 @@ IF $PSCAL
|
||||
[trigger(moondate(3))] SPECIAL MOON 3 -1 -1 [moontime(3)]
|
||||
ENDIF
|
||||
|
||||
REM 4 PS (First-Bit-Of-PS)
|
||||
REM 4 PSFILE file.ps
|
||||
REM 4 PS (Third-Bit-Of-PS)
|
||||
REM 4 PSFILE file2.ps
|
||||
|
||||
REM Mon SPECIAL SHADE 255 255 255
|
||||
REM Tue SPECIAL SHADE 255 255 204
|
||||
REM Wed SPECIAL SHADE 255 204 255
|
||||
|
||||
@@ -2527,7 +2527,10 @@ _A BoxHeight _A sub lineto closepath
|
||||
BoxWidth _A sub _A lineto BoxWidth _A sub BoxHeight _A sub lineto
|
||||
_A BoxHeight _A sub lineto closepath
|
||||
1 1 0.8 setrgbcolor fill 0.0 setgray
|
||||
|
||||
(First-Bit-Of-PS)
|
||||
(Second-Bit-Of-PS)
|
||||
(Third-Bit-Of-PS)
|
||||
(Fourth-Bit-Of-PS)
|
||||
SAVESTATE restore
|
||||
/SAVESTATE save def
|
||||
3 xincr mul MinX add ytop translate
|
||||
|
||||
Reference in New Issue
Block a user