[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Elisp function(s) to get the most recent n urls in a buffer
From: |
Brett Kelly |
Subject: |
Elisp function(s) to get the most recent n urls in a buffer |
Date: |
18 Jun 2006 23:22:31 -0700 |
User-agent: |
G2/0.2 |
This is my first foray into actual elisp programming, so be gentle ;)
My idea is this: I'd like to be able to execute a function in ERC
(emacs IRC client) to open a new buffer and show me the last n urls
that appear in the ERC buffer. From there, I'd like to select (using
RET) one url, have it open in my browser (using browse-url-at-point, I
imagine) and have the list buffer close and return me to the ERC buffer
from which I called the function.
So, I'm attempting to write a function that builds and returns a list
of the last n urls in a buffer. Here's what I've got so far:
(setf urllist '())
(defun get-urls (loc count)
(interactive)
(save-excursion
(goto-char loc)
(while (> count (length 'urllist))
(progn
(- (search-backward-regexp "http:") 5)
(cons (thing-at-point 'url) '(urllist))
(goto-char (- point 1)))
('urllist))))
I'm not really having a problem, per se - just looking for some
guidance and some style recommendations. Assuming this is somewhat
correct (or at least on the right track), what would be my next step?
Thanks!
- Elisp function(s) to get the most recent n urls in a buffer,
Brett Kelly <=