summaryrefslogtreecommitdiffstats
path: root/browser.c
AgeCommit message (Collapse)Author
2019-02-02Add an error message for <descend-directory>.Kevin McCarthy
Don't allow the operation on a non-directory. Print a message indicating it's not a directory.
2019-02-02Separate out op variable in the browser.Kevin McCarthy
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.
2019-01-31Allow descending into maildir and mh directories in file browserCorey Minyard
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>
2019-01-05Fix a few indenting issues.Kevin McCarthy
These are mostly the result of making the formatting changes commit after the indent changes commit.
2019-01-04Clean up formatting.Kevin McCarthy
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.
2019-01-04Clean up code indentation.Kevin McCarthy
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.
2018-12-31Remove trailing whitespace.Kevin McCarthy
The result of find . -name "*.[ch]" -exec emacs -batch {} \ --eval="(progn (delete-trailing-whitespace) (and (buffer-modified-p) (save-buffer)))" \;
2018-04-19Add $sort_browser options for count and unread.Kevin McCarthy
2018-04-19Add $browser_abbreviate_mailboxes.Kevin McCarthy
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.
2018-01-12examine_directory: set directory/symlink size to zeroOlaf Hering
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>
2017-09-20Display an error message when delete mailbox fails. (see #3968)Kevin McCarthy
2017-08-10Change helpers functions to pass actx. (see #3728)Kevin McCarthy
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.
2017-03-26Set refresh when popping the menu stack.Kevin McCarthy
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.
2017-03-26Add a menu stack to track current and past menus.Kevin McCarthy
Change the pager to use a MENU, right now just to hold the refresh state.
2017-03-12Add shortcuts for IMAP and POP mailboxes in the file browserDmitri Vereshchagin
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.
2016-09-02merge stableKevin McCarthy
2016-09-02Increase date buffer size for $folder_format. (closes #3863)Kevin McCarthy
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.
2016-08-22Remove the $locale configuration variable.Kevin McCarthy
$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!
2016-07-30Add unread and total message count format strings to $folder_format.Kevin McCarthy
%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.
2016-06-17folder_file: remove struct statOlaf Hering
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.
2016-05-09Change M_* symbols to MUTT_*Derek Martin
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.
2016-04-27Add cols parameter to mutt_FormatString()Kevin McCarthy
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.
2016-01-01Update copyright notices.Kevin McCarthy
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.
2015-10-04Create a separate macro/push/exec event buffer. (closes #3779)Kevin McCarthy
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.
2013-04-11backout c1371176ea45Michael Elkins
2013-04-10fix various compiler warnings; most were due to unchecked return values from ↵Michael Elkins
system calls.
2011-12-03Declare many structures const (closes #3552)Dan Fandrich
Many structs used in mutt are actually constant but are defined without the 'const' keyword. This can slow initialization (slightly) in some environments due to extra copying and increases the amount of writable RAM required at run-time, which can be significant on non-MMU systems. Using const can also increase the opportunities for compiler optimization. The attached patch marks many such structures as const. On my test x86 build, this reduces the size of .data by over 50%.
2011-05-23folder_file: change type of new from short to intOlaf Hering
As requested by Rocco Rutte in bug #2421 increase the type to int. Signed-off-by: Olaf Hering <olaf@aepfle.de>
2010-08-24Do not call regfree if regcomp fails.Emanuele Giaquinta
The content of the regex_t structure is undefined in this case.
2010-08-06avoid using C99 boolMichael Elkins
2010-08-06add %D format string to $folder_format to expand the time based on $date_format.Michael Elkins
properly set the locale for LC_TIME prior to calling strftime() closes #1734 closes #3406
2010-08-03add locale.h for compililng with -std=c99Michael Elkins
2009-06-11Use only latest mtime of new/cur for browser, not whole stat() infoRocco Rutte
2009-04-29Fix maildir times in mailboxes browser. Closes #626.Rocco Rutte
Instead of using the (pointless) mtime of the top-level maildir folder, use the latest mtime of the "new" and "cur" subdirectories. Maildir folders in the mailboxes list can now be properly sorted by date. This does not affect the directory browser. Also see #2421.
2009-03-17Fix some warnings with -W about missing initializers in structsRocco Rutte
2009-01-05Style fixesBrendan Cully
2009-01-05Leave error message on screen if imap_mailbox_create failsBrendan Cully
2009-01-04Update copyrights. Closes #3016.Brendan Cully
I went through the logs of each file with a copyright header and updated the years for the authors in the headers for any non-comment changes they introduced. What a pain!
2008-11-30Manage last search pattern outside of menu lifecycleRocco Rutte
Previously, the pattern was thrown away during menu destruction. For the next search, mutt then can't provide a good suggestion. The new behaviour is to manage the pattern outside the lifecyle to always provide the last pattern as suggestion.
2008-07-02Use realpath() in mutt_pretty_mailbox() for paths that may need it.Rocco Rutte
This requires to add the buffer size as parameter since the result may be longer than the original but still fit in the buffer. Closes #2948.
2007-09-05Interpret relative paths in browser relative to shown dir, not workingRocco Rutte
dir (closes #2471).
2007-04-15merge with tipMichael Elkins
2007-04-13Strip / from tail of LastDir when copying from Maildir (closes #1885)Brendan Cully
2007-04-11Pass column value recursively when expanding format strings (bug #2840).Michael Elkins
2007-04-09Use mutt_pretty_size() to format '%s' in $folder_format so it is similar to ↵Michael Elkins
'%c' in $hdr_format
2007-04-02Add hook for proper IMAP unseen count in mailbox browserBrendan Cully
2007-03-20Enlarge help string buffersRocco Rutte
Even on 80x25 terminals, SHORT_STRING (128 byte) may not be enough so use LONG_STRING (1k) as STRING (256 byte) may well be too short for wider terminals. Closes debian #4152777.
2006-08-05Don't allow user to attempt to delete root IMAP folder.Brendan Cully
2005-10-06Sort browser entries after every IMAP browsing operation instead of justBrendan Cully
when explicitly requested. Closes: #2089.
2005-09-17Gah, forgot the zip code when updating the FSF address...Brendan Cully