, The Linux Users' Guide 

[ Pobierz całość w formacie PDF ]
.That wouldrequire retyping whole portions of perfectly good text.Instead, use combinations of M-b, C-b, andC-f to move to the precise location of the error, x it, and then use C-e to move to the end of theline again. 8.13.CUSTOMIZING EMACS 83When you have to type in a lename, don't ever type in the whole name.Just type in enoughof it to identify it uniquely, and let Emacs's completion nish the job by hitting Tab or Space.Why waste keystrokes when you can waste CPU cycles instead?If you are typing some kind of plain text, and somehowyour auto- lling or auto-wrapping hasgotten screwed up, use M-q, which is fill-paragraph in common text modes.This will adjust"the paragraph you're in as if it had been wrapped line by line, but without your having to go messaround with it by hand.M-q will work from inside the paragraph, or from its very beginning or end.Sometimes it's helpful to use C-x u, undo , which will try to undo" the last change s youmade.Emacs will guess at how much to undo; usually it guesses very intelligently.Calling itrepeatedly will undo more and more, until Emacs can no longer remember what changes were made.8.13 Customizing EmacsEmacs is so big, and so complex, that it actually has its own programming language! I'm notkidding: to really customize Emacs to suit your needs, you have to write programs in this language.It's called Emacs Lisp, and it's a dialect of Lisp, so if you have previous experience in Lisp, it willseem quite friendly.If not, don't worry: I'm not going to go into a great deal of depth, because it'sde nitely best learned by doing.To really learn about programming Emacs, you should consult theInfo pages on Emacs Lisp, and read a lot of Emacs Lisp source code.Most of Emacs's functionality is de ned in les of Emacs Lisp9 code.Most of these lesare distributed with Emacs and collectively are known as the Emacs Lisp library".This li-brary's location depends on how Emacs was installed on your system | common locations areusr lib emacs lisp, usr lib emacs 19.19 lisp , etc.The 19.19" is the version number ofEmacs, and might be di erent on your system.You don't need to poke around your lesystem looking for the lisp library, because Emacs has theinformation stored internally, in a variable called load-path.To nd out the value of this variable,it is necessary to evaluate it; that is, to have Emacs's lisp interpreter get its value.There is a specialmode for evaluating Lisp expressions in Emacs, called lisp-interaction-mode.Usually, there is abu er called *scratch*" that is already in this mode.If you can't nd one, create a new bu er ofany name, and type M-x lisp-interaction-mode inside it.Now you have a workspace for interacting with the Emacs Lisp interpreter.Type this:load-pathand then press C-j at the end of it.In lisp-interaction-mode, C-j is bound to eval-print-last-sexp.An sexp" is an s-expression", which means a balanced group of parentheses, including none.Well, that's simplifying it a little, but you'll get a feel for what they are as you work with EmacsLisp.Anyway, evaluating load-path should get you something like this:load-path C-j" usr lib emacs site-lisp vm-5.35" " home kfogel elithp"9Sometimes uno cially called Elisp". 84 CHAPTER 8.EDITING FILES WITH EMACS" usr lib emacs site-lisp" " usr lib emacs 19.19 lisp"It won't look the same on every system, of course, since it is dependant on how Emacs wasinstalled.The above example comes from my 386 PC running Linux.As the above indicates,load-path is a list of strings.Each string names a directory that might contain Emacs Lisp les.When Emacs needs to load a le of Lisp code, it goes looking for it in each of these directories, inorder.If a directory is named but does not actually exist on the lesystem, Emacs just ignores it.When Emacs starts up, it automatically tries to load the le.emacs in your home directory.Therefore, if you want to make personal customizations to Emacs, you should put them in.emacs [ Pobierz całość w formacie PDF ]
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • anikol.xlx.pl