Richard Russon [Mon, 7 Mar 2016 04:41:20 +0000 (04:41 +0000)]
merge: bug-fixes - various downstream bug fixes
* add strndup.c strnlen.c
* fix spelling typo
* More careful file writing for aliases and attachments
* Bye srandom() and random()
* Remove TLS version notification
* Use unlocked libc IO everywhere.
* Add browser sort by description, message count and new message count
* fix %* index_format
* build fix for po package name
* mute build warning
Richard Russon [Wed, 2 Dec 2015 03:58:44 +0000 (03:58 +0000)]
build: conditional compilation
Make sidebar compilation conditional on a configure option.
Add --enable-sidebar option to configure
Alter Makefile to honour configure
Move our OPS into OPS.sidebar
Surround all our code with #ifdef USE_SIDEBAR
By using the unifdef program, all the sidebar code can be removed.
The result is code that differs only slightly from the original mutt
code. Run this on each source file:
Compared to the original mutt code, there are some minor changes,
such as whitespace, and minor refactoring of variables.
Note: One sidebar global variable is left-behind: SidebarWidth.
This is deeply embedded in the mutt code. This is because mutt
hard-codes a lot of values: 0's for the left-hand side of the
screen and COLS representing the width of the screen.
Richard Russon [Wed, 2 Dec 2015 03:58:15 +0000 (03:58 +0000)]
tidy: add comments
NOTE: this patch does NOT make any code changes.
It simply adds comment blocks.
Fully document all the sidebar config options.
Add comment-blocks describing each function -- what it does, the
parameters it takes, the return values. These can be used by
doxygen.
Richard Russon [Wed, 2 Dec 2015 03:03:49 +0000 (03:03 +0000)]
tidy: sidebar
Tidy up code in sidebar.c
Minor refactoring of code
Initialise variables
Check pointers before use
Bracket complicated logic
Add {} to unbalanced, or ambiguous, if's
Align = signs
Split up illegible uses of ternary operator ? :
Split up: if ((x = y()) == NULL)
Remove perl-like one-line if's
Compare pointers to NULL
Move our private data struct (sidebar_entry) from protos.h
Richard Russon [Mon, 30 Nov 2015 16:37:36 +0000 (16:37 +0000)]
fix: drop DrawFullLine
Drop global variable DrawFullLine
sidebar used a global variable in order to occasionally draw a
complete line of text on the screen. By manipulating the
SidebarWidth, we can produce the same effect.
Removing this variable also removes the need for nearly 50 lines of
duplicated code in mutt_FormatString.
Richard Russon [Tue, 1 Dec 2015 04:14:25 +0000 (04:14 +0000)]
fix: drop unused
NOTE: this patch does NOT make any functional changes.
remove unused parameters from:
draw_sidebar
scroll_sidebar
calc_boundaries
draw_sidebar has a return value that isn't used
struct MBOX_LIST isn't used
remove some unneeded #include's
remove defunct #ifdef BUFFY_SIZE
remove junk comments
Richard Russon [Tue, 24 Nov 2015 16:27:20 +0000 (16:27 +0000)]
feature: working utf8
Correctly handle utf8 character sequences.
Fix the distinction, in the code, between buffer length in bytes,
string length in wide-chars and screen width in cells.
Steve Kemp [Thu, 19 Nov 2015 18:29:49 +0000 (18:29 +0000)]
feature: new only
Add new config: "sidebar_newmail_only"
Only display mailboxes containing new mail.
Add two new functions and keyboard mappings.
"sidebar-next-new" / "sidebar-prev-new" select the next/previous
mailbox that contains new, or flagged, mail.
Official Mutt-Sidebar patch against mutt-1.5.24
http://www.lunar-linux.org/mutt-sidebar/
http://lunar-linux.org/~tchan/mutt/patch-1.5.24.sidebar.20151111.txt
David Wilson [Tue, 22 Oct 2013 18:34:57 +0000 (11:34 -0700)]
Use unlocked libc IO everywhere.
Since mutt does not use threads, there is no reason it should use the
locked variants of the FILE* IO functions. This checks if the unlocked
functions are available, and if so enables them globally via mutt.h.
Cuts load time for a 56k message, 1.8GB /var/mail mailbox from 14
seconds to ~6 seconds, since we avoid acquiring and releasing a mutex
for every character of input read.
Sami Farin [Wed, 16 Oct 2013 18:34:57 +0000 (11:34 -0700)]
Bye srandom() and random()
Prefer getrandom on Linux, use /dev/urandom otherwise to
get entropy for MIME boundaries, message-id, Maildir filename,
temporary filename. Using MUTT_RANDTAG_LEN (currently 16) base32
characters for boundaries and message-id.
Sami Farin [Wed, 16 Oct 2013 18:34:57 +0000 (11:34 -0700)]
More careful file writing for aliases and attachments
Use fsync and check for errors when appending to alias file,
saving attachments, and bouncing a message. Still more checks are needed.
Also preserve errno if safe_fsync_close fails.