all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Gmail’s \Muted label in Gnus
@ 2016-01-04 13:05 Nikolai Weibull
  0 siblings, 0 replies; 6+ messages in thread
From: Nikolai Weibull @ 2016-01-04 13:05 UTC (permalink / raw)
  To: Emacs Users

Hi!

Has anyone written any functionality for setting Gmail’s \Muted label
from Gnus?  I’d like to be able to mute threads in Gmail from Gnus,
but before I learn the inner workings of Gnus and nnimap I figured I’d
check if anyone’s already done the work.

Thanks!



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Gmail’s \Muted label in Gnus
       [not found] <mailman.1649.1451912715.843.help-gnu-emacs@gnu.org>
@ 2016-01-09  8:58 ` Lars Magne Ingebrigtsen
  2016-01-09  9:11   ` Nikolai Weibull
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-01-09  8:58 UTC (permalink / raw)
  To: help-gnu-emacs

Nikolai Weibull <now@disu.se> writes:

> Has anyone written any functionality for setting Gmail’s \Muted label
> from Gnus?  I’d like to be able to mute threads in Gmail from Gnus,
> but before I learn the inner workings of Gnus and nnimap I figured I’d
> check if anyone’s already done the work.

I don't think anybody's implemented support for \Muted in Gnus, but it
sounds like a useful thing to have.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Gmail’s \Muted label in Gnus
  2016-01-09  8:58 ` Lars Magne Ingebrigtsen
@ 2016-01-09  9:11   ` Nikolai Weibull
  2016-02-07  5:37     ` Lars Ingebrigtsen
  2016-02-08  5:04     ` Lars Ingebrigtsen
  0 siblings, 2 replies; 6+ messages in thread
From: Nikolai Weibull @ 2016-01-09  9:11 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: Emacs Users

On Sat, Jan 9, 2016 at 9:58 AM, Lars Magne Ingebrigtsen <lmi@gnus.org> wrote:
> Nikolai Weibull <now@disu.se> writes:
>
>> Has anyone written any functionality for setting Gmail’s \Muted label
>> from Gnus?  I’d like to be able to mute threads in Gmail from Gnus,
>> but before I learn the inner workings of Gnus and nnimap I figured I’d
>> check if anyone’s already done the work.
>
> I don't think anybody's implemented support for \Muted in Gnus, but it
> sounds like a useful thing to have.

I actually figured it out, sort of.  I’m sure there are better ways of
handling it, perhaps the + and - should be sent using
nnimap-send-command, but this, at least, works.  As only muting part
of a thread will confuse Gmail, we select all articles belonging to a
thread that in one way or another has been included by
gnus-summary-work-articles.  Then we add \Muted and remove \Inbox.
Finally, to make it clear that something happened in Gnus, we kill the
thread.  It’d perhaps be better if we could use a custom mark, but I
couldn’t figure out if that was OK to do.

(defun now-gnus-summary-mute-articles (n)
  (interactive "P")
  (let (articles root-articles)
    (dolist (article (gnus-summary-work-articles n))
      (unless (member article articles)
        (let ((parent (gnus-summary-article-parent article)))
          (while parent
            (setq article parent)
            (setq parent (gnus-summary-article-parent parent))))
        (push article root-articles)
        (if articles
            (nconc articles (gnus-summary-articles-in-thread article))
          (setq articles (gnus-summary-articles-in-thread article)))))
    (sort articles '<)
    (when (and articles
               (with-current-buffer (nnimap-buffer)
                 (and (nnimap-command "UID STORE %s +X-GM-LABELS (\\Muted)"
                                      (nnimap-article-ranges articles))
                      (nnimap-command "UID STORE %s -X-GM-LABELS (\\Inbox)"
                                      (nnimap-article-ranges articles)))))
      (apply 'gnus-summary-remove-process-mark articles)
      (dolist (article (nreverse root-articles))
        (gnus-summary-goto-subject article)
        (gnus-summary-kill-thread)))))



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Gmail’s \Muted label in Gnus
  2016-01-09  9:11   ` Nikolai Weibull
@ 2016-02-07  5:37     ` Lars Ingebrigtsen
  2016-02-07 15:58       ` Eli Zaretskii
  2016-02-08  5:04     ` Lars Ingebrigtsen
  1 sibling, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-07  5:37 UTC (permalink / raw)
  To: Nikolai Weibull; +Cc: Emacs Users

Nikolai Weibull <now@disu.se> writes:

> I actually figured it out, sort of.  I’m sure there are better ways of
> handling it, perhaps the + and - should be sent using
> nnimap-send-command, but this, at least, works.  As only muting part
> of a thread will confuse Gmail, we select all articles belonging to a
> thread that in one way or another has been included by
> gnus-summary-work-articles.  Then we add \Muted and remove \Inbox.
> Finally, to make it clear that something happened in Gnus, we kill the
> thread.  It’d perhaps be better if we could use a custom mark, but I
> couldn’t figure out if that was OK to do.
>
> (defun now-gnus-summary-mute-articles (n)
>   (interactive "P")
>   (let (articles root-articles)
>     (dolist (article (gnus-summary-work-articles n))
>       (unless (member article articles)

Looks good.  Do you have FSF copyright assignment papers on file?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Gmail’s \Muted label in Gnus
  2016-02-07  5:37     ` Lars Ingebrigtsen
@ 2016-02-07 15:58       ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2016-02-07 15:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: help-gnu-emacs

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Sun, 07 Feb 2016 16:37:11 +1100
> Cc: Emacs Users <help-gnu-emacs@gnu.org>
> 
> > (defun now-gnus-summary-mute-articles (n)
> >   (interactive "P")
> >   (let (articles root-articles)
> >     (dolist (article (gnus-summary-work-articles n))
> >       (unless (member article articles)
> 
> Looks good.  Do you have FSF copyright assignment papers on file?

Yes, he does.

Thanks.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Gmail’s \Muted label in Gnus
  2016-01-09  9:11   ` Nikolai Weibull
  2016-02-07  5:37     ` Lars Ingebrigtsen
@ 2016-02-08  5:04     ` Lars Ingebrigtsen
  1 sibling, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-08  5:04 UTC (permalink / raw)
  To: Nikolai Weibull; +Cc: Emacs Users

Nikolai Weibull <now@disu.se> writes:

> I actually figured it out, sort of.  I’m sure there are better ways of
> handling it, perhaps the + and - should be sent using
> nnimap-send-command, but this, at least, works.  As only muting part
> of a thread will confuse Gmail, we select all articles belonging to a
> thread that in one way or another has been included by
> gnus-summary-work-articles.  Then we add \Muted and remove \Inbox.
> Finally, to make it clear that something happened in Gnus, we kill the
> thread.  It’d perhaps be better if we could use a custom mark, but I
> couldn’t figure out if that was OK to do.
>
> (defun now-gnus-summary-mute-articles (n)
>   (interactive "P")
>   (let (articles root-articles)
>     (dolist (article (gnus-summary-work-articles n))

Looks good.  Can you resubmit this as a patch, and include documentation
fixes, too?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-08  5:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-04 13:05 Gmail’s \Muted label in Gnus Nikolai Weibull
     [not found] <mailman.1649.1451912715.843.help-gnu-emacs@gnu.org>
2016-01-09  8:58 ` Lars Magne Ingebrigtsen
2016-01-09  9:11   ` Nikolai Weibull
2016-02-07  5:37     ` Lars Ingebrigtsen
2016-02-07 15:58       ` Eli Zaretskii
2016-02-08  5:04     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.