summaryrefslogtreecommitdiffstats
path: root/main.c
AgeCommit message (Collapse)Author
2019-01-05Merge branch 'stable'Kevin McCarthy
2019-01-05Update copyright for the next stable release.Kevin McCarthy
2019-01-04Clean up formatting.Kevin McCarthy
Add spaces after if, else, while, for, switch. Unify the brace placement style. The vast majority of the code uses Allman style so convert the relatively few K&R braces over.
2019-01-04Clean up code indentation.Kevin McCarthy
These are mostly automated changes corresponding to the emacs settings: (c-set-style "linux") (setq c-basic-offset 2) (c-set-offset 'case-label '+) Most of the code follows the convention: (add-to-list 'c-cleanup-list 'space-before-funcall) but this is not enforced by this indentation cleanup. Also, I personally dislike tabs, so I have: (setq-default indent-tabs-mode nil) in my own configuration. However I have no desire to change every line just for that effect. So this cleanup does nothing about the mix issue. Some of the secondary files (e.g. regex.c) have been skipped. I've also skipped crypt-gpgme.c, because I need to think about that file. Werner Koch and the GnuPG team contributed most it, and it follows the Gnu indentation settings. It should probably be made uniform with Mutt, but I don't want to discourage future GnuPG contribution to the file. I manually reverted a few unsightly cleanups, and added a few tweeks when I saw things that could be improved.
2018-12-31Remove trailing whitespace.Kevin McCarthy
The result of find . -name "*.[ch]" -exec emacs -batch {} \ --eval="(progn (delete-trailing-whitespace) (and (buffer-modified-p) (save-buffer)))" \;
2018-12-25Finish protected header write support.Kevin McCarthy
Write out the protected headers when writing the mime header part. Hide protected subjects with $crypt_protected_headers_subject, for outgoing, postponed, and fcc'ed messages. Don't hide in postponed and fcc'ed if $crypt_protected_headers_read isn't set. Add a few missing cases where mime_headers needed to be cleaned up on error. Remove the protected headers for $fcc_clear.
2018-12-25Add a new mode for mutt_write_rfc822_header().Kevin McCarthy
Convert the mode parameter to an enum, to make the code a bit more readable.
2018-10-06Add buffer pool functions.Kevin McCarthy
Also add a few helper functions: mutt_buffer_clear(), mutt_buffer_strcpy(), and a macro mutt_b2s to grab the buffer data as a const char *.
2018-09-14Free queries and alias_queries before exiting.Kevin McCarthy
2018-07-28Move exit cleanup in main() to end of function.Kevin McCarthy
Route exits to the same place to ensure uniform cleanup. Message printing is a bit of a mess, but for now, try to keep the exact same behavior.
2018-07-28Fix -z and -Z options to work with IMAP.Kevin McCarthy
-Z did not work if $imap_passive was set (the default). I think using the option implies the desire to open a new connection and check buffy at startup, so temporarily turn it off during the buffy. -z was not hooked up for IMAP. Change it to call imap_status(). This also requires $imap_passive be unset, so temporarily turn the option off too.
2018-06-03add feature file monitoring with Linux inotifyGT
2018-05-01Update copyright notices.Kevin McCarthy
2018-04-15Add libidn2 supportMatej Muzila
2018-02-06Add a blank line between the compile options and the contact info for mutt -vVincent Lefevre
2018-02-04Put gitlab issues url on a separate line.Kevin McCarthy
This removes the need to use brackets, and makes it easier for translations to fit within 80 columns. Thanks to Derek Martin for the suggested wording, and to Vincent Lefèvre for proofreading and noticing a small error.
2018-01-31Merge branch 'stable'Kevin McCarthy
2018-01-31Add delimiters around gitlab issues URL.Kevin McCarthy
Without the delimiters, the period can be easily inadvertantly copied as part of the URL.
2018-01-17Merge branch 'stable'Kevin McCarthy
2018-01-17Change bug reporting URL to gitlab issues.Kevin McCarthy
2018-01-16Split Copyright and Thanks in help output.Olaf Hering
The Copyright string is changing often, and its content is obvious. It does not need translation. The remaining string can be translated. This change avoids a stale translation once one of the years change. Signed-off-by: Olaf Hering <olaf@aepfle.de>
2017-12-17manually touch atime when reading a mbox fileAdam Borowski
The only common use of atime left is local mail agents leaving a mark on mbox file after the mail has been read. And, since POSIX-2008, it is possible to use futimens() to alter atime even on filesystems mounted with noatime. There's no extra cost for doing this on when atime updates are enabled: the inode will be dirty already.
2017-11-28Update copyright notices.Kevin McCarthy
2017-06-01Enable TEXTDOMAINDIR override to make translation testing easier.TAKAHASHI Tamotsu
If set, TEXTDOMAINDIR will point to a translation directory instead of using the mutt installation directory.
2017-06-01Fix "format string is not a string literal" warnings. (closes #3949)TAKAHASHI Tamotsu
Mutt calls msgfmt with '-c' to verify that translation format strings match, but it is still safer to indirect strings with no formatting through %s.
2017-03-18Fix conststrings type mismatches. (closes #3926)Kevin McCarthy
The generation programs for conststrings.c: txt2c.c and txt2c.sh, specified the resultant types as "unsigned char[]" while main.c declared them as "const char[]". txt2.c generates 0xXX hex codes for each individual character, thus the "unsigned" definition. With link-time optimization, some versions of gcc notice the mismatch and emit a warning. Change the declarations to match the definitions and cast to char[] when they are used.
2017-01-28Improve the label completion hash table usage.Kevin McCarthy
Move the hash table inside the Context. Hook message arrival/deletion to update the label hash. Change the label hash to strdup keys. Use hash_find_elem when updating the counter, to reduce unnecessary add/delete operations.
2017-01-28Adds label completion.David Champion
A global label hash is added, to which labels are added as they're parsed from a mailbox file or edited manually by the user. Reference counts are kept in the hash table so that unused labels are removed from available completions. Completion is available in the label editor only, but it may be feasible to add for search expressions if the preceding text ends with '~y'.
2016-12-11Add setenv/unsetenv commands.David Champion
These can be used to add and remove environment variables passed to children via mutt_system(). Commited by Kevin McCarthy with some cleanup.
2016-11-13Compress patch from the neomutt repository.Kevin McCarthy
With the following changes: - po/de.po changes trimmed to just the compress additions. - Move the sample muttrc to contrib, and add it to the Makefile.am so it is distributed. Remove the sample vimrc. - Remove extra fluff from manual. Thanks to Roland Rosenfeld for the original patch, and to the NeoMutt team for their work cleaning up the patch.
2016-08-22Remove the $locale configuration variable.Kevin McCarthy
$locale was only used to set the LC_TIME locale. Unfortunately, Mutt previously defaulted to using "C". This overrode the user's locale setting and forced them to re-specify their locale inside their .muttrc. Remove $locale and instead use the locale specified by the environment. Mutt still allows "C locale" dates by using a leading "!" in $date_format, ${}, etc. Another use of $locale was to customize attribution dates using hooks. The next commit will introduce $attribution_locale, which can be used for this instead. Thanks to Derek Martin for the original patch!
2016-08-05Update copyright notices.Kevin McCarthy
2016-07-11Initialize mutt windows even in batch mode. (closes #3853)Kevin McCarthy
mutt_select_fcc() calls mutt_addr_hook() -> mutt_make_string() which refers to MuttIndexWindow->cols when calling mutt_FormatString(). In batch mode, MuttIndexWindow hasn't been initialized, leading to a segfault. This might be the only overlap, but it seems wiser to just initialize the mutt windows in case there are other references (now or in the future) when processing format strings in batch mode.
2016-06-23Change sidebar to consistently use realpath for context and buffy comparison.Kevin McCarthy
The original sidebar patch contained a half-implemented attempt to use realpath() mailbox paths for comparison. (Presumably so the open mailbox remains highlighted despite symlink issues). Add realpath to the Context, and set it when opening a mailbox. Remove sidebar ifdef for the buffy member, and always set it there too. Change the sidebar to use the realpath for comparison everywhere. mutt_buffy_check() is using stat device and inode for comparison. Perhaps this can be changed to use realpath instead, but that's beyond the scope of this patch.
2016-06-04Add "mutt_" prefix to global sidebar functions.Kevin McCarthy
Also, remove unused sb_init declaration.
2016-06-04Add neomutt version of sidebar patch. (closes #3829)Richard Russon
This is the patch from neomutt; branch 'devel/win-sidebar'; commit c796fa85f9cacefb69b8f7d8545fc9ba71674180 with the following changes: - move the sample muttrc and vimrc to contrib. - remove the README.sidebar. - empty out the PATCHES file.
2016-05-09Change M_* symbols to MUTT_*Derek Martin
Changeset 23334e967dd7 created a workaround for a namespace conflict with Solaris and derivatives. After some discussion, the team decided it would be best to move away from using the "M_" prefix for macros. This patch was automatically generated by running: perl -wpi -e 's/\bM_(\w+)\b/MUTT_$1/g' `find . -name '*.[ch]' -print` with the exception that sys_socket.h was exempted. (That file will be backed out subsequent to this commit.) Thanks to Andras Salamon for supplying the perl script used to make this change.
2016-04-27Add window structures to use for screen layout.Kevin McCarthy
This is a series of 11 patches, centralizing Mutt screen drawing inside windows (mutt_window_t structures). Currently, the screen drawing and cursor positioning logic is distributed all over the code, resulting in many files having the same logic of where the help, status, message windows are. Additionally, the code directly uses move and mvadd*/mvprint* functions, which means if the layouts are changed, the row/column computation logic needs to be changed all over the place. The patch creates a (very simple) mutt_window_t structure and functions for moving, addch/str/printw, along with clearing the line. The windows keep track of where they are on the screen, allowing the Mutt code to simply position elements relative to the window. During curses initalization, and when the window is resized, the window sizes and positions and recomputed. Also, a new option flags, R_REFLOW is added for options that need to force a reflow when they are changed. Thanks to Richard Russon for pointing out the slang compilation issue.
2016-03-08Add $resume_edited_draft_files option.Kevin McCarthy
This adds an extra header when saving edited draft files (-E -H on the command line). With this header, the next time they are edited, they are automatically "resumed" (by setting $resume_draft_files). The idea is to prevent multiple user-defined headers and signatures from being added to the draft message by avoiding processing it as a brand new message after the first time.
2016-02-28Draft file tweeks: rename flag, don't auto-abort on no change.Kevin McCarthy
Rename the flag to SENDDRAFTFILE since it will be used in contexts other than the body allocation. Don't automatically abort if the message was unchanged; it seems possible the draft files could be used as the entire message reply.
2016-02-07Add new flag -E to modify draft/include file. (closes #3799)Kevin McCarthy
Specifying -E with -i will cause mutt to directly edit the include file. Specifying -E with -H will cause the draft file to be regenerated from the latest version of the email on exit. Improve -H so that it will read (and write) multipart messages.
2016-01-01Update copyright notices.Kevin McCarthy
This patch only updates existing copyright notices in the source files, using commit dates since the last copyright update in commits e3af935cdb1a and f8fd60d8d3f2. Add a notice to the COPYRIGHT file to refer to our mercurial repository for the full commit history. Add myself to the COPYRIGHT file and smime_keys.pl file.
2015-11-24Rename idna functions and bits for smtputf8 changes.Kevin McCarthy
This is patch 1 of 4 implementing support for SMTPUTF8 (RFC 6531). Change mutt_idna.c to be always compiled. Remove the stub functions in mutt_idna.h. Instead, put #ifdefs around the idna function calls. The conversion functions will be fixed up in the next patch. Rename the conversion functions to mutt_addrlist_to_intl() and mutt_env_to_intl(). Rename the ADDRESS idna status bits to "intl" status bits.
2015-07-11Fix batch mode lockup. (closes #3761) (closes #3760)Kevin McCarthy
The new TS capability check was also running when curses wasn't initialized. Move check inside the !OPTNOCURSES block.
2013-11-02Override draft headers with arguments. (closes #3580)Kevin McCarthy
Currently, if the -H option is used, it is not possible to redefine the recipient addresses with positional argument. This patch fixes it as well as CC, Bcc, and Subject headers. This patch is based on the patch by Petr Písař at http://dev.mutt.org/trac/attachment/ticket/3580/override_draft_headers_with_arguments.patch This version of the patch merges the To, Cc, and Bcc commandline arguments into the template, and fixes a few small problems with the previous patch. This patch also moves the fin close outside the "if (tempfile)" block, since it is opened outside that block.
2013-10-22Terminal status line support, based on the xterm title patch.David Champion
Christoph Berg took the xterm title patch from the mutt mailing list and maintained it for Debian: * Changes made: - 2007-01-27 myon: using %P caused a segfault, updated status.c to catch menu==NULL. - 2007-02-20 myon: make the note about the xterm_set_titles defaults a comment. - 2008-08-02 myon: move set_xterm_* prototypes into the proper header file (cleaner code, no functional change, evades conflict with sidebar patch) This update reworks the Debian version as generic support for tsl/fsl terminfo capability. It no longer depends on a static list of supported terminal types, although it will use default support for these terminal types *if* they do not advertise tsl/fsl or XT in terminfo. The generic terminal status line can be implemented in any fashion, and on hardware terminals it can be a special out-of-screen region of the display. Most modern terminal emulators appear to emulate the status line in the window title; thus the notion of the tsl escape as an xterm window title escape. Configuration variables have been renamed: $ts_status_format format string (using $status_format codes) for the terminal status line $ts_icon_format format string (using $status_format codes) for the xterm icon name $ts_enabled toggle for whether to issue status updates The old configuration names exist as synonyms. Logic flow: * If tsl (string) is set in terminfo, mutt will use that escape to switch to the status area, and will use fsl to switch back to the regular display area. * Otherwise, if XT (boolean) is set in terminfo, mutt will use the standard xterm-compatible escapes. * Otherwise, if $TERM matches a known terminal type, mutt will use the standard xterm-compatible escapes. * Otherwise, this feature is disabled. = NOTE = The XTerm icon escape sequence is not formalized in terminfo, so the egregious kludge of hardcoding the escape is necessary in this case. However, some terminal emulators (e.g. MacOS X Terminal.app) will set the status line (window title) when the icon sequence is received. Since there is no way to detect this behavior, the only solution is to write your configuration to take it into account. Rather than add a variable to control icon escapes separately, we just provide the advice: if you use such a terminal, you may wish to set ts_icon_format to an empty string. This will cause it not to be used.
2013-01-20use pkg-config to look for libidn if available.Michael Elkins
checking <idn/idna.h> rather than including -I/usr/include/idn for Solaris 11. closes #3624
2013-01-03Backed out changeset bf84f24e512dMichael Elkins
2013-01-02display +/-NCURSES_WIDECHAR when displaying ncurses version to show whether ↵Michael Elkins
we are linked against -lncurses or -lncursesw
2012-10-16Add compiler and configure info to mutt -v output (closes #3537)David Champion
Makefile(.am) updated to produce conststrings.c, which contains C strings representing: * the compiler's own version information; * the CFLAGS value from the Make environment * the ./configure options main.c is updated to print them when running 'mutt -v'. txt2c.sh is added to produce conststrings.c. txt2c.sh uses a compiled txt2c binary if possible, for complete fidelity to the source strings in whatever encoding they may use. If txt2c is not available (could not be compiled, or was not compiled natively) it falls back on a shell function to approximate the output using sed and tr.