Commit Graph

126 Commits

Author SHA1 Message Date
Galen Abell 8635c70fda Add command history and cycling
Aerc will keep track of the previous 1000 commands, which the user can
cycle through using the arrow keys while in the ex-line. Pressing up
will move backwards in history while pressing down will move forward.
2019-07-26 14:29:34 -04:00
Daniel Bridges 67fb0938a6 Support configurable header layout in compose widget 2019-07-26 14:22:04 -04:00
Jeffas dc4c36adbf Add new-email trigger
This patch sets up the trigger config section of aerc.conf.

Each trigger has its own function which is called from the place where
it is triggered. Currently only the new-email trigger is implemented.

The triggers make use of format strings. For instance, in the new-email
trigger this allows the user to select the trigger command and also the
information extracted from the command and placed into their command.

To actually execute the trigger commands the keypresses are simulated.

Further triggers can be implemented in the future.

Formatting of the command is moved to a new package.
2019-07-26 14:00:24 -04:00
Jeffas ee5b537d53 Fix :close on terminal panic
Executing :close on a terminal would panic due to it already having been
removed.

This is also related to the fact that removing a tab doesn't check for
whether it actually found a tab to remove or not.
2019-07-25 18:12:08 -04:00
Jeffas 4541519225 Add space which was missing 2019-07-25 18:12:05 -04:00
Jeffas e42b95a617 Add change tab command
This command allows the user to change tab by giving the tab name. This
can be tab completed too. The previous tab is stored in the tabs module
so that when a new tab is created it is still possible to go to the
previous one.

Normal invocation is :ct folder
Previous tab is :ct -
2019-07-23 10:27:59 -04:00
Kevin Kuehler f81e4bd41c Implement :filter, :clear
Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
2019-07-19 11:30:32 -04:00
Galen Abell 7899d15d60 Add :attach command for compose
Allow users to add attachments to emails in the Compose view. Syntax is
:attach <path>, where path is a valid file. Attachments will show up in
the pre-send review screen.
2019-07-19 10:30:47 -04:00
Drew DeVault fe7230bb9a Add :cp alias for :copy 2019-07-17 18:42:03 -04:00
Nicolai Dagestad a1763bf207 Add an option to toggle between read and unread 2019-07-17 17:01:25 -04:00
Jeffas 715c9a4797 Update status message to include destination 2019-07-17 15:59:08 -04:00
Kevin Kuehler 8bb115dbae commands: Don't crash when store is nil
On a slow network connection, running these commands without this guard
will cause aerc to panic.

Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
2019-07-15 09:46:49 -04:00
Pedro L. Ramos d85f671bdf 71: Allow user to change config options at runtime
There is a LoadConf and a LoadConfFromFile.
LoadConfFromFile reads the iniFile into memory and and calls
LoadConf, which executes the old parsing commands from
LoadConf (old func).

