unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* help with function
@ 2007-11-09 21:05 someusernamehere
  2007-11-09 23:51 ` weber
  0 siblings, 1 reply; 3+ messages in thread
From: someusernamehere @ 2007-11-09 21:05 UTC (permalink / raw)
  To: help-gnu-emacs

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

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

* Re: help with function
  2007-11-09 21:05 help with function someusernamehere
@ 2007-11-09 23:51 ` weber
  2007-11-10  0:12   ` Joost Kremers
  0 siblings, 1 reply; 3+ messages in thread
From: weber @ 2007-11-09 23:51 UTC (permalink / raw)
  To: help-gnu-emacs

On Nov 9, 7:05 pm, someusernamehere <someusernameh...@gmail.com>
wrote:
> 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

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

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

* Re: help with function
  2007-11-09 23:51 ` weber
@ 2007-11-10  0:12   ` Joost Kremers
  0 siblings, 0 replies; 3+ messages in thread
From: Joost Kremers @ 2007-11-10  0:12 UTC (permalink / raw)
  To: help-gnu-emacs

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                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)

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

end of thread, other threads:[~2007-11-10  0:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-09 21:05 help with function someusernamehere
2007-11-09 23:51 ` weber
2007-11-10  0:12   ` Joost Kremers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).