From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: emacs evaluating Date: Sat, 07 Feb 2009 15:18:23 +0100 Organization: Informatimago Message-ID: <87prhufhzk.fsf@galatea.local> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1234017651 24821 80.91.229.12 (7 Feb 2009 14:40:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Feb 2009 14:40:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 07 15:42:05 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LVoNg-0004Yo-0S for geh-help-gnu-emacs@m.gmane.org; Sat, 07 Feb 2009 15:42:04 +0100 Original-Received: from localhost ([127.0.0.1]:46711 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVoMM-0000Fy-CP for geh-help-gnu-emacs@m.gmane.org; Sat, 07 Feb 2009 09:40:42 -0500 Original-Followup-To: gnu.emacs.help Original-Newsgroups: comp.lang.lisp,gnu.emacs.help Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin) Cancel-Lock: sha1:NjA0MDdmNjVlNjM2NzhmYTRhOWU4ZTZmNGYwYzcyMTRmZDJjNWUyZA== Original-Lines: 70 Original-NNTP-Posting-Date: 07 Feb 2009 15:18:24 MET Original-NNTP-Posting-Host: 88.182.134.169 Original-X-Trace: 1234016304 news-3.free.fr 15784 88.182.134.169:62336 Original-X-Complaints-To: abuse@proxad.net Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!feed.ac-versailles.fr!proxad.net!feeder1-2.proxad.net!212.27.60.64.MISMATCH!cleanfeed3-b.proxad.net!nnrp18-2.free.fr!not-for-mail Original-Xref: news.stanford.edu comp.lang.lisp:260298 gnu.emacs.help:166663 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61973 Archived-At: "Haris Bogdanović" writes: > "Haris Bogdanović" wrote in message > news:gmir6e$cno$1@gregory.bnet.hr... >> Hi. >> >> When I write a function in emacs, how can I try it ? Emacs questions are better asked on news:gnu.emacs.help Type C-x C-e with the point after the function source to enter it into the emacs lisp image. They type (your-function your-argument) C-x C-e to evaluate it. If you type C-y C-x C-e instead, the result of the expression will be inserted in the buffer at the point. (+ 1 2) C-u C-x C-e --> 3 (defun f (x) (if (< x 1) 1 (* x (f (1- x))))) C-x C-e (f 9) C-u C-x C-e --> 362880 You don't need to compile your emacs lisp functions to use them. At least not until they're debugged. >> Can I open some window (buffer) for evaluating ? Yes. M-x ielm RET gives you an interactive REPL to emacs lisp. > When I try to compile function it gives me "make -k" command, I press enter > and I get error message. > Does emacs have lisp interpreter or I have to install it separatelly ? You can get information about what an emacs command purpose is with: C-h f compile RET As you can see, compile has nothing to do with compiling emacs lisp code. It could be used to compile an emacs lisp source, if you defined a Makefile or used the emacs command to do so. For example, you could use: emacs --eval '(byte-compile-file "source.el")' to compile source.el into source.elc with emacs. But we prefer to do it more interactively in lisp: To compile a function: (byte-compile 'your-function) C-x C-e To compile an emacs lisp source file: M-x byte-compile-file RET source.el RET To load an emacs lisp source: M-x load-file RET source.el RET To evaluate a while buffer: M-x eval-buffer RET -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ----------> http://www.netmeister.org/news/learn2quote.html <----------- ---> http://homepage.ntlworld.com/g.mccaughan/g/remarks/uquote.html <--- __Pascal Bourguignon__ http://www.informatimago.com/