From: Tero Tilus <tero@tilus.net>
To: Sup developers <sup-devel@rubyforge.org>
Subject: [sup-devel] [PATCH] Publish hook
Date: Sun, 21 Feb 2010 22:24:17 +0200 [thread overview]
Message-ID: <1266783512-sup-8493@tilus.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]
Quite a few times I've found myself wanting to send a mail text to
etherpad/pastebin/etc or attachment doc to flicr/evernote/etc. I went
to drill an appropriately small hole to sup to enable just that.
Patch attached and online
http://github.com/terotil/sup/tree/feature-publish-attachment
--
Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
[-- Attachment #2: 0001-Publishing-hook.patch --]
[-- Type: application/octet-stream, Size: 1782 bytes --]
From e97f535e9394f1e82a66f263ec893743b48ed965 Mon Sep 17 00:00:00 2001
From: Tero Tilus <tero@tilus.net>
Date: Sun, 21 Feb 2010 22:09:56 +0200
Subject: [PATCH] Publishing hook
---
lib/sup/modes/thread-view-mode.rb | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
index 0e935a4..58207e0 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -35,6 +35,14 @@ Return value:
which will be appended by sup.
EOS
+ HookManager.register "publish", <<EOS
+Executed when a message or a chunk is requested to be published.
+Variables:
+ chunk: Redwood::Message or Redwood::Chunk::* to be published.
+Return value:
+ None.
+EOS
+
register_keymap do |k|
k.add :toggle_detailed_header, "Toggle detailed header", 'h'
k.add :show_header, "Show full message header", 'H'
@@ -59,6 +67,7 @@ EOS
k.add :edit_as_new, "Edit message as new", 'D'
k.add :save_to_disk, "Save message/attachment to disk", 's'
k.add :save_all_to_disk, "Save all attachments to disk", 'A'
+ k.add :publish, "Publish message/attachment using publish-hook", 'P'
k.add :search, "Search for messages from particular people", 'S'
k.add :compose, "Compose message to person", 'm'
k.add :subscribe_to_list, "Subscribe to/unsubscribe from mailing list", "("
@@ -388,6 +397,15 @@ EOS
end
end
+ def publish
+ chunk = @chunk_lines[curpos] or return
+ if HookManager.enabled? "publish"
+ HookManager.run "publish", :chunk => chunk
+ else
+ BufferManager.flash "Publishing hook not defined."
+ end
+ end
+
def edit_draft
m = @message_lines[curpos] or return
if m.is_draft?
--
1.5.6.5
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
next reply other threads:[~2010-02-21 20:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-21 20:24 Tero Tilus [this message]
2010-02-27 8:26 ` Rich Lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1266783512-sup-8493@tilus.net \
--to=tero@tilus.net \
--cc=sup-devel@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox