all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* arguments in url question
@ 2008-03-17  2:25 grocery_stocker
  2008-03-17  3:16 ` Ben Pfaff
  0 siblings, 1 reply; 5+ messages in thread
From: grocery_stocker @ 2008-03-17  2:25 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=GB2312, Size: 1081 bytes --]

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?


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-17 21:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-17  2:25 arguments in url question grocery_stocker
2008-03-17  3:16 ` Ben Pfaff
2008-03-17  4:00   ` Chad
2008-03-17  4:09     ` Ben Pfaff
2008-03-17 21:34       ` Barry Margolin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.