From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ken Newsgroups: gmane.emacs.help Subject: Re: Retrieve a web page into buffer and insert some text into it. Date: Wed, 28 Jul 2010 19:46:37 -0400 Message-ID: <4C50C15D.6000808@mousecar.com> References: <4C504E73.6050207@mousecar.com> Reply-To: GNU Emacs List NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1280360860 21617 80.91.229.12 (28 Jul 2010 23:47:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 28 Jul 2010 23:47:40 +0000 (UTC) To: GNU Emacs List Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 29 01:47:38 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OeGLa-0006aH-53 for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Jul 2010 01:47:38 +0200 Original-Received: from localhost ([127.0.0.1]:35048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OeGLZ-0007cs-QH for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Jul 2010 19:47:37 -0400 Original-Received: from [140.186.70.92] (port=47043 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OeGL8-0007cl-Fv for help-gnu-emacs@gnu.org; Wed, 28 Jul 2010 19:47:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OeGL6-0002pG-Tt for help-gnu-emacs@gnu.org; Wed, 28 Jul 2010 19:47:10 -0400 Original-Received: from mout.perfora.net ([74.208.4.194]:49386) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeGL6-0002p4-Mt for help-gnu-emacs@gnu.org; Wed, 28 Jul 2010 19:47:08 -0400 Original-Received: from dellap.mousecar.net (dsl093-011-017.cle1.dsl.speakeasy.net [66.93.11.17]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0M9IcY-1Oqxdu1Uys-00CBtB; Wed, 28 Jul 2010 19:47:06 -0400 User-Agent: Thunderbird 2.0.0.24 (X11/20100721) In-Reply-To: <4C504E73.6050207@mousecar.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=5AD091E7 X-Provags-ID: V02:K0:ChiG0N3ihDhtBi+LWJqhB2sUKdxqd19oE0JK/uLhDA+ ZOzWjst9lHP9FMZUEzczJ8Z5Sqs2n1FzIwBo4ZGyu6Fqsc+/rQ mW/J36dECCm5a0dX1g7Ym0esztlq4O3ETmrSytKatU8g/QQTYl oRkYUX36vEY4aOA+Ed2Wze3lMqT3x7W/zIrMWBMOqLb4POja3q RvLTS6vQ9lSYELgtdzJVkQ5Fg9q40D6BUQaKSAcscc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:74330 Archived-At: Lennart suggested I use a different defun, url-copy-file. I tried that instead, but it didn't work. But then I went back to my original code, moved a single parenthesis and... it worked... mostly. Here's the code: ------------------------ start --------------------------- load url.el (defun www-edit-web-page (url) "Retrieve web page and load into new buffer for editing. Automatically insert after tag URL, appropriately html-tagged URL." (interactive "sLoad URL: ") (with-temp-buffer (url-retrieve url 'edit-web-page))) (defun edit-web-page (status) "Switch to the buffer returned by `url-retreive'. The buffer should contain the web page sent by the server." (switch-to-buffer (current-buffer)) (goto-char 0) (re-search-forward "" nil t) ;go to end of tag. ;insert URL into page (insert "\n

From: " url "\n

\n\n")) ------------------------ ende --------------------------- This properly fetches the web page and loads it into a new, unsaved buffer (exactly what I want), but the last line in the second defun doesn't execute. The error messages are telling me that edit-web-page doesn't know the value of "url". So how do I pass this variable-- with its assignment from www-edit-web-page to edit-web-page? (I have a guess, but i'm more a C/bash/blah/blah/blah guy, so elisp is a bit mysterious.)