From: weber <hugows@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: help with function
Date: Fri, 09 Nov 2007 23:51:55 -0000 [thread overview]
Message-ID: <1194652315.389737.125330@19g2000hsx.googlegroups.com> (raw)
In-Reply-To: <1194642348.322445.52600@k35g2000prh.googlegroups.com>
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
next prev parent reply other threads:[~2007-11-09 23:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-09 21:05 help with function someusernamehere
2007-11-09 23:51 ` weber [this message]
2007-11-10 0:12 ` Joost Kremers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1194652315.389737.125330@19g2000hsx.googlegroups.com \
--to=hugows@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.