From 87f8ff6dc8918be1fdf564bfe367565cf2b1ddbb Mon Sep 17 00:00:00 2001 From: Damien Riegel Date: Wed, 23 Aug 2017 22:15:06 -0400 Subject: [PATCH] teach gen-map-doc about the new opcode header gen-map-doc was the last element of Neomutt using the OPS* files. By teaching it the format of opcodes.h, it's now possible to remove these files. --- Makefile.am | 3 +- OPS | 208 ------------------------------------------------ OPS.CRYPT | 4 - OPS.MIX | 7 -- OPS.NOTMUCH | 7 -- OPS.PGP | 6 -- OPS.SIDEBAR | 9 --- OPS.SMIME | 1 - configure.ac | 6 -- doc/Makefile.am | 6 +- doc/gen-map-doc | 10 ++- 11 files changed, 12 insertions(+), 255 deletions(-) delete mode 100644 OPS delete mode 100644 OPS.CRYPT delete mode 100644 OPS.MIX delete mode 100644 OPS.NOTMUCH delete mode 100644 OPS.PGP delete mode 100644 OPS.SIDEBAR delete mode 100644 OPS.SMIME diff --git a/Makefile.am b/Makefile.am index 5d6f7286413..fc4742bb10e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -89,8 +89,7 @@ EXTRA_DIST = account.h attach.h bcache.h browser.h buffy.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 \ mutt_options.h mutt_regex.h mutt_sasl.h mutt_sasl_plain.h \ - mutt_socket.h mutt_ssl.h mutt_tunnel.h mx.h myvar.h nntp.h opcodes.h OPS \ - OPS.CRYPT OPS.MIX OPS.NOTMUCH OPS.PGP OPS.SIDEBAR OPS.SMIME pager.h \ + mutt_socket.h mutt_ssl.h mutt_tunnel.h mx.h myvar.h nntp.h opcodes.h pager.h \ pgpewrap.c pop.h protos.h queue.h README.md README.SSL remailer.c remailer.h \ rfc1524.h rfc2047.h rfc2231.h rfc3676.h rfc822.h sidebar.h \ sort.h txt2c.c txt2c.sh version.h diff --git a/OPS b/OPS deleted file mode 100644 index 76c2b62afa1..00000000000 --- a/OPS +++ /dev/null @@ -1,208 +0,0 @@ -OP_NULL "null operation" -OP_END_COND "end of conditional execution (noop)" -OP_ATTACH_VIEW_MAILCAP "force viewing of attachment using mailcap" -OP_ATTACH_VIEW_TEXT "view attachment as text" -OP_ATTACH_COLLAPSE "Toggle display of subparts" -OP_BOTTOM_PAGE "move to the bottom of the page" -OP_BOUNCE_MESSAGE "remail a message to another user" -OP_BROWSER_GOTO_FOLDER "swap the current folder position with $folder if it exists" -OP_BROWSER_NEW_FILE "select a new file in this directory" -OP_BROWSER_VIEW_FILE "view file" -OP_BROWSER_TELL "display the currently selected file's name" -OP_BROWSER_SUBSCRIBE "subscribe to current mbox (IMAP/NNTP only)" -OP_BROWSER_UNSUBSCRIBE "unsubscribe from current mbox (IMAP/NNTP only)" -OP_BROWSER_TOGGLE_LSUB "toggle view all/subscribed mailboxes (IMAP only)" -OP_BUFFY_LIST "list mailboxes with new mail" -OP_CATCHUP "mark all articles in newsgroup as read" -OP_CHANGE_DIRECTORY "change directories" -OP_CHECK_NEW "check mailboxes for new mail" -OP_COMPOSE_ATTACH_FILE "attach file(s) to this message" -OP_COMPOSE_ATTACH_MESSAGE "attach message(s) to this message" -OP_COMPOSE_ATTACH_NEWS_MESSAGE "attach news article(s) to this message" -OP_COMPOSE_EDIT_BCC "edit the BCC list" -OP_COMPOSE_EDIT_CC "edit the CC list" -OP_COMPOSE_EDIT_DESCRIPTION "edit attachment description" -OP_COMPOSE_EDIT_ENCODING "edit attachment transfer-encoding" -OP_COMPOSE_EDIT_FCC "enter a file to save a copy of this message in" -OP_COMPOSE_EDIT_FILE "edit the file to be attached" -OP_COMPOSE_EDIT_FROM "edit the from field" -OP_COMPOSE_EDIT_HEADERS "edit the message with headers" -OP_COMPOSE_EDIT_MESSAGE "edit the message" -OP_COMPOSE_EDIT_MIME "edit attachment using mailcap entry" -OP_COMPOSE_EDIT_NEWSGROUPS "edit the newsgroups list" -OP_COMPOSE_EDIT_REPLY_TO "edit the Reply-To field" -OP_COMPOSE_EDIT_FOLLOWUP_TO "edit the Followup-To field" -OP_COMPOSE_EDIT_X_COMMENT_TO "edit the X-Comment-To field" -OP_COMPOSE_EDIT_SUBJECT "edit the subject of this message" -OP_COMPOSE_EDIT_TO "edit the TO list" -OP_CREATE_MAILBOX "create a new mailbox (IMAP only)" -OP_EDIT_TYPE "edit attachment content type" -OP_COMPOSE_GET_ATTACHMENT "get a temporary copy of an attachment" -OP_COMPOSE_ISPELL "run ispell on the message" -OP_COMPOSE_NEW_MIME "compose new attachment using mailcap entry" -OP_COMPOSE_TOGGLE_RECODE "toggle recoding of this attachment" -OP_COMPOSE_POSTPONE_MESSAGE "save this message to send later" -OP_COMPOSE_RENAME_ATTACHMENT "send attachment with a different name" -OP_COMPOSE_RENAME_FILE "rename/move an attached file" -OP_COMPOSE_TO_SENDER "compose a new message to the sender" -OP_COMPOSE_SEND_MESSAGE "send the message" -OP_COMPOSE_TOGGLE_DISPOSITION "toggle disposition between inline/attachment" -OP_COMPOSE_TOGGLE_UNLINK "toggle whether to delete file after sending it" -OP_COMPOSE_UPDATE_ENCODING "update an attachment's encoding info" -OP_COMPOSE_WRITE_MESSAGE "write the message to a folder" -OP_COPY_MESSAGE "copy a message to a file/mailbox" -OP_CREATE_ALIAS "create an alias from a message sender" -OP_CURRENT_BOTTOM "move entry to bottom of screen" -OP_CURRENT_MIDDLE "move entry to middle of screen" -OP_CURRENT_TOP "move entry to top of screen" -OP_DECODE_COPY "make decoded (text/plain) copy" -OP_DECODE_SAVE "make decoded copy (text/plain) and delete" -OP_DELETE "delete the current entry" -OP_DELETE_MAILBOX "delete the current mailbox (IMAP only)" -OP_DELETE_SUBTHREAD "delete all messages in subthread" -OP_DELETE_THREAD "delete all messages in thread" -OP_DISPLAY_ADDRESS "display full address of sender" -OP_DISPLAY_HEADERS "display message and toggle header weeding" -OP_DISPLAY_MESSAGE "display a message" -OP_EDIT_LABEL "add, change, or delete a message's label" -OP_EDIT_MESSAGE "edit the raw message" -OP_EDITOR_BACKSPACE "delete the char in front of the cursor" -OP_EDITOR_BACKWARD_CHAR "move the cursor one character to the left" -OP_EDITOR_BACKWARD_WORD "move the cursor to the beginning of the word" -OP_EDITOR_BOL "jump to the beginning of the line" -OP_EDITOR_BUFFY_CYCLE "cycle among incoming mailboxes" -OP_EDITOR_COMPLETE "complete filename or alias" -OP_EDITOR_COMPLETE_QUERY "complete address with query" -OP_EDITOR_DELETE_CHAR "delete the char under the cursor" -OP_EDITOR_EOL "jump to the end of the line" -OP_EDITOR_FORWARD_CHAR "move the cursor one character to the right" -OP_EDITOR_FORWARD_WORD "move the cursor to the end of the word" -OP_EDITOR_HISTORY_DOWN "scroll down through the history list" -OP_EDITOR_HISTORY_UP "scroll up through the history list" -OP_EDITOR_KILL_EOL "delete chars from cursor to end of line" -OP_EDITOR_KILL_EOW "delete chars from the cursor to the end of the word" -OP_EDITOR_KILL_LINE "delete all chars on the line" -OP_EDITOR_KILL_WORD "delete the word in front of the cursor" -OP_EDITOR_QUOTE_CHAR "quote the next typed key" -OP_EDITOR_TRANSPOSE_CHARS "transpose character under cursor with previous" -OP_EDITOR_CAPITALIZE_WORD "capitalize the word" -OP_EDITOR_DOWNCASE_WORD "convert the word to lower case" -OP_EDITOR_UPCASE_WORD "convert the word to upper case" -OP_ENTER_COMMAND "enter a muttrc command" -OP_ENTER_MASK "enter a file mask" -OP_EXIT "exit this menu" -OP_FILTER "filter attachment through a shell command" -OP_FIRST_ENTRY "move to the first entry" -OP_FLAG_MESSAGE "toggle a message's 'important' flag" -OP_FOLLOWUP "followup to newsgroup" -OP_FORWARD_TO_GROUP "forward to newsgroup" -OP_FORWARD_MESSAGE "forward a message with comments" -OP_GENERIC_SELECT_ENTRY "select the current entry" -OP_GET_CHILDREN "get all children of the current message" -OP_GET_MESSAGE "get message with Message-Id" -OP_GET_PARENT "get parent of the current message" -OP_GROUP_REPLY "reply to all recipients" -OP_HALF_DOWN "scroll down 1/2 page" -OP_HALF_UP "scroll up 1/2 page" -OP_HELP "this screen" -OP_JUMP "jump to an index number" -OP_LAST_ENTRY "move to the last entry" -OP_LIST_REPLY "reply to specified mailing list" -OP_LOAD_ACTIVE "load list of all newsgroups from NNTP server" -OP_MACRO "execute a macro" -OP_MAIL "compose a new mail message" -OP_MAIN_BREAK_THREAD "break the thread in two" -OP_MAIN_CHANGE_FOLDER "open a different folder" -OP_MAIN_CHANGE_FOLDER_READONLY "open a different folder in read only mode" -OP_MAIN_CHANGE_GROUP "open a different newsgroup" -OP_MAIN_CHANGE_GROUP_READONLY "open a different newsgroup in read only mode" -OP_MAIN_CLEAR_FLAG "clear a status flag from a message" -OP_MAIN_DELETE_PATTERN "delete messages matching a pattern" -OP_MAIN_IMAP_FETCH "force retrieval of mail from IMAP server" -OP_MAIN_IMAP_LOGOUT_ALL "logout from all IMAP servers" -OP_MAIN_FETCH_MAIL "retrieve mail from POP server" -OP_MAIN_LIMIT "show only messages matching a pattern" -OP_MAIN_LINK_THREADS "link tagged message to the current one" -OP_MAIN_NEXT_UNREAD_MAILBOX "open next mailbox with new mail" -OP_MAIN_NEXT_NEW "jump to the next new message" -OP_MAIN_NEXT_NEW_THEN_UNREAD "jump to the next new or unread message" -OP_MAIN_NEXT_SUBTHREAD "jump to the next subthread" -OP_MAIN_NEXT_THREAD "jump to the next thread" -OP_MAIN_NEXT_UNDELETED "move to the next undeleted message" -OP_MAIN_NEXT_UNREAD "jump to the next unread message" -OP_MAIN_PARENT_MESSAGE "jump to parent message in thread" -OP_MAIN_PREV_THREAD "jump to previous thread" -OP_MAIN_PREV_SUBTHREAD "jump to previous subthread" -OP_MAIN_PREV_UNDELETED "move to the previous undeleted message" -OP_MAIN_PREV_NEW "jump to the previous new message" -OP_MAIN_PREV_NEW_THEN_UNREAD "jump to the previous new or unread message" -OP_MAIN_PREV_UNREAD "jump to the previous unread message" -OP_MAIN_READ_THREAD "mark the current thread as read" -OP_MAIN_READ_SUBTHREAD "mark the current subthread as read" -OP_MAIN_ROOT_MESSAGE "jump to root message in thread" -OP_MAIN_SET_FLAG "set a status flag on a message" -OP_MAIN_SYNC_FOLDER "save changes to mailbox" -OP_MAIN_TAG_PATTERN "tag messages matching a pattern" -OP_MAIN_QUASI_DELETE "delete from mutt, don't touch on disk" -OP_MAIN_UNDELETE_PATTERN "undelete messages matching a pattern" -OP_MAIN_UNTAG_PATTERN "untag messages matching a pattern" -OP_MARK_MSG "create a hotkey macro for the current message" -OP_MIDDLE_PAGE "move to the middle of the page" -OP_NEXT_ENTRY "move to the next entry" -OP_NEXT_LINE "scroll down one line" -OP_NEXT_PAGE "move to the next page" -OP_PAGER_BOTTOM "jump to the bottom of the message" -OP_PAGER_HIDE_QUOTED "toggle display of quoted text" -OP_PAGER_SKIP_QUOTED "skip beyond quoted text" -OP_PAGER_TOP "jump to the top of the message" -OP_PIPE "pipe message/attachment to a shell command" -OP_POST "post message to newsgroup" -OP_PREV_ENTRY "move to the previous entry" -OP_PREV_LINE "scroll up one line" -OP_PREV_PAGE "move to the previous page" -OP_PRINT "print the current entry" -OP_PURGE_MESSAGE "really delete the current entry, bypassing the trash folder" -OP_PURGE_THREAD "really delete the current thread, bypassing the trash folder" -OP_QUERY "query external program for addresses" -OP_QUERY_APPEND "append new query results to current results" -OP_QUIT "save changes to mailbox and quit" -OP_RECALL_MESSAGE "recall a postponed message" -OP_RECONSTRUCT_THREAD "reconstruct thread containing current message" -OP_REDRAW "clear and redraw the screen" -OP_REFORMAT_WINCH "{internal}" -OP_RENAME_MAILBOX "rename the current mailbox (IMAP only)" -OP_REPLY "reply to a message" -OP_RESEND "use the current message as a template for a new one" -OP_SAVE "save message/attachment to a mailbox/file" -OP_SEARCH "search for a regular expression" -OP_SEARCH_REVERSE "search backwards for a regular expression" -OP_SEARCH_NEXT "search for next match" -OP_SEARCH_OPPOSITE "search for next match in opposite direction" -OP_SEARCH_TOGGLE "toggle search pattern coloring" -OP_SHELL_ESCAPE "invoke a command in a subshell" -OP_SORT "sort messages" -OP_SORT_REVERSE "sort messages in reverse order" -OP_SUBSCRIBE_PATTERN "subscribe to newsgroups matching a pattern" -OP_TAG "tag the current entry" -OP_TAG_PREFIX "apply next function to tagged messages" -OP_TAG_PREFIX_COND "apply next function ONLY to tagged messages" -OP_TAG_SUBTHREAD "tag the current subthread" -OP_TAG_THREAD "tag the current thread" -OP_TOGGLE_NEW "toggle a message's 'new' flag" -OP_TOGGLE_READ "toggle view of read messages" -OP_TOGGLE_WRITE "toggle whether the mailbox will be rewritten" -OP_TOGGLE_MAILBOXES "toggle whether to browse mailboxes or all files" -OP_TOP_PAGE "move to the top of the page" -OP_UNCATCHUP "mark all articles in newsgroup as unread" -OP_UNDELETE "undelete the current entry" -OP_UNDELETE_THREAD "undelete all messages in thread" -OP_UNDELETE_SUBTHREAD "undelete all messages in subthread" -OP_UNSUBSCRIBE_PATTERN "unsubscribe from newsgroups matching a pattern" -OP_VERSION "show the Mutt version number and date" -OP_VIEW_ATTACH "view attachment using mailcap entry if necessary" -OP_VIEW_ATTACHMENTS "show MIME attachments" -OP_WHAT_KEY "display the keycode for a key press" -OP_LIMIT_CURRENT_THREAD "limit view to current thread" -OP_MAIN_SHOW_LIMIT "show currently active limit pattern" -OP_MAIN_COLLAPSE_THREAD "collapse/uncollapse current thread" -OP_MAIN_COLLAPSE_ALL "collapse/uncollapse all threads" diff --git a/OPS.CRYPT b/OPS.CRYPT deleted file mode 100644 index 0f5664ca405..00000000000 --- a/OPS.CRYPT +++ /dev/null @@ -1,4 +0,0 @@ -OP_DECRYPT_SAVE "make decrypted copy and delete" -OP_DECRYPT_COPY "make decrypted copy" -OP_FORGET_PASSPHRASE "wipe passphrase(s) from memory" -OP_EXTRACT_KEYS "extract supported public keys" diff --git a/OPS.MIX b/OPS.MIX deleted file mode 100644 index a836226c78c..00000000000 --- a/OPS.MIX +++ /dev/null @@ -1,7 +0,0 @@ -OP_MIX_USE "accept the chain constructed" -OP_MIX_APPEND "append a remailer to the chain" -OP_MIX_INSERT "insert a remailer into the chain" -OP_MIX_DELETE "delete a remailer from the chain" -OP_MIX_CHAIN_PREV "select the previous element of the chain" -OP_MIX_CHAIN_NEXT "select the next element of the chain" -OP_COMPOSE_MIX "send the message through a mixmaster remailer chain" diff --git a/OPS.NOTMUCH b/OPS.NOTMUCH deleted file mode 100644 index 96263c7aa00..00000000000 --- a/OPS.NOTMUCH +++ /dev/null @@ -1,7 +0,0 @@ -OP_MAIN_CHANGE_VFOLDER "open a different virtual folder" -OP_MAIN_VFOLDER_FROM_QUERY "generate virtual folder from query" -OP_MAIN_WINDOWED_VFOLDER_FORWARD "shifts virtual folder time window forwards" -OP_MAIN_WINDOWED_VFOLDER_BACKWARD "shifts virtual folder time window backwards" -OP_MAIN_MODIFY_LABELS "modify (notmuch) tags" -OP_MAIN_MODIFY_LABELS_THEN_HIDE "modify labels and then hide message" -OP_MAIN_ENTIRE_THREAD "read entire thread of the current message" diff --git a/OPS.PGP b/OPS.PGP deleted file mode 100644 index 0558ed79e17..00000000000 --- a/OPS.PGP +++ /dev/null @@ -1,6 +0,0 @@ -OP_COMPOSE_ATTACH_KEY "attach a PGP public key" -OP_COMPOSE_PGP_MENU "show PGP options" -OP_MAIL_KEY "mail a PGP public key" -OP_VERIFY_KEY "verify a PGP public key" -OP_VIEW_ID "view the key's user id" -OP_CHECK_TRADITIONAL "check for classic PGP" diff --git a/OPS.SIDEBAR b/OPS.SIDEBAR deleted file mode 100644 index e39f80c64aa..00000000000 --- a/OPS.SIDEBAR +++ /dev/null @@ -1,9 +0,0 @@ -OP_SIDEBAR_NEXT "move the highlight to next mailbox" -OP_SIDEBAR_NEXT_NEW "move the highlight to next mailbox with new mail" -OP_SIDEBAR_OPEN "open highlighted mailbox" -OP_SIDEBAR_PAGE_DOWN "scroll the sidebar down 1 page" -OP_SIDEBAR_PAGE_UP "scroll the sidebar up 1 page" -OP_SIDEBAR_PREV "move the highlight to previous mailbox" -OP_SIDEBAR_PREV_NEW "move the highlight to previous mailbox with new mail" -OP_SIDEBAR_TOGGLE_VIRTUAL "toggle between mailboxes and virtual mailboxes" -OP_SIDEBAR_TOGGLE_VISIBLE "make the sidebar (in)visible" diff --git a/OPS.SMIME b/OPS.SMIME deleted file mode 100644 index 1161ff901d4..00000000000 --- a/OPS.SMIME +++ /dev/null @@ -1 +0,0 @@ -OP_COMPOSE_SMIME_MENU "show S/MIME options" diff --git a/configure.ac b/configure.ac index a572199ee0e..579f44d16b1 100644 --- a/configure.ac +++ b/configure.ac @@ -264,7 +264,6 @@ AS_IF([test x$use_notmuch = "xyes"], [ AC_DEFINE(USE_NOTMUCH,1,[ Define if you want support for the notmuch. ]) MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_notmuch.o" LIBS="$LIBS -lnotmuch" - OPS="$OPS \$(srcdir)/OPS.NOTMUCH" AC_MSG_CHECKING([for notmuch api version 3]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM( @@ -282,15 +281,10 @@ AS_IF([test x$use_notmuch = "xyes"], [ dnl --with-mixmaster AS_IF([test "$with_mixmaster" != "no"], [ AS_IF([test -x "$with_mixmaster"], [MIXMASTER="$with_mixmaster"], [MIXMASTER="mixmaster"]) - OPS="$OPS \$(srcdir)/OPS.MIX" MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS remailer.o" AC_DEFINE_UNQUOTED(MIXMASTER, "$MIXMASTER", [Where to find mixmaster on your system.]) ]) -# We now require all OPS -OPS="\$(srcdir)/OPS \$(srcdir)/OPS.SIDEBAR $OPS \$(srcdir)/OPS.PGP \$(srcdir)/OPS.SMIME \$(srcdir)/OPS.CRYPT" -AC_SUBST([OPS]) - AC_SUBST(PGPAUX_TARGET) AC_SUBST(SMIMEAUX_TARGET) diff --git a/doc/Makefile.am b/doc/Makefile.am index 6a6c711b4dd..ad8d75bd19a 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -137,12 +137,12 @@ mutt.1: $(srcdir)/mutt.man $(EDIT) $(srcdir)/mutt.man > $@ manual.xml: makedoc$(EXEEXT) ../config.h $(top_srcdir)/init.h \ - manual.xml.head $(top_srcdir)/functions.h $(top_srcdir)/OPS* manual.xml.tail \ - $(srcdir)/gen-map-doc + manual.xml.head $(top_srcdir)/functions.h manual.xml.tail \ + $(srcdir)/gen-map-doc $(top_srcdir)/opcodes.h ( mutt_ver=`sed -n -e '/MUTT_VERSION/s/.*"\(.*\)".*/\1/p' ../config.h` && \ sed -e "s/@VERSION\@/$(PACKAGE_VERSION) ($$mutt_ver)/" $(srcdir)/manual.xml.head && \ $(MAKEDOC_CPP) $(top_srcdir)/init.h | ./makedoc$(EXEEXT) -s && \ $(MAKEDOC_CPP) $(top_srcdir)/functions.h | \ - perl $(srcdir)/gen-map-doc $(srcdir)/manual.xml.tail $(top_srcdir)/OPS* \ + perl $(srcdir)/gen-map-doc $(srcdir)/manual.xml.tail $(top_srcdir)/opcodes.h \ ) > $@ diff --git a/doc/gen-map-doc b/doc/gen-map-doc index 91edb26f849..79ff237fa84 100644 --- a/doc/gen-map-doc +++ b/doc/gen-map-doc @@ -8,11 +8,17 @@ my $xml = shift @ARGV; open F, "cat @ARGV |" or die "OPS*: $!"; while () { - /(\w+) "(.+)"/ or die "$.: parse error"; - $OPS{$1} = $2; + if ( /^\s+_fmt\((\w+),\s+N_\("(.+)"\)\)/ ) { + $OPS{$1} = $2; + } } close F; +my $num_ops = scalar(keys(%OPS)); +if ( $num_ops == 0 ) { + die "No OPS found. Has the syntax changed?"; +} + while () { if (/^const struct Binding Op.*{ \/\* map: (.*) \*\//) { $map = $1;