unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs newbie - Syntax Highlighting and Indentation
@ 2003-11-14 15:52 David Rasmussen
  2003-11-14 17:13 ` Uwe Siart
                   ` (7 more replies)
  0 siblings, 8 replies; 21+ messages in thread
From: David Rasmussen @ 2003-11-14 15:52 UTC (permalink / raw)


I've installed the Windows version of Emacs 21.3.1.
I have read some tutorials, but I have two questions (for now):

1) How do I enable syntax highlighting by default, for any type of file 
/ extension / mode that supports it? I have enabled it in the Options 
menu, and saved my options. But isn't there a non-menu-way of doing 
this, so I can get to learn and understand how to configure emacs myself?

2) When I edit a java file, the Java major mode i automatically loaded. 
But when I press TAB at the beginning of a new line, i get an 
indentation of 4 spaces. How do I alter this to 2 spaces instead? Or any 
other number of spaces? What if I want to get a tab character instead of 
spaces, when indenting (I really don't, but I would like to know)?

TIA!

/David

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-14 15:52 Emacs newbie - Syntax Highlighting and Indentation David Rasmussen
@ 2003-11-14 17:13 ` Uwe Siart
  2003-11-14 17:48 ` Jiri Pejchal
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 21+ messages in thread
From: Uwe Siart @ 2003-11-14 17:13 UTC (permalink / raw)


David Rasmussen wrote:

> 1) How do I enable syntax highlighting by default, for any type of file 
> / extension / mode that supports it?

Put

   (global-font-lock-mode t)

in one of your startup files (~/.emacs or site-start.el, or whatever).

-- 
Uwe

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-14 15:52 Emacs newbie - Syntax Highlighting and Indentation David Rasmussen
  2003-11-14 17:13 ` Uwe Siart
@ 2003-11-14 17:48 ` Jiri Pejchal
  2003-11-14 18:08 ` Michael M Mason
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 21+ messages in thread
From: Jiri Pejchal @ 2003-11-14 17:48 UTC (permalink / raw)


David Rasmussen <david.rasmussen@gmx.net> writes:

> I've installed the Windows version of Emacs 21.3.1.
> I have read some tutorials, but I have two questions (for now):
> 
> 1) How do I enable syntax highlighting by default, for any type of
>    file / extension / mode that supports it? I have enabled it in the
>    Options menu, and saved my options. But isn't there a non-menu-way
>    of doing this, so I can get to learn and understand how to
>    configure emacs myself?



Put (global-font-lock-mode 1) in your .emacs (maybe it's _emacs on
Windows) -- that is configuration file for Emacs. (You don't have to do
it if you have saved the options).

Start with Control-h t --> tutorial
Then you can start reading manual: Control-h i Emacs RETURN


> 
> 2) When I edit a java file, the Java major mode i automatically
>    loaded. But when I press TAB at the beginning of a new line, i get
>    an indentation of 4 spaces. How do I alter this to 2 spaces

(setq c-basic-offset 2) 

>    instead? Or any other number of spaces? What if I want to get a tab
>    character instead of spaces, when indenting (I really don't, but I
>    would like to know)?

Everything is possible, just read the manual:-)

--
Jiri Pejchal

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-14 15:52 Emacs newbie - Syntax Highlighting and Indentation David Rasmussen
  2003-11-14 17:13 ` Uwe Siart
  2003-11-14 17:48 ` Jiri Pejchal
@ 2003-11-14 18:08 ` Michael M Mason
  2003-11-14 18:20 ` Artur Hefczyc
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 21+ messages in thread
From: Michael M Mason @ 2003-11-14 18:08 UTC (permalink / raw)


On Fri, 14 Nov 2003 16:52:12 +0100, David Rasmussen
<david.rasmussen@gmx.net> wrote:

>I've installed the Windows version of Emacs 21.3.1.
>I have read some tutorials, but I have two questions (for now):
>
>1) How do I enable syntax highlighting by default, for any type of file 
>/ extension / mode that supports it? I have enabled it in the Options 
>menu, and saved my options. But isn't there a non-menu-way of doing 
>this, so I can get to learn and understand how to configure emacs myself?

Customisations are saved in a file called .emacs which is
stored in your home directory.  Unless you've taken steps to
tell it otherwise, Emacs will very probably be using the
root directory of your C: drive as your home directory.  You
can open your .emacs using C-x C-f and specifying ~/.emacs
as the filename.

In order to find out what you can put in your .emacs, select
"Read the Emacs Manual" from the "Help" menu and check out
the "Init File" sections.  You will probably also want to
have a look at "font-locking" (the name for syntax
highlighting).  The commands that you will most likely want
to put in your .emacs are:

(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
(transient-mark-mode t)

There's a lot of Windows-specific information at:

http://www.gnu.org/software/emacs/windows/faq.html

and there's plenty of .emacs stuff at:

http://www.dotemacs.de/

-- 
Michael

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-14 15:52 Emacs newbie - Syntax Highlighting and Indentation David Rasmussen
                   ` (2 preceding siblings ...)
  2003-11-14 18:08 ` Michael M Mason
@ 2003-11-14 18:20 ` Artur Hefczyc
  2003-11-15 14:18   ` David Rasmussen
       [not found] ` <david.rasmussen@gmx.net>
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Artur Hefczyc @ 2003-11-14 18:20 UTC (permalink / raw)


