Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to remove draft label #226

Closed
tsaitgaist opened this issue Feb 9, 2014 · 2 comments
Closed

unable to remove draft label #226

tsaitgaist opened this issue Feb 9, 2014 · 2 comments

Comments

@tsaitgaist
Copy link

I have a draft mail in my inbox, which never got sent.
I can't edit nor send it anymore, as I run into the same exception described in #220 .
I don't use any gmail account. This draft mail was created in sup itself.
I'm trying to get rid of it (e.g. remove the draft label).
As draft is a protected label, I can't remove it within sup use the 'l' keybinding. Thus I tried to use sup-tweak-labels.
Since sent.mbox is not in the source list, I used "sup-tweak-labels -r draft --all-sources", but run into yet another exception (in ruby 2.1 and 1.9):

$ sup-tweak-labels -r draft --all-sources
[2014-02-09 18:22:10 +0100] using character set encoding "UTF-8"
[2014-02-09 18:22:10 +0100] locking .sup/lock...
[2014-02-09 18:22:10 +0100] translated query: "(source_id:1 OR source_id:2 OR source_id:3 OR source_id:4 OR source_id:9999 OR source_id:9998) (label:draft)"
[2014-02-09 18:22:10 +0100] parsed xapian query: Xapian::Query(((0 * I1 OR 0 * I2 OR 0 * I3 OR 0 * I4 OR 0 * I9999 OR 0 * I9998) AND 0 * Ldraft))
.gem/ruby/2.1.0/gems/sup-0.15.4/bin/sup-tweak-labels:88: warning: Enumerator.new without a block is deprecated; use Object#to_enum
Found 5 documents across 6 sources. Scanning...
[2014-02-09 18:22:11 +0100] saving index and sources...
[2014-02-09 18:22:11 +0100] Flushing Xapian updates to disk. This may take a while...
[2014-02-09 18:22:11 +0100] unlocking .sup/lock...
.gem/ruby/2.1.0/gems/sup-0.15.4/lib/sup/index.rb:137:in `update_message_state': undefined method `[]' for #<Redwood::Message:0x000000014a6ae0> (NoMethodError)
    from .gem/ruby/2.1.0/gems/sup-0.15.4/bin/sup-tweak-labels:109:in `block in <top (required)>'
    from .gem/ruby/2.1.0/gems/sup-0.15.4/lib/sup/index.rb:284:in `block in each_id'
    from .gem/ruby/2.1.0/gems/sup-0.15.4/lib/sup/index.rb:284:in `each'
    from .gem/ruby/2.1.0/gems/sup-0.15.4/lib/sup/index.rb:284:in `each_id'
    from .gem/ruby/2.1.0/gems/sup-0.15.4/bin/sup-tweak-labels:95:in `each'
    from .gem/ruby/2.1.0/gems/sup-0.15.4/bin/sup-tweak-labels:95:in `<top (required)>'
    from .gem/ruby/2.1.0/bin/sup-tweak-labels:23:in `load'
    from .gem/ruby/2.1.0/bin/sup-tweak-labels:23:in `<main>'

Any advice what I could do next?

@cscorley
Copy link
Contributor

You could try something like what I've done in #211. These hooks might work to simply remove the label:

startup.rb:

class Redwood::InboxMode
  def remove_draft_label
    t = cursor_thread or return
    if t.is_draft?
      t.remove_label :draft
    end
  end
end

keybindings.rb:

modes["inbox-mode"].keymap.add :remove_draft_label, "Remove draft label", "w"

Also, is deleting the draft not an option?

@gauteh
Copy link
Member

gauteh commented Feb 11, 2014

Duplicates: #220, #225.

@gauteh gauteh closed this as completed Feb 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants