From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.227.133.6 with SMTP id d6cs199435wbt; Wed, 1 Feb 2012 01:23:57 -0800 (PST) Received: by 10.224.188.140 with SMTP id da12mr31857636qab.49.1328088236436; Wed, 01 Feb 2012 01:23:56 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org. [205.234.109.19]) by mx.google.com with ESMTP id p1si18943850qad.37.2012.02.01.01.23.56; Wed, 01 Feb 2012 01:23:56 -0800 (PST) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 005071218284; Wed, 1 Feb 2012 04:23:54 -0500 (EST) Received: from mail-ww0-f54.google.com (mail-ww0-f54.google.com [74.125.82.54]) by rubyforge.org (Postfix) with ESMTP id B47EA1218281 for ; Wed, 1 Feb 2012 03:53:44 -0500 (EST) Received: by wgbdq12 with SMTP id dq12so910659wgb.23 for ; Wed, 01 Feb 2012 00:53:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=content-type:from:to:subject:date:message-id:user-agent :content-transfer-encoding; bh=z/M+nrfsK67HChkPJ0Uv1SjOOu8QwShMMuf9940qM/A=; b=LHNn2hganDqYZz9VlqfK4GHI6hRfPa8DAsWmJA37M8/V9iAGrM0X8k5R47NuSsV2hk 9MP7nmOLXMWY5YMmAOSRMN5mGSbiUWXDNNCVTp0dUaPNHyd6RYL3XNkG2z42Y208VeHI PnRE67d1VtY0Xid+FSgVFKVrq3q649RZDBF90= Received: by 10.180.80.8 with SMTP id n8mr40448551wix.14.1328086424060; Wed, 01 Feb 2012 00:53:44 -0800 (PST) Received: from localhost (host86-139-188-123.range86-139.btcentralplus.com. [86.139.188.123]) by mx.google.com with ESMTPS id cb8sm43317372wib.0.2012.02.01.00.53.41 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Feb 2012 00:53:42 -0800 (PST) From: Gabor Nyitrai To: sup-talk Date: Wed, 01 Feb 2012 08:53:38 +0000 Message-Id: <1328086279-sup-9116@haka> User-Agent: Sup/0.12.1 Subject: [sup-talk] keybinding to open link under cursor X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org Hello, I tried to add a keybinding hook to open a link that is on the current line, but I got lost browsing the sup source... can you help how to do this? # keybindings.rb modes['thread-view-mode'].keymap.add :open_link, "Open link on current line", "Y" class Redwood::ThreadViewMode def open_link m = @message_lines[curpos] or return ## get the link from the current line somehow # link = ... ## testing, just to see some response BufferManager.flash "#{curpos}" ## testing, write content to a file to see what we've got path = "/tmp/sup-temp.txt" File.open(path, 'w') { |io| io.write m.raw_message } ## open a browser with the link as argument # spawn "chromium-browser", link, [:in, :out, :err] => "/dev/null" end end Thanks, Gabor _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk