Re: [PATCH 3/4] emacs: add function to resend message to new recipients
On Wed, 02 Sep 2015, Tomi Ollilawrote: > The new function notmuch-show-message-resend re-sends > message to new recipients using #'message-resend. > > Recipients are read from minibuffer as a comma-separated > string (with some keyboard support including tab completion). > > Final confirmation before sending is asked. > --- This series looks good to me modulo three minor comments (I even like the choice of binding to b). The first comment is that, in light of the recent address series, I think Patch 2 can be dropped completely, with a small change to this patch. See below for that, and the other two minor suggestions. Also, I wonder if when it gets a NEWS item it might be worth mentioning that a user might have already added this function to their emacs init file as it has been on the wiki. (It took me way too long to realise that was why this patch was not working for me!) Best wishes Mark > > Since id:1440619626-18768-2-git-send-email-tomi.oll...@iki.fi > - changed (bury-buffer) to (notmuch-bury-or-kill-this-buffer) > - it is hard to have the buffer been kept around but it is posiible > > emacs/notmuch-address.el | 19 +++ > emacs/notmuch-show.el| 8 > 2 files changed, 27 insertions(+) > > diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el > index 8982a415ce11..83788efd3c1b 100644 > --- a/emacs/notmuch-address.el > +++ b/emacs/notmuch-address.el > @@ -119,4 +119,23 @@ (defun notmuch-address-locate-command (command) > > ;; > > +(defun notmuch-address-from-minibuffer (prompt) > + (if (not (notmuch-address--message-insinuated)) > + (read-string prompt) This can become (if (not notmuch-address-command) > +(let ((rmap (copy-keymap minibuffer-local-map)) > + (omap minibuffer-local-map)) > + ;; Configure TAB to start completion when executing read-string. > + ;; "Original" minibuffer keymap is restored just before calling > + ;; notmuch-address-expand-name as it may also use minibuffer-local-map > + ;; (completing-read probably does not but if something else is used > there). > + (define-key rmap "\C-i" (lambda () ;; TAB I think this could become (define-key rmap (kbd "TAB") (lambda () which is easy to read and consistent with the definitions of other keymaps (eg the main notmuch-show keymap). > +(interactive) > +(let ((enable-recursive-minibuffers t) > + (minibuffer-local-map omap)) > + (notmuch-address-expand-name > + (let ((minibuffer-local-map rmap)) > + (read-string prompt) > + > +;; > + > (provide 'notmuch-address) > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index 0565ab0725b2..046cb0e41f0b 100644 > --- a/emacs/notmuch-show.el > +++ b/emacs/notmuch-show.el > @@ -1806,6 +1806,14 @@ (defun notmuch-show-forward-message ( > prompt-for-sender) >(with-current-notmuch-show-message > (notmuch-mua-new-forward-message prompt-for-sender))) > > +(defun notmuch-show-resend-message (addresses) > + "Resend the current message." > + (interactive (list (notmuch-address-from-minibuffer "Resend to: "))) > + (when (yes-or-no-p (concat "Confirm resend to " addresses " ")) Perhaps y-or-n-p rather than yes-or-no-p? > +(notmuch-show-view-raw-message) > +(message-resend addresses) > +(notmuch-bury-or-kill-this-buffer))) > + > (defun notmuch-show-next-message ( pop-at-end) >"Show the next message. > > -- > 2.0.0 > > ___ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch
[PATCH] emacs: poll: return useful errors when poll fails.
Previously poll called from emacs would fail silently. This makes it return a useful error message. In the non-deprecated case of notmuch new and appropriate hooks, it uses notmuch-call-notmuch-process which gives an error and additionally puts the stdout/stderr etc in the *Notmuch errors* buffer. In the deprecated case of a custom poll script it only returns an error message. Commit based on a bug report, and a potential fix, by Ketil Malde. --- This should fix the bug reported in the parent message -- we should definitely report error messages. It might be nice to output the stdout/stderr in the custom poll script case but since we don't have built in infrastructure for it it probably isn't worth it for a deprecated case. (Note I don't use poll, so this is not heavily tested) Best wishes Mark emacs/notmuch-lib.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 1c3a9fe..89c01a5 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -243,8 +243,9 @@ depending on the value of `notmuch-poll-script'." (interactive) (if (stringp notmuch-poll-script) (unless (string= notmuch-poll-script "") - (call-process notmuch-poll-script nil nil)) -(call-process notmuch-command nil nil nil "new"))) + (unless (equal (call-process notmuch-poll-script nil nil) 0) + (error "Notmuch: poll script `%s' failed!" notmuch-poll-script))) +(notmuch-call-notmuch-process "new"))) (defun notmuch-bury-or-kill-this-buffer () "Undisplay the current buffer. -- 2.1.4 ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] emacs: poll: return useful errors when poll fails.
On Wed, Oct 28 2015, Mark Walterswrote: > Previously poll called from emacs would fail silently. This makes it > return a useful error message. > > In the non-deprecated case of notmuch new and appropriate hooks, it > uses notmuch-call-notmuch-process which gives an error and > additionally puts the stdout/stderr etc in the *Notmuch errors* > buffer. > > In the deprecated case of a custom poll script it only returns an > error message. > > Commit based on a bug report, and a potential fix, by Ketil Malde. > --- Looks good (to me) -- I investigated a bit how notmuch-call-notmuch-process does things; it uses notmuch-check-exit-status which is not applicable here. Mark said he doesn't use poll -- and I have rewritten my poll(*) so my tests will be as lightweight as his. So we wait for Ketil's report how this works :D Tomi (*) see at the end of this email > > This should fix the bug reported in the parent message -- we should > definitely report error messages. It might be nice to output the > stdout/stderr in the custom poll script case but since we don't have > built in infrastructure for it it probably isn't worth it for a > deprecated case. > > (Note I don't use poll, so this is not heavily tested) > > Best wishes > > Mark > For reference, if anyone gets ideas from this... ;; overwrite notmuch-poll defined in notmuch.el (defun notmuch-poll () (interactive) (save-window-excursion (let ((buffer (get-buffer-create "*my notmuch polls*"))) (set-buffer buffer) (setq buffer-read-only nil) (goto-char (point-max)) (pop-to-buffer buffer) (call-process "notmuch-log-output.sh" nil t t "new" "--verbose") (bury-buffer))) ;; <- b-b to put the buffer at the "bottom" of buffers (message "update finished")) ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch