Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] keybinding to open link under cursor
@ 2012-01-31  8:54 Gabor Nyitrai
  2012-01-31 14:26 ` Alvaro Herrera
  2012-02-01  3:16 ` Michael Stapelberg
  0 siblings, 2 replies; 3+ messages in thread
From: Gabor Nyitrai @ 2012-01-31  8:54 UTC (permalink / raw)
  To: sup-devel

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... how do I this? I got this much:

# 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 =~ /http:\/\/[^ ]+/
        
        # 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-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


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

* Re: [sup-devel] keybinding to open link under cursor
  2012-01-31  8:54 [sup-devel] keybinding to open link under cursor Gabor Nyitrai
@ 2012-01-31 14:26 ` Alvaro Herrera
  2012-02-01  3:16 ` Michael Stapelberg
  1 sibling, 0 replies; 3+ messages in thread
From: Alvaro Herrera @ 2012-01-31 14:26 UTC (permalink / raw)
  To: sup-devel


Excerpts from Gabor Nyitrai's message of mar ene 31 05:54:29 -0300 2012:
> 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... how do I this? I got this much:

I'm interested, so if you make it work please post it.

How would you handle a link that's longer than the current line?  I
don't know anything about the buffer implementation, so it seems
possible a wrapped line appears just as two lines; other representations
(such as a logical line being composed of more than one physical line)
would make more sense, but I have no idea how to do that or whether it's
even possible.

-- 
Álvaro Herrera <alvherre@alvh.no-ip.org>
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

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

* Re: [sup-devel] keybinding to open link under cursor
  2012-01-31  8:54 [sup-devel] keybinding to open link under cursor Gabor Nyitrai
  2012-01-31 14:26 ` Alvaro Herrera
@ 2012-02-01  3:16 ` Michael Stapelberg
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Stapelberg @ 2012-02-01  3:16 UTC (permalink / raw)
  To: sup-devel

Hi Gabor,

Excerpts from Gabor Nyitrai's message of 2012-01-31 08:54:29 +0000:
> 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... how do I this? I got this much:
Isn’t that a feature which should rather go into the terminal emulator? For
urxvt, there is the mark-and-yank script:
https://github.com/bartman/urxvt-scripts

Best regards,
Michael
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

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

end of thread, other threads:[~2012-02-01  3:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-31  8:54 [sup-devel] keybinding to open link under cursor Gabor Nyitrai
2012-01-31 14:26 ` Alvaro Herrera
2012-02-01  3:16 ` Michael Stapelberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox