aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2018-09-11 13:11:28 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-09-11 19:05:55 +0200
commit67d0cb65d0794e2d91e72e5fa1e3612172e5812e (patch)
treed8275afb0f98a5171bc459b5e45c4bc2a67a92f5
parent4f4bccd1627c845330235721f593d2e93418723d (diff)
downloadst-67d0cb65d0794e2d91e72e5fa1e3612172e5812e.tar.gz
st-67d0cb65d0794e2d91e72e5fa1e3612172e5812e.zip
Remove the ISO 14755 feature
And move it to the patches section. Keeping it would force to add an exec pledge on OpenBSD, and some people think it's bloated, so bye!
-rw-r--r--config.def.h1
-rw-r--r--st.14
-rw-r--r--st.c26
-rw-r--r--st.h1
4 files changed, 0 insertions, 32 deletions
diff --git a/config.def.h b/config.def.h
index 82b1b09..823e79f 100644
--- a/config.def.h
+++ b/config.def.h
@@ -177,7 +177,6 @@ static Shortcut shortcuts[] = {
177 { TERMMOD, XK_V, clippaste, {.i = 0} }, 177 { TERMMOD, XK_V, clippaste, {.i = 0} },
178 { TERMMOD, XK_Y, selpaste, {.i = 0} }, 178 { TERMMOD, XK_Y, selpaste, {.i = 0} },
179 { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, 179 { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
180 { TERMMOD, XK_I, iso14755, {.i = 0} },
181}; 180};
182 181
183/* 182/*
diff --git a/st.1 b/st.1
index 81bceff..e8d6059 100644
--- a/st.1
+++ b/st.1
@@ -159,10 +159,6 @@ Copy the selected text to the clipboard selection.
159.TP 159.TP
160.B Ctrl-Shift-v 160.B Ctrl-Shift-v
161Paste from the clipboard selection. 161Paste from the clipboard selection.
162.TP
163.B Ctrl-Shift-i
164Launch dmenu to enter a unicode codepoint and send the corresponding glyph
165to st.
166.SH CUSTOMIZATION 162.SH CUSTOMIZATION
167.B st 163.B st
168can be customized by creating a custom config.h and (re)compiling the source 164can be customized by creating a custom config.h and (re)compiling the source
diff --git a/st.c b/st.c
index 76bb3ea..574dbee 100644
--- a/st.c
+++ b/st.c
@@ -38,15 +38,11 @@
38 38
39/* macros */ 39/* macros */
40#define IS_SET(flag) ((term.mode & (flag)) != 0) 40#define IS_SET(flag) ((term.mode & (flag)) != 0)
41#define NUMMAXLEN(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1)
42#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == '\177') 41#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == '\177')
43#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f)) 42#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f))
44#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c)) 43#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c))
45#define ISDELIM(u) (utf8strchr(worddelimiters, u) != NULL) 44#define ISDELIM(u) (utf8strchr(worddelimiters, u) != NULL)
46 45
47/* constants */
48#define ISO14755CMD "dmenu -w \"$WINDOWID\" -p codepoint: </dev/null"
49
50enum term_mode { 46enum term_mode {
51 MODE_WRAP = 1 << 0, 47 MODE_WRAP = 1 << 0,
52 MODE_INSERT = 1 << 1, 48 MODE_INSERT = 1 << 1,
@@ -1982,28 +1978,6 @@ tprinter(char *s, size_t len)
1982} 1978}
1983 1979
1984void 1980void
1985iso14755(const Arg *arg)
1986{
1987 FILE *p;
1988 char *us, *e, codepoint[9], uc[UTF_SIZ];
1989 unsigned long utf32;
1990
1991 if (!(p = popen(ISO14755CMD, "r")))
1992 return;
1993
1994 us = fgets(codepoint, sizeof(codepoint), p);
1995 pclose(p);
1996
1997 if (!us || *us == '\0' || *us == '-' || strlen(us) > 7)
1998 return;
1999 if ((utf32 = strtoul(us, &e, 16)) == ULONG_MAX ||
2000 (*e != '\n' && *e != '\0'))
2001 return;
2002
2003 ttywrite(uc, utf8encode(utf32, uc), 1);
2004}
2005
2006void
2007toggleprinter(const Arg *arg) 1981toggleprinter(const Arg *arg)
2008{ 1982{
2009 term.mode ^= MODE_PRINT; 1983 term.mode ^= MODE_PRINT;
diff --git a/st.h b/st.h
index dac64d8..38c61c4 100644
--- a/st.h
+++ b/st.h
@@ -80,7 +80,6 @@ void die(const char *, ...);
80void redraw(void); 80void redraw(void);
81void draw(void); 81void draw(void);
82 82
83void iso14755(const Arg *);
84void printscreen(const Arg *); 83void printscreen(const Arg *);
85void printsel(const Arg *); 84void printsel(const Arg *);
86void sendbreak(const Arg *); 85void sendbreak(const Arg *);