Commit Graph

617 Commits (8c7b001aa5d4cb6bbaf438f3f47cd91cc2fd6833)

Author SHA1 Message Date
Manos Pitsidianakis 23ca41e3e8
add libgpgme feature 4 years ago
Manos Pitsidianakis b9c07bacef
melib: decode text inline message/rfc822 attachments 4 years ago
Manos Pitsidianakis b0e50a29bd
melib/list_management: don't ignore "NO" in List-Post 4 years ago
Manos Pitsidianakis baa44109f2
melib/thread: "merge" duplicate messages in threads 4 years ago
Manos Pitsidianakis a187cee1d3
plugins: place socket in XDG_RUNTIME_DIR, not CWD
Closes #78
4 years ago
Manos Pitsidianakis fba69d1e5d
SearchBackend: add Auto variant as default 4 years ago
Manos Pitsidianakis 7dfa6c0639
view/thread: use reverse colors in cursor in case of NO_COLOR 4 years ago
Manos Pitsidianakis 82cd690005
sqlite3: only update when SearchBackend is sqlite3 4 years ago
Manos Pitsidianakis 8eb78ae01b
sidebar: compute mailbox tree only for subscribed mailboxes 4 years ago
Manos Pitsidianakis 05e4dbcd5a
melib: update smol to 1.0.0 4 years ago
Manos Pitsidianakis fbf2b7dc7b
sidebar: add customizable mailbox tree
Concerns #72
4 years ago
Manos Pitsidianakis 83bee279e6
melib/email/compose: set attachment status
Set Content-Disposition: attachment to, well, attachments.
4 years ago
Manos Pitsidianakis d862e7bf53
statustab: don't process scrolling events if account is open 4 years ago
Manos Pitsidianakis 005c879a12
accounts: remove job timeout 4 years ago
Manos Pitsidianakis 8a8c790f8c
accounts: fix blocking jobs not spawning on blocking workers 4 years ago
Manos Pitsidianakis e60eb23f4d
statustab: show active jobs 4 years ago
Manos Pitsidianakis 07742ec053
utilities: ensure command suggestions are LIFO 4 years ago
Manos Pitsidianakis f83df69d2f
utilities/widgets: ensure ProgressSpinner is cleaned up 4 years ago
Manos Pitsidianakis 17a4ccdcbc
melib/imap: perform reconnect on IDLE failure 4 years ago
Manos Pitsidianakis 315af9bc05
shortcut!: prevent panic if shortcut key $section is missing 4 years ago
Manos Pitsidianakis fadf20d7b1
NotificationType: add melib::ErrorKind 4 years ago
Manos Pitsidianakis 46e3bb8074
conf/accounts: call is_online if Refresh job fails 4 years ago
Manos Pitsidianakis 3ef60f2688
jobs: add module doco 4 years ago
Manos Pitsidianakis c9a06b9b5c
mail/view: unset self.dirty early on draw 4 years ago
Manos Pitsidianakis 51db5b6c2f
listing/conversations: redraw selection undo on Esc 4 years ago
Manos Pitsidianakis 14de776314
listing/plain: add row_attr! macro 4 years ago
Manos Pitsidianakis 20b02ffd4f
Lookup tag color/ignore settings in all three setting levels
There are three setting levels for tag settings:

- per mailbox override    ^
- per account override    |
- global setting          |
                        depth

