Commit Graph

1236 Commits (32b4c30feecb43586843900e2a77c094437a18c9)

Author SHA1 Message Date
Manos Pitsidianakis c7fbc5cafb
imap: remove redundant passing of AccountHash 2020-06-11 11:43:18 +03:00
Manos Pitsidianakis 2d862e39f4
imap: off by one error in iteration 2020-06-11 11:42:02 +03:00
Manos Pitsidianakis 2d3f49d64d
imap: index by (MailboxHash, UID) instead of just UID
Mailboxes can share UIDs.
2020-06-11 11:41:08 +03:00
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.
2020-06-10 19:02:54 +03:00
Manos Pitsidianakis e97cf98b3b
Add `view` subcommand
Add subcommand to view standalone e-mail files in meli's pager without
instantiating any accounts.
2020-06-10 18:07:56 +03:00
Manos Pitsidianakis 7dc8a87a62
Prevent sub overflow in EnvelopeView 2020-06-10 18:07:56 +03:00
Manos Pitsidianakis 05c6c19889
src/conf.rs: Remove debug! prints 2020-06-09 17:20:30 +03:00
Manos Pitsidianakis 9f30cd6bbc
state.rs: send AccountStatusChange 2020-06-09 15:39:53 +03:00
Manos Pitsidianakis 1241b6073f
Clear tags before applying new ones in NewFlags 2020-06-09 15:39:01 +03:00
Manos Pitsidianakis ca9d4fde58
Discard EnvelopeRename event if envelope is missing from Collection 2020-06-09 15:38:13 +03:00
Manos Pitsidianakis f3d5edfe14
Add copy/move to other account operations 2020-06-08 22:11:43 +03:00
Manos Pitsidianakis c07185a3aa
regexp: add priority field to regular expressions 2020-06-08 00:55:30 +03:00
Manos Pitsidianakis 465c78e903
Add Cell::keep_attrs() method 2020-06-08 00:55:29 +03:00
Manos Pitsidianakis 4bc8ff2ce9
Use structopt for command line parsing 2020-06-08 00:55:29 +03:00
Manos Pitsidianakis a17f0b4fd4
listing: rework MailListingTrait
split redraw_list() to redraw_threads_list() and redraw_envelope_list()
2020-06-07 14:35:41 +03:00
Manos Pitsidianakis 9edef4ecd2
ui: add attachment_tree() func in MailView
Split ascii attachment tree generation into a function in MailView
2020-06-07 14:35:41 +03:00
Manos Pitsidianakis 5435a4615e
imap: don't try to connect in is_online()
Attempting to connect to the server when calling imap's is_online()
blocks the UI process, so don't.
2020-06-07 14:35:41 +03:00
Manos Pitsidianakis b4dfc1f89d
imap: add experimental header caching with sqlite3
Add support for header caching. It is currently unstable and should not
be used. It can be turned on by specifying "X_header_caching" to true in
the IMAP account's configuration.

The header cache is saved in a sqlite3 database in your XDG_DATA_DIR,
for example:

  /home/epilys/.local/share/meli/17328072387188469646_header_cache.db

Concerns #31 https://git.meli.delivery/meli/meli/issues/31
2020-06-07 14:35:20 +03:00
Manos Pitsidianakis 6458ccb860
meli: update nom dependency to 5.1.1 2020-06-06 23:22:26 +03:00
Manos Pitsidianakis 6ec249dd7f
melib: update nom dependency from 3.2.0 to 5.1.1
That was hecking exhausting
2020-06-06 23:19:07 +03:00
Manos Pitsidianakis db4c401828
melib/error: add chain_err_summary() method 2020-06-06 12:27:02 +03:00
Manos Pitsidianakis e4d4cd55d3
melib: skip mbox `From ` header if present
mbox messages might end up in the parser by mistake, for example by
being present in a Maildir store.
2020-06-06 12:24:39 +03:00
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" }
2020-06-05 10:56:36 +03:00
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.
2020-06-05 10:56:36 +03:00
Manos Pitsidianakis 8c1c628c2c
melib: fix non-unicode encode_header() char boundary issue 2020-06-05 10:56:35 +03:00
Manos Pitsidianakis 84976b1dc9
Update libloading dependency to 0.6.2 2020-06-05 10:56:35 +03:00
Manos Pitsidianakis 5366888dff
Add samples/ directory with config and themes 2020-06-02 18:31:07 +03:00
Manos Pitsidianakis d2cdd26127
docs: update meli-themes.5 2020-06-02 18:31:07 +03:00
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.
2020-06-02 18:31:07 +03:00
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.
2020-06-02 18:31:07 +03:00
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.
2020-06-02 18:31:07 +03:00
Manos Pitsidianakis 9c0ee76ff4
themes: Rename Theme struct to Themes 2020-06-02 18:31:07 +03:00
Manos Pitsidianakis 5144fb6b6b
Add CHANGELOG.md file 2020-06-01 18:05:03 +03:00
Manos Pitsidianakis 049175e743
pager: fix filter invocation and ansi parsing 2020-05-31 22:37:06 +03:00
Manos Pitsidianakis bee1baedb2
themes: add indentation level color keys
Add theme keys for the indentation level colors in ThreadView
2020-05-31 16:44:39 +03:00
Manos Pitsidianakis b3b9563db0
LineBreakCandidateIter: make iter non-recursive
A line with lots of graphemes without any breaks can overflow the stack,
so make the recursion into a loop.
2020-05-31 01:08:22 +03:00
Manos Pitsidianakis 6ceed3cae9
sqlite3: move module to melib 2020-05-30 15:37:12 +03:00
Manos Pitsidianakis 815ff98acc
imap: add smarter untagged reply detection 2020-05-30 14:43:44 +03:00
Manos Pitsidianakis 2c45c39048
ShellExpandTrait: fix for non-linux targets 2020-05-30 14:09:54 +03:00
Manos Pitsidianakis 960d660786
Add #[ignore] to test_parser() 2020-05-29 22:21:12 +03:00
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.
2020-05-29 20:43:40 +03:00
Manos Pitsidianakis fad8820868
Make serde default for manual_refresh = false 2020-05-29 20:43:39 +03:00
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.
2020-05-29 20:43:39 +03:00
Manos Pitsidianakis e4a1ab8a09
Fix rustfmt suggestions 2020-05-29 20:43:39 +03:00
Manos Pitsidianakis 0a83b99e7c
Update nix, linkify, uuid dependencies 2020-05-29 15:59:47 +03:00
Manos Pitsidianakis b8261ee36a
Overhaul input thread
Remove raw/non raw distinction.

Use a pipe for input thread commands and poll stdin/pipe for events
2020-05-29 15:43:05 +03:00
Manos Pitsidianakis 839c1b1eb5
bin.rs: remove useless #[macro_use] 2020-05-28 21:02:49 +03:00
Manos Pitsidianakis bea0ca61f5
maildir: conditionally accept invalid subdirs
If directory is invalid (i.e. has no {cur,new,tmp} subfolders), accept
 it ONLY if it contains subdirs of any depth that are valid maildir
 paths.

For example, this change will accept the following directory tree:
```
  invalid_maildir
  └── valid_maildir
      ├── cur
      ├── new
      └── tmp
```
2020-05-28 21:02:49 +03:00
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.
2020-05-28 21:02:49 +03:00
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`
2020-05-28 21:02:49 +03:00