From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: syntax / method for executing an emacs lisp function? Date: Tue, 30 May 2006 11:30:27 -0600 Organization: IHS Message-ID: References: <1149002530.775420.198690@38g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1149010323 17275 80.91.229.2 (30 May 2006 17:32:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 30 May 2006 17:32:03 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 30 19:32:02 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fl84O-0007wG-1L for geh-help-gnu-emacs@m.gmane.org; Tue, 30 May 2006 19:31:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fl84N-0003oE-H1 for geh-help-gnu-emacs@m.gmane.org; Tue, 30 May 2006 13:31:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fl84C-0003o7-Gv for help-gnu-emacs@gnu.org; Tue, 30 May 2006 13:31:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fl84A-0003nn-Uy for help-gnu-emacs@gnu.org; Tue, 30 May 2006 13:31:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fl84A-0003nk-SI for help-gnu-emacs@gnu.org; Tue, 30 May 2006 13:31:38 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Fl8A0-0004xX-PS for help-gnu-emacs@gnu.org; Tue, 30 May 2006 13:37:40 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Fl83z-0007r6-FU for help-gnu-emacs@gnu.org; Tue, 30 May 2006 19:31:27 +0200 Original-Received: from 207.167.42.206 ([207.167.42.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 May 2006 19:31:27 +0200 Original-Received: from ihs_4664 by 207.167.42.206 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 May 2006 19:31:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 66 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.206 User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) In-Reply-To: <1149002530.775420.198690@38g2000cwa.googlegroups.com> 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:35293 Archived-At: farbot@gmail.com wrote: > I'm writing a language mode for emacs, but have never used emacs before > (the mode is for others to use). I've searched for hours, but can't > find the incantation I need. I'd appreciate some pointers to specific > help files or techniques. First, you should read the Introduction to Programming in Emacs Lisp, which is a manual distributed with Emacs 22 in Info format and available on the web at http://www.gnu.org/software/emacs/emacs-lisp-intro/ The Emacs Lisp reference manual is distributed with Emacs in Info format, too. `C-h i' then `m Info RET' will get you started with Info, or read it online at http://www.gnu.org/software/emacs/elisp/ The Emacs Wiki is a great resource; here are two good pages, one general and one specific: http://www.emacswiki.org/cgi-bin/wiki/CategoryCode http://www.emacswiki.org/cgi-bin/wiki/CreateNewMajorMode > I'd like to run the regexp-opt command to optimize my list of keywords. > For example: > (regexp-opt '("TRUE" "FALSE") t) > > I've tried a bunch of methods from inside emacs, but it always says > there is "no match" for regexp-opt. regexp-opt is autoloaded in Emacs 22, but perhaps you need this: (require 'regexp-opt) > I've had the best luck on the > command line using 'emacs --eval' option, but one of two things > happens: 1) it dislikes my syntax (badly placed ()s, unmatched '), or > 2) it accepts the syntax, and opens emacs and shows a *scratch* buffer > in "(Lisp Interaction)" mode -- but there are no function results > present. In the *Messages* buffer, I find my command echoed, but still > no function results. Please post exactly what you did, and exactly what happened. My crystal ball is at the shop. The results of a function call given on the command line with --eval are not printed anywhere by default. > I also tried typing commands in Lisp Interaction mode -- but neither > return nor enter makes them execute. That's because RET is bound to newline in that mode. You need to type C-j, which runs eval-print-last-sexp. This is documented in the Emacs manual in the Lisp Interaction node. > I'm thinking I need to figure out how to execute from a file instead of > the command line -- since some of my keyword lists are quite long (not > sure how much fits on the command line). That's up to your shell and your OS. But putting your Emacs Lisp in its own file is a good idea anyway. > I'm running emacs 21.2.1 from the command line on Mac OS X 10.4.6. > Thanks for any pointers you might have. Read the Fine Manuals. -- Kevin