From: someusernamehere
Subject: Newbie question, store some in a variable
Date: 
Message-ID: <1194637527.446622.218730@i13g2000prf.googlegroups.com>
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

From: Maciej Katafiasz
Subject: Re: Newbie question, store some in a variable
Date: 
Message-ID: <fh2eac$k4n$1@news.net.uni-c.dk>
Den Fri, 09 Nov 2007 11:45:27 -0800 skrev someusernamehere:

> 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:

This group concerns itself with Common Lisp, whereas your code is about 
details of Emacs Lisp and its user interaction. Head over to comp.emacs

Cheers,
Maciej
From: someusernamehere
Subject: Re: Newbie question, store some in a variable
Date: 
Message-ID: <1194638858.132203.283230@t8g2000prg.googlegroups.com>
On Nov 9, 2:01 pm, Maciej Katafiasz <········@gmail.com> wrote:
> Den Fri, 09 Nov 2007 11:45:27 -0800 skrev someusernamehere:
>
> > 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:
>
> This group concerns itself with Common Lisp, whereas your code is about
> details of Emacs Lisp and its user interaction. Head over to comp.emacs




Well, and hot to do this in common lisp???
From: Maciej Katafiasz
Subject: Re: Newbie question, store some in a variable
Date: 
Message-ID: <fh2hk9$k4n$3@news.net.uni-c.dk>
Den Fri, 09 Nov 2007 12:07:38 -0800 skrev someusernamehere:

>> This group concerns itself with Common Lisp, whereas your code is about
>> details of Emacs Lisp and its user interaction. Head over to comp.emacs
> Well, and hot to do this in common lisp???

Mu.

CL doesn't have the concept of point, interactive functions, and the 
concept of "user input" is rather vague as well.

Cheers,
Maciej
From: Barry Fishman
Subject: Re: Newbie question, store some in a variable
Date: 
Message-ID: <m3tznt8zhf.fsf@barry_fishman.acm.org>
someusernamehere <················@gmail.com> writes:

> On Nov 9, 2:01 pm, Maciej Katafiasz <········@gmail.com> wrote:
>> Den Fri, 09 Nov 2007 11:45:27 -0800 skrev someusernamehere:
>>
>> > 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:
>>
>> This group concerns itself with Common Lisp, whereas your code is about
>> details of Emacs Lisp and its user interaction. Head over to comp.emacs
>
> Well, and hot to do this in common lisp???

What OS are you using?  Which Common Lisp?  Are you using a GUI?

The following should work with CLISP, no GUI, Firefox as the browser,
and Google as the search engine.

(setf *browser* :firefox)

(defun search-word ()
  (format *query-io* "~&Find: ")
  (finish-output *query-io*)
  (let ((line (read-line *query-io* nil nil)))
    (when line
      (let ((url (concatenate 'string "http://www.google.com/search?q=" line)))
        (browse-url url)))))

-- 
Barry Fishman
From: Rainer Joswig
Subject: Re: Newbie question, store some in a variable
Date: 
Message-ID: <joswig-65CAC8.20530509112007@news-europe.giganews.com>
In article <························@i13g2000prf.googlegroups.com>,
 someusernamehere <················@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

Looks like Emacs Lisp, right?

->  gnu.emacs.help