[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Tips for moving to XEmacs




> -----Original Message-----
> From: Bill Moseley [mailto:moseley@hank.org]
> Sent: Tuesday, January 28, 2003 1:15 PM
> To: debian-user@lists.debian.org
> Subject: Tips for moving to XEmacs
>
>
>
> Argh, how many times have I attempted this move!
>
> I'd like to make a push to move to XEmacs as my main editor (from a
> Windows editor Program File Editor).  It's hard to move to a new editor
> with a large learning curve when there's work to be done.
>
> I edit mostly C and Perl code.
>
> I'm looking for tips to help in my change over.
>
> To keep this somewhat on-topic (e.g. debian), I've installed
>
> $ dpkg -l | grep emacs
> ii  emacsen-common 1.4.15         Common facilities for all emacsen.
> ii  xemacs21       21.4.6-8       Editor and kitchen sink
> ii  xemacs21-bases 2002.03.29-1   Editor and kitchen sink --
> compiled  elisp su
> ii  xemacs21-bin   21.4.6-8       Editor and kitchen sink --
> support binaries
> ii  xemacs21-nomul 21.4.6-8       Editor and kitchen sink --
> Non-mule binary
> ii  xemacs21-suppo 21.4.6-8       Editor and kitchen sink --
> architecture inde

I'm not using xemacs under debian but I use xemacs almost all day every day
so I can help you.

XEmacs has its own package management system. See the xemacs install notes.
This is how you get dired, c-mode and perl-mode. I mention this because I
don't know if the debian packages install all the good stuff or just the
core.

FYI: I'd get the MULE binary. MULE adds automagic EOL detection, which I
find invaluable in today's world.


> is there anything else I should install for editing C and Perl?

You'll need perl-modes and cc-mode at minimum.


> There's lots of Emacs tutorials found by Google.  Any recommendations on
> ones you might have found most useful?

No. It's been a few years since I was an emacs newbie.

>
> The tips I need to help me start using Emacs are in basic configuration
> (these are mostly common functions of my old editor that I can't live
> without):
>
> - I don't want long lines to wrap with the U-turn arrow at the end, I want
> a scroll bar.

(setq truncate-lines t)

>
> - I want tab to insert spaces instead of tabs, and each indent is to the
> next 4 char column.

(setq indent-tabs-mode nil)

> - I'm not a fan of syntax highlighting.  Maybe I should be.

Yeah. It takes a while to get used to but it makes so many stupid little
errors leap right out at you. Ever had an unterminated string on line 5
cause a syntax error on line 214? Well, font lock makes those things
obvious. Both C and perl are particularly prone to such errors so you might
be wise to get used to it.

It's called font-lock-mode in xemacs and I think it is off by default.

> - I need to be able to find matching braces (find the start of end of the
> current block)

Look into forward-sexp (C-M-f) and backward-sexp (C-M-b). There's also a bit
of code floating around that gives you vi style matching that I thought was
clever. But they all boil down to sexps.

> - I need to be able to indent and un-indent a block of text.

Block indenting is pretty easy:

C-u <count> C-x TAB

Syntax indenting is easier:

TAB

it depends on the language mode. C indents pretty well, perl less so. If you
want to quickly use language indenting on a region: C-M-\


> - Auto-indent/un-indent, of course, plus smart indenting when I open a new
> brace.

(global-set-key [(return)] 'newline-and-indent)

Electric braces are language specific. I hate 'em so I can't help you other
to say they are there.

> - How do I get my button 4 and 5 to scroll (the mouse wheel works in other
> programs)?

Probably some variant of global-set-key. Try rolling the wheel then running
M-x view-lossage to see what xemacs saw.

> - I'd like to have black on white text, and a smaller font in the buffers.

Ah. You can spend hours screwing with fonts. It's a terrible area because it
deals with X fonts. Colors are pretty easy though. Try
M-x list-colors-display to get your palette up, then try
(set-face-foreground 'default "pink") etc etc.


> Is is sacrilegious to want the cut/copy/paste keys to be mapped to the
> common C-c C-x and C-v keys?  I guess that would break a lot in emacs.

Sacrilegious? No. Foolhardy, yes. C-x and C-c are critical emacs keys.
You'll go nuts trying to follow emacs docs if they are rebound. I do believe
there is a PC style input package but I've never tried it.

My suggestions are:

1) Learn to navigate the info pages.
2) Use the web. I didn't have google when I was learning. There's lots of
great stuff out there.
3) Concentrate on the features that make you want to switch. Let the fancy
stuff come later when you aren't panicked.
4) Never stop exploring... you haven't even mentioned my favorite cool
things, like sql-mode and macros. God I love keyboard macros. Templates are
great too. And then there counter-mode. And shell mode and shell filters
have their place. And tramp/efs... oh those are so sweet. And mighty dired
has saved my bacon many times. And calc.

And don't be afraid to read the source. Most of the packages are in lisp.
Even if you can't read lisp well, you'll see obvious variable declarations
that can tell you what to customize.

Oh yeah: you might want to play with the customize package. I don't use it
much but it is interesting. M-x customize will let you set most of the stuff
I mentioned.

Good luck.



Reply to: