From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Brett Kelly" Newsgroups: gmane.emacs.help Subject: Elisp function(s) to get the most recent n urls in a buffer Date: 18 Jun 2006 23:22:31 -0700 Organization: http://groups.google.com Message-ID: <1150698151.471076.227210@r2g2000cwb.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1150699228 5164 80.91.229.2 (19 Jun 2006 06:40:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 19 Jun 2006 06:40:28 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 19 08:40:27 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FsDQw-0003Iu-UJ for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Jun 2006 08:40:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsDQw-0007la-Dg for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Jun 2006 02:40:26 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!r2g2000cwb.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 70.37.88.230 Original-X-Trace: posting.google.com 1150698156 1748 127.0.0.1 (19 Jun 2006 06:22:36 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 19 Jun 2006 06:22:36 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: r2g2000cwb.googlegroups.com; posting-host=70.37.88.230; posting-account=tPBwAg0AAAD499FHFjkAuzZlSt66eJzv Original-Xref: shelby.stanford.edu gnu.emacs.help:139915 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35539 Archived-At: 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!