From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost ([128.39.46.106]) by mx.google.com with ESMTPSA id gi5sm11200744lbc.4.2014.01.26.23.34.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jan 2014 23:34:33 -0800 (PST) From: Gaute Hope To: sup-talk Subject: Fwd: Re: [sup] Deleting an email does not remove the inbox label (#211) Date: Mon, 27 Jan 2014 08:33:48 +0100 Message-Id: <1390808017-sup-7245@qwerzila> User-Agent: Sup/git Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-1390808029-30134-3677-339-1-=" --=-1390808029-30134-3677-339-1-= Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline This might be of interest.. --- Begin forwarded message from Christopher Corley --- From: Christopher Corley To: sup-heliotrope/sup Cc: Gaute Hope Date: Sat, 18 Jan 2014 20:37:18 +0100 Subject: Re: [sup] Deleting an email does not remove the inbox label (#211) Got it! Had to add a method to a few of the modes, and then bind a key to that method. startup.rb: ``` class Redwood::ThreadIndexMode def toggle_archived_and_deleted t = cursor_thread or return multi_toggle_archive [t] multi_toggle_deleted [t] end end class Redwood::InboxMode def archive_and_delete t = cursor_thread or return multi_archive [t] multi_toggle_deleted [t] end end class Redwood::ThreadMode def archive_and_delete_and_next archive_and_then { delete_and_next } end end ``` and keybindings.rb: ``` modes["inbox-mode"].keymap.add :archive_and_delete, "Archive and delete", :backspace modes["thread-index-mode"].keymap.add :toggle_archived_and_deleted, "Archive and delete thread", :backspace modes["thread-view-mode"].keymap.add :archive_and_delete_and_next, "Archive and delete thread, then view next", :backspace ``` Hope this helps someone out! --- Reply to this email directly or view it on GitHub: https://github.com/sup-heliotrope/sup/issues/211#issuecomment-32690777 --- End forwarded message --- --=-1390808029-30134-3677-339-1-= Content-Disposition: attachment; filename="sup-attachment-1390807517-7371.html" Content-Type: text/html; name="sup-attachment-1390807517-7371.html" Content-Transfer-Encoding: 8bit

Got it! Had to add a method to a few of the modes, and then bind a key to that method.

startup.rb:

class Redwood::ThreadIndexMode
  def toggle_archived_and_deleted
    t = cursor_thread or return
    multi_toggle_archive [t]
    multi_toggle_deleted [t]
  end
end

class Redwood::InboxMode
  def archive_and_delete
    t = cursor_thread or return
    multi_archive [t]
    multi_toggle_deleted [t]
  end
end

class Redwood::ThreadMode
  def archive_and_delete_and_next
      archive_and_then { delete_and_next }
  end
end

and keybindings.rb:

modes["inbox-mode"].keymap.add :archive_and_delete, "Archive and delete", :backspace
modes["thread-index-mode"].keymap.add :toggle_archived_and_deleted, "Archive and delete thread", :backspace
modes["thread-view-mode"].keymap.add :archive_and_delete_and_next, "Archive and delete thread, then view next", :backspace

Hope this helps someone out!


Reply to this email directly or view it on GitHub.

--=-1390808029-30134-3677-339-1-=--