commit b4c5e772118e3f198989732e3aee1146ef9b5217
parent 7892e89a47ccb35549b25fe558245b9e8f639daf
Author: lumidify <nobody@lumidify.org>
Date: Sun, 19 Dec 2021 13:27:55 +0100
Improve Makefile
Diffstat:
4 files changed, 52 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
@@ -8,6 +8,7 @@ MANPREFIX = ${PREFIX}/man
BIN = ${NAME}
MAN1 = ${BIN:=.1}
+MISCFILES = Makefile README LICENSE IDEAS NOTES TODO
OBJ = \
assert.o \
@@ -28,6 +29,8 @@ OBJ = \
window.o \
pango-compat.o
+SRC = ${OBJ:.o=.c}
+
HDR = \
assert.h \
buffer.h \
@@ -46,13 +49,22 @@ HDR = \
draw_util.h \
window.h \
cleanup.h \
+ macros.h \
pango-compat.h
+CONFIGHDR = \
+ config.h \
+ theme_config.h \
+ keys_basic_config.h \
+ keys_command_config.h \
+ keys_config.h
+
CFLAGS_LEDIT = -g -Wall -Wextra -D_POSIX_C_SOURCE=200809L `pkg-config --cflags x11 xkbfile pangoxft xext`
LDFLAGS_LEDIT = ${LDFLAGS} `pkg-config --libs x11 xkbfile pangoxft xext` -lm
all: ${BIN}
+# FIXME: make this nicer
ledit.o window.o : config.h
theme.o : theme_config.h
keys_basic.o : keys_basic_config.h keys_config.h
@@ -67,7 +79,26 @@ ${OBJ} : ${HDR}
${BIN}: ${OBJ}
${CC} -o $@ ${OBJ} ${LDFLAGS_LEDIT}
+install: all
+ mkdir -p "${DESTDIR}${PREFIX}/bin"
+ cp -f ${BIN} "${DESTDIR}${PREFIX}/bin"
+ for f in ${BIN}; do chmod 755 "${DESTDIR}${PREFIX}/bin/$$f"; done
+ mkdir -p "${DESTDIR}${MANPREFIX}/man1"
+ cp -f ${MAN1} "${DESTDIR}${MANPREFIX}/man1"
+ for m in ${MAN1}; do chmod 644 "${DESTDIR}${MANPREFIX}/man1/$$m"; done
+
+uninstall:
+ for f in ${BIN}; do rm -f "${DESTDIR}${PREFIX}/bin/$$f"; done
+ for m in ${MAN1}; do rm -f "${DESTDIR}${MANPREFIX}/man1/$$m"; done
+
clean:
rm -f ${BIN} ${OBJ}
-.PHONY: all clean
+dist:
+ rm -rf "${NAME}-${VERSION}"
+ mkdir -p "${NAME}-${VERSION}"
+ cp -f ${MAN1} ${SRC} ${HDR} ${CONFIGHDR} ${MISCFILES} "${NAME}-${VERSION}"
+ tar cf - "${NAME}-${VERSION}" | gzip -c > "${NAME}-${VERSION}.tar.gz"
+ rm -rf "${NAME}-${VERSION}"
+
+.PHONY: all clean install uninstall dist
diff --git a/ledit.1 b/ledit.1
@@ -1,3 +1,7 @@
+.\" TODO:
+.\" paste buffer line vs. char oriented
+.\" bigword, etc.
+.\"
.\" WARNING: Some parts of this are stolen shamelessly from OpenBSD's
.\" vi(1) manpage!
.Dd December 18, 2021
@@ -23,22 +27,23 @@ are documented, but it is very likely that many have been missed.
If you find an important difference that is not documented, please
contact me.
.Sh ANTI-DESCRIPTION
-.Bl -tag -width Ds
-.It Nm
+.Nm
is not a code editor.
Features for code editing may be added in the future, but the main
purpose is currently to edit other text.
-.It Nm
+.Pp
+.Nm
is not a general-purpose text editor.
It is content to be useful for some tasks and does not feel insulted when
other editors are used for other tasks.
-.It Nm
+.Pp
+.Nm
is not a minimalistic text editor.
It probably counts as reasonably minimalistic in the modern world, but
that is not the main goal.
-.It Nm
+.Pp
+.Nm
is not a good text editor.
-.El
.Sh KEY BINDINGS
The key bindings listed here are given as the default English bindings.
These will, of course, not be accurate for other languages or if
@@ -700,6 +705,13 @@ Substitute
with
.Ar replace
in the given line range.
+.Pp
+Instead of
+.Cm / ,
+any other unicode character may be used. The first unicode character after the
+.Cm s
+is used as the delimiter.
+.Pp
If no range is given, substitution is only performed on the current line.
Note that no regex is currently supported.
.Pp
diff --git a/undo.c b/undo.c
@@ -198,6 +198,7 @@ ledit_undo(undo_stack *undo, ledit_mode mode, void *callback_data,
);
break;
default:
+ /* FIXME: show this as a message */
fprintf(stderr, "Error with undo. This should not happen. Fix the code please.\n");
break;
}
diff --git a/window.h b/window.h
@@ -52,7 +52,7 @@ typedef struct {
int message_shown; /* whether a readonly message is shown at the bottom */
bottom_bar *bb; /* encapsulates the text at the bottom */
int redraw; /* whether something has changed and the window has to be redrawn */
- ledit_mode mode; /* mode of the view - a bit ugly to duplicate this here... */
+ ledit_mode mode; /* mode of the view - a bit ugly to duplicate this here... */
/* stuff for filtering events so not too many have to be handled */
struct timespec last_scroll;