Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

newbie needs to be bailed out

29 views
Skip to first unread message

Kim Young

unread,
Jan 4, 2012, 2:22:36 PM1/4/12
to help-gn...@gnu.org
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.


John "Kim" Young
1663 71st Street
Brooklyn, NY 11204
(917) 620-5562
kimy...@mac.com




Peter Dyballa

unread,
Jan 4, 2012, 2:45:12 PM1/4/12
to Kim Young, help-gn...@gnu.org

Am 04.01.2012 um 20:22 schrieb Kim Young:

> 1. What is the command to determine the version of emacs that is provided with lion?

emacs --version

>
> 2. How do I enable color highlighting for syntext?

Use a colour terminal!

--
Greetings

Pete

Government is actually the worst failure of civilized man. There has never been a really good one, and even those that are most tolerable are arbitrary, cruel, grasping and unintelligent.
– H. L. Mencken


Dan Espen

unread,
Jan 4, 2012, 2:58:25 PM1/4/12
to
Peter Dyballa <Peter_...@Web.DE> writes:

> Am 04.01.2012 um 20:22 schrieb Kim Young:
>
>> 1. What is the command to determine the version of emacs that is provided with lion?
>
> emacs --version
>
>>
>> 2. How do I enable color highlighting for syntext?
>
> Use a colour terminal!

Never used a mac but wouldn't the X or Native AquaEmacs be a better
choice. At least a new user would have an easy to use
menubar to look for things.

(Besides getting more colors.)

--
Dan Espen

Pascal J. Bourguignon

unread,
Jan 4, 2012, 3:12:16 PM1/4/12
to
Running emacs on X would good. Notice that the emacs distributed by
Apple is not compiled with X support: you'd have to compile your own
emacs.

Otherwise Aquamacs would be bad.
The good emacs to run on Aqua is http://emacsformacosx.com


--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.

Philipp Haselwarter

unread,
Jan 4, 2012, 5:40:14 PM1/4/12
to Peter Dyballa, help-gn...@gnu.org, Kim Young
Peter Dyballa <Peter_...@Web.DE> writes:

> Am 04.01.2012 um 20:22 schrieb Kim Young:
>
>> 1. What is the command to determine the version of emacs that is provided with lion?
>
> emacs --version
>
>>
>> 2. How do I enable color highlighting for syntext?
>
> Use a colour terminal!
>
---8<---[snipped 10 lines]---8<---

Or emacs in graphical mode; also make sure to turn on
`global-font-lock-mode'.

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

With emacs come `abbrev.el' and `skeleton.el', I like `yasnippet' very
much. Make sure to take a look at the emacswiki:
http://www.emacswiki.org/emacs/CategoryTemplates

--
Philipp Haselwarter

Jai Dayal

unread,
Jan 4, 2012, 6:54:31 PM1/4/12
to Kim Young, help-gn...@gnu.org
1) in terminal type, emacs --version

2) in emacs, type "M-x" and then type global-font-lock-mode  M stands for "meta" and is generally the ALT key.

3) what the other guy said

On Wed, Jan 4, 2012 at 2:22 PM, Kim Young <kimy...@me.com> 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?

Peter Dyballa

unread,
Jan 4, 2012, 6:57:00 PM1/4/12
to Philipp Haselwarter, help-gn...@gnu.org, Kim Young

Am 04.01.2012 um 23:40 schrieb Philipp Haselwarter:

>>> 2. How do I enable color highlighting for syntext?
>>
>> Use a colour terminal!
>>
> ---8<---[snipped 10 lines]---8<---
>
> Or emacs in graphical mode; also make sure to turn on
> `global-font-lock-mode'.

Such Emacsen do not come with Mac OS X. (Presumingly the best integrated one is the "AppKit Emacs" based on GNU Emacs 23.3 – it has to be compiled by one-self. Once you install X11 you could also use the X11 variant of either GNU Emacs 23.3 or the coming GNU Emacs 24.1.)

Marko Vojinovic

