From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: newbie needs to be bailed out Date: Thu, 05 Jan 2012 11:18:18 +0800 Message-ID: <87fwfudeh1.fsf@ericabrahamsen.net> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1325733521 25100 80.91.229.12 (5 Jan 2012 03:18:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Jan 2012 03:18:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 05 04:18:38 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ridqg-0006Ej-3j for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Jan 2012 04:18:38 +0100 Original-Received: from localhost ([::1]:54749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ridqf-0000SF-Dc for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Jan 2012 22:18:37 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ridqa-0000Rz-Sw for help-gnu-emacs@gnu.org; Wed, 04 Jan 2012 22:18:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RidqZ-0002f0-Nd for help-gnu-emacs@gnu.org; Wed, 04 Jan 2012 22:18:32 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:37930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RidqZ-0002ew-IP for help-gnu-emacs@gnu.org; Wed, 04 Jan 2012 22:18:31 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RidqX-0006BS-U2 for help-gnu-emacs@gnu.org; Thu, 05 Jan 2012 04:18:29 +0100 Original-Received: from 114.250.133.120 ([114.250.133.120]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Jan 2012 04:18:29 +0100 Original-Received: from eric by 114.250.133.120 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Jan 2012 04:18:29 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 51 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 114.250.133.120 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.92 (gnu/linux) Cancel-Lock: sha1:dpL9BMT3QYtwZ4VNz78Z3qRSvwk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83337 Archived-At: On Thu, Jan 05 2012, Kim Young wrote: > Hello, > > I am running Mac os x lion and I want to use emacs to try to write > some shell scripts for work. I am new to emacs so I would like help > with some very basic things. > > 1. What is the command to determine the version of emacs that is provided with lion? > > 2. How do I enable color highlighting for syntext? > > 3 How do I get a list of the command sequences that auto generate > things like "for", "while" and "do" loops for the various languages > (C++, ruby, etc) I might use? > > Thanks for any help you can give me. In addition to what everyone else has said… Assuming you are already *in* emacs and using it to write bash scripts, you want to find the "major mode" that corresponds with your file. When I open, for instance, ~/.bashrc, it goes into shell-script mode, and on the mode line I see (Shell-script[bash]). So emacs knows I'm editing a shell script, and knows it's a bash script. This major mode (see (info "(emacs)Modes")) provides both the syntax highlighting you're looking for, and also helpful commands for language constructs. All the major languages (C++, ruby, etc) have their own major modes, that provide the correct highlighting and give you helper functions. Hope that's what you were asking! Read the manual! Eric > > John "Kim" Young > 1663 71st Street > Brooklyn, NY 11204 > (917) 620-5562 > kimyoung@mac.com > > > > > -- GNU Emacs 24.0.92.2 (i686-pc-linux-gnu, GTK+ Version 2.24.8) of 2012-01-04 on pellet