From 5c600997cd0e028a237fe6847ddffa1f2c340ea6 Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Wed, 27 Sep 2017 07:32:52 +0200 Subject: [PATCH] keywords: Remove dead code/doc of keywords patch Keywords patch support have been removed by 92e6dc1d89f7187eeea1412e51598600925e23f5. This change removes associated config and docs. Closes #769 --- README.md | 1 - copy.c | 9 -- doc/manual.xml.head | 300 ----------------------------------------- doc/neomutt-syntax.vim | 10 +- envelope.h | 1 - globals.h | 1 - imap/message.c | 2 +- init.h | 36 ----- mutt.h | 6 - options.h | 2 - version.c | 1 - 11 files changed, 2 insertions(+), 367 deletions(-) diff --git a/README.md b/README.md index 20cc1f81a..ebc3928f8 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ sorted through them, fixed them up and documented them. | Ifdef | Conditional config options | Index Color | Custom rules for theming the email index | Initials Expando | Expando for author's initials -| Keywords | Labels/Tagging for emails | Kyoto Cabinet | Kyoto Cabinet backend for the header cache | Limit Current Thread | Focus on one Email Thread | LMDB | LMDB backend for the header cache diff --git a/copy.c b/copy.c index 71014bd7d..931af0878 100644 --- a/copy.c +++ b/copy.c @@ -132,15 +132,6 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, ignore = false; } - if (flags & CH_UPDATE_LABEL) - { - if ((mutt_strncasecmp("X-Label:", buf, 8) == 0) || - (mutt_strncasecmp("X-Keywords:", buf, 11) == 0) || - (mutt_strncasecmp("X-Mozilla-Keys:", buf, 15) == 0) || - (mutt_strncasecmp("Keywords:", buf, 9) == 0)) - continue; - } - if (!ignore && fputs(buf, out) == EOF) return -1; } diff --git a/doc/manual.xml.head b/doc/manual.xml.head index 3d3816976..7d3b272dc 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -7671,93 +7671,6 @@ roessler@does-not-exist.org Thomas Roessler mutt pgp find topics of value. - - Keyword Management - NeoMutt has supported textual labels (usually known as X-Labels after - the header that we use to store them) for many years. Since we initially - added support for X-Labels, however, the larger community has evolved - more common ways of using and managing such labels, often known as - keywords or - tags. - If you are new to NeoMutt or to using keywords in NeoMutt, you only need - to know that the <edit-label> binding will edit keywords, and that - you can search for keywords using the - ~y pattern, and use the - %y expando to display it in your - $index_format. You also can sort by keyword. Keywords - that you set will be stored to the - X-Label:header by default. - If you've been using X-Labels for a while, things have grown - slightly. NeoMutt still supports X-Labels much as it has since 2000, but the - scope of this support has expanded to support three additional - header-based techniques for storing keyword metadata on messages: - - - X-Keywords - - Informal design; space-delimited keywords - - - - X-Mozilla-Keys - - Informal design used by Mozilla-based agents; space-delimited - keywords - - - - Keywords - - Standardized in RFC2822 (2001); comma-space-delimited - keywords - - - - X-Label - - NeoMutt-specific design; freeform text (but see - $xlabel_delimiter) - - - - With X-Label, NeoMutt's only notion of a message keyword was the - literal string value of the X-Label header. Under the new, integrated - support, each message may have a list of distinct message keywords. When - reading keywords from one of the headers in the list above, the header - value is split on the indicated delimiter (space or comma-space) for - X-Keywords:, X-Mozilla-Keys:, and Keywords:. By default, X-Label: is - parsed as a single keyword. By setting $xlabel_delimiter, you can force - splitting of X-Label: as well. - Two boolean variables control how keywords are saved when writing - messages to a mailbox. The default settings preserve backward - compatibility within NeoMutt completely, but by changing these values you - can transition to more standard keyword storage. - $keywords_legacy, if set, will - tell NeoMutt to use only "legacy" headers -- i.e., - X-Keywords:, - X-Mozilla-Keys, - Keywords, or - X-Label:. Keywords will be saved to whichever header - was in use by the message the keyword was read from. If - $keywords_standard is set, - keywords will be saved without exception to the standard - Keywords:header. (If both are set, both will be used; - if both are unset, legacy headers are used.) Additionally, - $xlabel_delimiter is used to - format the X-Label: header on saves. - To migrate completely to the new standard, unset - $keywords_legacy and set - $keywords_standard, and set - $xlabel_delimiter either to what you currently use to - delimit keywords in X-Labels, or to - (comma space). - Note that it is common practice to insert - X-Label:or other keyword headers from proxmail or - other mail filters. This is a useful trick for categorizing messages en - masse as they are delivered to your inbox, and it is fully compatible - with the new keywords code. - - Display Munging Working within the confines of a console or terminal window, it is @@ -11451,219 +11364,6 @@ set index_format='%4C %Z %{%b %d} %I (%?l?%4l&%4c?) %s' - - Keywords Feature - Labels/Tagging for emails - - - Support - - Since:NeoMutt 2016-05-30 - - Dependencies:None - - - - Introduction - Unify label/keyword handling. - Since x-labels were added to NeoMutt in 2000, a number of other - approaches to what we now call - tagging have also emerged. One of them was even made - standard in RFC 2822. This update unifies the handling of all these - strategies. - We start by changing NeoMutt's internal keyword storage from a - single string which may contain whitespace to a list of discrete - keywords. This has advantages for keyword completion as well as for - portability among varying "standards" for keyword storage. This may - represent a significant change for existing NeoMutt users who have set - x-labels containing spaces, and should be regarded with suspicion. The - advantages are significant, though. - Next we allow NeoMutt to parse keywords into this internal list from - any of the following headers: X-Label (freeform), X-Keywords - (space-delimited), X-Mozilla-Keys (space-delimited), and Keywords (RFC - 2822, comma-space-delimited). NeoMutt remembers which headers it sourced - keywords from, and can rewrite those headers when saving messages for - compatibility with the mailer of origin. - (X-Label was specified as freeform text by NeoMutt, its only known - implementation. X-Labels have been used both as a - tagging device, probably with space delimiting, and as a - memo field, where space-delimited parsing would ruin the - semantics of the memo. By default NeoMutt will not split X-Labels at all. - Set $xlabel_delimiter if your needs vary.) - Finally we add two booleans: $keywords_legacy=true and - $keywords_standard=FALSE. When $keywords_legacy is true, NeoMutt will - always save keyword to whatever original header it came from. When - $keywords_standard=true, NeoMutt will save to the Keywords: header. If - both are true NeoMutt saves to both; if neither is true, NeoMutt saves only - to legacy headers to avoid complete loss of keywords. - Overall this represents convergence path for all competing - labelling/tagging/keywording systems toward one that is specified by - RFC. - You can change or delete the X-Label: field within NeoMutt using the - edit-label command. This works for tagged messages, too. - - - - Variables - - - Keywords Variables - - - - Name - Type - Default - - - - - - keywords_legacy - - boolean - - yes - - - - - keywords_standard - - boolean - - no - - - - - xlabel_delimiter - - string - (empty) - - - -
-
- - - Functions - Keywords adds the following function to NeoMutt. By default, it is - not bound to a key. - - - Keyword Functions - - - - Menus - Function - Description - - - - - index,pager - - <edit-label> - - add, change, or delete a message's label - - - -
-
- - - Sort - - - Keywords Sort - - - - Sort - Description - - - - - - label - - Sort by label - - - -
-
- - - neomuttrc - -# Example NeoMutt config file for the keywords feature. - -# -------------------------------------------------------------------------- -# VARIABLES - shown with their default values -# -------------------------------------------------------------------------- -# Should NeoMutt save the keywords to whatever keyword it came from? -set keywords_legacy = yes -# Should NeoMutt use the "Keywords:" header? -set keywords_standard = no -# How should the keywords be separated? -set xlabel_delimiter = "" -# -------------------------------------------------------------------------- -# FUNCTIONS - shown with an example mapping -# -------------------------------------------------------------------------- -# Bind 'y' to edit labels/keywords -bind index,pager y edit-label - - # vim: syntax=neomuttrc - - - - - See Also - - - - $index_format - - - - - index-color feature - - - - - folder-hook - - - - - - - Known Bugs - None - - - - Credits - - - David Champion - dgc@uchicago.edu - - - Richard Russon - rich@flatcap.org - - - -
- Kyoto Cabinet Feature Kyoto Cabinet backend for the header cache diff --git a/doc/neomutt-syntax.vim b/doc/neomutt-syntax.vim index 72e4f5fdd..df5e653d9 100644 --- a/doc/neomutt-syntax.vim +++ b/doc/neomutt-syntax.vim @@ -441,7 +441,7 @@ syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" -syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" @@ -817,14 +817,6 @@ syntax keyword muttrcColorField contained index_number syntax keyword muttrcColorField contained index_size syntax keyword muttrcColorField contained index_subject syn region muttrcColorLine keepend start=/^\s*color\s\+index_\%(author\|collapsed\|date\|flags\|label\|number\|size\|subject\)/ skip=+\\$+ end=+$+ contains=muttrcColorKeyword,muttrcComment,muttrcUnHighlightSpace -" Vim syntax file for the NeoMutt keywords feature. - -syntax keyword muttrcVarBool contained skipwhite keywords_legacy nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syntax keyword muttrcVarBool contained skipwhite keywords_standard nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr - -syntax keyword muttrcVarStr contained skipwhite xlabel_delimiter nextgroup=muttrcVarEqualsIdxFmt - -syntax match muttrcFunction contained "\" " Vim syntax file for the NeoMutt new-mail feature. diff --git a/envelope.h b/envelope.h index c0aed881f..e882f197d 100644 --- a/envelope.h +++ b/envelope.h @@ -59,7 +59,6 @@ struct Envelope struct ListHead references; /**< message references (in reverse order) */ struct ListHead in_reply_to; /**< in-reply-to header content */ struct ListHead userhdrs; /**< user defined headers */ - int kwtypes; bool irt_changed : 1; /**< In-Reply-To changed to link/break threads */ bool refs_changed : 1; /**< References changed to break thread */ diff --git a/globals.h b/globals.h index 79a966dd8..c032afb90 100644 --- a/globals.h +++ b/globals.h @@ -189,7 +189,6 @@ WHERE char *TSIconFormat; WHERE short TSSupported; WHERE char *Username; WHERE char *Visual; -WHERE char *XlabelDelimiter; WHERE char *CurrentFolder; WHERE char *LastFolder; diff --git a/imap/message.c b/imap/message.c index 65f5dc416..58b3b19e5 100644 --- a/imap/message.c +++ b/imap/message.c @@ -499,7 +499,7 @@ int imap_read_headers(struct ImapData *idata, unsigned int msn_begin, unsigned i static const char *const want_headers = "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE " "CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL " - "X-KEYWORDS X-MOZILLA-KEYS KEYWORDS X-ORIGINAL-TO"; + "X-ORIGINAL-TO"; struct Progress progress; int retval = -1; bool evalhc = false; diff --git a/init.h b/init.h index d0982bb17..83de046ea 100644 --- a/init.h +++ b/init.h @@ -1638,28 +1638,6 @@ struct Option MuttVars[] = { ** from your spool mailbox to your $$mbox mailbox, or as a result of ** a ``$mbox-hook'' command. */ - { "keywords_legacy", DT_BOOL, R_NONE, OPT_KEYWORDS_LEGACY, 1 }, - /* - ** .pp - ** If \fIset\fP, keywords/labels/tags will be written to whatever - ** legacy, nonstandard headers (X-Label, X-Keywords, X-Mozilla-Keys) - ** they were sourced from. - ** .pp - ** If both ``$$keywords_legacy'' and - ** ``$$keywords_standard'' are \fCfalse\fP, NeoMutt will save keywords - ** to legacy headers to ensure that it does not lose your labels. - */ - { "keywords_standard", DT_BOOL, R_NONE, OPT_KEYWORDS_STANDARD, 0 }, - /* - ** .pp - ** If \fIset\fP, keywords/labels/tags will be written to the - ** RFC2822-standard Keywords: header; this may imply a conversion from - ** legacy headers. - ** .pp - ** If both ``$$keywords_legacy'' and - ** ``$$keywords_standard'' are \fCfalse\fP, NeoMutt will save keywords - ** to legacy headers to ensure that it does not lose your labels. - */ { "mail_check", DT_NUMBER, R_NONE, UL &MailCheck, 5 }, /* ** .pp @@ -4403,20 +4381,6 @@ struct Option MuttVars[] = { { "xterm_set_titles", DT_SYNONYM, R_NONE, UL "ts_enabled", 0 }, /* */ - { "xlabel_delimiter", DT_STRING, R_NONE, UL &XlabelDelimiter, UL "" }, - /* - ** .pp - ** The character used to delimit distinct keywords in X-Label headers. - ** X-Label is primarily a NeoMutt artifact, and the semantics of the field - ** were never defined: it is free-form text. However interaction with - ** X-Keywords:, X-Mozilla-Keys:, and Keywords: requires that we adopt - ** some means of identifying separate keywords within the field. Set - ** this to your personal convention. - ** .pp - ** This affect both parsing existing X-Label headers and writing new - ** X-Label headers. You can modify this variable in runtime to accomplish - ** various kinds of conversion. - */ #ifdef USE_NNTP { "x_comment_to", DT_BOOL, R_NONE, OPT_X_COMMENT_TO, 0 }, /* diff --git a/mutt.h b/mutt.h index 92106cecd..be0850cf6 100644 --- a/mutt.h +++ b/mutt.h @@ -303,12 +303,6 @@ enum QuadOptionVars #define MUTT_SPAM 1 #define MUTT_NOSPAM 2 -/* flags for keywords headers */ -#define MUTT_X_LABEL (1 << 0) /**< introduced to neomutt in 2000 */ -#define MUTT_X_KEYWORDS (1 << 1) /**< used in c-client, dovecot */ -#define MUTT_X_MOZILLA_KEYS (1 << 2) /**< tbird */ -#define MUTT_KEYWORDS (1 << 3) /**< rfc2822 */ - void mutt_free_regex_list(struct RegexList **list); void mutt_free_replace_list(struct ReplaceList **list); bool mutt_matches_ignore(const char *s); diff --git a/options.h b/options.h index 81eef975e..e26c60bbf 100644 --- a/options.h +++ b/options.h @@ -111,8 +111,6 @@ enum GlobalBool OPT_IMPLICIT_AUTOVIEW, OPT_INCLUDE_ONLYFIRST, OPT_KEEP_FLAGGED, - OPT_KEYWORDS_LEGACY, - OPT_KEYWORDS_STANDARD, OPT_MAILCAP_SANITIZE, OPT_MAIL_CHECK_RECENT, OPT_MAIL_CHECK_STATS, diff --git a/version.c b/version.c index 47f22a2a3..a46668fe2 100644 --- a/version.c +++ b/version.c @@ -116,7 +116,6 @@ static struct CompileOptions comp_opts_default[] = { { "imap", 1 }, { "index_color", 1 }, { "initials", 1 }, - { "keywords", 1 }, { "limit_current_thread", 1 }, { "multiple_fcc", 1 }, { "nested_if", 1 }, -- 2.40.0