Jakub Wilk [Thu, 14 Dec 2017 15:23:38 +0000 (16:23 +0100)]
Fix type mismatch in mutt_progress_init()
Fixes the following GCC warning:
curs_lib.c: In function ‘mutt_progress_init’:
curs_lib.c:471:65: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘size_t {aka unsigned int}’ [-Wformat=]
snprintf(progress->sizestr, sizeof(progress->sizestr), "%ld", progress->size);
^
Jakub Wilk [Thu, 14 Dec 2017 15:22:37 +0000 (16:22 +0100)]
Fix type mismatch in mutt_pretty_size()
Fixes the following GCC warnings:
muttlib.c: In function ‘mutt_pretty_size’:
config.h:55:19: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘size_t {aka unsigned int}’ [-Wformat=]
#define OFF_T_FMT "%" PRId64
^
muttlib.c:614:22: note: in expansion of macro ‘OFF_T_FMT’
snprintf(s, len, OFF_T_FMT "K", (n + 51) / 1024);
^~~~~~~~~
config.h:55:19: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘size_t {aka unsigned int}’ [-Wformat=]
#define OFF_T_FMT "%" PRId64
^
muttlib.c:621:22: note: in expansion of macro ‘OFF_T_FMT’
snprintf(s, len, OFF_T_FMT "M", (n + 52428) / 1048576);
^~~~~~~~~
Justin Vasel [Wed, 29 Nov 2017 18:00:44 +0000 (13:00 -0500)]
Bring consistency among sizes
There are instances in the code that refer to lengths or sizes of strings and
buffers and the like, but they are not typed in a consistent manner. The purpose
of this commit is to provide some consistency to these scenarios by changing
their type from unsigned int, int, unsigned long, etc. to size_t.
In general, these situations were identified by globally searching the code
for patterns along the lines of:
(unsigned|unsigned int|int|long) (len|blen|olen|length|l|size)
and changing the type to size_t on a case-by-case basis.
The following situations were explicitly ignored:
- autosetup/jimsh0.c, because it appears to be third-party code
- inputs to function calls relating to ssl and sasl, because they don't take
size_t as inputs and recasting in the function call didn't seem worth the
increased messiness
- for loop indices, because in some cases unsigned indices can breed bugs
This commit takes care of most obvious cases. There may certainly be subtler
ones that were missed in this pass.
Justin Vasel [Thu, 30 Nov 2017 04:29:58 +0000 (23:29 -0500)]
Configure number of directory components displayed in sidebar
In cases of a complex maildir directory structures, one may want to hide the
highest `N` directories from display in the sidebar to keep things looking
clean and legible.
This commit introduces a new config parameter, `sidebar_component_depth`, which
takes a positive integer as its value.
For example, suppose I have the following directory structure:
```
Inbox
dir1/dir2
dir1/dir2/dir3/sushi
dir1/dir2/dir3/neomutt/developer
```
By setting `sidebar_component_depth=2` in one's rc file, the sidebar will
display these maildirs in the following way:
```
Inbox
dir2
dir3/sushi
dir3/neomutt/developer
```
As seen in this example, the two highest directories have been truncated from
each path except in the case when there are `<= N` subdirectories, in which
case the bottom-most directory is displayed.
This parameter has a default value of 0, which disables the feature.
A previously-existing option, `sidebar_short_path`, provides similar behavior,
but truncates all except the bottom-most directories. When that option is
enabled, `sidebar_component_depth` is ignored.
Update autosetup to commit b5a0e85d87a46d931ff1e4f8e5de8cd5307f93ba
- this makes it accept --enable-silent-rules and --disable-silent-rules
amongst other things, as requested in
https://github.com/msteveb/autosetup/issues/33
Debian tools and probably other tools too pass arguments like
--mandir=\${prefix}/share/man
to configure. The prefix survives the output into the Makefile,
therefore, we need to define prefix in the Makefile too.
Pietro Cerutti [Fri, 1 Dec 2017 15:49:15 +0000 (15:49 +0000)]
Support reading FQDN from mailname files
Currently, we support reading from /etc/mailname and /etc/mail/mailname.
Adding support for more files is trivial. Reading these files is only
done if NeoMutt was configured without the --with-domain option.
toogley [Sat, 2 Dec 2017 19:51:50 +0000 (20:51 +0100)]
github: make removal of irrelevant sections easier
When users remove the irrelevant things for their issue, they often
leave the indentation of the nested list. That causes github to render
those lines as code instead of markdown list items.
Richard Russon [Mon, 27 Nov 2017 00:09:26 +0000 (00:09 +0000)]
merge: more additions to libmutt
* move signal functions to libmutt
* standardise the naming of the signal functions
* move exit syslist to libmutt
* factor out ICONV_CONST from headers
Richard Russon [Sun, 26 Nov 2017 22:48:58 +0000 (22:48 +0000)]
merge: standardise the string formatting functions
There are lots of callback functions used by `mutt_expando_format()`.
These commits make sure they all have similar names and have similarly
named parameters and variables.
* rename formatting functions
* rename format parameters/variables
* update format function comments
* rearrange switch statements in format functions
* light tidy of format functions
The *_stat functions accept an additional optional stat structure
parameter, which must point to the stat structure of the file.
Using the *_stat functions can save a call to stat() as the stat
structure does not need to be queried by the mutt_file_chmod_* function.