~kaction/config

ref: 17da553310d73b2fa8f29b3d4fdbf9b5dd12fdef config/nixpkgs/overlays.d/staging.d/fbpdf/patches/current-page.patch -rw-r--r-- 998 bytes View raw
17da5533 — Dmitry Bogatov shell: add alias to push to github 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 9126202ca9ddc897a6aab06063c74781889c88ce Mon Sep 17 00:00:00 2001
From: Dmitry Bogatov <KAction@disroot.org>
Date: Sun, 9 Feb 2020 11:37:35 -0500
Subject: [PATCH] Print current page number to fd=4 on exit

This minor change makes it possible to create wrapper that saves and
restores page number context when document is re-opened.
---
 README  | 2 ++
 fbpdf.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/README b/README
index d8ceae1..3653836 100644
--- a/README
+++ b/README
@@ -52,3 +52,5 @@ W		zoom to fit page contents horizontally
 Z		set the default zoom level for 'z' command
 d		sleep one second before the next command
 ==============	================================================
+
+On exit fbpdf prints current page number to file descriptor 4.
diff --git a/fbpdf.c b/fbpdf.c
index 65b654b..7d06b87 100644
--- a/fbpdf.c
+++ b/fbpdf.c
@@ -348,6 +348,7 @@ static void mainloop(void)
 		draw();
 	}
 	term_cleanup();
+	dprintf(4, "%d\n", num);
 }
 
 static char *usage =