projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add linking inter-libraries dependencies
[apps/madmutt.git]
/
keymap.c
diff --git
a/keymap.c
b/keymap.c
index
f5fea68
..
580c2a4
100644
(file)
--- a/
keymap.c
+++ b/
keymap.c
@@
-30,12
+30,8
@@
struct mapping_t Menus[] = {
{"postpone", MENU_POST},
{"pgp", MENU_PGP},
{"smime", MENU_SMIME},
{"postpone", MENU_POST},
{"pgp", MENU_PGP},
{"smime", MENU_SMIME},
-
-#ifdef HAVE_GPGME
{"key_select_pgp", MENU_KEY_SELECT_PGP},
{"key_select_smime", MENU_KEY_SELECT_SMIME},
{"key_select_pgp", MENU_KEY_SELECT_PGP},
{"key_select_smime", MENU_KEY_SELECT_SMIME},
-#endif
-
{"query", MENU_QUERY},
{"generic", MENU_GENERIC},
{NULL, 0}
{"query", MENU_QUERY},
{"generic", MENU_GENERIC},
{NULL, 0}
@@
-150,7
+146,7
@@
static int parsekeys (const char *str, keycode_t * d, int max)
len--;
}
len--;
}
- return
(max - len)
;
+ return
max - len
;
}
/* insert a key sequence into the specified map. the map is sorted by ASCII
}
/* insert a key sequence into the specified map. the map is sorted by ASCII
@@
-305,7
+301,7
@@
static int retry_generic (int menu, keycode_t * keys, int keyslen,
mutt_ungetch (lastkey, 0);
for (; keyslen; keyslen--)
mutt_ungetch (keys[keyslen - 1], 0);
mutt_ungetch (lastkey, 0);
for (; keyslen; keyslen--)
mutt_ungetch (keys[keyslen - 1], 0);
- return
(km_dokey (MENU_GENERIC)
);
+ return
km_dokey (MENU_GENERIC
);
}
if (menu != MENU_EDITOR) {
/* probably a good idea to flush input here so we can abort macros */
}
if (menu != MENU_EDITOR) {
/* probably a good idea to flush input here so we can abort macros */
@@
-329,7
+325,7
@@
int km_dokey (int menu)
if (!map)
if (!map)
- return
(retry_generic (menu, NULL, 0, 0)
);
+ return
retry_generic (menu, NULL, 0, 0
);
for (;;) {
/* ncurses doesn't return on resized screen when timeout is set to zero */
for (;;) {
/* ncurses doesn't return on resized screen when timeout is set to zero */
@@
-389,12
+385,12
@@
int km_dokey (int menu)
/* Nope. Business as usual */
while (LastKey > map->keys[pos]) {
if (pos > map->eq || !map->next)
/* Nope. Business as usual */
while (LastKey > map->keys[pos]) {
if (pos > map->eq || !map->next)
- return
(retry_generic (menu, map->keys, pos, LastKey)
);
+ return
retry_generic (menu, map->keys, pos, LastKey
);
map = map->next;
}
if (LastKey != map->keys[pos])
map = map->next;
}
if (LastKey != map->keys[pos])
- return
(retry_generic (menu, map->keys, pos, LastKey)
);
+ return
retry_generic (menu, map->keys, pos, LastKey
);
if (++pos == map->len) {
if (++pos == map->len) {
@@
-452,7
+448,7
@@
const char *km_keyname(int c)
snprintf (buf, sizeof (buf), "%c", (unsigned char) c);
else
snprintf (buf, sizeof (buf), "\\x%hx", (unsigned short) c);
snprintf (buf, sizeof (buf), "%c", (unsigned char) c);
else
snprintf (buf, sizeof (buf), "\\x%hx", (unsigned short) c);
- return
(buf)
;
+ return
buf
;
}
int km_expand_key (char *s, size_t len, struct keymap_t *map)
}
int km_expand_key (char *s, size_t len, struct keymap_t *map)
@@
-461,14
+457,14
@@
int km_expand_key (char *s, size_t len, struct keymap_t *map)
int p = 0;
if (!map)
int p = 0;
if (!map)
- return
(0)
;
+ return
0
;
for (;;) {
m_strcpy(s, len, km_keyname(map->keys[p]));
len -= (l = m_strlen(s));
if (++p >= map->len || !len)
for (;;) {
m_strcpy(s, len, km_keyname(map->keys[p]));
len -= (l = m_strlen(s));
if (++p >= map->len || !len)
- return
(1)
;
+ return
1
;
s += l;
}
s += l;
}
@@
-483,7
+479,7
@@
struct keymap_t *km_find_func (int menu, int func)
for (; map; map = map->next)
if (map->op == func)
break;
for (; map; map = map->next)
if (map->op == func)
break;
- return
(map)
;
+ return
map
;
}
void km_init (void)
}
void km_init (void)
@@
-622,7
+618,7
@@
int mutt_parse_push (BUFFER * buf, BUFFER * s, unsigned long data __attribute__
}
else
push_string (buf->data);
}
else
push_string (buf->data);
- return
(r)
;
+ return
r
;
}
/* expects to see: <menu-string>,<menu-string>,... <key-string> */
}
/* expects to see: <menu-string>,<menu-string>,... <key-string> */
@@
-662,14
+658,14
@@
static char *parse_keymap (int *menu, BUFFER * s, int maxmenus, int *nummenus,
m_strcpy(err->data, err->dsize, _("null key sequence"));
}
else if (MoreArgs (s))
m_strcpy(err->data, err->dsize, _("null key sequence"));
}
else if (MoreArgs (s))
- return
(buf.data)
;
+ return
buf.data
;
}
else {
m_strcpy(err->data, err->dsize, _("too few arguments"));
}
error:
p_delete(&buf.data);
}
else {
m_strcpy(err->data, err->dsize, _("too few arguments"));
}
error:
p_delete(&buf.data);
- return
(NULL)
;
+ return
NULL
;
}
static int
}
static int
@@
-680,9
+676,9
@@
try_bind (char *key, int menu, char *func, struct binding_t *bindings)
for (i = 0; bindings[i].name; i++)
if (m_strcmp(func, bindings[i].name) == 0) {
km_bindkey (key, menu, bindings[i].op);
for (i = 0; bindings[i].name; i++)
if (m_strcmp(func, bindings[i].name) == 0) {
km_bindkey (key, menu, bindings[i].op);
- return
(0)
;
+ return
0
;
}
}
- return
(-1)
;
+ return
-1
;
}
struct binding_t *km_get_table (int menu)
}
struct binding_t *km_get_table (int menu)
@@
-758,7
+754,7
@@
int mutt_parse_bind (BUFFER * buf, BUFFER * s, unsigned long data __attribute__
}
}
p_delete(&key);
}
}
p_delete(&key);
- return
(r)
;
+ return
r
;
}
/* macro <menu> <key> <macro> <description> */
}
/* macro <menu> <key> <macro> <description> */
@@
-773,7
+769,7
@@
int mutt_parse_macro (BUFFER * buf, BUFFER * s, unsigned long data __attribute__
if ((key =
parse_keymap (menu, s, sizeof (menu) / sizeof (menu[0]), &nummenus,
err)) == NULL)
if ((key =
parse_keymap (menu, s, sizeof (menu) / sizeof (menu[0]), &nummenus,
err)) == NULL)
- return
(-1)
;
+ return
-1
;
mutt_extract_token (buf, s, M_TOKEN_CONDENSE);
/* make sure the macro sequence is not an empty string */
mutt_extract_token (buf, s, M_TOKEN_CONDENSE);
/* make sure the macro sequence is not an empty string */
@@
-805,7
+801,7
@@
int mutt_parse_macro (BUFFER * buf, BUFFER * s, unsigned long data __attribute__
}
}
p_delete(&key);
}
}
p_delete(&key);
- return
(r)
;
+ return
r
;
}
/* exec function-name */
}
/* exec function-name */
@@
-819,7
+815,7
@@
int mutt_parse_exec (BUFFER * buf, BUFFER * s, unsigned long data __attribute__
if (!MoreArgs (s)) {
m_strcpy(err->data, err->dsize, _("exec: no arguments"));
if (!MoreArgs (s)) {
m_strcpy(err->data, err->dsize, _("exec: no arguments"));
- return
(-1)
;
+ return
-1
;
}
do {
}
do {
@@
-837,7
+833,7
@@
int mutt_parse_exec (BUFFER * buf, BUFFER * s, unsigned long data __attribute__
if (ops[nops] == OP_NULL) {
mutt_flushinp ();
mutt_error (_("%s: no such function"), function);
if (ops[nops] == OP_NULL) {
mutt_flushinp ();
mutt_error (_("%s: no such function"), function);
- return
(-1)
;
+ return
-1
;
}
nops++;
}
}
nops++;
}