The remaining of the LoadConfFromFile is the same as the old OldConf.
2019-07-15 09:42:03 -04:00
Daniel Bridges 217e85a55d Fix crashes when operating on empty folder (#216) 2019-07-10 13:21:38 -04:00
Drew DeVault 3f30c27bb3 Fix :pipe -b actually writing to stdin 2019-07-08 18:50:40 -04:00
Drew DeVault 133085b436 Fix re-opening of expired pipe tabs 2019-07-08 18:32:31 -04:00
Drew DeVault 6797f93476 :exec, :pipe: show exit status on completion 2019-07-08 18:22:41 -04:00
Drew DeVault 7ecc6f96de Add :exec and :pipe -b(ackground) 2019-07-08 18:19:08 -04:00
Ben Burwell c610c3cd9d Factor IMAP-specific structs out of UI models
Before, we were using several IMAP-specific concepts to represent
information being displayed in the UI. Factor these structures out of
the IMAP package to make it easier for other backends to provide the
required information.
2019-07-08 16:06:28 -04:00
Drew DeVault 363aab5cc1 Make :pipe command more generic 2019-07-05 12:21:12 -04:00
Drew DeVault f9f523ad59 Remove unused caps string 2019-07-04 12:33:19 -04:00
Gregory Mullen f9d26eef58 Add IMAP folder tab completion
Credit for this fix goes to Reto; I guess if we're not gonna be mutt
we should probabaly do things correctly.
2019-07-04 11:28:04 -04:00
Zach Sisco ddd0fa428f Crash on delete in empty folder (#213) 2019-07-04 11:08:08 -04:00
Ben Burwell 030f390436 Add unsubscribe command
The unsubscribe command, available when in a message viewer context,
enables users to easily unsubscribe from mailing lists.

When the command is executed, aerc looks for a List-Unsubscribe header
as defined in RFC 2369. If found, aerc will attempt to present the user
with a suitable interface for completing the request. Currently, mailto
and http(s) URLs are supported. In the case of a HTTP(S) URL, aerc will
open the link in a browser. For mailto links, a new composer tab will be
opened with a message filled out according to the URL. The message is
not sent automatically in order to provide the user a chance to review
it first.

Closes #101
2019-07-04 11:06:14 -04:00
Ben Burwell 1bb1a80156 Use "open" instead of "xdg-open" on Darwin systems 2019-07-04 10:58:33 -04:00
Gregory Mullen 2a0961701c Implement basic tab completion support
Tab completion currently only works on commands. Contextual completion
will be added in the future.
2019-06-29 14:24:19 -04:00
Drew DeVault 91a75cd98b Implement :search, :next-result, :prev-result 2019-06-26 20:50:54 -04:00
Reto Brunner ccf5c02c38 msgview/save: Use defaultSavePath if no path is provided 2019-06-25 10:38:55 -04:00
Drew DeVault ceeb30abeb Fix Cc & Bcc handling in replies 2019-06-21 14:33:09 -04:00
Martin Hafskjold Thoresen 53df15ae06 Insert nil check before handling prev/next message
If these are called before the store is setup, `acct.Store()` returns
`nil`, and we SEGFAULT in `MessageStore.nextPrev`.
2019-06-18 19:39:42 -04:00
Réouven Assouly ce475e4952 commands/msgview: add open command 2019-06-17 14:52:52 -04:00
Réouven Assouly dfe114b643 Make part encoding checks case insensitive
commands/msgview/save and commands/msgview/pipe now use case
insensitive comparisons to determine if the part is encoded as base64
or quoted-printable.
2019-06-16 11:24:42 -04:00
Clayton Craft e56ceb099e Support directories in path to :save
This adds new functionality to :save in the message view for specifying
directories in the path. A new flag, -p, is also added to :save for
automatically creating any directories in the path that do not exist.

If the path ends in a / (e.g. "Downloads/mail/") or if the path is an
existing directory, the part's file name is the filename from the mail
header for the part. Otherwise, it uses the last element in the path as
the filename (e.g. 'blah.jpg' is the filename if the path is
'Downloads/mail/blah.jpg')
2019-06-14 09:48:20 -04:00
Kevin Kuehler 9746f4858c commands/msgview: Add next/prev commands
Signed-off-by: Kevin Kuehler <kkuehler@brave.com>
2019-06-11 09:34:48 -04:00
Kevin Kuehler 32f970e053 Move select functionality from msglist to msgstore
Remove msglist Next and Prev commands

Signed-off-by: Kevin Kuehler <kkuehler@brave.com>
2019-06-11 09:34:36 -04:00
Kevin Kuehler d1df710328 commands/msg/archive: Work with msgviwer
Inside the generic msg command we cannot use aerc.SelectedAccount()
because the method naively assumes the current tab is an AccountView.
Use the ProvidesMessage interface instead.

Signed-off-by: Kevin Kuehler <kkuehler@brave.com>
2019-06-11 09:18:51 -04:00
Drew DeVault d22a9140cd Implement :mkdir command 2019-06-09 19:21:26 -04:00
Drew DeVault a98824af75 Fix :new-account getopts 2019-06-09 19:14:56 -04:00
Drew DeVault 57471a0e67 Fix :copy arg handling 2019-06-09 19:14:04 -04:00
Drew DeVault c55223106d Fix :move command's arg parsing 2019-06-09 18:29:21 -04:00
Clayton Craft f5a4d935ef Update reply to use getopt posix optind format
This changes the handling of optind for the 'reply' command to match
recent changes to getopt.
2019-06-09 15:50:50 -04:00
Drew DeVault 6271d455eb Add :read and :unread commands 2019-06-09 14:55:42 -04:00
Drew DeVault d63653ecde commands/msg/copy: remove unnecessary code 2019-06-09 14:54:27 -04:00
Robert Günzler acfe7d7625 Add archive command
Adds an archive command that moves the current message into the folder
specified in the account config entry.

Supports three layouts at this point:

- flat: puts all messages next to each other
- year: creates a folder per year
- month: same as above, plus folders per month

This also adds a "-p" argument to "cp" and "mv" that works like
"--parents" on mkdir(1). We use this to auto-create the directories
for the archive layout.
2019-06-09 11:33:50 -04:00
Yash Srivastav 35f57321f8 Mark sent emails as read 2019-06-08 12:44:01 -04:00
Yash Srivastav fca7321639 Message list: implement index-format option 2019-06-07 16:22:01 -04:00
Yash Srivastav b83e7c9fa6 implements ability to view headers in message view 2019-06-07 09:20:24 -04:00
JanUlrich 0771eaf24c Introduce :new-account -t
Adding the [-t] temporary flag to the new-account command
- when using -t a newly created account will not be stored into the
accounts.conf

Issue #134
2019-06-05 09:32:43 -04:00
Tadeo Kondrak 023a2622f9 Allow no arguments to :cd
I often use the bare `cd` command to get back to my home directory.
2019-06-05 09:32:23 -04:00
Kevin Kuehler 753adb9069 widget: Add ProvidesMessage interface
Consists of 3 functions
* Store: Access to MessageStore type
* SelectedAccount: Access to Account widget that the target widget
belongs to
* SelectedMessage: Current message (selected in msglist or the one we
are viewing)

Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
2019-06-02 10:16:29 -04:00