Re: [PATCH v3 00/34] A great number of cosmetic changes

2020-08-09 Thread David Bremner
Tomi Ollila  writes:

>
> --ignore-whitespace could help...
>
> for the --no-keep-cr (the default) not to work, in thread containing this
>
>https://lkml.org/lkml/2019/12/1/69
>
> may give some hint why the situation is as unclear as it is now...

--ignore-whitespace adds CRs to the files, which is pretty ick.

I ended up writing a python script to massage the patches, and added
that to my patch application alias.

The series is now applied to master.




email-to-8bit
Description: Binary data
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH v5] Emacs: Ensure left-to-right display for message headers

2020-08-09 Thread =?utf-8?Q?T=E2=80=AEomi?= Ollila


How about this =D

(Sorry how the headers might look...)

From: contains U+202E (LEFT-TO-RIGHT OVERRIDE) (in =?utf-8?Q?T=E2=80=AEomi?=)

https://www.fileformat.info/info/unicode/char/202e/index.htm

Tomi

---

(top-posting on purpose, all rest is for reference only)

On Fri, Aug 07 2020, Teemu Likonen wrote:

> In notmuch-show buffer insert invisible U+200E LEFT-TO-RIGHT MARK
> character at the beginning of message header paragraph if the From
> header contains a right-to-left character. This ensures that the
> header paragraph is always rendered in left-to-right mode.
>
> See Emacs Lisp reference manual section "(elisp) Bidirectional
> Display" for more info.
> ---
>  emacs/notmuch-show.el | 12 +---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
>
> As the commit description says this version inserts U+200E
> LEFT-TO-RIGHT MARK only if the first header line (From header)
> contains a right-to-left character.
>
> This version is probably friendlier to the current test files which
> don't expect to see U+200E LEFT-TO-RIGHT MARK in the output.
>
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index c9170466..0eb27e33 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -466,10 +466,16 @@ unchanged ADDRESS if parsing fails."
>  (defun notmuch-show-insert-headerline (headers date tags depth)
>"Insert a notmuch style headerline based on HEADERS for a
>  message at DEPTH in the current thread."
> -  (let ((start (point)))
> +  (let ((start (point))
> + (from (notmuch-sanitize
> +(notmuch-show-clean-address (plist-get headers :From)
> +(when (string-match "\\cR" from)
> +  ;; If the From header has a right-to-left character add
> +  ;; invisible U+200E LEFT-TO-RIGHT MARK character which forces
> +  ;; the header paragraph as left-to-right text.
> +  (insert (propertize (string ?\x200e) 'invisible t)))
>  (insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width 
> depth))
> - (notmuch-sanitize
> -  (notmuch-show-clean-address (plist-get headers :From)))
> + from
>   " ("
>   date
>   ") ("
> -- 
> 2.20.1
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH] Emacs: Indent first header line only when indentation is turned on

2020-08-09 Thread Teemu Likonen
Previously in message-show mode message's first header line (From
header) was always indented, even if user had turned thread
indentation off with "<" (notmuch-show-toggle-thread-indentation)
command.

This change modifies notmuch-show-insert-headerline function so that
it doesn't indent the first header line if notmuch-show-indent-content
variable is nil.
---
 emacs/notmuch-show.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 0eb27e33..2310017a 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -474,7 +474,10 @@ message at DEPTH in the current thread."
   ;; invisible U+200E LEFT-TO-RIGHT MARK character which forces
   ;; the header paragraph as left-to-right text.
   (insert (propertize (string ?\x200e) 'invisible t)))
-(insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width 
depth))
+(insert (notmuch-show-spaces-n
+(if notmuch-show-indent-content
+(* notmuch-show-indent-messages-width depth)
+  0))
from
" ("
date
-- 
2.20.1
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH v3 00/34] A great number of cosmetic changes

2020-08-09 Thread Tomi Ollila
On Sun, Aug 09 2020, David Bremner wrote:

> Jonas Bernoulli  writes:
>>
>> Jonas Bernoulli (34):
>>   emacs: Shorten long lines
>>   emacs: Remove excess empty lines
>
>
> These patches (and Đoàn Trần Công Danh's that I just applied by hand)
> both seem to have problem with base64 encoded patches documented at.
>
>  https://lore.kernel.org/git/20191218194144.gl17...@pobox.com/
>
> It seems that the patches have CRLF line endings inside the base64
> encoding, and git fails to strip the CRs.
>
> I'm not sure why this happens for some patches and not for others;
> I hope there is not re-encoding happening on the mailing list. If there
> is we should fix that.
>
> The practical upshot is that I can't really apply such a long series by
> hand. Ideas welcome. A short term fix would be to fetch a ref from
> somewhere. OTOH, I hope this isn't going to be a recurring problem.

--ignore-whitespace could help...

for the --no-keep-cr (the default) not to work, in thread containing this

   https://lkml.org/lkml/2019/12/1/69

may give some hint why the situation is as unclear as it is now...

Tomi

> d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH v3 00/34] A great number of cosmetic changes

2020-08-09 Thread Jonas Bernoulli
David Bremner  writes:
> A short term fix would be to fetch a ref from somewhere.

You can fetch it with:

git fetch https://github.com/tarsiiformes/notmuch.git cleanup

 Jonas
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH v3 00/34] A great number of cosmetic changes

2020-08-09 Thread Jonas Bernoulli
Đoàn Trần Công Danh  writes:

> On 2020-08-09 09:09:39-0300, David Bremner  wrote:
>> Jonas Bernoulli  writes:
>> >
>> > Jonas Bernoulli (34):
>> >   emacs: Shorten long lines
>> >   emacs: Remove excess empty lines
>> 
>> 
>> These patches (and Đoàn Trần Công Danh's that I just applied by hand)
>> both seem to have problem with base64 encoded patches documented at.
>> 
>>  https://lore.kernel.org/git/20191218194144.gl17...@pobox.com/
>> 
>> It seems that the patches have CRLF line endings inside the base64
>> encoding, and git fails to strip the CRs.
>> 
>> I'm not sure why this happens for some patches and not for others;
>> I hope there is not re-encoding happening on the mailing list. If there
>> is we should fix that.
>
> It seems like the mailing list base64-encodes utf-8 email.
> My email will be sent in utf-8 for obvious reason.
>
> I don't know about Jonas's, some of them are in utf-8 and some other
> is in plain ascii.

That seems to be it.  I don't remember the exact question but when
sending I was asked about what encoding to use and I confirmed the
default, which was utf-8.  Usually I am not asked this question.

 Jonas
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH v3 00/34] A great number of cosmetic changes

2020-08-09 Thread Đoàn Trần Công Danh
On 2020-08-09 09:09:39-0300, David Bremner  wrote:
> Jonas Bernoulli  writes:
> >
> > Jonas Bernoulli (34):
> >   emacs: Shorten long lines
> >   emacs: Remove excess empty lines
> 
> 
> These patches (and Đoàn Trần Công Danh's that I just applied by hand)
> both seem to have problem with base64 encoded patches documented at.
> 
>  https://lore.kernel.org/git/20191218194144.gl17...@pobox.com/
> 
> It seems that the patches have CRLF line endings inside the base64
> encoding, and git fails to strip the CRs.
> 
> I'm not sure why this happens for some patches and not for others;
> I hope there is not re-encoding happening on the mailing list. If there
> is we should fix that.

It seems like the mailing list base64-encodes utf-8 email.
My email will be sent in utf-8 for obvious reason.

I don't know about Jonas's, some of them are in utf-8 and some other
is in plain ascii.


-- 
Danh
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH v3 00/34] A great number of cosmetic changes

2020-08-09 Thread David Bremner
Jonas Bernoulli  writes:
>
> Jonas Bernoulli (34):
>   emacs: Shorten long lines
>   emacs: Remove excess empty lines


These patches (and Đoàn Trần Công Danh's that I just applied by hand)
both seem to have problem with base64 encoded patches documented at.

 https://lore.kernel.org/git/20191218194144.gl17...@pobox.com/

It seems that the patches have CRLF line endings inside the base64
encoding, and git fails to strip the CRs.

I'm not sure why this happens for some patches and not for others;
I hope there is not re-encoding happening on the mailing list. If there
is we should fix that.

The practical upshot is that I can't really apply such a long series by
hand. Ideas welcome. A short term fix would be to fetch a ref from
somewhere. OTOH, I hope this isn't going to be a recurring problem.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH 02/19] lib: add stub for notmuch_database_open_with_config

2020-08-09 Thread David Bremner
Reto  writes:

>> + * Mode to open database. Use one of #NOTMUCH_DATABASE_MODE_READ_WRITE
>> + * or #NOTMUCH_DATABASE_MODE_READ_WRITE
>
> I think you want to have NOTMUCH_DATABASE_MODE_READ_ONLY here?
>
> Greetings,
> Reto

yes, you are correct.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH v3 00/34] A great number of cosmetic changes

2020-08-09 Thread Jonas Bernoulli
Tomi Ollila  writes:

> I made a quick check of release dates of emacs 25.1, gmime 3 and xapian 1.4
> -- gmime 3 released early 2017, xapian 1.4 middle of 2016 and emacs 25.1
> sept 2016 -- so requiring emacs 25.1 is pretty much aligned to those
> releases and therefore dropping emacs 24 support looks good to me.

Great!

>> That resulted in a few new commits of course, marked with * below.
>> And since I had to add some commit anyway, I also added three other
>> minor commits, marked with ^ below.
>
> I checked the new commits, looks good to me. I also was preparing dropping
> emacs 23 support code and the changes aligned what I tried. Interestinglyy
> this change in notmuch-mua.el:
>   ;; There is a bug in emacs 23's message.el that results in a newline
>   ;; not being inserted after the References header, so the next header
>   ;; is concatenated to the end of it. 
> Is still effective in emacs 26.3 -- I wonder whether there is something
> wrong notmuch-emacs handles the case `notmuch-mua-insert-references` is
> needed.

I'll have a look.

> I trust the earlier changes are the same as in v2 and v1

Almost. In "emacs: Increase consistency of library headers" I did bring
the headers of "notmuch-compat.el" and "emacs/notmuch-version.el.tmpl"
more in line.  But that's it.

 Jonas
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH 02/19] lib: add stub for notmuch_database_open_with_config

2020-08-09 Thread Reto
On Sat, Aug 08, 2020 at 11:16:36AM -0300, David Bremner wrote:
> +/* NOTMUCH_DEPRECATED(5, 4) */
> +notmuch_status_t
> +notmuch_database_open_verbose (const char *path,
> +notmuch_database_mode_t mode,
> +notmuch_database_t **database,
> +char **error_message);
> +
> +/**
> + * Open an existing notmuch database located at 'database_path', using
> + * configuration in 'config_path'.
> + *
> + * @param[in]database_path
> + * @parblock
> + * Path to existing database.
> + *
> + * A notmuch database is a Xapian database containing appropriate
> + * metadata.
>   *
>   * The database should have been created at some time in the past,
>   * (not necessarily by this process), by calling
> - * notmuch_database_create with 'path'. By default the database should be
> - * opened for reading only. In order to write to the database you need to
> - * pass the NOTMUCH_DATABASE_MODE_READ_WRITE mode.
> + * notmuch_database_create.
> + *
> + * If 'database_path' is NULL, use the location specified
> + *
> + * - in the environment variable NOTMUCH_DATABASE, if non-empty
> + *
> + * - by $XDG_DATA_HOME/notmuch/$PROFILE where XDG_DATA_HOME defaults
> + *   to "$HOME/.local/share" and PROFILE as as discussed in
> + *   'profile'
> + *
> + * If 'database_path' is non-NULL, but does not appear to be a Xapian
> + * database, check for a directory '.notmuch/xapian' below
> + * 'database_path' (this is the behavior of
> + * notmuch_database_open_verbose pre-0.32).
> + *
> + * @endparblock
> + * @param[in]mode
> + * @parblock
> + * Mode to open database. Use one of #NOTMUCH_DATABASE_MODE_READ_WRITE
> + * or #NOTMUCH_DATABASE_MODE_READ_WRITE

I think you want to have NOTMUCH_DATABASE_MODE_READ_ONLY here?

Greetings,
Reto
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH v3 00/34] A great number of cosmetic changes

2020-08-09 Thread Tomi Ollila
On Sat, Aug 08 2020, Jonas Bernoulli wrote:

> David Bremner  writes:
>
>> Tomi Ollila  writes:
>
>>> So we have 3 options:
>>>
>>> 1) apply this patch and now drop support for emacs 24
>>>
>>> 2) apply this patch and somehow infor emacs 24 users to install cl-lib from
>>> ELPA
>>
>> I'm fine with either of these options. I'd hope we can specify what
>> versions we need in emacs/notmuch-pkg.el.templ
>
> I went with option 1: drop support for emacs 24.  Instead of just
> adding a NEWS entry and bump a number, I also removed some old cruft
> that was only necessary for emacs 24 (and in some cases emacs 23!).

I made a quick check of release dates of emacs 25.1, gmime 3 and xapian 1.4
-- gmime 3 released early 2017, xapian 1.4 middle of 2016 and emacs 25.1
sept 2016 -- so requiring emacs 25.1 is pretty much aligned to those
releases and therefore dropping emacs 24 support looks good to me.

> That resulted in a few new commits of course, marked with * below.
> And since I had to add some commit anyway, I also added three other
> minor commits, marked with ^ below.

I checked the new commits, looks good to me. I also was preparing dropping
emacs 23 support code and the changes aligned what I tried. Interestinglyy
this change in notmuch-mua.el:
  ;; There is a bug in emacs 23's message.el that results in a newline
  ;; not being inserted after the References header, so the next header
  ;; is concatenated to the end of it. 
Is still effective in emacs 26.3 -- I wonder whether there is something
wrong notmuch-emacs handles the case `notmuch-mua-insert-references` is
needed.

I trust the earlier changes are the same as in v2 and v1

Tomi


>
>  Cheers,
>  Jonas
>
> Jonas Bernoulli (34):
>   emacs: Shorten long lines
>   emacs: Remove excess empty lines
>   emacs: Fix indentation
>   emacs: Closing parenthesis go on the same line
>   emacs: Only set one variable per setq form
>   emacs: Use 'and' instead of 'when' when the return value matters
>   emacs: Use 'unless' instead of 'when' and 'not'
>   emacs: Use 'when' instead of 'if' when there is no ELSE part
>   emacs: Use one or three lines for 'if' forms
>   emacs: Extend face to window edge again
>   emacs: Fix some function declarations
>   emacs: No longer define notmuch-hello-mode-map as a function
>   emacs: notmuch-poll: Let the user know we are polling
>   emacs: Use makefile-gmake-mode in Makefile*s
>   emacs: Improve doc-strings
>   emacs: Autoload notmuch-jump-search only once
>   emacs: Autoload notmuch-jump using an autoload cookie
>   emacs: Various cosmetic changes
>   emacs: Increase consistency of library headers
>   Fix typos
>   .dir-locals.el: Set variables for correct "shell" mode
>   test: Fix indentation
> ^ .gitignore: Sort using sort-lines
> ^ emacs: Provide 'rstdoc' feature at end of file
> ^ emacs: Add end-of-file line to libraries that lack it
> * NEWS: Add stub for 0.31
> * NEWS: At least Emacs 25.1 is required now
> * emacs: Use cl-incf where appropriate
> * emacs: Remove notmuch-setq-local
> * emacs: Remove notmuch-read-char-choice
> * emacs: Drop old advices that were only need for Emacs 23
> * emacs: Do not abuse advice to monkey patch while testing
> * emacs: Use new advice mechanism do advice mm-shr
> * try-emacs-mua: Trim `require' advice for Emacs 25
>
>  .dir-locals.el |   2 +-
>  .gitignore |  28 +-
>  Makefile.global|   1 +
>  Makefile.local |   2 +-
>  NEWS   |  10 +-
>  bindings/Makefile.local|   2 +-
>  bindings/python-cffi/notmuch2/__init__.py  |   2 +-
>  bindings/python-cffi/notmuch2/_base.py |   6 +-
>  bindings/python-cffi/notmuch2/_database.py |   8 +-
>  bindings/python-cffi/notmuch2/_message.py  |   4 +-
>  bindings/python-cffi/notmuch2/_tags.py |   8 +-
>  bindings/python-cffi/tests/conftest.py |   2 +-
>  bindings/python/notmuch/database.py|  12 +-
>  bindings/python/notmuch/query.py   |   2 +-
>  compat/Makefile.local  |   2 +-
>  completion/Makefile.local  |   2 +-
>  devel/try-emacs-mua|  26 +-
>  doc/Makefile.local |   2 +-
>  emacs/Makefile.local   |   2 +-
>  emacs/coolj.el |  24 +-
>  emacs/make-deps.el |   7 +-
>  emacs/notmuch-address.el   | 188 -
>  emacs/notmuch-company.el   |  56 +--
>  emacs/notmuch-compat.el|  88 +
>  emacs/notmuch-crypto.el|  49 ++-
>  emacs/notmuch-draft.el |  24 +-
>  emacs/notmuch-hello.el | 102 +++--
>  emacs/notmuch-jump.el  |  61 ++-
>  emacs/notmuch-lib.el   | 202 +-
>  emacs/notmuch-maildir-fcc.el   | 122 +++---
>  emacs/notmuch-messa