Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help with function

0 views
Skip to first unread message

someusernamehere

unread,
Nov 9, 2007, 4:05:48 PM11/9/07
to
Hey, I need some help, how I can write a simple lisp code which ask
for a value, after store in a variable, indeed I want to the value is
concatenate to an url, I have the following:

which found on google:

(defun search-word ()
(interactive)
(browse-url
(concat "http://foo.bar.foobar/index.php?search="
(thing-at-point 'word))))

but this is only with the word at point, I want ask a word, any help?

thanks

weber

unread,
Nov 9, 2007, 6:51:55 PM11/9/07
to
On Nov 9, 7:05 pm, someusernamehere <someusernameh...@gmail.com>
wrote:

Well, that was an easy one ;)


(defun search-word ()
(interactive)
(browse-url
(concat "http://foo.bar.foobar/index.php?search="

(read-from-minibuffer "Word: "))))

If you really want to store the value into a variable do this:

(defun search-word ()
"Search for a word in foo bar"
(interactive)
(let ((word (read-from-minibuffer "Word: ")))
(browse-url
(concat "http://foo.bar.foobar/index.php?search=" word))))

bye
weber

Joost Kremers

unread,
Nov 9, 2007, 7:12:29 PM11/9/07
to
weber wrote:
> (defun search-word ()
> (interactive)
> (browse-url
> (concat "http://foo.bar.foobar/index.php?search="
> (read-from-minibuffer "Word: "))))

(defun search-word (word)
(interactive "sWord: ")
(browse-url (concat "http://foo.bar.foobar/index.php?search=" word)))

--
Joost Kremers joostk...@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)

0 new messages