Add mutt-functions `<edit-raw-message>`, `<edit-or-view-raw-message>`
and `<view-raw-message>`.
`<view-raw-message>` is a binding for the C-function
`mutt_view_message()`, which opens the raw message as a read-only file
in an external editor.
`<edit-or-view-raw-message>` is a dispatcher function: If the mailbox
is writable then this is the same as `<edit-raw-message>`, otherwise it
is the same as `<view-raw-message>`.
`<edit-raw-message>` is a synonym for `<edit>` whose name coherent with
the naming scheme of the other two functions introduced.
Change default key binding of `e` from `edit` to
`edit-or-view-raw-message`. This allows viewing the raw message in an
external editor also in read-only mailboxes.
Reis Radomil [Wed, 15 Nov 2017 20:53:03 +0000 (21:53 +0100)]
editmsg.c: Implement mutt_view_message() function
Add mutt_view_message() function, which opens the selected message or
the tagged messages as a read-only file in an external editor. This
function is similar to mutt_edit_message() but does not allow modifying
the message.
A usage scenario might be to view the message source code in an editor.
Note: This patch only adds C functions. It does not add any mutt-functions.
Reis Radomil [Wed, 15 Nov 2017 20:52:14 +0000 (21:52 +0100)]
Rename OP_EDIT_MESSAGE to OP_EDIT_RAW_MESSAGE
This brings the constant name in line with the description of its
corresponding mutt-function and paves the way for a coherent name scheme
in the upcoming 'edit-raw-message' family of mutt-functions.
Richard Russon [Mon, 13 Nov 2017 02:39:04 +0000 (02:39 +0000)]
highlight preproc-like variable
`allow_skip` is only set in one place in a `#ifdef`d block.
This effectively makes it a preprocessor condition.
By changing its name to capitals we let Coverity know how we're using
the variable.
Richard Russon [Wed, 1 Nov 2017 05:14:22 +0000 (05:14 +0000)]
fix: drop capability aliases
`CapabilityAliases` was a list of alternative names (just one) for IMAP
capability strings. This isn't necessary. We can put the strings in
`Capabilities` and fix the enumeration.
Richard Russon [Sat, 4 Nov 2017 14:31:54 +0000 (14:31 +0000)]
alias drop self
struct Alias began:
```c
struct Alias
{
struct Alias *self; /* XXX - ugly hack */
...
```
There didn't seem to be any reason for this pointer.
The two places that allocate a new Alias, immediately set the self
pointer to the object. No users of `self` test it first.
Pietro Cerutti [Thu, 26 Oct 2017 16:08:41 +0000 (17:08 +0100)]
Wrap dirname(3) inside a mutt_dirname() function
* Wrap dirname(3) inside a mutt_dirname() function
This new function, opposite to the original dirname(3), does not modify
its argument and can be passed a const char * argument. This means that
callers mustn't copy their strings before calling dirname anymore.
Mehdi ABAAKOUK [Wed, 25 Oct 2017 16:10:53 +0000 (18:10 +0200)]
url: make notmuch query string parser generic (#812)
* Notmuch: remove custom UriTag linked list
Use STAILQ helper for UriTag linked list.
* url: make notmuch query string parser generic
Enhance the url.c to handle query strings.
This permits to remove the notmuch custom url parser.
* url: always parse query string
This removes url_parse_with_qs methods.
* fix some problems
- double free in nm_normalize_uri()
- set path to NULL in url_parse()
If we're setting all the other members, we should set the path too
- tidy some doxygen docs
* notmuch: remove useless starting / from db_filename
Pietro Cerutti [Wed, 25 Oct 2017 15:51:46 +0000 (16:51 +0100)]
Do not use CPPFLAGS / CFLAGS together with CC_FOR_BUILD (#882)
* Do not use CPPFLAGS / CFLAGS together with CC_FOR_BUILD
* Restore -std=c99 when building makedoc
* Make sure host-independent CFLAGS are passed to CC_FOR_BUILD
* Let CC_FOR_BUILD carry CFLAGS_FOR_BUILD, there's no reason to split them
Austin Ray [Sat, 21 Oct 2017 18:08:34 +0000 (14:08 -0400)]
Fix smart wrap in pager without breaking header
This commit addresses the issue of smart wrap not working if a line
started with whitespace.
This behavior was a result commit f5e472b where smart wrap was disabled
on lines beginning with a space or tab to prevent headers from having
weird wrapping.
This commit addresses this issue by only applying smart wrapping if the
pager is displaying a message body. This allows smart_wrap to work
inside of a message and preserves what commit f5e472b addressed.
Additionally, the buf[cnt] checks have been simplified with the use of
the ISSPACE() macro.
While fixing the smart wrap, it became apparent that the HEADER portion
of the pager was not properly updating when the wrap size was modified.
To address this, the wrap command was changed from R_PAGER to
R_PAGER_FLOW in init.h. This redraws the pager after wrap is modified.
Austin Ray [Tue, 17 Oct 2017 21:23:36 +0000 (17:23 -0400)]
notmuch: virtual-mailboxes should accept a limit
* Fix issue #849
nm_uri_from_query() checks if there is a custom limit and includes it
in the URI. This keeps the limit intact after nm_normalize_uri()
terminates. Otherwise, the limit is stored within nm_normalize_uri()'s
temporary NmCtxData struct and lost upon termination.
Additionally, nm_normalize_uri() properly initializes tmp_ctxdata, which
sets the default db_limit value. This ensures db_limit is either
NmDbLimit or the custom limit. My earlier attempt to resolve #849 did
not initialize db_limit and suffered from random db_limit values.
The url_parse_query() check was removed from nm_normalize_uri() as
new_ctxdata() contains the same block of code. Error message numbering
has been updated the reflect the change.
* Remove redundant variable
Refactor per suggestions in code review to remove redundant variable and
update method signature.
The removal of the redundant variable prompt the need to change
tmp_ctxdata from NmCtxData to *NmCtxData. Calls to its fields have been
updated to reflect its new status.