unread,
Jan 4, 2012, 7:14:36 PM1/4/12
to help-gn...@gnu.org
On Wednesday 04 January 2012 18:54:31 Jai Dayal wrote:
> On Wed, Jan 4, 2012 at 2:22 PM, Kim Young <kimy...@me.com> wrote:
> > 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?
>
> 1) in terminal type, emacs --version

This maybe doesn't apply to the OP, but I've seen MacOSX users who don't even
know what a "terminal" is, let alone how to open one (being a Linux user
myself, I also had some trouble finding a way to open a terminal when I first
sat in front of a Mac machine on one occasion).

So, is there a way to find out the emacs version from within a running emacs
instance itself?

Best, :-)
Marko



Jai Dayal

unread,
Jan 4, 2012, 7:16:48 PM1/4/12
to Marko Vojinovic, help-gn...@gnu.org
Hmm, good question.  All though, the OP did state he was using it to write shell scripts, others might not know.

I honestly don't know.

Drew Adams

unread,
Jan 4, 2012, 7:20:46 PM1/4/12
to Marko Vojinovic, help-gn...@gnu.org
> is there a way to find out the emacs version from within
> a running emacs instance itself?

M-x emacs-version


Barry Margolin

unread,
Jan 4, 2012, 7:49:18 PM1/4/12
to
In article <mailman.1187.132572142...@gnu.org>,
Peter Dyballa <Peter_...@Web.DE> wrote:

> Am 04.01.2012 um 23:40 schrieb Philipp Haselwarter:
>
> >>> 2. How do I enable color highlighting for syntext?
> >>
> >> Use a colour terminal!
> >>
> > ---8<---[snipped 10 lines]---8<---
> >
> > Or emacs in graphical mode; also make sure to turn on
> > `global-font-lock-mode'.
>
> Such Emacsen do not come with Mac OS X. (Presumingly the best integrated one
> is the "AppKit Emacs" based on GNU Emacs 23.3 ­ it has to be compiled by
> one-self. Once you install X11 you could also use the X11 variant of either
> GNU Emacs 23.3 or the coming GNU Emacs 24.1.)

I'm still using the Carbon Emacs build of 22.2 from 2008. What recent
version would probably be the smoothest transition from this?

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

Eric Abrahamsen

unread,
Jan 4, 2012, 10:18:18 PM1/4/12
to help-gn...@gnu.org
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
> kimy...@mac.com
>
>
>
>
>

--
GNU Emacs 24.0.92.2 (i686-pc-linux-gnu, GTK+ Version 2.24.8)
of 2012-01-04 on pellet


Peter Dyballa

unread,
Jan 5, 2012, 7:32:04 AM1/5/12
to Marko Vojinovic, help-gn...@gnu.org

Am 5.1.2012 um 01:14 schrieb Marko Vojinovic:

> This maybe doesn't apply to the OP, but I've seen MacOSX users who don't even
> know what a "terminal" is, let alone how to open one (being a Linux user
> myself, I also had some trouble finding a way to open a terminal when I first
> sat in front of a Mac machine on one occasion).

Apple adds some documentation to the released DVDs which explain such basic things. It's mostly English, though... and has to be read by oneself, it does not speak.

>
> So, is there a way to find out the emacs version from within a running emacs
> instance itself?

How can you determine that when you can't launch a terminal in which GNU Emacs runs?

--
Greetings

Pete

If we don't succeed, we run the risk of failure.
– George W. Bush


Xah Lee

unread,
Jan 6, 2012, 11:48:06 AM1/6/12
to
On Jan 4, 11:22 am, Kim Young <kimyo...@me.com> 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.

here's some recommendations for Mac.

• If you use emacs in a Terminal always, then the one bundled with Mac
OS X 10.5 is fine.

• color syntax is on by default. If not, type 【Alt+x font-lock-mode
Enter】

• if you use emacs a lot, and want to use it outside of Terminal, i
recommend AquaMacs emacs or Carbon Emacs. See: 〈Which Emacs to
Download for Windows and Mac?〉 @ http://xahlee.org/emacs/which_emacs.html

• for template, you can install yasnippet. See: 〈Emacs Templates with
YASnippet〉 @ http://xahlee.org/emacs/emacs_templates.html

Xah
0 new messages