From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.help Subject: Re: Opening and Closing a buffer in elisp, and elisp regexp Date: Mon, 24 Jul 2006 08:53:38 +0200 Message-ID: <44C46E72.5090600@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1153724538 7911 80.91.229.2 (24 Jul 2006 07:02:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 24 Jul 2006 07:02:18 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 24 09:02:16 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 1G4uSE-0001wX-IK for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Jul 2006 09:02:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G4uSD-0001zi-Ki for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Jul 2006 03:02:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G4uS1-0001zQ-W3 for help-gnu-emacs@gnu.org; Mon, 24 Jul 2006 03:02:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G4uS0-0001yq-9g for help-gnu-emacs@gnu.org; Mon, 24 Jul 2006 03:02:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G4uS0-0001yb-3C for help-gnu-emacs@gnu.org; Mon, 24 Jul 2006 03:02:00 -0400 Original-Received: from [213.165.64.21] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1G4uT1-0005TU-Tb for help-gnu-emacs@gnu.org; Mon, 24 Jul 2006 03:03:04 -0400 Original-Received: (qmail invoked by alias); 24 Jul 2006 07:01:58 -0000 Original-Received: from N910P001.adsl.highway.telekom.at (EHLO [62.47.57.161]) [62.47.57.161] by mail.gmx.net (mp018) with SMTP; 24 Jul 2006 09:01:58 +0200 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: inkedmn@gmail.com X-Y-GMX-Trusted: 0 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:36190 Archived-At: (defun get-last-urls (count) "Build a list of the count most recent urls in the buffer" ;; Let `actual' count the actual number of urls found, calling `length' ;; in a loop is not very elegant. (let (urls (actual 0)) (save-excursion (while (and (< actual count) ; Did not find yet enough. ;; Move re-search into `and' to stop when no more matches are ;; found and set third argument to t to avoid that it barfs ;; when there are no more matches. Note: This finds only text ;; starting with "" nil t)) (setq actual (1+ actual)) ;; Use "(match-string 1)" to strip the leading "<". (add-to-list 'urls (match-string 1)))) urls))