Click to See Complete Forum and Search --> : any emacs users?


Lord_Override
09-06-2001, 03:43 PM
what does your .emacs file look like? i just started using it and i do not have one except one that enabled c indentation. not c++ indentation just c.
can i see someone else's that has perl indentation, c and c++ indentation, and prefereably support for other languages?
i know emacs supports them with its modules but they dont always seem to indent properly for me. also is it possible to syntax highlight in regular emacs20?

Gnu/Vince
09-06-2001, 06:43 PM
I don't use Emacs, so I can't tell, but I can tell you this: Vim does C/C++ indenting. And with version 6 which will be released in a couple of weeks, you will be able to make indenting files for any type of file. So, if you edit a .xyz, and if there's a indent file for xyz files, vim 6 will indent accordingly to the rules in that file!

Salmon
09-06-2001, 10:42 PM
what does your .emacs file look like?

I tried to paste mine in, but 1.) It's seriously huge, and 2.) all the indentation, etc came out screwy and I'm not about to try and clean it up in this tiny little text box.

What do you mean by "they dont always seem to indent properly"?

For syntax highlighting in emacs20 (works in X only as far as I know -- with GNU/Emacs anyway) you should place the following line in your .emacs.

(global-font-lock-mode t)

That will enable syntax highlighting by default for all modes that support it.

The Kooman
09-06-2001, 11:04 PM
Originally posted by Lord_Override:
<STRONG>can i see someone else's that has perl indentation, c and c++ indentation, and prefereably support for other languages?
i know emacs supports them with its modules but they dont always seem to indent properly for me. also is it possible to syntax highlight in regular emacs20?</STRONG>

Assumption - you're an emacs newbie :)

Take a look at the source emacs-lisp files (perl-mode.el in this case). I know it sounds scary but you get a lot of info by looking at the documentation strings in the functions - those are what you see when you ask for help!

Have you tried looking for help on the Perl mode? The easiest way to do it is to type M-x perl-mode in the *scratch* buffer and then do C-h m

You can also do an apropos on perl by doing a C-h a followed by "perl" (no quotes). That'll give you list of functions and variables which have the world "perl" in them. Take a look and see if there's anything you can play with.

I learnt a lot of emacs customization just looking at the lisp code. Just focus on the intent of the function and not the implementation and syntax. If you do that it won't be that difficult!

Just my $0.02!

Lord_Override
09-07-2001, 09:28 AM
gnu/vince: i like vim, but I like emacs more :)

when i say they don't always indent is that for example if I open a blank.cpp file then type

int main()
{

then the cursor is not automatically moved to a tab width on the next line, it works for c but not c++ or perl.

is there a variable to set that can just auto indent on {'s and :'s (for case statements?)

EscapeCharacter
09-07-2001, 09:41 AM
http://www.thinkgeek.com/images/products/zoom/vi-emacs.jpg :)

Lord_Override
09-07-2001, 11:32 AM
http://www.thinkgeek.com/images/products/zoom/emacs-vi.jpg