David Rasmussen <david.rasmussen@gmx.net> writes:
> 1) How do I enable syntax highlighting by default, for any type of file /
>    extension / mode that supports it? I have enabled it in the Options menu, and
>    saved my options. But isn't there a non-menu-way of doing this, so I can get
>    to learn and understand how to configure emacs myself?

Right way to customize emacs is to edit .emacs file in your home
directory. It is easy to find on Unix like systems but windows have
'home' directory in many different locations. So I suggest to look for
your .emacs file on HDD. It should be there, because you saved your settings.

It contains elisp code in most cases setting many different variables.
Here is my .emacs file in use on both systems - Windows and Linux:
http://wttools.sourceforge.net/emacs-stuff/emacs.html

It is rather big file but don't panic, you don't need to start with all
these settings. Many of them are commented in this file.

> 2) When I edit a java file, the Java major mode i automatically loaded. But when
>    I press TAB at the beginning of a new line, i get an indentation of 4
>    spaces. How do I alter this to 2 spaces instead? Or any other number of
>    spaces? What if I want to get a tab character instead of spaces, when
>    indenting (I really don't, but I would like to know)?

The shortest answer to your question is:

Put to your .emacs file following code:
(setq c-basic-offset 2)

Other setting you might find useful for Java coding are:
(setq tab-width 4
      indent-tabs-mode nil)

However for Java coding I recommend JDEE package for emacs. I have been
using it for 3 years and I am very satisfied with it.
You can find more information about (installation, setup and use) it in
article I work on at following address:
http://wttools.sourceforge.net/emacs-stuff/emacsandjdee.html

If you need more info just ask.

Artur
-- 
Artur Hefczyc, Open Source Developer:
http://www.geotools.org/
http://generguide.sourceforge.net/
http://wttools.sourceforge.net/
http://maven-plugins.sourceforge.net/

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
       [not found] ` <david.rasmussen@gmx.net>
@ 2003-11-14 19:07   ` Peter S Galbraith
  2003-11-15  1:11   ` Peter S Galbraith
  1 sibling, 0 replies; 21+ messages in thread
From: Peter S Galbraith @ 2003-11-14 19:07 UTC (permalink / raw)
  Cc: help-gnu-emacs

David Rasmussen <david.rasmussen@gmx.net> wrote:

> I've installed the Windows version of Emacs 21.3.1.
> I have read some tutorials, but I have two questions (for now):
> 
> 1) How do I enable syntax highlighting by default

I'm a little disappointed (but not surprised) that everyone replying
so far says to edit the .emacs file.

The simple and user-friendly answer is to use the Options menu, enable
Syntax Highlighting and then Save Options.

I'm also encouraging new users to use the custom interface rather than
scaring them with elisp edits.

My two cents.

-- 
Peter S. Galbraith <p.galbraith@globetrotter.net>
GPG key 1024/D2A913A1 - 97CE 866F F579 96EE  6E68 8170 35FF 799E
6623'rd GNU/Linux user at the Counter - http://counter.li.org/

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
       [not found] ` <mailman.86.1068840578.399.help-gnu-emacs@gnu.org>
@ 2003-11-14 21:33   ` Bruce Ingalls
  2003-11-14 22:01     ` Stefan Monnier
  2003-11-14 23:15   ` David Rasmussen
  1 sibling, 1 reply; 21+ messages in thread
From: Bruce Ingalls @ 2003-11-14 21:33 UTC (permalink / raw)


>>1) How do I enable syntax highlighting by default
> 
> I'm a little disappointed (but not surprised) that everyone replying
> so far says to edit the .emacs file.
> 
> The simple and user-friendly answer is to use the Options menu, enable
> Syntax Highlighting and then Save Options.
> 
> I'm also encouraging new users to use the custom interface rather than
> scaring them with elisp edits.

Well, Emacs would be more user friendly, if it weren't so picky about 
its friends ;)
I hope a shameless plug for *my* .emacs at
  <url: http://emacro.sourceforge.net/ >
will make Emacs more user friendly, and solves many more issues.
It also comes with newbie documentation, and requires no programming.

The really easy answer, is to upgrade to the latest version of Emacs 
from CVS, if you know how to - it maximizes color by default.

You won't find the answer you expect, by searching the Options menu 
under "Development" nor "Programming".
Nor will you find "syntax highlighting".

Buried under "Faces", you will find "Font Lock Maximum Decoration".

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-14 21:33   ` Bruce Ingalls
@ 2003-11-14 22:01     ` Stefan Monnier
  0 siblings, 0 replies; 21+ messages in thread
From: Stefan Monnier @ 2003-11-14 22:01 UTC (permalink / raw)


> The really easy answer, is to upgrade to the latest version of Emacs from
> CVS, if you know how to - it maximizes color by default.

Huh?!?!  This hasn't changed since at least Emacs-20.

> Buried under "Faces", you will find "Font Lock Maximum Decoration".

This variable has been set to t (i.e. maximum) for a slong as
I can remember.
And I don't know anybody who actually makes use of it (other than
redundantly setting it to t that is).
There's a good reason it's buried.  I wish I could kill it once and for all.


        Stefan

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-14 15:52 Emacs newbie - Syntax Highlighting and Indentation David Rasmussen
                   ` (5 preceding siblings ...)
       [not found] ` <mailman.86.1068840578.399.help-gnu-emacs@gnu.org>
@ 2003-11-14 22:13 ` David Rasmussen
  2003-11-14 22:22   ` Jody M. Klymak
                     ` (2 more replies)
  2003-11-15 15:09 ` David Rasmussen
  7 siblings, 3 replies; 21+ messages in thread
From: David Rasmussen @ 2003-11-14 22:13 UTC (permalink / raw)


Thanks to everyone. As an aside, let me just mention that emacs for 
windows must somehow be cygwin-aware. When I start emacs from a normal 
Windows command prompt or from a shortcut, it saves .emacs in c:\
But if I start emacs from cygwin (no, I do not have emacs for cygwin 
installed, it _is_ the same emacs I am starting from cygwin, that I 
started from the command prompt and the desktop just before), it saves 
.emacs in c:\cygwin\home\david\

Cool!

/David

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-14 22:13 ` David Rasmussen
@ 2003-11-14 22:22   ` Jody M. Klymak
  2003-11-15  9:47   ` Artur Hefczyc
  2003-11-17 13:39   ` Kevin Dziulko
  2 siblings, 0 replies; 21+ messages in thread
From: Jody M. Klymak @ 2003-11-14 22:22 UTC (permalink / raw)



Hello David,

David Rasmussen <david.rasmussen@gmx.net> writes:

> Thanks to everyone. As an aside, let me just mention that emacs for
> windows must somehow be cygwin-aware. When I start emacs from a normal
> Windows command prompt or from a shortcut, it saves .emacs in c:\
> But if I start emacs from cygwin (no, I do not have emacs for cygwin
> installed, it _is_ the same emacs I am starting from cygwin, that I
> started from the command prompt and the desktop just before), it saves
> .emacs in c:\cygwin\home\david\

I think you'll find that if you set the environment variable HOME
(under Control Panel - System - Advanced - Environment Variables)
that you will get the same effect starting emacs outside of cygwin.  

http://www.gnu.org/software/emacs/windows/ntemacs.html

http://www.gnu.org/software/emacs/windows/faq3.html#startup

Cheers,  Jody

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
       [not found] ` <mailman.86.1068840578.399.help-gnu-emacs@gnu.org>
  2003-11-14 21:33   ` Bruce Ingalls
@ 2003-11-14 23:15   ` David Rasmussen
       [not found]     ` <mailman.117.1068862385.399.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 21+ messages in thread
From: David Rasmussen @ 2003-11-14 23:15 UTC (permalink / raw)


Peter S Galbraith wrote:
> 
> I'm a little disappointed (but not surprised) that everyone replying
> so far says to edit the .emacs file.
> 
> The simple and user-friendly answer is to use the Options menu, enable
> Syntax Highlighting and then Save Options.
> 
> I'm also encouraging new users to use the custom interface rather than
> scaring them with elisp edits.
> 

I agree completely that there's no need to do things the hard way, if 
there is an easy way. I have nothing against menu systems and such that 
makes a program more user-friendly. The only reason I wanted to know 
"the hard way", is that one of my reasons for learning emacs is that I 
want to learn to use a powerful editor that is likely to be available on 
all sorts of system, even if I am only logging in with ssh etc.
And I can't be certain that there is this nice menu on all the other 
systems that I might use emacs on. So I want to learn to use emacs 
"platform independantly".
I know that there are other editors that fills the bill, but I haven't 
found one that felt natural to me. I have tried hard to learn vim, but 
it all disappears again. Maybe the same will happen with emacs, I don't 
know. Maybe I should write my own editor :)

/David

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
       [not found] ` <david.rasmussen@gmx.net>
  2003-11-14 19:07   ` Peter S Galbraith
@ 2003-11-15  1:11   ` Peter S Galbraith
  1 sibling, 0 replies; 21+ messages in thread
From: Peter S Galbraith @ 2003-11-15  1:11 UTC (permalink / raw)
  Cc: help-gnu-emacs

David Rasmussen <david.rasmussen@gmx.net> wrote:

> Peter S Galbraith wrote:
> > I'm a little disappointed (but not surprised) that everyone replying
> > so far says to edit the .emacs file.
> > The simple and user-friendly answer is to use the Options menu, enable
> > Syntax Highlighting and then Save Options.
> > I'm also encouraging new users to use the custom interface rather than
> > scaring them with elisp edits.
> 
> I agree completely that there's no need to do things the hard way, if there
> is an easy way. I have nothing against menu systems and such that makes a
> program more user-friendly. The only reason I wanted to know "the hard
> way", is that one of my reasons for learning emacs is that I want to learn
> to use a powerful editor that is likely to be available on all sorts of
> system, even if I am only logging in with ssh etc.
> And I can't be certain that there is this nice menu on all the other
> systems that I might use emacs on. So I want to learn to use emacs
> "platform independantly".

Okay, but the only thing that using the Options menu and saving does (or
using customization and saving) is add an entry to your .emacs which you
are free to copy to another machine the same way.  There's no black
magic involved.

The nice thing about looking at the custom interface once in a while is
that it makes a nice summary of features in one place.  You learn a lot
about what's available by looking at it.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-14 22:13 ` David Rasmussen
  2003-11-14 22:22   ` Jody M. Klymak
@ 2003-11-15  9:47   ` Artur Hefczyc
  2003-11-17 13:39   ` Kevin Dziulko
  2 siblings, 0 replies; 21+ messages in thread
From: Artur Hefczyc @ 2003-11-15  9:47 UTC (permalink / raw)


David Rasmussen <david.rasmussen@gmx.net> writes:

> Thanks to everyone. As an aside, let me just mention that emacs for windows must
> somehow be cygwin-aware. When I start emacs from a normal Windows command prompt
> or from a shortcut, it saves .emacs in c:\
> But if I start emacs from cygwin (no, I do not have emacs for cygwin installed,
> it _is_ the same emacs I am starting from cygwin, that I started from the
> command prompt and the desktop just before), it saves .emacs in
> c:\cygwin\home\david\

I use the second way of 2 above - regular NTEmacs ran from cygwin
environment.
I suggest to write simple windows script starting always emacs under
cygwin:
cat > startemacs.bat
set HOME="c:/cygwin/home/david"
set PATH="c:/cygwin/bin;c:/cygwin/usr/bin;"%HOME%
cd %HOME%
c:/path/to/emacs/emacs.exe

Or something like above.
It has many advantages over emacs in 'pure' windows environment. It
then can use all cygwin tools like bash, sed, grep, diff and others.

Look in my article mentioned in earlier post, it should contain more
detailed info about this.

Artur
-- 
Artur Hefczyc, Open Source Developer:
http://www.geotools.org/
http://generguide.sourceforge.net/
http://wttools.sourceforge.net/
http://maven-plugins.sourceforge.net/

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
       [not found]     ` <mailman.117.1068862385.399.help-gnu-emacs@gnu.org>
@ 2003-11-15 11:06       ` David Rasmussen
  2003-11-15 12:43         ` Bruce Ingalls
  0 siblings, 1 reply; 21+ messages in thread
From: David Rasmussen @ 2003-11-15 11:06 UTC (permalink / raw)


Peter S Galbraith wrote:
> 
> The nice thing about looking at the custom interface once in a while is
> that it makes a nice summary of features in one place.  You learn a lot
> about what's available by looking at it.
> 

Good point.

And I'd say: Would it kill emacs to have menus on all platforms, even in 
the console? They could just stay out of the way most of the time, and 
only pop up when requested. There is no reason why emacs couldn't have a 
layered architeture, in terms of usability. That is, there is no way why 
  the most common operations shouldn't be fairly easy to figure out and 
perform, even for a newbie. Advanced features shouldn't stand in the way 
for simple features.

But I like emacs so far. I don't know why, but I seem to be able to 
learn and remember stuff faster than with vim. Weird.

/David

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-15 11:06       ` David Rasmussen
@ 2003-11-15 12:43         ` Bruce Ingalls
  2003-11-15 12:47           ` David Rasmussen
  0 siblings, 1 reply; 21+ messages in thread
From: Bruce Ingalls @ 2003-11-15 12:43 UTC (permalink / raw)


David Rasmussen wrote:

> And I'd say: Would it kill emacs to have menus on all platforms, even in 
> the console?
Menus are available on all platforms.
Try F10 from the console.
I think M-' also works.
This should be in the splash screen that comes up, when you start Emacs 
without opening a file.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-15 12:43         ` Bruce Ingalls
@ 2003-11-15 12:47           ` David Rasmussen
  0 siblings, 0 replies; 21+ messages in thread
From: David Rasmussen @ 2003-11-15 12:47 UTC (permalink / raw)


Bruce Ingalls wrote:

> 
> Menus are available on all platforms.
> Try F10 from the console.
> I think M-' also works.
> This should be in the splash screen that comes up, when you start Emacs 
> without opening a file.
> 

Oh, sorry then :)
I told you I were a newbie...

Cool then!

/David

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-14 18:20 ` Artur Hefczyc
@ 2003-11-15 14:18   ` David Rasmussen
  2003-11-15 15:08     ` Artur Hefczyc
  0 siblings, 1 reply; 21+ messages in thread
From: David Rasmussen @ 2003-11-15 14:18 UTC (permalink / raw)


Artur Hefczyc wrote:
> 
> The shortest answer to your question is:
> 
> Put to your .emacs file following code:
> (setq c-basic-offset 2)
> 

Where exactly in .emacs do I put this? Just at the bottom after 
everything else?

> Other setting you might find useful for Java coding are:
> (setq tab-width 4
>       indent-tabs-mode nil)
> 

What does this do?

/David

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-15 14:18   ` David Rasmussen
@ 2003-11-15 15:08     ` Artur Hefczyc
  0 siblings, 0 replies; 21+ messages in thread
From: Artur Hefczyc @ 2003-11-15 15:08 UTC (permalink / raw)


David Rasmussen <david.rasmussen@gmx.net> writes:
> Artur Hefczyc wrote:
>> The shortest answer to your question is:
>> Put to your .emacs file following code:
>> (setq c-basic-offset 2)
> Where exactly in .emacs do I put this? Just at the bottom 
> after everything else?

It doesn't matter where you put it in file, it does matter in what
context.
I think you can put following code in any place in your .emacs file:

(defun my-java-mode-hook ()
  "Hook for running Java file..."
  (message "Loading my-java-hook...")
  (setq c-block-comment-prefix "* "
	indent-tabs-mode nil
	c-basic-offset 2)
  (message "my-java-mode-hook function executed")
)
(add-hook 'java-mode-hook 'my-java-mode-hook)

As you can see I defined very simple elisp function: 'my-java-mode-hook'
which will be executed every time you switch to Java file. You can put
there some more actions or settings. I suggest to look in my .emacs file
(mentioned in another post) and look for function: 'my-jde-mode-hook'.

Above code presents one advantage over configuring emacs from menu or
customization package. You can define any (even simple) function which
is executed in certain cases. And you have a little more control.

>> Other setting you might find useful for Java coding are:
>> (setq tab-width 4
>>       indent-tabs-mode nil)

Well, it's a shame! These 2 settings together doesn't make sense,
almost.
'tab-width' variable controls 'visual' width of table character, so it
can appear as 4 spaces if put in file.
'indent-tabs-mode' when set to 'nil' means: don't use tab character for
indentation. Set value to 't' if you want to use tab characters.

So you can blame me that I set tab-width for some value and then I
order emacs to not use tabs at all! However it can be useful if you
don't use tabs yourself but from time to time you load other files -
not your own, containing tabs.

On another side using tabs can be very useful. Lets assume you are
working on some code with more developers. Each of them prefer
different indentation depth. If you start using tabs each of them can
set different 'tab-width' so the same file can be displayed differently!

By the way, if you want to learn about some variable under emacs, place
cursor on variable name and press:
C-h v <Enter>  (Control-'h' and 'v')
if you want function description
C-h f <Enter>

If you place cursor on symbol name it is taken as default symbol but
you can change symbol name if you want description for another. And
remember with <tab> key you have symbol completing feature available.
Don't ask what does it mean, just try it!

Artur
-- 
Artur Hefczyc, Open Source Developer:
http://www.geotools.org/
http://generguide.sourceforge.net/
http://wttools.sourceforge.net/
http://maven-plugins.sourceforge.net/

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-14 15:52 Emacs newbie - Syntax Highlighting and Indentation David Rasmussen
                   ` (6 preceding siblings ...)
  2003-11-14 22:13 ` David Rasmussen
@ 2003-11-15 15:09 ` David Rasmussen
  2003-11-15 16:50   ` Artur Hefczyc
  7 siblings, 1 reply; 21+ messages in thread
From: David Rasmussen @ 2003-11-15 15:09 UTC (permalink / raw)


Most of you said that I should put somehting along the lines of

(setq c-basic-offset 2)

in my .emacs to alter the tab spacing and indentation. But it doesn't work?

/David

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-15 15:09 ` David Rasmussen
@ 2003-11-15 16:50   ` Artur Hefczyc
  0 siblings, 0 replies; 21+ messages in thread
From: Artur Hefczyc @ 2003-11-15 16:50 UTC (permalink / raw)


David Rasmussen <david.rasmussen@gmx.net> writes:
> Most of you said that I should put somehting along the lines of
> (setq c-basic-offset 2)
> in my .emacs to alter the tab spacing and indentation. But it doesn't work?

It may not work if you put only above code, bacuse each major mode has
own definition for such variables. So you should set this variable
_for_ _java_ mode in your case.

You should use mode hook as described in my previous post. Put those
code in your .emacs file and try it then. (You should restart emacs
after modyfing .emacs)
I checked it before minute and it worked for me.

If it still doesn't work for you it might mean you doesn't use java
mode by default for java files. Maybe jde mode then?
To see what is your major mode during editing java files you should
open java file under emacs and then execute emacs function
'describe-mode' in following way:

M-x describe-mode
(press: 'Alt-x' and write function name: 'describe-mode' and press
<ENTER>)
New window should appear with 3rd non empty line:

Java mode:

It is 'Jde mode:' on my installation.
Please let me know if you successed or not.

Artur
-- 
Artur Hefczyc, Open Source Developer:
http://www.geotools.org/
http://generguide.sourceforge.net/
http://wttools.sourceforge.net/
http://maven-plugins.sourceforge.net/

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Emacs newbie - Syntax Highlighting and Indentation
  2003-11-14 22:13 ` David Rasmussen
  2003-11-14 22:22   ` Jody M. Klymak
  2003-11-15  9:47   ` Artur Hefczyc
@ 2003-11-17 13:39   ` Kevin Dziulko
  2 siblings, 0 replies; 21+ messages in thread
From: Kevin Dziulko @ 2003-11-17 13:39 UTC (permalink / raw)


On Fri, 14 Nov 2003, David Rasmussen wrote:

> Thanks to everyone. As an aside, let me just mention that emacs for 
> windows must somehow be cygwin-aware. When I start emacs from a normal 
> Windows command prompt or from a shortcut, it saves .emacs in c:\
> But if I start emacs from cygwin (no, I do not have emacs for cygwin 
> installed, it _is_ the same emacs I am starting from cygwin, that I 
> started from the command prompt and the desktop just before), it saves 
> .emacs in c:\cygwin\home\david\
> 
> Cool!
> 
> /David
> 
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
> 

If you want to use only 1 .emacs file, set the HOME variable in windows 
setting to c:\cygwin\home\david\.  A google will give you plenty of 
instructions on that.

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2003-11-17 13:39 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-14 15:52 Emacs newbie - Syntax Highlighting and Indentation David Rasmussen
2003-11-14 17:13 ` Uwe Siart
2003-11-14 17:48 ` Jiri Pejchal
2003-11-14 18:08 ` Michael M Mason
2003-11-14 18:20 ` Artur Hefczyc
2003-11-15 14:18   ` David Rasmussen
2003-11-15 15:08     ` Artur Hefczyc
     [not found] ` <david.rasmussen@gmx.net>
2003-11-14 19:07   ` Peter S Galbraith
2003-11-15  1:11   ` Peter S Galbraith
     [not found] ` <mailman.86.1068840578.399.help-gnu-emacs@gnu.org>
2003-11-14 21:33   ` Bruce Ingalls
2003-11-14 22:01     ` Stefan Monnier
2003-11-14 23:15   ` David Rasmussen
     [not found]     ` <mailman.117.1068862385.399.help-gnu-emacs@gnu.org>
2003-11-15 11:06       ` David Rasmussen
2003-11-15 12:43         ` Bruce Ingalls
2003-11-15 12:47           ` David Rasmussen
2003-11-14 22:13 ` David Rasmussen
2003-11-14 22:22   ` Jody M. Klymak
2003-11-15  9:47   ` Artur Hefczyc
2003-11-17 13:39   ` Kevin Dziulko
2003-11-15 15:09 ` David Rasmussen
2003-11-15 16:50   ` Artur Hefczyc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).