[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
arguments in url question
From: |
grocery_stocker |
Subject: |
arguments in url question |
Date: |
Sun, 16 Mar 2008 19:25:30 -0700 (PDT) |
User-agent: |
G2/1.0 |
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
<a href=\"http://en.wikipedia.org/wiki/Emacs\">Emacs�J</a>.
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
"/"))) "�J") )
)
)
(concat "<a href=\"" url "\">" linktext "</a>" )
)
)
What I don't get is how can a url have optional arguments. I mean
wouldn't something like
“http://yahoo.com/news/3829.php”
just be passed as one argument to the function i this case?
- arguments in url question,
grocery_stocker <=