Re: [RFC 0/2] add --new-tags= to notmuch-new(1)

2021-09-20 Thread David Bremner
andr...@rammhold.de writes:

> I am posting this as an RFC to see what other users and the developers think
> about this approach and if anyone has solved a similar issue (in a different
> way).

I honestly don't know if what you propose is the best solution for your
problem. Looking at the functionality for it's own sake, I wonder why
you don't copy the UI from notmuch insert, which already allows
specifying arbitrary tag operations for newly delivered messages. I
suspect some of the code can re-used as well.

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


Re: [PATCH v4] emacs: notmuch-tree: customizable strings for drawing trees

2021-09-20 Thread David Bremner
Jose Antonio Ortega Ruiz  writes:

> On Tue, Aug 31 2021, David Bremner wrote:
>
>> jao  writes:
>>
>>> -  (push "│" tree-status))
>>> +  (push (alist-get 'vertical notmuch-tree-thread-symbols 3) 
>>> tree-status))
>>
>> That 3 looks like a typo. If nothing else turns up, I can just delete
>> it.
>
> indeed.  it's a leftover of my previous implementation.  please go
> ahead.  thanks!

Done, and applied to master.
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [bug] notmuch-read-tag-changes, incompatability with consult, non-standard usage of completing-read-multiple

2021-09-20 Thread David Bremner
Natnael Kahssay  writes:

> notmuch-read-tag-changes throws error, "Tag must be in the form of 
> +'this_tag' or '-that_tag'" when used with consult. notmuch-read-tag-changes 
> expects completing-read-multiple to strip crm-separator out of results. 
> Consult's implementation of competing-read-multiple doesn't strip results.
> I discussed with the author of the package here. 
> https://github.com/minad/consult/issues/410
>
> He states notmuch is using a non-standard and possibly tentative property of 
> completing-read-multiple. I agree.


This seems related to the discussion starting at

 https://nmbug.notmuchmail.org/nmweb/show/87im0w6u5r.fsf%40m4x.org

See in particular

https://nmbug.notmuchmail.org/nmweb/show/m2pmud2xxa.fsf%40dme.org
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[bug] notmuch-read-tag-changes, incompatability with consult, non-standard usage of completing-read-multiple

2021-09-20 Thread Natnael Kahssay


notmuch-read-tag-changes throws error, "Tag must be in the form of +'this_tag' 
or '-that_tag'" when used with consult. notmuch-read-tag-changes expects 
completing-read-multiple to strip crm-separator out of results. Consult's 
implementation of competing-read-multiple doesn't strip results.
I discussed with the author of the package here. 
https://github.com/minad/consult/issues/410

He states notmuch is using a non-standard and possibly tentative property of 
completing-read-multiple. I agree.

Below I have a version of notmuch-read-tag-changes that removes suffix 
crm-separator of returned candidates explicitly.
#+begin_src emacs-lisp
(defun notmuch-read-tag-changes (current-tags &optional prompt initial-input)
  "Prompt for tag changes in the minibuffer.

CURRENT-TAGS is a list of tags that are present on the message
or messages to be changed.  These are offered as tag removal
completions.  CURRENT-TAGS may contain duplicates.  PROMPT, if
non-nil, is the query string to present in the minibuffer.  It
defaults to \"Tags\".  INITIAL-INPUT, if non-nil, will be the
initial input in the minibuffer."
  (let* ((all-tag-list (notmuch-tag-completions))
 (add-tag-list (mapcar (apply-partially 'concat "+") all-tag-list))
 (remove-tag-list (mapcar (apply-partially 'concat "-") current-tags))
 (tag-list (append add-tag-list remove-tag-list))
 (prompt (concat (or prompt "Tags") " (+add -drop): "))
 (crm-separator " ")
 ;; By default, space is bound to "complete word" function.
 ;; Re-bind it to insert a space instead.  Note that 
 ;; still does the completion.
 (crm-local-completion-map
  (let ((map (make-sparse-keymap)))
(set-keymap-parent map crm-local-completion-map)
(define-key map " " 'self-insert-command)
map)))
(mapcar (lambda (entry)
  (substring entry 0 (- (length crm-separator
(delete "" (completing-read-multiple
prompt
;; Append the separator to each completion so when the
;; user completes a tag they can immediately begin
;; entering another.  `completing-read-multiple'
;; ultimately splits the input on crm-separator, so we
;; don't need to strip this back off (we just need to
;; delete "empty" entries caused by trailing spaces).
(mapcar (lambda (tag-op) (concat tag-op crm-separator)) 
tag-list)
nil nil initial-input
'notmuch-read-tag-changes-history)
#+end_src


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org