[bug?][notmuch-emacs] X11: renders Headers with face attributes

2019-03-21 Thread Gregor Zattler
Dear notmuch developers,

today I got a spam mail which's Subject: and From: header were
displayed as bold (with the exception of German umlauts) in
notmuch-emacs in a graphical frame (X11), they were displayed as
a string of hollow rectangles in a frame on a urxvt terminal (see
attached screen shots).  I see there are bold and italic
mathematical bold letters in Unicode.  The bold ones are used
here.

This are the headers in question:

Subject:=?UTF-8?B?IPCdl5jwnZe78J2YgfCdl7nwnZeu8J2YgPCdmIHwnZiC8J2Xu/Cdl7Qg8J2Xs8O88J2XvyDwnZeU8J2Xu/Cdl7TwnZey8J2XtcO28J2Xv/Cdl7bwnZe08J2XsiDwnZe28J2XuiDwnZen8J2Xv/Cdl67wnZiC8J2XsvCdl7/wnZez8J2XrvCdl7nwnZe5IA==?=
From:=?UTF-8?B?IPCdl6bwnZiB8J2XsvCdl7/wnZev8J2Xsi3wnZep8J2XvPCdl7/wnZiA8J2XvPCdl7/wnZe08J2XsiA=?=<2m...@0ytix511n5cb63oezbgj69wpm.com>

