From: Damien Riegel Date: Tue, 22 Aug 2017 16:22:30 +0000 (-0400) Subject: use opcodes.h instead of keymap_defs.h X-Git-Tag: neomutt-20170907~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f895f47b49ad6d1bb38abc6581f7a947bc0aea3;p=neomutt use opcodes.h instead of keymap_defs.h keymap_defs.h is a generated header and sometimes it falls out of the sync with config.h, which leads to weird errors about opcodes being undefined. Using a static header prevents that. As both keymap_defs.h and keymap_alldefs.h are now gone, gen_defs is no longer necessary and can be removed as well. --- diff --git a/.gitignore b/.gitignore index ed84f3e98..9f2db6906 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ autom4te.cache/ conststrings.c git_ver.h hcache/hcversion.h -keymap_defs.h mutt mutt_md5 pgpewrap diff --git a/Makefile.am b/Makefile.am index 2661c1e06..5d6f72864 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,7 +40,7 @@ bin_SCRIPTS = $(SMIMEAUX_TARGET) distdir = neo$(PACKAGE)-$(VERSION) -BUILT_SOURCES = conststrings.c git_ver.h keymap_defs.h +BUILT_SOURCES = conststrings.c git_ver.h bin_PROGRAMS = mutt $(PGPAUX_TARGET) @@ -84,7 +84,7 @@ EXTRA_mutt_SOURCES = browser.h mbyte.h mutt_idna.c mutt_idna.h \ EXTRA_DIST = account.h attach.h bcache.h browser.h buffy.h \ ChangeLog.md charset.h CODE_OF_CONDUCT.md compress.h copy.h \ - COPYRIGHT filter.h functions.h gen_defs globals.h \ + COPYRIGHT filter.h functions.h globals.h \ group.h history.h init.h keymap.h LICENSE.md mailbox.h \ mapping.h mbyte.h mime.h mime.types mutt.h mutt_commands.h \ mutt_curses.h mutt_idna.h mutt_lua.h mutt_menu.h mutt_notmuch.h \ @@ -131,9 +131,6 @@ LDADD = $(LIBOBJS) $(INTLLIBS) dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -keymap_defs.h: $(OPS) $(srcdir)/gen_defs - $(srcdir)/gen_defs $(OPS) > $@ - git_ver.h: $(mutt_SOURCES) $(SUBDIRS) version=`git describe --dirty --abbrev=6 --match "neomutt-*" 2> /dev/null | sed -e 's/^neomutt-[0-9]\{8\}//' -e 's/g//'`; \ echo 'const char *GitVer = "'$$version'";' > git_ver.h.tmp; \ diff --git a/addrbook.c b/addrbook.c index d77086bd8..745259ee5 100644 --- a/addrbook.c +++ b/addrbook.c @@ -29,11 +29,11 @@ #include "format_flags.h" #include "globals.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mapping.h" #include "mutt_curses.h" #include "mutt_menu.h" +#include "opcodes.h" #include "options.h" #include "protos.h" #include "rfc822.h" diff --git a/browser.c b/browser.c index a3b5702f4..03574f81f 100644 --- a/browser.c +++ b/browser.c @@ -50,7 +50,6 @@ #include "format_flags.h" #include "globals.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mailbox.h" #include "mapping.h" @@ -60,6 +59,7 @@ #include "mutt_regex.h" #include "mutt_socket.h" #include "mx.h" +#include "opcodes.h" #include "options.h" #include "protos.h" #include "sort.h" diff --git a/compose.c b/compose.c index 0996b32b0..454ab5836 100644 --- a/compose.c +++ b/compose.c @@ -43,7 +43,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "list.h" #include "mailbox.h" @@ -55,6 +54,7 @@ #include "mutt_socket.h" #include "mx.h" #include "ncrypt/ncrypt.h" +#include "opcodes.h" #include "options.h" #include "protos.h" #include "rfc1524.h" diff --git a/curs_lib.c b/curs_lib.c index 4e97664c9..d737ca32b 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -44,12 +44,12 @@ #include "mutt.h" #include "enter_state.h" #include "globals.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mbyte.h" #include "mutt_curses.h" #include "mutt_menu.h" #include "mutt_regex.h" +#include "opcodes.h" #include "options.h" #include "pager.h" #include "protos.h" diff --git a/curs_main.c b/curs_main.c index 57e08945f..dadc7e6ce 100644 --- a/curs_main.c +++ b/curs_main.c @@ -41,7 +41,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "list.h" #include "mailbox.h" @@ -51,6 +50,7 @@ #include "mutt_socket.h" #include "mx.h" #include "ncrypt/ncrypt.h" +#include "opcodes.h" #include "options.h" #include "pattern.h" #include "protos.h" diff --git a/enter.c b/enter.c index 1a3497732..ad5162591 100644 --- a/enter.c +++ b/enter.c @@ -32,10 +32,10 @@ #include "globals.h" #include "history.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mbyte.h" #include "mutt_curses.h" +#include "opcodes.h" #include "options.h" #include "protos.h" diff --git a/functions.h b/functions.h index 80f1f387f..ad81ce286 100644 --- a/functions.h +++ b/functions.h @@ -42,7 +42,7 @@ #else #include #include "keymap.h" -#include "keymap_defs.h" +#include "opcodes.h" #endif // clang-format off diff --git a/gen_defs b/gen_defs deleted file mode 100755 index 6f3951cc6..000000000 --- a/gen_defs +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -echo '#ifndef _MUTT_KEYMAP_DEFS_H' -echo '#define _MUTT_KEYMAP_DEFS_H 1' -echo '' -echo '/* Automatically generated by gen_defs. Do not edit! */' -echo '' - -for mode in help defs; do - case $mode in - help) - echo "#ifdef HELP_C" - echo "const char *HelpStrings[] = {" - expr='s;^[^ ]* *\(.*\); N_(\1),;' - ;; - *) - echo "enum {" - expr='s;^\([^ ]*\).*; \1,;' - ;; - esac - for i in $*; do - sed -e '/^\/\*/d' -e "$expr" < $i - done - if test $mode = help; then - echo ' NULL' - else - echo ' OP_MAX' - fi - echo "};" - if test $mode = help; then - echo "#endif /* MAIN_C */" - echo '' - fi -done -echo '#endif /* _MUTT_KEYMAP_DEFS_H */' - -exit 0 diff --git a/handler.c b/handler.c index 134ec5016..f8a962f86 100644 --- a/handler.c +++ b/handler.c @@ -44,12 +44,12 @@ #include "filter.h" #include "globals.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "list.h" #include "mime.h" #include "mutt_curses.h" #include "ncrypt/ncrypt.h" +#include "opcodes.h" #include "options.h" #include "parameter.h" #include "protos.h" diff --git a/help.c b/help.c index 4f9e84286..7c759c123 100644 --- a/help.c +++ b/help.c @@ -32,11 +32,11 @@ #include #include "globals.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mapping.h" #include "mbyte.h" #include "mutt_curses.h" +#include "opcodes.h" #include "options.h" #include "pager.h" #include "protos.h" diff --git a/keymap.c b/keymap.c index 17363bb59..edd74c872 100644 --- a/keymap.c +++ b/keymap.c @@ -30,12 +30,12 @@ #include "keymap.h" #include "functions.h" #include "globals.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mapping.h" #include "mutt.h" #include "mutt_curses.h" #include "ncrypt/ncrypt.h" +#include "opcodes.h" #include "options.h" #include "protos.h" #ifdef USE_IMAP diff --git a/menu.c b/menu.c index 11690ab96..a9324c116 100644 --- a/menu.c +++ b/menu.c @@ -34,12 +34,12 @@ #include "context.h" #include "globals.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mbyte.h" #include "mutt_curses.h" #include "mutt_menu.h" #include "mutt_regex.h" +#include "opcodes.h" #include "options.h" #include "pattern.h" #include "protos.h" diff --git a/mutt_ssl.c b/mutt_ssl.c index ebc1fa09a..a98cc95a4 100644 --- a/mutt_ssl.c +++ b/mutt_ssl.c @@ -46,11 +46,11 @@ #include "account.h" #include "globals.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mutt_idna.h" #include "mutt_menu.h" #include "mutt_socket.h" +#include "opcodes.h" #include "options.h" #include "protos.h" diff --git a/mutt_ssl_gnutls.c b/mutt_ssl_gnutls.c index ae719915d..94b270620 100644 --- a/mutt_ssl_gnutls.c +++ b/mutt_ssl_gnutls.c @@ -34,11 +34,11 @@ #include "account.h" #include "globals.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mutt_menu.h" #include "mutt_regex.h" #include "mutt_socket.h" +#include "opcodes.h" #include "options.h" #include "protos.h" diff --git a/mx.c b/mx.c index 50a17393b..89c1fd81b 100644 --- a/mx.c +++ b/mx.c @@ -43,10 +43,10 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mailbox.h" #include "ncrypt/ncrypt.h" +#include "opcodes.h" #include "options.h" #include "pattern.h" #include "protos.h" diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 68b2caafc..c7e879864 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -56,13 +56,13 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "list.h" #include "mime.h" #include "mutt_curses.h" #include "mutt_menu.h" #include "ncrypt.h" +#include "opcodes.h" #include "options.h" #include "pager.h" #include "parameter.h" diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 94378fc51..83fff289e 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -42,13 +42,13 @@ #include "globals.h" #include "gnupgparse.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "list.h" #include "mime.h" #include "mutt_curses.h" #include "mutt_menu.h" #include "ncrypt.h" +#include "opcodes.h" #include "options.h" #include "pager.h" #include "pgp.h" diff --git a/ncrypt/smime.c b/ncrypt/smime.c index 93b41e812..928340799 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -46,12 +46,12 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mime.h" #include "mutt_curses.h" #include "mutt_menu.h" #include "ncrypt.h" +#include "opcodes.h" #include "options.h" #include "parameter.h" #include "protos.h" diff --git a/pager.c b/pager.c index c7946a6d3..d2b28bddf 100644 --- a/pager.c +++ b/pager.c @@ -46,7 +46,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mailbox.h" #include "mapping.h" @@ -56,6 +55,7 @@ #include "mutt_regex.h" #include "mx.h" #include "ncrypt/ncrypt.h" +#include "opcodes.h" #include "options.h" #include "pattern.h" #include "protos.h" diff --git a/pattern.c b/pattern.c index b634fcc47..984d1fa5e 100644 --- a/pattern.c +++ b/pattern.c @@ -48,7 +48,6 @@ #include "globals.h" #include "group.h" #include "header.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "list.h" #include "mailbox.h" @@ -57,6 +56,7 @@ #include "mutt_menu.h" #include "mutt_regex.h" #include "ncrypt/ncrypt.h" +#include "opcodes.h" #include "options.h" #include "protos.h" #include "state.h" diff --git a/postpone.c b/postpone.c index 8ac4beb4c..d61d7fa40 100644 --- a/postpone.c +++ b/postpone.c @@ -37,7 +37,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "list.h" #include "mailbox.h" @@ -45,6 +44,7 @@ #include "mime.h" #include "mutt_menu.h" #include "ncrypt/ncrypt.h" +#include "opcodes.h" #include "options.h" #include "parameter.h" #include "protos.h" diff --git a/query.c b/query.c index 332b73c44..05f0d93a6 100644 --- a/query.c +++ b/query.c @@ -39,12 +39,12 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mapping.h" #include "mutt_curses.h" #include "mutt_idna.h" #include "mutt_menu.h" +#include "opcodes.h" #include "protos.h" #include "rfc822.h" diff --git a/recvattach.c b/recvattach.c index cabc74667..cacde36ab 100644 --- a/recvattach.c +++ b/recvattach.c @@ -41,7 +41,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mailbox.h" #include "mapping.h" @@ -50,6 +49,7 @@ #include "mutt_menu.h" #include "mx.h" #include "ncrypt/ncrypt.h" +#include "opcodes.h" #include "options.h" #include "protos.h" #include "rfc1524.h" diff --git a/remailer.c b/remailer.c index 84f010cc7..8b3d62bbb 100644 --- a/remailer.c +++ b/remailer.c @@ -39,12 +39,12 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "list.h" #include "mapping.h" #include "mutt_curses.h" #include "mutt_menu.h" +#include "opcodes.h" #include "options.h" #include "protos.h" #include "rfc822.h" diff --git a/sidebar.c b/sidebar.c index d0ac85133..70a4847c5 100644 --- a/sidebar.c +++ b/sidebar.c @@ -34,11 +34,11 @@ #include "context.h" #include "format_flags.h" #include "globals.h" -#include "keymap_defs.h" #include "lib/lib.h" #include "mutt_curses.h" #include "mutt_menu.h" #include "mx.h" +#include "opcodes.h" #include "options.h" #include "protos.h" #include "sort.h" @@ -975,8 +975,7 @@ void mutt_sb_draw(void) * @param op Operation code * * Change the selected mailbox, e.g. "Next mailbox", "Previous Mailbox - * with new mail". The operations are listed OPS.SIDEBAR which is built - * into an enum in keymap_defs.h. + * with new mail". The operations are listed in opcodes.h. * * If the operation is successful, HilBuffy will be set to the new mailbox. * This function only *selects* the mailbox, doesn't *open* it.