unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Brett  Kelly" <inkedmn@gmail.com>
Subject: Elisp function(s) to get the most recent n urls in a buffer
Date: 18 Jun 2006 23:22:31 -0700	[thread overview]
Message-ID: <1150698151.471076.227210@r2g2000cwb.googlegroups.com> (raw)

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!

             reply	other threads:[~2006-06-19  6:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-19  6:22 Brett  Kelly [this message]
2006-06-19 15:16 ` Elisp function(s) to get the most recent n urls in a buffer vfoley

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1150698151.471076.227210@r2g2000cwb.googlegroups.com \
    --to=inkedmn@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).