Is this a bug?  Should untrusted senders be allowed to influence
how headers are displayed?  I don't think so.  For me this case
should be handled as a homograph attack
(https://en.wikipedia.org/wiki/IDN_homograph_attack).

I do know there is character folding for searches but emacs would
need to use the reverse for displaying characters and only
characters which deviate in a way that is recognized as a font
attribute.

Thanks for your attention, Gregor
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Feature request: Limit output of notmuch show

2019-03-21 Thread Jörg Volbers

Hello everyone,

I would like to limit the output of notmuch show to a certain 
amount of mails, similar to the option `--limit' in notmuch 
search. But actually, I think the most elegant way would be to 
allow a limiting operator as a query term.


Is it a difficulty to implement that? Would anyone do that? I am 
not able to write anything in C, so I'm out of it.


Jörg Volbers



signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: tree: support fold/unfold thread

2019-03-21 Thread Julien Masson
This patch allow the user to fold/unfold a thread in the current tree
buffer by pressing "t" key.

By default a string is displayed at the beginning of the overlay to
indicate that this thread is folded.
Pressing again "t" on a folded thread will unfold it.

This feature works accross all the queries which are in Tree View.

Signed-off-by: Julien Masson 
---

I started to write this feature only for myself and some people around
me were interested so I thought it might be interesting to share with
you as well :)

Please tell me if you want to change some default value:
-> notmuch-tree-overlay-string
-> notmuch-tree-overlay-fold-face
-> "t" key bind to notmuch-tree-toggle-folding-thread

I personnaly bind  to notmuch-tree-toggle-folding-thread

 emacs/notmuch-tree.el | 73 +++
 1 file changed, 73 insertions(+)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index c00315e..7227692 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -71,6 +71,11 @@ Note the author string should not contain
   :type '(alist :key-type (string) :value-type (string))
   :group 'notmuch-tree)
 
+(defcustom notmuch-tree-overlay-string " [...]"
+  "String displayed at the beginning of the overlay"
+  :type 'string
+  :group 'notmuch-tree)
+
 ;; Faces for messages that match the query.
 (defface notmuch-tree-match-face
   '((t :inherit default))
@@ -159,6 +164,13 @@ Note the author string should not contain
   :group 'notmuch-tree
   :group 'notmuch-faces)
 
+;; Faces for overlays
+(defface notmuch-tree-overlay-fold-face
+  '((t :inherit 'font-lock-keyword-face))
+  "Default face used to display `notmuch-tree-overlay-string'"
+  :group 'notmuch-tree
+  :group 'notmuch-faces)
+
 (defvar notmuch-tree-previous-subject
   "The subject of the most recent result shown during the async display")
 (make-variable-buffer-local 'notmuch-tree-previous-subject)
@@ -196,6 +208,9 @@ if the user has loaded a different buffer in that window.")
 (make-variable-buffer-local 'notmuch-tree-message-buffer)
 (put 'notmuch-tree-message-buffer 'permanent-local t)
 
+(defvar notmuch-tree-overlays nil
+  "List of overlays used to fold/unfold thread")
+
 (defun notmuch-tree-to-message-pane (func)
   "Execute FUNC in message pane.
 
@@ -294,6 +309,7 @@ FUNC."
 (define-key map " " 'notmuch-tree-scroll-or-next)
 (define-key map (kbd "DEL") 'notmuch-tree-scroll-message-window-back)
 (define-key map "e" 'notmuch-tree-resume-message)
+(define-key map "t" 'notmuch-tree-toggle-folding-thread)
 map))
 (fset 'notmuch-tree-mode-map notmuch-tree-mode-map)
 
@@ -415,6 +431,60 @@ NOT change the database."
(notmuch-draft-resume id)
   (message "No message to resume!"
 
+(defun notmuch-tree-find-overlay (buffer start end)
+  "Return the first overlay found in `notmuch-tree-overlays'.
+
+The overlay found is located between START and END position in BUFFER."
+  (seq-find (lambda (ov)
+ (and (eq (overlay-buffer ov) buffer)
+  (<= (overlay-start ov) start)
+  (>= (overlay-end ov) end)))
+   notmuch-tree-overlays))
+
+(defun notmuch-tree-clean-up-overlays ()
+  "Remove overlays not referenced to any buffer"
+  (setq notmuch-tree-overlays (seq-filter #'overlay-buffer 
notmuch-tree-overlays)))
+
+(defun notmuch-tree-remove-overlay (overlay)
+  "Delete OVERLAY and remove it from `notmuch-tree-overlays' list"
+  (setq notmuch-tree-overlays (remove overlay notmuch-tree-overlays))
+  (delete-overlay overlay))
+
+(defun notmuch-tree-add-overlay (start end)
+  "Add an overlay from START to END in the current buffer.
+
+If non nil, `notmuch-tree-overlay-string' is added at the end of the line.
+The overlay created is added to `notmuch-tree-overlays' list"
+  (let ((overlay (make-overlay start end)))
+(add-to-list 'notmuch-tree-overlays overlay)
+(overlay-put overlay 'invisible t)
+(when notmuch-tree-overlay-string
+  (overlay-put overlay 'before-string
+  (propertize notmuch-tree-overlay-string
+  'face 'notmuch-tree-overlay-fold-face)
+
+(defun notmuch-tree-thread-range ()
+  "Return list of Start and End position of the current thread"
+  (let (start end)
+(save-excursion
+  (while (not (or (notmuch-tree-get-prop :first) (eobp)))
+   (forward-line -1))
+  (setq start (line-end-position))
+  (notmuch-tree-next-thread)
+  (setq end (- (point) 1))
+  (list start end
+
+(defun notmuch-tree-toggle-folding-thread ()
+  "Fold / Unfold the current thread"
+  (interactive)
+  (cl-multiple-value-bind (start end)
+  (notmuch-tree-thread-range)
+(unless (= start end)
+  (let ((overlay (notmuch-tree-find-overlay (current-buffer) start end)))
+   (if overlay
+   (notmuch-tree-remove-overlay overlay)
+ (notmuch-tree-add-overlay start end))
+
 ;; The next two functions close the message window before calling
 ;; 

[PATCH] vim: Use non-deprecated method parse instead of new.

2019-03-21 Thread Nicolas Lesser
---
 vim/notmuch.vim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index ad8b7c80..541698cd 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -666,7 +666,7 @@ ruby << EOF
date = Time.at(e.newest_date).strftime(date_fmt)
subject = e.messages.first['subject']
if $mail_installed
-   subject = Mail::Field.new("Subject: " + 
subject).to_s
+   subject = Mail::Field.parse("Subject: " 
+ subject).to_s
else
subject = 
subject.force_encoding('utf-8')
end
-- 
2.21.0

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] Fix "jobserver unavailable" warning

2019-03-21 Thread David Bremner
aide...@aidecoe.name writes:

> ---
>  doc/Makefile.local | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

pushed something similar. I couldn't get this patch to apply for some
reason.

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch