POV-Ray : Newsgroups : povray.unix : Linux(general quiz) : Re: Linux (general quiz) [warning long post ahead...] Server Time
28 Jul 2024 20:20:32 EDT (-0400)
  Re: Linux (general quiz) [warning long post ahead...]  
From: Luis M  Ibarra
Date: 9 Apr 1999 19:42:27
Message: <370E8F4B.D202AD95@jano.estadistica.unam.mx>
Nieminen Mika wrote:
> : Learn Emacs, it'll pay back soon.
> 
>   I wouldn't say "soon".
>   I have used emacs for about 4 years now. It took me about 2 years to learn
> just how to reconfigure the keys (for example I wanted alt-x to be the same
> as ctrl-x-c, F2 to save, etc).

Taking your example and using information obtained only from the Emacs
manual at the info help system (CTRL-h then i) [most of this info is
also in the tutorial and the emacs manual page (man emacs at the unix
prompt), let's see if we can reconfigurate the keyboard. (I'm using GNU
Emacs 20.3.2)

The tutorial explains thing about commands and how some keys are bounded
to them, also at lines 985-989 briefly explan the apropos help funtion. 

Let's see if there is a command for bound new keys; 

	C-h a
	key

WOW! 17 commands about keys!, is there one for set a key bound to a
command?; 

	C-x o 
	C-s
	set

we find the command "global-set-key", if we key searching (CRTL-s
again), we also find the "local-set-key" command. 

So let's see if this global-set-key will do.

	C-h f
	global-set-key 

The first line of the description is "Give KEY a global binding as
COMMAND.", bingo we found it, also it say how to use it:
"(global-set-key KEY COMMAND)". 

Ok fine. Now we need to know how to pass the key and which command to
pass. Let's do the later first;

	C-h k
	C-x C-c

It says at the first line "C-x C-c runs the command
save-buffers-kill-emacs", So this is the command we have to pass to the
global-set-key command. Now for the key how we say "alt-x"? 
well we say it as M-x. As explained in the tutorial ALT key is the same
as META key (Why the f@#*  did the emacs programmers changed the names
of the keys? (*) see note at end). We must escape the key and the
global-set-key whats a string (It say so in the description), so we
write "\M-x", we also can pass the key as [M-x] or as [(alt x)]. 

We need to pass the command as a reference or the interpreter would use
it as a variable name. (ie 'global-set-key instead of  global-set-key),
so finally the key is bound with

(global-set-key "\M-x" 'global-set-key)

We put that line in the init file ($HOME/.emacs) and we are there.

*THAT* take you two years to learn?, most of the stuff needed is
explained in the tutorial, and the manual has examples of setting keys
in the init file section!. And without touching the documentation a
search in the net would have give you the answer in minutes. Emacs is
complex. Yes I grant you that. But it's not THAT complex, grant me that
:).

Yes, it's not the tipical Windows program. Emacs is MUCH more powerfull,
and more complex but it's all documented!, there a lot of examples in
the manual, and there a lot of info in the net (including .emacs files). 

The basic difference between MS-world and the Unix-world is;

In the unix world you will *HAVE* to read and *understand* the manuals
for even the most basic tasks, but you will be compensated with lots and
lots of freedom and power.

In the MS-world you don't have to read manuals (almost never except for
the most complex programs), but you won't have freedom nor power!. 

An example of that, is Emacs, most of it's functionality is written in
small chunks written in lisp (emacs-lisp) ala plug-ins, the core of
Emacs is infact a complete lisp interpreter and compiler. You don't need
to learn lisp to every day use of emacs, you need to learn some for
customization, and if you learn a lot of emacs-lisp, babe, the heaven is
the limit. That's way you have mail readers, web browsers, arbitrary
precision calculators, address books, file managers, programing
environments, several cultures calendars, etc... all in your editor
without meking it blowded. 

check http://dotfiles.com/ there are configuration files for some
programs.

(*) they didn't change the name, that was the name of the modifiers keys
on the old machines they wrote Emacs for. Emacs is so well written that
it didn't die with the original machine it was written for, isn't it 
wonderfull?.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.