commit - f2b332a5aef1bdabe9e254a3b85c32490a6cb3ef
commit + 5a3c3edeecbcf2d8b0e2b2c0f20f527cb47d714b
blob - f5b1c014d6ab8dd8160a9bbc8a28d03b0a1d01da
blob + f29666f53077c9e38a051bbfc55cca5a2f175397
--- cmd.c
+++ cmd.c
} \
} while(0)
+#define GUARD_READ_ONLY() \
+ do { \
+ if (!in_minibuffer) { \
+ message("text is read-only"); \
+ return; \
+ } \
+ } while(0)
+
/* return 1 if moved, 0 otherwise */
static inline int
forward_line(struct buffer *buffer, int n)
{
char *c, *n;
- if (!in_minibuffer) {
- message("text is read-only");
- return;
- }
+ GUARD_READ_ONLY();
minibuffer_taint_hist();
{
char *c, *p, *start;
- if (!in_minibuffer) {
- message("text is read-only");
- return;
- }
+ GUARD_READ_ONLY();
minibuffer_taint_hist();
{
char *c;
- if (!in_minibuffer) {
- message("text is read-only");
- return;
- }
+ GUARD_READ_ONLY();
minibuffer_taint_hist();
c = utf8_nth(buffer->current_line->line, buffer->cpoff);