From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: grocery_stocker Newsgroups: gmane.emacs.help Subject: arguments in url question Date: Sun, 16 Mar 2008 19:25:30 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0d49795c-c0de-4def-83fb-3f96794860eb@c19g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1205747124 16117 80.91.229.12 (17 Mar 2008 09:45:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Mar 2008 09:45:24 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 17 10:45:52 2008 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.50) id 1JbBug-0002cW-8D for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Mar 2008 10:45:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JbBu6-0005gv-Il for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Mar 2008 05:45:14 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!c19g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.programming Original-Lines: 35 Original-NNTP-Posting-Host: 66.81.68.124 Original-X-Trace: posting.google.com 1205720730 29803 127.0.0.1 (17 Mar 2008 02:25:30 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 17 Mar 2008 02:25:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c19g2000prf.googlegroups.com; posting-host=66.81.68.124; posting-account=kTs1ygoAAACgG1TSoyECpovEyy-V6_8b User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20061011 Fedora/1.5.0.7-7.fc6 Firefox/1.5.0.7, gzip(gfe), gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:157084 comp.programming:251110 X-Mailman-Approved-At: Mon, 17 Mar 2008 05:39:10 -0400 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:52459 Archived-At: The following question stems from the following url http://xahlee.org/emacs/wrap-url.html The following function on his web page basically makes a url ouf given a link. (defun wrap-url-string (url &optional raw) "Make the string into a html link.\n Example: http://en.wikipedia.org/wiki/Emacs becomes Emacs=A8J. If the url is a wikipedia link, then the link text is shortened to its title. If the optional argument raw is not nil, no shortening will happen." (require 'gnus-util) (let ((linktext url)) (setq linktext (gnus-url-unhex-string linktext nil)) (if (and (not raw) (string-match "wikipedia.org" url)) (progn (setq linktext (concat (car (last (split-string linktext "/"))) "=A8J") ) ) ) (concat "" linktext "" ) ) ) What I don't get is how can a url have optional arguments. I mean wouldn't something like =A1=B0http://yahoo.com/news/3829.php=A1=B1 just be passed as one argument to the function i this case?