So lookup in each of them in this order for configuration, not just the
deepest level.
4 years ago
Manos Pitsidianakis 41664bbe91
Don't panic if no dbus notification server is available 4 years ago
Manos Pitsidianakis 4829e13c47
melib/maildir: impl copy_messages for Maildir 4 years ago
Manos Pitsidianakis a1585d4006
components/listing: draw rows select status at all times 4 years ago
Manos Pitsidianakis ed27ed604c
listing: select multiple messages with a motion
- Press a number (movement multiplier)
- Press "select_entry" shortcut (default: v)
- Press a movement (arrow keys, PageUp/Down, Home/End)
- Resulting selection will be symmetric difference of previous selection
plus all the entries traversed with movement
4 years ago
Manos Pitsidianakis bda5bd963a
mail/view: cache message body/text in MailView state 4 years ago
Manos Pitsidianakis 1fe873887f
components/utilities: keep track of finished jobs
Keep track of finished jobs in case we get a job notification more than
once.
4 years ago
Manos Pitsidianakis f05dd379ae
Send NewJob event on all job startups 4 years ago
Manos Pitsidianakis 65357625ea
conf: impl DotAddressable for NotificationsSettings 4 years ago
Manos Pitsidianakis 1ac3a7a903
Make dbus dependency optional
Put dbus dependency behing `dbus-notifications` feature.
4 years ago
Manos Pitsidianakis be57b65dae
melib/email: add flags arg to Mail::new 4 years ago
Manos Pitsidianakis d57dd9c98e
melib/email/address: return Option in get_display_name 4 years ago
Manos Pitsidianakis c6c0da7fcb
melib: cleanup commit
Cleanup melib module exports, add some document tests, change some
documentation.
4 years ago
Manos Pitsidianakis 8f46c4ebe7
Small fixes 4 years ago
Manos Pitsidianakis b94342c52b
themes/regexp: fix unwrap check on regexp match byte offsets 4 years ago
Manos Pitsidianakis f02dde46da
melib/error:Add ErrorKind::Timeout
Timeout errors lead to automatic restart of connections without
bothering the user about the details, compared to actual network errors.
4 years ago
Manos Pitsidianakis 25b325dbda
Keep bytes copy in SaveMessage job in case of failure 4 years ago
Manos Pitsidianakis ca0f37e1f3
Send AccountStatusChange event on receiving mailboxes 4 years ago
Manos Pitsidianakis 843616221e
Add logging level to Generic jobs
Not every job success should be shown to the user, for example updating
the sqlite3 database. So introduce a level to only show relevant
notifications.
4 years ago
Manos Pitsidianakis c6f11fb592
melib: update notify to 4.0.15 4 years ago
Manos Pitsidianakis 14663e46b9
Remove some old TODO comments 4 years ago
Manos Pitsidianakis 4217839155
melib/email: remove Envelope::from_token 4 years ago
Manos Pitsidianakis 9e9be0b5f3
Remove block_on from mailbox creation/deletion 4 years ago
Manos Pitsidianakis b545a0b905
Show error if watch job fails 4 years ago
Manos Pitsidianakis fc25c7b165
Fix compiler warnings 4 years ago
Manos Pitsidianakis 629997397f
Allow toggle_help (default ?) remapping 4 years ago
Manos Pitsidianakis 53e924eb33
Add edit envelope action back as async 4 years ago
Manos Pitsidianakis 1ca0bd0d96
sqlite3: add schema versioning
To potentially be used with automatic migrations on version update
4 years ago
Manos Pitsidianakis 8d50e83a33
melib/email: add case-insensitive Header struct
- HeaderName is either 32 or less inlined bytes or heap-allocated vec for more than that.
- Equality and hashing is case-insensitive
- A HeaderMap is a hashmap from HeaderName to Strings that can be
indexed with &str, case insensitive. Insertion order is also preserved
4 years ago
Manos Pitsidianakis 94433cfc40
melib/backends: cleanup MailBackend trait definition 4 years ago
Manos Pitsidianakis 3eadaba34e
Replace old pseudo-async code with blocking rust async 4 years ago
Manos Pitsidianakis a190805384
melib/backends: Add BackendEvent enum 4 years ago
Manos Pitsidianakis 9928ee78e7
Add Reply{ToAuthor,ToAll} actions
- previous Reply action now lets you select recipients by default
- ReplyToAuthor selects the Envelope author as recipient
- ReplyToAll selects all addresses
4 years ago
Manos Pitsidianakis d95aae1987
terminal/keys: add `Space` identifier in Key Display impl 4 years ago
Manos Pitsidianakis 9afbdd4887
Add insert_user_agent option in composing
Add option for automatically inserting a 'User-Agent' header in new
drafts.
4 years ago
Manos Pitsidianakis bb4754e38a
themes/shortcuts: preserve order of keys 4 years ago
Manos Pitsidianakis 8a6bf3b217
Preserve Account order from configuration file
Use IndexMap to preserve the order of accounts in the UI from the
account definitions.
4 years ago
Manos Pitsidianakis b9e53a7451
melib/smtp: add recipient argument in mail_transaction() 4 years ago
Manos Pitsidianakis 79b2b38e32
melib: add supports_submission backend capability
To be used by NNTP, JMAP and some IMAP servers with BURL capability
4 years ago
Manos Pitsidianakis fe4dae12df
listing/*: show MailboxEntry::status() when length is 0
Show the MailboxEntry::status() string when self.length == 0, instead of
"MAILBOX is empty".
4 years ago
Manos Pitsidianakis c88eac1cc5
melib/jmap: implement search
Closes #59
4 years ago
Manos Pitsidianakis 52bcecfd4a
conf.rs: reject unknown configuration options
Closes #11
4 years ago
Manos Pitsidianakis 750e32c8e1
mail/listing: use mailbox count() total instead of loaded total 4 years ago
Manos Pitsidianakis 5db749c258
terminal/cells.rs: fix resize to grow actually making the grid smaller 4 years ago
Manos Pitsidianakis fb523c140a
terminal/cells: resize growable grid when exactly at bounds 4 years ago
Manos Pitsidianakis 890000bd0e
status page: trim extension name at 30 chars
NNTP has some long protocol extension names
4 years ago
Manos Pitsidianakis c5d0a6c3b6
conf/accounts.rs: don't retry connect on auth error 4 years ago
Manos Pitsidianakis ec0153e7b2
melib: add protocol extension info in MailBackendCapabilities 4 years ago
Manos Pitsidianakis 3ac2c12e7a
Small fixes 4 years ago
Manos Pitsidianakis 44fdc0765e
conf/accounts.rs: add 30s job timeout 4 years ago
Manos Pitsidianakis 2db983ae1f
mail/view.rs: try restarting future if get bytes fails 4 years ago
Manos Pitsidianakis 70a4409e59
mail/listing*: various theme color fixes 4 years ago
Manos Pitsidianakis 74673880e6
command.rs: add eof() parser to action parsers 4 years ago
Manos Pitsidianakis 26b327d86a
mail/listing*: clear selection after perform_action() 4 years ago
Manos Pitsidianakis b5530860d2
conf/DotAddressable: impls for more types 4 years ago
Manos Pitsidianakis 0d198dbb56
conf.rs: fix struct decl/impl order in file
Impls and type declarations were out of order
4 years ago
Manos Pitsidianakis 7fd511e149
conf/shortcuts.rs: implement DotAddressable for Shortcuts 4 years ago
Manos Pitsidianakis 1cc1b0604c
conf/accounts.rs: use QueryTrait when search_backend is None 4 years ago
Manos Pitsidianakis 3f8aa560f0
melib/MailBackend: add MailBackendCapabilities struct 4 years ago
Manos Pitsidianakis 4aaa784d8f
Fix panic on empty command history when browsing history 4 years ago
Manos Pitsidianakis 8b90c7fcb6
conf/shortcuts: add shortcut for COMMAND mode
Replace hardcoded Key value with customisable shortcut
"general.enter_command_mode"
4 years ago
Manos Pitsidianakis c2550f60b6
Rename EXECUTE mode to COMMAND
vim uses COMMAND, and we want to be consistent with vim when possible.
4 years ago
Manos Pitsidianakis b20bdea8f0
EXECUTE: cancel command with Esc 4 years ago
Manos Pitsidianakis 989cfcc877
conf/accounts.rs: use mailbox alias if available in MailboxEntry::name() 4 years ago
Manos Pitsidianakis 7744ef1462
conf/accounts.rs: make JobRequest::Generic name Cow<'_, str> 4 years ago
Manos Pitsidianakis d6ef3567f4
conf/accounts.rs: add hash() method 4 years ago
Manos Pitsidianakis 688060ceb6
conf/accounts.rs: always load Inbox 4 years ago
Manos Pitsidianakis ed3b2fa6c8
types.rs: add JobCanceled event 4 years ago
Manos Pitsidianakis 00acba7717
melib/MailBackend: add copy_messages,set_flags,delete_messages methods 4 years ago
Manos Pitsidianakis a049a83fe3
conf/accounts: add insert_job() method 4 years ago
Manos Pitsidianakis 246ac4b84a
Update smallvec dependency to 1.4.1 4 years ago
Manos Pitsidianakis f9efaea0ec
ConversationsListing: fix invalid update_line colors 4 years ago
Manos Pitsidianakis 99fbac3806
Remove unused variables/functions 4 years ago
Manos Pitsidianakis 1bd89b3c96
themes: add mail.sidebar_account_name key 4 years ago
Manos Pitsidianakis 44ffbe54e2
input_thread: add atomic refcount to check if thread is dead 4 years ago
Manos Pitsidianakis 0882dbbad0
melib/Collection: put all fields behind a mutex 4 years ago
Manos Pitsidianakis fadb3634e0
melib: take MailboxHash instead of &Mailbox in fetch*() 4 years ago
Manos Pitsidianakis 9103d05617
melib: s/get/fetch in MailBackend methods 4 years ago
Manos Pitsidianakis 996abd323f
Add print setting action
Add experimental print setting action. The command is of the form:

  print account_name listing.index_style

account_name is currently ignored.

The path, e.g. listing.index_style is split by "." and fed to
DotAddressable lookup trait method. The method checks the first segment
in the path if it matches any of the struct's fields, and then calls the
field's lookup method.
4 years ago
Manos Pitsidianakis b4dadf20b6
ThreadListing: don't print previous link on root envelopes
If a thread root is missing (i.e. we never received that message or it
was deleted) threads rendered like this:

 ├─>Re: original subject
 ├─>Re: original subject
 └─>Re: original subject

This causes visual ambiguity if the parentless thread follows another:

 Another thread
 └─>Re: Another thread
 ├─>Re: original subject
 ├─>Re: original subject
 └─>Re: original subject

This commit removes the "previous link" from every first message in a group:

 ┬─>Re: original subject
 ├─>Re: original subject
 └─>Re: original subject
4 years ago
Manos Pitsidianakis 08d8c05a67
CompactListing: update self.rows{,_drawn} on row update
self.rows{,_drawn} were left unupdated, and stale envelope hashes could
result in panics
4 years ago
Manos Pitsidianakis 1bac926bdc
CompactListing: add row_attr macro
Add macro to calculate theme attribute for given thread row
4 years ago
Manos Pitsidianakis 5e1fa2d8d7
CompactListing: add select command
Select envelopes based on query
4 years ago
Manos Pitsidianakis 0d3fe288c5
sqlite3: make reindex operation async 4 years ago
Manos Pitsidianakis 32f196143e
melib: add supports_search() method to MailBackend 4 years ago
Manos Pitsidianakis 5ef62a39b8
conf: Rename cache_type to search_backend 4 years ago
Manos Pitsidianakis 017a45d5cd
conf/accounts: add JobRequest::Generic 4 years ago
Manos Pitsidianakis eb62463e7d
jobs: add spawn_blocking() method 4 years ago
Manos Pitsidianakis 1f9cdb8be5
conf/accounts: update mailbox status on payload delivery 4 years ago
Manos Pitsidianakis 587eaf7215
ThreadListing: add columns 4 years ago
Manos Pitsidianakis 77dc1d74bf
Add smtp client support for sending mail in UI
`mailer_command` was removed, and a new setting `send_mail` was added.

Its possible values are a string, consisting of a shell command to
execute, or settings to configure an smtp server connection. The
configuration I used for testing this is:

  [composing]
  send_mail = { hostname = "smtp.mail.tld", port = 587, auth = { type = "auto", username = "yoshi", password = { type = "command_eval", value = "gpg2 --no-tty -q -d ~/.passwords/msmtp/yoshi.gpg" } }, security = { type = "STARTTLS" } }

For local smtp server:
  [composing]
  send_mail = { hostname = "localhost", port = 25, auth = { type = "none" }, security = { type = "none" } }
4 years ago
Manos Pitsidianakis ddafde7b37
jobs: save handle for each Job
If we save the JoinHandle for each task, we can cancel it in future
commits if we have to timeout network requests.
4 years ago
Manos Pitsidianakis 9db6b07b71
Remove some needless clones and stuff (thanks to Clippy) 4 years ago
Manos Pitsidianakis edfd2b1fef
conf.rs: accept default action "Y" when asking to create config
Reported by: bronsen
4 years ago
Manos Pitsidianakis d914f7afd9
MailView: send NewJob event on mail body request 4 years ago
Manos Pitsidianakis 899d497c9c
Rename _cmd options to _command for consistency 4 years ago
Manos Pitsidianakis bfc08f892d
Show account online error status in status tab 4 years ago
Manos Pitsidianakis 3a16dc6522
Show account online error status when offline 4 years ago
Manos Pitsidianakis 931863436d
imap: remove blocking imap backend, replace with async 4 years ago
Manos Pitsidianakis 89dedbedb7
imap: launch async watch when connection comes online
Closes #38 Make async watch/refresh work in imap
4 years ago
Manos Pitsidianakis b5748c247a
MailBackend: remove connect() method 4 years ago
Manos Pitsidianakis f48343ca89
conf/accounts: add is_{async,remote} fields 4 years ago
Manos Pitsidianakis 231471fa8c
MailBackend: add is_{async,online} methods 4 years ago
Manos Pitsidianakis 94e0aa4fe7
MailBackend: change get() ret type to Result<_> 4 years ago
Manos Pitsidianakis a7e177586a
Fix clippy lints 4 years ago
Manos Pitsidianakis bbedeed3e3
More imap async fixes 4 years ago
Manos Pitsidianakis b3876113aa
BackendOp: return future in as_bytes() 4 years ago
Manos Pitsidianakis 4721073bc3
Rename jobs1 to jobs 4 years ago
Manos Pitsidianakis 1ddde9ccba
BackendOp: change fetch_flags() retval to future 4 years ago
Manos Pitsidianakis ed3e66cedf
BackendOp: remove description() method 4 years ago
Manos Pitsidianakis e06308fed2
MailBackend: change more methods to Futures 4 years ago
Manos Pitsidianakis 03522c0298
melib: Fixup warnings in imap_async, maildir 4 years ago
Manos Pitsidianakis 21051fa862
JobRequest: add more variants 4 years ago
Manos Pitsidianakis c82367e00d
BackendOp: Change set_{flag,tag} methods 4 years ago
Manos Pitsidianakis 8c1fc031e5
BackendOp: change fetch_flags retval to Result<Flag> 4 years ago
Manos Pitsidianakis ee10cdbcd5
Make get_async() return a Stream 4 years ago
Manos Pitsidianakis a38764f490
Add somewhat-working async IMAP backend 4 years ago
Manos Pitsidianakis 4f3a98f90a
Add job executor 4 years ago
Manos Pitsidianakis ca7bbd9de4
Fix pasted text not being registered immediately
Input thread reading from stdin should continue reading after receiving
the magic BRACKET START sequence until receiving the BRACKET END
sequence.
4 years ago
Manos Pitsidianakis 58aff83b95
Change "Draft saved" to "Message saved" 4 years ago
Manos Pitsidianakis c0c19268ee
Add ProgressSpinner widget 4 years ago
Manos Pitsidianakis c4bc7be5d1
Tabbed: correctly pass events to other children
When passing an event to the focused tab and it is not handled, the
other children weren't then each called to see if they handle the
event. That led to refresh events etc not being processed by the mail
list tab if it wasn't focused.
4 years ago
Manos Pitsidianakis 4ae7a57d45
Add save-draft command 4 years ago
Manos Pitsidianakis bfbaf3d617
Utilize EnvelopeRemove events
EnvelopeRemove events were not ever used in the UI
4 years ago
Manos Pitsidianakis efb06be09b
melib: return Result<_> from operation()
Envelope might have been deleted before main thread requests an
operation, which is a race condition.
4 years ago
Manos Pitsidianakis b946b61cf1
terminal/cells.rs: remove unused variables 4 years ago
Manos Pitsidianakis eca1921a8a
collection: add update_flags() method
On NewFlags events, the threads in Collection were not being updated, so
if an envelope's seen status was toggled the thread's unseen count was
  not updated, and thus not reflected in the UI even though the
  envelope's new flags event was registered properly.
4 years ago
Manos Pitsidianakis a6a30f3adb
conf/accounts.rs return Result on init() 4 years ago
Manos Pitsidianakis 688a798fa2
XDGNotifications: increase rate limiting
3 notifications evenly spread per second did not make any sense.
Increase it to 1000 and see if it's ok
4 years ago
Manos Pitsidianakis 6bdd9b07bb
bin: remove unwrap from timer thread 4 years ago
Manos Pitsidianakis ca11c8e474
Remove useless debug prints 4 years ago
Manos Pitsidianakis 9fb86ab2f2
components: create layouts module in utilities 4 years ago
Manos Pitsidianakis 0169025d50
build.rs: add proc-macro to generate Override structs for configuration 4 years ago
Manos Pitsidianakis 02c881ac00
Add save-attachment option for entire message as eml 4 years ago
Manos Pitsidianakis d7e4bd9379
conf: set default override value to None 4 years ago
Manos Pitsidianakis cecd33eb5e
SVGScreenshotFilter: make svg smaller and fix grapheme cluster textLength inaccuracies 4 years ago
Manos Pitsidianakis 58ddfae9a7
execute.rs: fix missing space parsers 4 years ago
Manos Pitsidianakis fe655e679c
Fix rustfmt suggestions 4 years ago
Manos Pitsidianakis 0618e62ab6
Add optional feature to save SVG screenshot 4 years ago
Manos Pitsidianakis bc0189ffa1
Spawn workers on demand 4 years ago
Manos Pitsidianakis 55948dd7c2
Use BTreeSet instead of HashSet in copy_area()
I kind of forgot about BTreeSets, and kept a separate HashSet and sorted
index of the set's keys.
4 years ago
Manos Pitsidianakis e97cf98b3b
Add `view` subcommand
Add subcommand to view standalone e-mail files in meli's pager without
instantiating any accounts.
4 years ago
Manos Pitsidianakis 7dc8a87a62
Prevent sub overflow in EnvelopeView 4 years ago
Manos Pitsidianakis 05c6c19889
src/conf.rs: Remove debug! prints 4 years ago
Manos Pitsidianakis 9f30cd6bbc
state.rs: send AccountStatusChange 4 years ago
Manos Pitsidianakis 1241b6073f
Clear tags before applying new ones in NewFlags 4 years ago
Manos Pitsidianakis ca9d4fde58
Discard EnvelopeRename event if envelope is missing from Collection 4 years ago
Manos Pitsidianakis f3d5edfe14
Add copy/move to other account operations 4 years ago
Manos Pitsidianakis c07185a3aa
regexp: add priority field to regular expressions 4 years ago
Manos Pitsidianakis 465c78e903
Add Cell::keep_attrs() method 4 years ago
Manos Pitsidianakis 4bc8ff2ce9
Use structopt for command line parsing 4 years ago
Manos Pitsidianakis a17f0b4fd4
listing: rework MailListingTrait
split redraw_list() to redraw_threads_list() and redraw_envelope_list()
4 years ago
Manos Pitsidianakis 9edef4ecd2
ui: add attachment_tree() func in MailView
Split ascii attachment tree generation into a function in MailView
4 years ago
Manos Pitsidianakis 6458ccb860
meli: update nom dependency to 5.1.1 4 years ago
Manos Pitsidianakis 6ec249dd7f
melib: update nom dependency from 3.2.0 to 5.1.1
That was hecking exhausting
4 years ago
Manos Pitsidianakis 3e31c46a74
Add "regexp" feature, format text with regexps
`regexp` feature uses the pcre2 library to enable the user to define
regular expressions for matching text and applying text formatting to
the matches. An example from the theme configuration I used to test
this:

  [terminal.themes.win95.text_format_regexps]
  "listing.subject" = { "\\[[^\\]]*\\]" = { attrs = "Bold" } }
  "listing.from" = { "\\<[^\\>]*\\>(?:(?:\\s*$)|(?=,))" = { attrs = "Italics" } }

  [terminal.themes.win95.text_format_regexps."pager.envelope.body"]
  "^>.*$" = { attrs = "Italics" }
  "\\d+\\s?(?:(?:[KkMmTtGg]?[Bb])|(?:[KkMmTtGg][Bb]?)(?=\\s))" = { attrs = "Bold | Underline" }
4 years ago
Manos Pitsidianakis ef0f269fbf
terminal: add FormatTag, text format tags
FormatTag describes a set of attributes, colors that exist in a
tag_table field of CellBuffer. The field of tag_associations contains
the hash of a tag and the {start,end} index of the cells that have this
attribute. A tag can thus be used many times.

An example of use is

    let t = self.pager.insert_tag(FormatTag {
        attrs: Attr::ITALICS,
        ..Default::default()
    });
    debug!("FormatTag hash = {}", t);
    let (width, height) = self.pager.size();
    for i in 0..height {
      if self.pager.content[(0, i)].ch() == '>' {
        self.pager.set_tag(t, (0, i), (width.saturating_sub(1), i));
      }
    }

This will set reply lines in text as italics.

This feature interface is not used anywhere yet.
4 years ago
Manos Pitsidianakis 5366888dff
Add samples/ directory with config and themes 4 years ago
Manos Pitsidianakis de03b106f3
themes: Add support for Color/Attribute aliases
Add aliases to avoid repetition of raw values when defining new themes.
Aliases are strings starting with "$" and must be defined in the
`color_aliases` and `attr_aliases` fields of a theme.
4 years ago
Manos Pitsidianakis eca8a30c3f
themes: Add Theme struct
Wrap HashMap<Cow<'static, str>, ThemeAttributeInner> into a struct, in
order to add more fields in the future.
4 years ago
Manos Pitsidianakis fa96a4e905
themes: add support for optional field theme value links
Theme attribute values can refer to another theme key instead of
defining a value. Add support for optionally defining the theme key's
field by appending a ".fg" or ".bg" suffix to the link's key.
4 years ago
Manos Pitsidianakis 9c0ee76ff4
themes: Rename Theme struct to Themes 4 years ago
Manos Pitsidianakis 049175e743
pager: fix filter invocation and ansi parsing 4 years ago
Manos Pitsidianakis bee1baedb2
themes: add indentation level color keys
Add theme keys for the indentation level colors in ThreadView
4 years ago
Manos Pitsidianakis 6ceed3cae9
sqlite3: move module to melib 4 years ago
Manos Pitsidianakis 960d660786
Add #[ignore] to test_parser() 4 years ago
Manos Pitsidianakis 9703b39a40
Add execute command parser to improve suggestions
Add grammar for execute commands and parser to identify possible next
tokens for the user's execute command input.

The grammar is given as a sequence of Tokens in each command's
definition. The parser parses the user's input according to this
grammar, and returns the tokens that could come next, if any.
4 years ago
Manos Pitsidianakis fad8820868
Make serde default for manual_refresh = false 4 years ago
Manos Pitsidianakis 12feca9c97
terminal/ansi: add attribute support
Add attribute escape sequence support in terminal::ansi, which handles
converting strings with ansi escape sequences into meli's internal
terminal structures in order to incorporate them into the UI.
4 years ago
Manos Pitsidianakis e4a1ab8a09
Fix rustfmt suggestions 4 years ago
Manos Pitsidianakis b8261ee36a
Overhaul input thread
Remove raw/non raw distinction.

Use a pipe for input thread commands and poll stdin/pipe for events
4 years ago
Manos Pitsidianakis 839c1b1eb5
bin.rs: remove useless #[macro_use] 4 years ago
Manos Pitsidianakis bd404e6937
Execute user shell commands with /bin/sh
Execute user provided command invocations $CMD such as `editor_cmd` with
`/bin/sh` as `/bin/sh -c "$CMD"

Previously, user commands were split by whitespace which must trigger
erroneous behavior if quotes are involved.
4 years ago
Manos Pitsidianakis bfff0e4feb
conf: add options for logging
Add options for log file location and maximum log level. Also add
manpage entries for these options in `meli.conf.5`
4 years ago
Manos Pitsidianakis 608ef9a946
conf: warn on invalid mailbox name conf 4 years ago
Manos Pitsidianakis ab30733ce7
SegmentTree: add update() method 4 years ago
Manos Pitsidianakis c2980f5dcf
RateLimit: add test 4 years ago
Manos Pitsidianakis 3573423169
PosixTimer: rearm timer only when calling rearm() 4 years ago
Manos Pitsidianakis 1717aa7845
bin: use self-pipe in signal handler
send_timeout() isn't signal safe, and might block.
4 years ago
Manos Pitsidianakis 7990b71c19
StatusBar: recognize readline shortcuts in Execute mode 4 years ago
Manos Pitsidianakis 295577f9d7
Fix invalid theme keys in ThreadListing 4 years ago
Manos Pitsidianakis a86c1cbb26
listing: redraw on EnvelopeUpdate events 4 years ago
Manos Pitsidianakis c5fe511d95
notmuch: don't remove tags from tag_index
When removing a tag, we shouldn't also remove it from the tag index.
4 years ago
Manos Pitsidianakis a6af7fc0d3
listing.rs: don't create unnecessary operation 4 years ago
Manos Pitsidianakis 8648b229ad
Add AccountHash to RefreshEvent
Different accounts might have same inboxes with same MailboxHashes. Use
the hash of the account's name to differentiate.
4 years ago
Manos Pitsidianakis eb701695f7
Remove fnv crate 4 years ago
Manos Pitsidianakis 3ea1ce5454
errors: add `source` field to MeliError 4 years ago
Manos Pitsidianakis d405aa9797
Show last worker thread heartbeat on status page 4 years ago
Manos Pitsidianakis c8391983ee
Refactor OfflineListing
Move offline status drawing to OfflineListing
4 years ago
Manos Pitsidianakis d580b25415
themes: overwrite only explicit key attributes
If user config file overwrites a single attribute and not the others,
for example only bg:

  "mail.listing.tag_default" = { bg = "Blue" }

The other attributes, in this case fg and attrs revert to the default
values of ThemeAttributeInner and not the default value for the key
"mail.listing.tag_default". As a result the above expands to:

  "mail.listing.tag_default" = { fg = Color::Default, bg = "Blue", attrs
  = Attr::Default }

This commit keeps the key value defaults, so the above should expand to:

  "mail.listing.tag_default" = { fg = default_theme["mail.listing.tag_default"].fg, bg = "Blue", attrs
  = default_theme["mail.listing.tag_default"].attrs }
4 years ago
Manos Pitsidianakis 18dcf15e1e
Add open_mailbox shortcut for sidebar 4 years ago
Manos Pitsidianakis d8135674df
themes: add {even,odd}_unseen, {even,odd}_selected, {even,odd}_highlighted
Suggested in #21
4 years ago
Manos Pitsidianakis e633434b93
themes: Fix invalid attribute links panic in is_cyclic
Attribute links are not checked for validity in theme validation, and an
invalid link would cause a panic in is_cyclic.

This commit improves the theme validation errors by printing if the
error lies in a theme key or a link.
4 years ago
Manos Pitsidianakis 4930d1b46c
Add Italics, Blink, Dim and Hidden text attributes
Text attributes have been rewritten as bit flags, so for example instead of
"BoldUnderline" you'd have to define "Bold | Underline" in your theme
settings.

Requested in #21
4 years ago
Manos Pitsidianakis e9a935dbf7
melib: add search method in mail backends 4 years ago
Manos Pitsidianakis 3d7b9ff7cb
Move Query to melib 4 years ago
Manos Pitsidianakis fd60be482f
Open sidebar for mailbox navigation with Left/Right arrow keys
Left/Right arrow keys change focus between the sidebar and mailbox
listing. If focused on sidebar, move arrow keys to select mailbox and
open with 'Enter'. Press Right arrow key to return to mailbox listing.

- Mailbox focused:
  +--+-------------+
  |~ |=============|
  |~ |=============|
  |  |=============|
  |~ |=============|
  |~ |=============|
  +--+-------------+
- Press `Left` arrow key
- Menu focused:
  +--------+-------+
  |~~~~    |=======|
  |~~      |=======|
  |        |=======|
  |~~~     |=======|
  |~~~~    |=======|
  +--------+-------+
- Press `Right` arrow key to return
4 years ago
Manos Pitsidianakis 840005022c
themes: add default tag theme attribute
The theme attribute key is "mail.listing.tag_default"
4 years ago
Manos Pitsidianakis e034f4dd52
view.rs: fix redrawing errors 4 years ago
Manos Pitsidianakis a3903ea2cb
Show Cc in default headers in mail view 4 years ago
Manos Pitsidianakis 4c32bf450d
Add {un,}subscribe mailbox operations
Concerns #17
4 years ago
Manos Pitsidianakis 9ff54f236b
Add conf_override! macro
conf_override! wraps struct definitions and defines a secondary Override
struct that wraps each field in an Option. The macro mailbox_settings!
is used to select settings from an account & mailbox index. If a user defines an overriding setting, the macro returns the override instead of the immediately next in the hierarchy setting.

The selection is done for a specific field as follows:

  if per-folder override is defined, return per-folder override
    else if per-account override is defined, return per-account override
      else return global setting field value.
4 years ago
Manos Pitsidianakis a8c1016f37
Add various logic checks 4 years ago
Manos Pitsidianakis 1811fb51cb
Fix unused imports/code compiler warnings 4 years ago
Manos Pitsidianakis b7175c2400
Fix compiler error in --no-default-features build 4 years ago
Manos Pitsidianakis 84d7e4c034
Small documentation fixes 4 years ago
Manos Pitsidianakis 31d90e1d87
Add managesieve.rs 4 years ago
Manos Pitsidianakis 651dda67cf
Respect autoload mailbox setting 4 years ago
Manos Pitsidianakis 106dae3334
Add config overrides to mailbox filter
If per-folder config filter is defined, it overrides the app-wide
filter.
4 years ago
Manos Pitsidianakis a3600c0cd2
Add `filter` option in mail list
Filter mail in mail list.

Example:
[listing]
filter = "not flags:seen" # show only unseen messages
4 years ago
Manos Pitsidianakis 9d20fd5576
Save forked processes for reaping 4 years ago
Manos Pitsidianakis 6c76db2063
Add delete, copy actions for envelopes 4 years ago
Manos Pitsidianakis 2a9059f9b4
Add add-attachment from pipe, default_header_values 4 years ago
Manos Pitsidianakis 63467a3c45
Check ComponentId equality on Composer::kill() 4 years ago
Manos Pitsidianakis 63af2a688a
Detect breaks on write_string_to_grid 4 years ago
Manos Pitsidianakis f10cc954e7
Don't dump mail on Account drop 4 years ago
Manos Pitsidianakis a94bb1e27a
Show float notification on refresh cmd 4 years ago
Manos Pitsidianakis 670485e8c7
compose: clear bounds of compose area properly 4 years ago
Manos Pitsidianakis 7b631beb0a
Don't panic in WorkController::drop 4 years ago
Manos Pitsidianakis ca51077f53
imap: Add support for untagged FETCH (FLAG.. messages
IDLE connection can get untagged "* FETCH (FLAGS ({flag_list))" messages
if any client has changed flags. Support this refresh event.
4 years ago
Manos Pitsidianakis 53fa3d03da
Notify embedded terminal on embedded process exit
When an embedded process exits the main process receives a SIGCHLD. The
check on whether the embedded process is alive is done on input, so
forward an input of '\0' to get the embedded terminal to notice its
child is dead.
4 years ago
Manos Pitsidianakis 126b65817e
Forward input on input/rawinput switch
Input thread listens on stdin input and forwards the input to the main
process. When an embedded terminal is launched within the main process,
the input thread is asked to switch to raw input, that is to send the
parsed input and the raw bytes to the main process in order to get them
forwarded to the embedded terminal. The switch happens by calling
get_events and get_events_raw.

When the input thread receives an InputCommand::{No,}Raw, it has already
received an input event, since the `select!` is within the
stdin events for loop. (There's no way to `select` on blocking iterators
or raw fds, which is unfortunate.).

This commit forwards the input to the next function instead of dropping
it.
4 years ago
Manos Pitsidianakis 7807f565ec
Clear input thread channel on restore()
The channel may contain Kill commands that will cause the new thread to
exit immediately.
4 years ago
Manos Pitsidianakis 65666e6695
Fix double call of restore_input
restore_input is called in State::rcv_event on arrival of a fork
finished event:

```
            UIEvent::Fork(ForkType::Finished) => {
                self.switch_to_main_screen();
                self.switch_to_alternate_screen();
                self.context.restore_input();
                return;
            }
```

So there shouldn't be an extra call here.
4 years ago