Age | Commit message (Collapse) | Author |
|
Large values shouldn't use subtraction into an integer return type, so
just convert all of them to use the macro, to be safe.
|
|
The browser lists the contents of a directory passed as 'f' when it
has a trailing slash; without, it lists everything matching that name
in the parent directory.
Since the browser does its own relative path expansion, we can just
use mutt_buffer_path_norel() to keep a trailing slash in 'f'.
|
|
This uses existing code to partially complete, and then launch the
browser for selection.
Unfortunately, completing a path argument brings up other issues, such
as quoting, which this currently doesn't handle. It also might be
better to rotate through completions rather than launching the file
brower.
Add a "select directory" mode to the browser, modeled on the IMAP
"enter vs select a mailbox with children" behavior: using <view-file>
to select the directory and <select-entry> to enter the directory.
|
|
Without this, IMAP autoreconnect, background-edit Fcc, browser
sticky-cursor, and sidebar "current" selection may not work properly.
Change imap_qualify_path() to preserve the password if it is present
in IMAP_MBOX for the generated URL.
In almost all cases, DT_PATH types are run through
mutt_pretty_mailbox(), which filters out the passwords, before
displaying them in the UI.
However there are a few cases where the context->path is displayed
directly. Create a new function, mutt_buffer_remove_path_password()
to remove it and display that instead.
|
|
Using a constant offset apparently allows the compiler to be smart
enough to detect a potential problem, but it isn't smart enough to see
we've already determined lastdirlen is non-zero.
|
|
This makes it easier to navigate up a directory when the file browser
is sorted by a value other than "alpha".
|
|
Record entry numbers as they are added to the list, so re-sorting by
"unsorted" can return to the original order.
This is most useful for the mailboxes case, where "unsorted" should
mean the order listed in the muttrc.
|
|
This allows to control file browser sorting and mailbox browser
sorting separately.
|
|
Some paths, such as the folder browser, or certain hook values,
should be expanded for shortcuts, but not for relative paths.
Configuration variables that hold commands that search by PATH should
also not be expanded.
Create a separate call, and a separate data type for config vars.
|
|
There was a disconnect between the compose menu and the behavior when
selecting multiple files. The select_file() operation populates the
files and numfiles when hitting 'quit'. The compose menu was
incorrectly looking at the fname parameter, which won't be populated
unless the user presses enter.
The enter_string() menu makes the same mistake. Change it to behave
differently depending on whether multiple is set.
The logic needs to be made clearer by changing the api. I will do
that in the next commit.
|
|
-nopoll allows adding the mailbox to the sidebar, or the mailbox
browser menu, without incurring polling costs.
-poll can be used to re-enable polling for a previously disabled
mailbox.
-label allows specifying an alternative string to show in the sidebar
and mailbox browser menu.
-nolabel removes a label from an existing mailbox.
Change $sidebar_sort_method so that "alpha" and "name" will sort by
the label if specified. "path", however, will always sort by the
actual mailbox path.
|
|
All invocations pass a pointer parameter. Perhaps at one point this
was like the init.h combined usage. But as with that, using an
unsigned long is incorrect, and we've been lucky to get away with it.
Since we don't need a union, just change it to void * to properly size
the parameter.
|
|
Most of these were already commented. Change a few of them to
a format gcc will recognize. In the future, we'll want to change to
whatever is standardized.
|
|
The menu isn't rebuilt after sorting, so the selected mailbox was not
sticky for that operation.
Refactor the sticky cursor setting out so it can be explicitly called
after sorting too.
|
|
|
|
Prior to the introduction of display_name/full_path, it showed "name",
which was the full IMAP URL but the shortname for folder/mailbox view.
Now that the full_path is available, it makes sense to show that for
all cases.
|
|
This option attempts to keep the browser cursor on the same mailbox.
It does this by keeping track of the current selected mailbox and
comparing that when regenerating the menu.
Modify imap_mailbox_create() and imap_mailbox_rename() to return the
new mailbox name so it can be automatically selected.
|
|
Mailbox and Folder view don't make use of the desc field. They store
an abbreviated version in the name field and expand it when selecting
or testing it.
IMAP stores the full URL in name, and stores an abbreviated
version (possibly with a trailing slash) in the desc field.
The asymetricity makes it awkward, and interferes with a smart-cursor
option in the next commit. So instead rename the fields to
"display_name" and "full_path".
In Mailfox and Folder view, store the fully expanded path, which we
have while iterating, in "full_path", and the shortened version in
"display_name".
Likewise in IMAP, store the full URL in "full_path" and the shortened
version in "display_name".
Simplify the code in browser.c to use the full_path instead of
concatenating and expanding.
|
|
A few functions in browser.c, buffy.c, and monitor.c were using
BUFFY->pathbuf but were potentially truncating via fixed size buffers.
Convert those to use BUFFERS too.
buffy_get() was creating epath and expanding it, apparently to match
against expanded BUFFY list entries, was wasn't using the epath. I
believe this is a bug, and have switched the comparison to epath.
|
|
Rename to BUFFER->pathbuf to make it clear the field is a BUFFER, and
to make sure to catch and review all usages.
There are still uses of pathbuf that are truncating and need to be
fixed, for example in browser.c and buffy.c.
Fix up sidebar usage in one place, that was pointing inside the
BUFFY->path with a char *. At the same time, change their "short
folder" computation to also use a BUFFER.
|
|
|
|
|
|
|
|
|
|
Add a cleanup method call to main to free the BUFFERS.
Add mutt_buffer_concat_path() buffer helper function.
|
|
Don't allow the operation on a non-directory. Print a message
indicating it's not a directory.
|
|
The i variable is used in several places and scopes as a temporary
index variable, but is also used to record the current operation.
Separate them out to make the code less confusing.
|
|
Some (maybe most) IMAP mail systems allow folders to be nested inside
folders, so you can have, say, an Inbox with more folders inside it.
However, in the file browser, mutt will only open a maildir/mh
directory as a mailbox, there is no way to get to the child mailboxes.
This change adds a function <descend-directory> that forces mutt to
descend into the directory. It is unbound by default.
Signed-off-by: Corey Minyard <minyard@acm.org>
|
|
These are mostly the result of making the formatting changes commit
after the indent changes commit.
|
|
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.
|
|
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.
|
|
The result of
find . -name "*.[ch]" -exec emacs -batch {} \
--eval="(progn (delete-trailing-whitespace) (and (buffer-modified-p) (save-buffer)))" \;
|
|
|
|
This allows '=' and '~' mailboxes shortcuts to be turned off in the
browser mailbox list.
The default $sort_browser value of "alpha" uses strcoll(3), which
ignores some punctuation. When using multiple accounts with
dynamically changing values of $folder, this can lead to an
unintuitive sorting order. (See issue #22 for an example.)
This problem came about because of commit 8328ce68, which enabled
mutt_pretty_mailbox() calls for IMAP and POP mailboxes too. The
commit had a valid point about consistency and too-wide mailbox
listings, so I don't really want to revert it.
This option provides an alternative to completely enable/disable the
shortcuts for those who run into an issue.
|
|
The size of a directory or symlink in the folder browser is not meaningful.
For directories it means just how many blocks were allocated to hold all
entries. It does not mean that the entries are still present in the directory.
For symlinks its the size of the target.
Set both to zero to simplify the folder browser output.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
|
|
|
Change the pager, compose, recvattach and recvcmd to pass the actx
instead of the individual idx and idxlen parameters.
Separate out the compose menu exit logic to first free the BODY data
and then call the shared actx free function at the bottom.
|
|
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.
|
|
Change the pager to use a MENU, right now just to hold the refresh
state.
|
|
Mailbox list may not be properly displayed in a standard 80-column
terminal window if the $folder variable contains a long URL. In such
a case only left part of each entry name can be visible with the default
value of $folder_format. What's worse, this visible part may not be
enough to distinguish between the entries.
Thus in this case mutt_pretty_mailbox() will be just as useful as for
local mailboxes.
|
|
|
|
The buffer size of 16 was sufficient to hold the %d format, but not
for using %D. Change to use a SHORT_STRING.
Thanks to Ian Zimmerman for the original patch, and to Antonio Radici
for forwarding it on to us.
|
|
$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!
|
|
%n will show the unread message count in the mailbox. %m will show
total message count. Except for %n with IMAP, these both require
$mail_check_stats to be set, which puts these counts inside BUFFY.
Since the imap_mboxcache is never fresher than the value in BUFFY,
remove the special imap_mailbox_state() call. Instead, just update
from the current Context for all mailboxes.
Remove the logic that overrode the %N format string to show unread
count for IMAP mailboxes. If they want to see unread count, they will
have to change the $folder_format.
Although it doesn't look possible to reuse browser_state.entry slots,
change the OP_DELETE_MAILBOX to memset(0) the deleted slot. Then, we
can change to logic in add_folder() so it doesn't need to zero-out
unset values.
|
|
Add and use new flag to indicate the folder is on local filesystem.
Add and use new gid, uid and nlink member.
Use existing ->mode member instead of stat->st_mode.
Use existing ->size member instead of stat->st_size.
Use existing ->mtime member instead of stat->st_mtime.
Remove struct stat, the used values were already duplicated in the struct.
This reduces memory usage.
|
|
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.
|
|
Continuing with the conversion to using windows for screen drawing,
mutt_FormatString() was directly using COLS for right justification
and similar formatting. Instead pass in a parameter, cols.
This change involved seeding the parameter through callback functions
too, as many of them call mutt_FormatString() back.
|
|
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.
|
|
Currently, the SSL and TLS certficate prompts turn on
OPTUNBUFFEREDINPUT, (to prevent macros and such from running right
through the dialog). Unfortunately, the menu dialog processing in
menu_dialog_dokey() is using mutt_ungetch() to forward non-dialog keys
on to standard menu processing. With OPTUNBUFFEREDINPUT set, those keys
never make it to the menu and are buffered until after the menu dialog.
This patch creates a new event buffer, separate from the standard
"unget" buffer, for use by macros, exec, and push events. These events
can be temporarily ignored by setting OPTIGNOREMACROEVENTS (renamed
from OPTUNBUFFEREDINPUT), while continuing to allow unget events to be
processed.
Since the "push" and "unget" functions now go to different buffers,
function names were slightly renamed, to make it less easy to
unintentionally use the wrong function at the wrong time.
|
|
|