mutt/mutt_curses.h -rw-r--r-- 6.8 KiB
Remove obsolete AC_HEADER_STDC and STDC_HEADERS checks.

The autoconf macro is obsolete in 2.70.  Also, we now assume at least
C99 so there is no point in checking for ANSI C89 header files.

Fix up code to assume STDC_HEADERS is always true, removing the
reference to it at the same time.
Convert progress and socket_poll millis to unsigned long long.

64-bit platforms should already be using a 64-bit tv_sec, so we should
use the same for the millis values.
Remove trailing whitespace.

The result of
  find . -name "*.[ch]" -exec emacs -batch {} \
    --eval="(progn (delete-trailing-whitespace) (and (buffer-modified-p) (save-buffer)))" \;
Prevent trying to match a failing color body regex repeatedly.

Emails with really long lines (e.g. spam), can suffer performance if a
complicated regex is matched to no effect over and over.  If the regex
failed at the beginning, it won't match at the end of another's regex
match range, so turn it off.
Move mutt_getch() timeout value into curs_lib.c

Change monitor.c to reference the curs_lib value, instead of

We need to store the value for both monitor.c's poll and for
mutt_monitor_ch() to perform an initial non-blocking check of ncurses'
getch() buffer.
Add new timeout functions to work with inotify monitors.

The ncurses timeout() function doesn't affect the new poll inside
mutt_monitor_poll().  This meant that $imap_keepalive and $timeout
were not being respected when the monitor was used.

Create mutt_getch_timeout(), which delegates to timeout() and sets a
timeout value mutt_monitor_poll() uses too.
merge default into stable
Add color commands for the compose menu headers and security status. (closes #3915).

Add "color compose header" to color the From/To/Subject/etc fields in
the compose menu.

Add "color compose security_encrypt/sign/both/none" to color the
security status of the message.
Fix km_error_key() infinite loop and unget buffer pollution.

'bind pager \Ch help' produces an infinite loop when an unbound key is
pressed in the pager.  The reason is because km_error_key() tries to
verify that the key sequence is really bound to the OP_HELP operation.
It does this by using km_expand_key(), tokenize_unget_string() on the
resulting buffer, then checking if the next km_dokey() returns OP_HELP.

The problem is that km_expand_key() does not always produce a string
that is properly reparsed by tokenize_unget_string().  Control-h
sequences are expanded to ^H.  tokenize_unget_string() recognizes this
as two characters '^' and 'H'.  km_error_key() checks the OP returned,
which is OP_PAGER_TOP for the '^'.  This is not OP_HELP, so it prints
a generic error and returns.  This leaves the 'H' in the input buffer!
Since 'H' (by default) is unbound in the pager, it retriggers
km_error_key(), resulting in an infinite loop.

The same issues can occur without control sequences:
  bind generic ? noop
  bind generic dq help
In the index, hitting an unbound key will end up leaving 'q' in the unget
buffer, because 'd' is bound in the index menu and will be read by km_dokey().

A simple approach to fix this would be to just use the same code as in
mutt_make_help(), which has no double-check.  This would be no worse
than the help menu, but can generate an inaccurate error message (e.g
if '?' were bound to noop)

This patch instead uses OP_END_COND as a barrier in the unget buffer.
It directly inserts the keys in the OP_HELP keymap, instead of using
km_expand_key() + tokenize_unget_string().  After calling km_dokey()
it flushes the unget buffer to the OP_END_COND barrier.

Thanks to Walter Alejandro Iglesias for reporting the bug.
Set refresh when popping the menu stack.

This removes the need for the OPTNEEDREDRAW option and MAYBE_REDRAW
macro previously used to communicate back the need to refresh after
exiting a menu.

Remove the redraw parameter from ci_bounce_message() and
mix_make_chain() which served the same purpose.
merge default into stable
Add neomutt version of sidebar patch.  (closes #3829)

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.
Fix header file indentation after M_ prefix renaming.

The use of tabs caused misalignment of various macro definitions.
9cafb05c — Derek Martin 4 years ago
Change M_* symbols to MUTT_*

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.
Fix remaining direct usages of COLS/LINES to use mutt window functions.

Most of these were just message update/clearing.
Modify the pager to use windows.

The pager view is somewhat complex, due to the "mini-index" and the
positioning of the index_status vs pager_status changes depending on
$status_on_top as well as $pager_index_lines and $help.

To make things simpler, it creates four "pager windows":
index_status_window, index_window, pager_status_window, pager_window.

mutt_term_width() is renamed to mutt_window_wrap_cols() and a
mutt_window_t parameter passed in.

Also, the pager drawing loop calling display_line() has a
mutt_window_move() added to move to the beginning of the next line
each time.  This is in case the pager_window isn't flush with the left
side of the terminal.
Modify the menu code to use windows.

Change menu.c to use the mutt_window_t structures and functions.  The
index/stats/help/message window pointers are stored inside the menu_t.
This is useful for the pager, where the "index" we want to use is a
Add window structures to use for screen layout.

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.
merge default into stable
Update copyright notices.

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.