]> granicus.if.org Git - neomutt/log
neomutt
8 years agoDecouple the sidebar from the Buffy list.
Kevin McCarthy [Sat, 2 Jul 2016 19:22:51 +0000 (12:22 -0700)]
Decouple the sidebar from the Buffy list.

Change the sidebar to use an array of SBENTRY* instead.  Move the
"is_hidden" into SBENTRY.  Remove the added "prev" pointer from BUFFY.

This way, sorting the sidebar doesn't affect the BUFFY list order, and
we don't need elements inside BUFFY just for the sidebar presentation.

Fix sidebar-next for the case where the mailboxes are unsorted and
$sidebar_new_mail_only is set.  Change sorting not to clump hidden
mailboxes at the bottom, instead simply skip over hidden mailboxes in
sidebar-next/prev.

8 years agoFix missing sidebar documentation links. (closes #3847)
Kevin McCarthy [Thu, 30 Jun 2016 19:57:17 +0000 (12:57 -0700)]
Fix missing sidebar documentation links. (closes #3847)

USE_SIDEBAR needed to be set in doc/makedoc-defs.h so that the sidebar
option documentation is generated whether mutt is configured with the
sidebar or not.

8 years agoRemove unused SORT_DESC.
Kevin McCarthy [Tue, 28 Jun 2016 23:06:22 +0000 (16:06 -0700)]
Remove unused SORT_DESC.

This came over with the sidebar patch, but I believe is only used by
the notmuch extension.

8 years agoRemove $sidebar_refresh_time from Sample Sidebar Config
Fahri Cihan Demirci [Tue, 28 Jun 2016 22:59:09 +0000 (15:59 -0700)]
Remove $sidebar_refresh_time from Sample Sidebar Config

The $sidebar_refresh_time option was removed with the changeset
1f840760e6e0. Remove it from the sample sidebar configuration as well,
so that anyone using that file in its entirety won't have to deal with "unknown
variable" errors.

8 years agoChange sidebar to consistently use realpath for context and buffy comparison.
Kevin McCarthy [Thu, 23 Jun 2016 19:38:07 +0000 (12:38 -0700)]
Change sidebar to consistently use realpath for context and buffy comparison.

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.

8 years agoChange sidebar next/prev-new to look at buffy->new too.
Kevin McCarthy [Wed, 22 Jun 2016 16:20:39 +0000 (09:20 -0700)]
Change sidebar next/prev-new to look at buffy->new too.

Look at new in addition to msg_unread count, to account for when
$mail_check_stats is unset or when the sidebar only shows the %n
status flag.

8 years agoAdd documentation to the "New Mail Detection" section of the manual.
Kevin McCarthy [Tue, 21 Jun 2016 03:09:52 +0000 (20:09 -0700)]
Add documentation to the "New Mail Detection" section of the manual.

Mention the behavior change with $mail_check_recent.

Add a section about $mail_check_stats.

8 years agoCombine the basic and extended buffy functions.
Kevin McCarthy [Fri, 17 Jun 2016 17:30:30 +0000 (10:30 -0700)]
Combine the basic and extended buffy functions.

Add a check_stats parameter to the mbox, maildir, and mh buffy
functions.  Use that parameter to determine whether to also count
total, new, and flagged messages.

This makes the functions a bit more complicated, but improves
efficiency (for maildir and mh).

Also includes the following cleanup/fixes:
* Move the orig-value counter reset to the beginnining of the loop,
  (before tmp->new is set to 0).

* Change trashed maildir messages to not be counted in msg_count

* Remove an incorrect setting of mailbox->new based on msg_count in
  maildir.  (I missed this one for 1f840760e6e0)

* Change mbox to use the context->mtime for stats_last_checked,
  removing a race condition.

* Fix mh to actually count the messages in order to generate msg_count.
  mh_sequences only covers the range of messages with some sort of
  flag.

8 years agoMake extended buffy independent of the sidebar.
Kevin McCarthy [Tue, 7 Jun 2016 22:02:58 +0000 (15:02 -0700)]
Make extended buffy independent of the sidebar.

Add new boolean option $mail_check_stats (default off) and
$mail_check_stats_interval.  The first turns extended buffy on.  The
second sets the amount of time in between extended buffy checks
(defaulting to 60 seconds).

Remove the option $sidebar_refresh_time.

Change mutt_buffy_check() to only notify the sidebar to redraw if a
mailbox buffy value changes.

Remove the #ifdefs around the extended buffy functions.  The next
patch will merge these functions with the basic functions and pass a
parameter instead.

Imap is a special case, because it sends out the status in one batch.
Change this to perform the comparisons inside cmd_parse_status() and
flag the sidebar there.  It was previously directly assigning the
status counters (unsigned int) to the buffy->new (short).  Change this
to assign 1/0.

8 years agoChange the default for sidebar_format to use %n.
Kevin McCarthy [Wed, 8 Jun 2016 21:43:35 +0000 (14:43 -0700)]
Change the default for sidebar_format to use %n.

The next series of patches is going to create a new option,
$mail_check_stats defaulting off.  When off, the extended buffy which
calculates total/new/flagged messages won't be run.  To help reduce
"sidebar is broken" bug reports, this changes the default format to
something not requiring extended buffy.

The previous default is documented in the option and preserved in the
sample sidebar muttrc in contrib.

8 years agoCorrected OPS.SIDEBAR filename in EXTRA_DIST.
Vincent Lefevre [Wed, 8 Jun 2016 11:28:54 +0000 (13:28 +0200)]
Corrected OPS.SIDEBAR filename in EXTRA_DIST.

8 years agoStart to fix sidebar buffy modifications.
Kevin McCarthy [Sat, 4 Jun 2016 18:32:12 +0000 (11:32 -0700)]
Start to fix sidebar buffy modifications.

The extended buffy for mh had incorrect placement of the loop
brackets.  The counters weren't being incremented in the loop.

Fix extended buffy for maildir to count a maildir message as new if it
doesn't have the info delimeter.

Remove shortcircuits added to the basic buffy stating there is new
mail when (msg_unread > 0).  This is not necessarily true, depending
on $mail_check_recent.

Note: the extended buffy still needs more fixes, which will be done
when it is refactored into its own option.

8 years agoVarious fixes to the sidebar logic.
Kevin McCarthy [Sat, 4 Jun 2016 18:32:09 +0000 (11:32 -0700)]
Various fixes to the sidebar logic.

Use strfcpy instead of strncpy.  The current logic could write past
the end of the buffer.

Don't mess with BUFFY next pointers during removal.  The
mutt_parse_mailboxes() is fine, but this is still not something that
should be done inside sidebar.c.

On removal, set next->prev since we can.

Fix unmailboxes logic:
  * only fix the prev pointers once.
  * if we unmailbox the open mailbox, set it to NULL.

Lastly, flag a redraw on mailboxes/unmailboxes.

8 years agoClean up the sidebar manual.
Kevin McCarthy [Sat, 4 Jun 2016 18:32:07 +0000 (11:32 -0700)]
Clean up the sidebar manual.

Remove the introduction section.  It's a nice effort, but reads more
like a tutorial than something that belongs in section 2.  Will
probably put in on the website instead.

Remove references to a "patch", neomutt, and the history.

Remove the sample muttrc from the manual.

Fix validation errors for the documentation.

8 years agoFix sidebar check_sec.sh warnings.
Kevin McCarthy [Sat, 4 Jun 2016 18:32:04 +0000 (11:32 -0700)]
Fix sidebar check_sec.sh warnings.

Use safe_malloc, FREE, and the safe_strcat functions.

8 years agoSidebar clean up: building and drawing logic.
Kevin McCarthy [Sat, 4 Jun 2016 18:32:03 +0000 (11:32 -0700)]
Sidebar clean up: building and drawing logic.

Fix the autoconf/makefile.am changes to be consistent.

Create a global SidebarNeedsRedraw to indicate a redraw is needed,
instead of putting sb_draw() everywhere in the code.

Create a menu_redraw_sidebar() function and use the REDRAW_SIDEBAR
flag instead of piggy-backing it inside the index loop.

Fix curs_main.c and pager.c to be a bit cleaner by using the global and
REDRAW_SIDEBAR.

Start to clean up some of the buffy code, but this needs to refactored
and fixed.

9 years agofix sidebar/mail_check painting problem
Richard Russon [Thu, 23 Jun 2016 14:57:32 +0000 (15:57 +0100)]
fix sidebar/mail_check painting problem

The bug was triggered when $mail_check was set to 0.

When drawing the status line, the Sidebar lied about its size to
workaround a bug in mutt_FormatString().  Whilst in that function the
Sidebar was redrawn.

The Sidebar got confused over whether it should be visible or not and
promptly vanished.

9 years agotravis: new build script
Richard Russon [Mon, 20 Jun 2016 03:52:37 +0000 (04:52 +0100)]
travis: new build script

9 years agomake the cursor resetting work in slang
Richard Russon [Sat, 18 Jun 2016 22:59:04 +0000 (23:59 +0100)]
make the cursor resetting work in slang

fixes: neomutt/homebrew-neomutt#13

9 years agoFix the case of messages in OPS.MIX and OPS.SIDEBAR
Kevin McCarthy [Sun, 12 Jun 2016 20:49:18 +0000 (13:49 -0700)]
Fix the case of messages in OPS.MIX and OPS.SIDEBAR

Thanks to Vincent Lefèvre for spotting the discrepancy.

9 years agoAdd sidebar_format flag '%n' to display 'N' on new mail.
Kevin McCarthy [Wed, 8 Jun 2016 20:16:45 +0000 (13:16 -0700)]
Add sidebar_format flag '%n' to display 'N' on new mail.

9 years agofix cursor position after sidebar redraw
Richard Russon [Mon, 13 Jun 2016 17:09:50 +0000 (18:09 +0100)]
fix cursor position after sidebar redraw

If the user is entering data, e.g. mail subject, and a sidebar redraw
interrupts them, put the cursor back where it belongs.

Fixes: #49
9 years agoFix sidebar buffy stats updating on mailbox close.
Kevin McCarthy [Mon, 6 Jun 2016 01:05:41 +0000 (18:05 -0700)]
Fix sidebar buffy stats updating on mailbox close.

Move the mutt_sb_set_buffystats() call from mx_fastclose_mailbox() to
the bottom of mx_close_mailbox().  Append-only mailboxes don't have
msgcount set, so fastclose was the wrong place to be doing these
updates.

9 years agoFix alignment in the compose menu.
Richard Russon [Thu, 9 Jun 2016 19:06:10 +0000 (12:06 -0700)]
Fix alignment in the compose menu.

Several of the compose-panel labels didn't use the TITLE_FMT to align
themselves.  This causes formatting problems when the width is changed,
e.g. by the NNTP patch.

9 years agotemporarily disable $sidebar_refresh_time
Richard Russon [Thu, 9 Jun 2016 13:01:42 +0000 (14:01 +0100)]
temporarily disable $sidebar_refresh_time

Limiting the refresh frequency of sidebar updates was interfering with
other Mutt behaviour.  Upstream, Mutt is changing how refresh is
handled.  I'll adopt those changes when they're finished.

The option will be silently ignored, for now.

9 years agofix reflow properly
Richard Russon [Tue, 7 Jun 2016 22:17:35 +0000 (23:17 +0100)]
fix reflow properly

The SidebarWidth was subtracted *after* the width calculations.
This meant the pager text was too narrow.

fixes #26

9 years agoSetting $sidebar_width to more than 128 would cause bad things to happen.
Richard Russon [Tue, 7 Jun 2016 20:40:04 +0000 (13:40 -0700)]
Setting $sidebar_width to more than 128 would cause bad things to happen.

First, give the users more than enough space.
Second, don't pad out short strings beyond the buffer

---
 sidebar.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

9 years agobug-fixes from mutt/default
Richard Russon [Mon, 6 Jun 2016 22:59:56 +0000 (23:59 +0100)]
bug-fixes from mutt/default

9 years agorename sidebar functions sb_* -> mutt_sb_*
Richard Russon [Mon, 6 Jun 2016 15:10:13 +0000 (16:10 +0100)]
rename sidebar functions sb_* -> mutt_sb_*

9 years agosync whitespace to mutt/default
Richard Russon [Mon, 6 Jun 2016 14:57:55 +0000 (15:57 +0100)]
sync whitespace to mutt/default

9 years agofix missing TITLE_FMTs
Richard Russon [Thu, 26 May 2016 11:54:28 +0000 (12:54 +0100)]
fix missing TITLE_FMTs

9 years agodoc: check for installed patches
Richard Russon [Sat, 21 May 2016 11:59:07 +0000 (12:59 +0100)]
doc: check for installed patches

9 years agodoc: css for sidebar intro
Richard Russon [Sat, 21 May 2016 11:39:34 +0000 (12:39 +0100)]
doc: css for sidebar intro

9 years agofix format=flowed text when the sidebar is enabled
Richard Russon [Tue, 17 May 2016 02:13:50 +0000 (03:13 +0100)]
fix format=flowed text when the sidebar is enabled

fixes #26

9 years agoSet COLUMNS to MuttIndexWindow->cols in mutt_create_filter_fd. (closes #3837)
Kevin McCarthy [Tue, 10 May 2016 16:42:27 +0000 (09:42 -0700)]
Set COLUMNS to MuttIndexWindow->cols in mutt_create_filter_fd. (closes #3837)

This allows filters to automatically (or via a command line argument)
adjust to the width of the pager/index.  This is even more important
with the sidebar, since the width of the pager is smaller than the
terminal width.

Thanks to Vincent Lefèvre for his helpful information and suggestions,
and to Richard Russon for the initial patches.

9 years agobump dependency to 1.6.1
Richard Russon [Sat, 7 May 2016 23:28:37 +0000 (00:28 +0100)]
bump dependency to 1.6.1

9 years agomerge: upstream
Richard Russon [Sun, 1 May 2016 13:39:59 +0000 (14:39 +0100)]
merge: upstream

 * Fix IDNA functions for systems without iconv.
 * Fix mutt_protect() when INLINE is set. (closes #3828)
 * Create a wrapper sys_socket.h to work around Solaris namespace issues.  (closes #3833)
 * automatic post-release commit for mutt-1.6.1

9 years agoautomatic post-release commit for mutt-1.6.1
Kevin McCarthy [Sat, 30 Apr 2016 21:21:44 +0000 (14:21 -0700)]
automatic post-release commit for mutt-1.6.1

9 years agoCreate a wrapper sys_socket.h to work around Solaris namespace issues. (closes ...
Kevin McCarthy [Wed, 27 Apr 2016 20:08:52 +0000 (13:08 -0700)]
Create a wrapper sys_socket.h to work around Solaris namespace issues.  (closes #3833)

Solaris includes "sys/stream.h" inside their "sys/socket.h".  This
include file adds many non-reserved macros to Mutt's namespace, two of
which conflict with existing Mutt macros.

The simplest fix would be to rename those macros in Mutt, however this
will cause difficulty with out-of-tree patches.  This fix creates a
wrapper include file that preserves those existing macros and prevents
the Solaris values from entering Mutt's namespace.

9 years agoallow sidebar functions when sidebar is hidden
Richard Russon [Wed, 27 Apr 2016 10:57:10 +0000 (11:57 +0100)]
allow sidebar functions when sidebar is hidden

Simon Lundström (simmel) noted that <sidebar-next-new> didn't work when
the sidebar was hidden.  There was no good reason for it not to work.

9 years agofix typo
Richard Russon [Wed, 20 Apr 2016 23:12:39 +0000 (00:12 +0100)]
fix typo

9 years agodrop spurious attribute setting
Richard Russon [Wed, 20 Apr 2016 21:01:12 +0000 (22:01 +0100)]
drop spurious attribute setting

9 years agotravis: add config
Richard Russon [Mon, 18 Apr 2016 00:07:55 +0000 (01:07 +0100)]
travis: add config

[ci skip]

9 years agoMake <sidebar-next-new> only find *new* mail
Richard Russon [Tue, 19 Apr 2016 13:54:53 +0000 (14:54 +0100)]
Make <sidebar-next-new> only find *new* mail

Previously, the <sidebar-next-new> function thought flagged emails were
"new".  This wasn't documented behaviour and was unexpected for the
user.

Fixes: #16
9 years agobuild fix
Richard Russon [Fri, 15 Apr 2016 14:22:31 +0000 (15:22 +0100)]
build fix

9 years agoallow sidebar_divider_char to be longer
Richard Russon [Fri, 15 Apr 2016 02:33:29 +0000 (03:33 +0100)]
allow sidebar_divider_char to be longer

Originally '$sidebar_divider_char' could be an arbitrary string.

When I reworked Sidebar I limited it to 1 character (because I couldn't
see a good case for anything else).

It turns out that ' | ' isn't a bad choice for the divider.

fixes: #15

9 years agominor code tidy
Richard Russon [Fri, 15 Apr 2016 01:22:31 +0000 (02:22 +0100)]
minor code tidy

9 years agofix crash caused by sidebar_folder_indent
Stephen Gilles [Fri, 15 Apr 2016 00:57:03 +0000 (01:57 +0100)]
fix crash caused by sidebar_folder_indent

Certain folder settings, combined with sidebar_folder_indent, caused an overflow
when trying to compare paths.

    set folder="~/mail/folder"
    mailboxes "~/mail/folder/"

Note the trailing / on the mailbox name.

Signed-off-by: Richard Russon <rich@flatcap.org>
9 years agoallow the user to change mailboxes again
Olaf Lessenich [Thu, 14 Apr 2016 22:23:28 +0000 (23:23 +0100)]
allow the user to change mailboxes again

"unmailboxes *" used to cause Sidebar to crash.  The bug-fix for this
introduced another bug that prevented users from changing to a
non-Sidebar folder.

Signed-off-by: Richard Russon <rich@flatcap.org>
9 years agotry hard to keep track of the open mailbox
Richard Russon [Thu, 14 Apr 2016 20:12:58 +0000 (21:12 +0100)]
try hard to keep track of the open mailbox

If a user deletes the current mailbox with "unmailboxes", but then adds
it back with "mailboxes", then we will highlight it correctly.

9 years agofix refresh of pager
Richard Russon [Thu, 14 Apr 2016 11:40:29 +0000 (12:40 +0100)]
fix refresh of pager

Sidebar didn't redraw properly when in the pager, or help.

9 years agofix formatting
Richard Russon [Wed, 13 Apr 2016 21:29:02 +0000 (22:29 +0100)]
fix formatting

Respect the TITLE_FMT when on the compose screen.

9 years agonote config changes in the readme
Richard Russon [Wed, 13 Apr 2016 15:17:56 +0000 (16:17 +0100)]
note config changes in the readme

9 years agocorrect sidebar's messages counts
Richard Russon [Tue, 12 Apr 2016 23:11:31 +0000 (00:11 +0100)]
correct sidebar's messages counts

Sidebar calculated the message counts slightly differently from Mutt.
This occasionally lead to the counts changing unexpectedly.

9 years agoignore case when sorting alphabetically
Richard Russon [Tue, 12 Apr 2016 14:36:03 +0000 (15:36 +0100)]
ignore case when sorting alphabetically

9 years agobuild fix for old compilers
Richard Russon [Sun, 10 Apr 2016 21:28:57 +0000 (22:28 +0100)]
build fix for old compilers

9 years agochange wiki references to website
Richard Russon [Mon, 11 Apr 2016 18:02:12 +0000 (19:02 +0100)]
change wiki references to website

9 years agoFix mutt_protect() when INLINE is set. (closes #3828)
Kevin McCarthy [Sun, 10 Apr 2016 23:02:06 +0000 (16:02 -0700)]
Fix mutt_protect() when INLINE is set. (closes #3828)

The oppenc changes allow security bits to be set even when not
encrypting or signing (for instance, OPPENCRYPT and INLINE).

mutt_protect() assumed that if INLINE is set, then either ENCRYPT or
SIGN must also be set.  Specifically, it would end up inline-signing
the message even though neither was set.

Ensure mutt_protect() is a noop if neither SIGN or ENCRYPT are set.

In ci_send_message(), check for sign or encrypt before calling the
crypt_get_keys() / mutt_protect() block, and also in the fcc section
(since clear_content would be NULL if not).

The second change to the fcc part is somewhat redundant, but better to
be explicit and avoid the case where the subtype is somehow
"encrypted" or "signed" even though msg->security wasn't set thus.

9 years agoOnly sort the sidebar if we're asked to
Richard Russon [Thu, 7 Apr 2016 13:06:27 +0000 (14:06 +0100)]
Only sort the sidebar if we're asked to

fixes #11

9 years agoFix IDNA functions for systems without iconv.
Kevin McCarthy [Tue, 5 Apr 2016 21:31:36 +0000 (14:31 -0700)]
Fix IDNA functions for systems without iconv.

The IDNA changes for SMTPUTF8 support introduced a bug for systems
without iconv.  For those systems, the local<->intl functions would
return an error due to the charset conversion failing.

Change mutt_idna.c back to being conditionally compiled, but this time
based on HAVE_ICONV.  If there is no iconv, stub out the functions in
mutt_idna.h.

9 years agoadd ident to PATCHES
Richard Russon [Thu, 18 Feb 2016 16:52:53 +0000 (16:52 +0000)]
add ident to PATCHES

9 years agoadd docs
Richard Russon [Tue, 29 Dec 2015 15:16:26 +0000 (15:16 +0000)]
add docs

9 years agorefresh sidebar after timeout
Stefan Assmann [Wed, 30 Oct 2013 18:34:57 +0000 (11:34 -0700)]
refresh sidebar after timeout

Allow the sidebar to automatically refresh after the amount of time
specified via the "timeout" variable.

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
9 years agosplit out sidebar wipe
Richard Russon [Mon, 8 Feb 2016 16:30:36 +0000 (16:30 +0000)]
split out sidebar wipe

9 years agohandle unmailboxes * safely
Richard Russon [Mon, 8 Feb 2016 02:02:13 +0000 (02:02 +0000)]
handle unmailboxes * safely

9 years agorename: lots of config for consistency with mutt
Richard Russon [Fri, 18 Dec 2015 15:47:37 +0000 (15:47 +0000)]
rename: lots of config for consistency with mutt

9 years agofeature: separate colour for spoolfile
Richard Russon [Thu, 31 Dec 2015 15:42:25 +0000 (15:42 +0000)]
feature: separate colour for spoolfile

don't highlight spoolfile if not coloured

9 years agofeature: separate sidebar indicator colour
Richard Russon [Thu, 31 Dec 2015 15:24:40 +0000 (15:24 +0000)]
feature: separate sidebar indicator colour

default MT_COLOR_SB_INDICATOR to MT_COLOR_INDICATOR

9 years agoexpandos for deleted, limited, tagged
Richard Russon [Thu, 31 Dec 2015 03:04:42 +0000 (03:04 +0000)]
expandos for deleted, limited, tagged

9 years agosplit up sb_draw
Richard Russon [Sat, 19 Dec 2015 18:40:19 +0000 (18:40 +0000)]
split up sb_draw

9 years agorevamp sorting
Richard Russon [Fri, 18 Dec 2015 18:40:19 +0000 (18:40 +0000)]
revamp sorting

9 years agodistinguish between what's highlighted and what's actually open
Richard Russon [Fri, 18 Dec 2015 18:40:19 +0000 (18:40 +0000)]
distinguish between what's highlighted and what's actually open

9 years agorefactor: visibility check
Richard Russon [Fri, 18 Dec 2015 17:40:50 +0000 (17:40 +0000)]
refactor: visibility check

9 years agoadd: BUFFY notifications
Richard Russon [Fri, 18 Dec 2015 17:34:17 +0000 (17:34 +0000)]
add: BUFFY notifications

9 years agorefactor: split out initialise
Richard Russon [Fri, 18 Dec 2015 17:18:09 +0000 (17:18 +0000)]
refactor: split out initialise

9 years agoadd: colours for divider and highlights
Richard Russon [Fri, 18 Dec 2015 16:35:14 +0000 (16:35 +0000)]
add: colours for divider and highlights

9 years agoadd: BUFFY sorting
Richard Russon [Fri, 18 Dec 2015 16:32:12 +0000 (16:32 +0000)]
add: BUFFY sorting

9 years agorename: vars
Richard Russon [Fri, 19 Feb 2016 04:21:10 +0000 (04:21 +0000)]
rename: vars

9 years agorename: msgcount to msg_count to match other sidebar variables
Richard Russon [Fri, 18 Dec 2015 15:33:03 +0000 (15:33 +0000)]
rename: msgcount to msg_count to match other sidebar variables

9 years agodrop old sort
Richard Russon [Fri, 18 Dec 2015 15:14:14 +0000 (15:14 +0000)]
drop old sort

9 years agofeature: add function sidebar-toggle-visible
Richard Russon [Wed, 9 Dec 2015 04:20:01 +0000 (04:20 +0000)]
feature: add function sidebar-toggle-visible

9 years agofix refresh -- time overflowed short
Richard Russon [Thu, 10 Dec 2015 16:58:40 +0000 (16:58 +0000)]
fix refresh -- time overflowed short

rename SidebarLastRefresh to LastRefresh as it's only used in sidebar.c

9 years agofix brain-damaged function: mh_buffy_update
Richard Russon [Wed, 2 Dec 2015 02:11:03 +0000 (02:11 +0000)]
fix brain-damaged function: mh_buffy_update

Since 1.5.19, mh_buffy_update hasn't worked.  It updated the values
of pointers rather than the destinations of the pointers.

9 years agobuild: conditional compilation
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:

    unifdef -Bm -UUSE_SIDEBAR -UHAVE_FMEMOPEN <FILE>

Then run sed using this script:

    s/ *- *SidebarWidth//g
    s/ *+ *SidebarWidth//g
    s/SidebarWidth *+ *//g
    s/SidebarWidth/0/g

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.

9 years agotidy: add comments
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.

9 years agotidy: rename functions
Richard Russon [Fri, 19 Feb 2016 04:32:06 +0000 (04:32 +0000)]
tidy: rename functions

9 years agosort: sidebar functions
Richard Russon [Mon, 30 Nov 2015 14:37:10 +0000 (14:37 +0000)]
sort: sidebar functions

NOTE: this patch does NOT make any code changes.
It simply rearranges entire functions.

Reorder the functions in sidebar.c
Put the static (helper) functions together.

9 years agotidy: other code
Richard Russon [Wed, 2 Dec 2015 02:23:51 +0000 (02:23 +0000)]
tidy: other code

Tidy up our code in mutt functions

Minor refactoring of code
Initialise variables
Check pointers before use
Bracket complicated logic

9 years agotidy: our functions
Richard Russon [Wed, 2 Dec 2015 02:21:12 +0000 (02:21 +0000)]
tidy: our functions

Tidy up code in our complete functions

Minor refactoring of code
Initialise variables
Check pointers before use
Bracket complicated logic

9 years agotidy: sidebar
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

9 years agofix: drop DrawFullLine
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.

9 years agofix: drop unused
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

9 years agoindent: sync to surroundings
Richard Russon [Tue, 1 Dec 2015 03:23:52 +0000 (03:23 +0000)]
indent: sync to surroundings

NOTE: this patch does NOT make any code changes.
If only adds/removes whitespace.

Tidy our code in mutt functions as best we can.
Importantly, match up the indent to the surrounding code.

Delete trailing whitespace
{} in compact style
Tidy whitespace around ()'s and maths operators

9 years agoindent: our functions
Richard Russon [Mon, 30 Nov 2015 04:25:05 +0000 (04:25 +0000)]
indent: our functions

NOTE: this patch does NOT make any code changes.
If only adds/removes whitespace.

Use whitespace uniformly across all of our code.

Delete trailing whitespace
Indent with tabs
Function {} to beginning of line
Other {} in compact style
Tidy whitespace around ()'s and maths operators

9 years agofeature: refresh
David Sterba [Fri, 27 Nov 2015 21:56:00 +0000 (21:56 +0000)]
feature: refresh

Add new config: "sidebar_refresh"
Configure the minimum time between sidebar refreshes to reduce
network traffic.

9 years agofeature: dotpathsep
Fabian Groffen [Thu, 26 Nov 2015 16:49:27 +0000 (16:49 +0000)]
feature: dotpathsep

Add new config: "sidebar_delim_chars"
Allow the user to configure how folder names are parsed into a
hierarchy.

9 years agofeature: working utf8
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.

9 years agofeature: whitelist
Jason DeTiberus [Thu, 19 Nov 2015 19:55:54 +0000 (19:55 +0000)]
feature: whitelist

Add new config: "sidebar_whitelist"
When displaying only-new mailboxes, force some mailboxes to be
always displayed

9 years agofeature: prev/next wraparound
Richard Russon [Thu, 19 Nov 2015 18:30:24 +0000 (18:30 +0000)]
feature: prev/next wraparound

Add new config: "sidebar_next_new_wrap"
When searching for next-new/prev-new mailbox, wrap around if the end
is reached.

9 years agofeature: new only
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.