view man/xemacs/fixit.texi @ 938:0391335b65dc

[xemacs-hg @ 2002-07-31 07:14:49 by michaels] 2002-07-17 Marcus Crestani <crestani@informatik.uni-tuebingen.de> Markus Kaltenbach <makalten@informatik.uni-tuebingen.de> Mike Sperber <mike@xemacs.org> configure flag to turn these changes on: --use-kkcc First we added a dumpable flag to lrecord_implementation. It shows, if the object is dumpable and should be processed by the dumper. * lrecord.h (struct lrecord_implementation): added dumpable flag (MAKE_LRECORD_IMPLEMENTATION): fitted the different makro definitions to the new lrecord_implementation and their calls. Then we changed mark_object, that it no longer needs a mark method for those types that have pdump descritions. * alloc.c: (mark_object): If the object has a description, the new mark algorithm is called, and the object is marked according to its description. Otherwise it uses the mark method like before. These procedures mark objects according to their descriptions. They are modeled on the corresponding pdumper procedures. (mark_with_description): (get_indirect_count): (structure_size): (mark_struct_contents): These procedures still call mark_object, this is needed while there are Lisp_Objects without descriptions left. We added pdump descriptions for many Lisp_Objects: * extents.c: extent_auxiliary_description * database.c: database_description * gui.c: gui_item_description * scrollbar.c: scrollbar_instance_description * toolbar.c: toolbar_button_description * event-stream.c: command_builder_description * mule-charset.c: charset_description * device-msw.c: devmode_description * dialog-msw.c: mswindows_dialog_id_description * eldap.c: ldap_description * postgresql.c: pgconn_description pgresult_description * tooltalk.c: tooltalk_message_description tooltalk_pattern_description * ui-gtk.c: emacs_ffi_description emacs_gtk_object_description * events.c: * events.h: * event-stream.c: * event-Xt.c: * event-gtk.c: * event-tty.c: To write a pdump description for Lisp_Event, we converted every struct in the union event to a Lisp_Object. So we created nine new Lisp_Objects: Lisp_Key_Data, Lisp_Button_Data, Lisp_Motion_Data, Lisp_Process_Data, Lisp_Timeout_Data, Lisp_Eval_Data, Lisp_Misc_User_Data, Lisp_Magic_Data, Lisp_Magic_Eval_Data. We also wrote makro selectors and mutators for the fields of the new designed Lisp_Event and added everywhere these new abstractions. We implemented XD_UNION support in (mark_with_description), so we can describe exspecially console/device specific data with XD_UNION. To describe with XD_UNION, we added a field to these objects, which holds the variant type of the object. This field is initialized in the appendant constructor. The variant is an integer, it has also to be described in an description, if XD_UNION is used. XD_UNION is used in following descriptions: * console.c: console_description (get_console_variant): returns the variant (create_console): added variant initialization * console.h (console_variant): the different console types * console-impl.h (struct console): added enum console_variant contype * device.c: device_description (Fmake_device): added variant initialization * device-impl.h (struct device): added enum console_variant devtype * objects.c: image_instance_description font_instance_description (Fmake_color_instance): added variant initialization (Fmake_font_instance): added variant initialization * objects-impl.h (struct Lisp_Color_Instance): added color_instance_type * objects-impl.h (struct Lisp_Font_Instance): added font_instance_type * process.c: process_description (make_process_internal): added variant initialization * process.h (process_variant): the different process types
author michaels
date Wed, 31 Jul 2002 07:14:49 +0000
parents 376386a54a3c
children
line wrap: on
line source


@node Fixit, Files, Search, Top
@chapter Commands for Fixing Typos
@cindex typos
@cindex mistakes, correcting

  This chapter describes commands that are especially useful when you
catch a mistake in your text just after you have made it, or when you 
change your mind while composing text on line.

@menu
* Kill Errors:: Commands to kill a batch of recently entered text.
* Transpose::   Exchanging two characters, words, lines, lists...
* Fixing Case:: Correcting case of last word entered.
* Spelling::    Apply spelling checker to a word, or a whole file.
@end menu

@node Kill Errors, Transpose, Fixit, Fixit
@section Killing Your Mistakes

@table @kbd
@item @key{DEL}
Delete last character (@code{delete-backward-char}).
@item M-@key{DEL}
Kill last word (@code{backward-kill-word}).
@item C-x @key{DEL}
Kill to beginning of sentence (@code{backward-kill-sentence}).
@end table

@kindex DEL
@findex delete-backward-char
  The @key{DEL} character (@code{delete-backward-char}) is the most
important correction command.  When used among graphic (self-inserting)
characters, it can be thought of as canceling the last character typed.

@kindex M-DEL
@kindex C-x DEL
@findex backward-kill-word
@findex backward-kill-sentence
  When your mistake is longer than a couple of characters, it might be more
convenient to use @kbd{M-@key{DEL}} or @kbd{C-x @key{DEL}}.
@kbd{M-@key{DEL}} kills back to the start of the last word, and @kbd{C-x
@key{DEL}} kills back to the start of the last sentence.  @kbd{C-x
@key{DEL}} is particularly useful when you are thinking of what to write as
you type it, in case you change your mind about phrasing.
@kbd{M-@key{DEL}} and @kbd{C-x @key{DEL}} save the killed text for
@kbd{C-y} and @kbd{M-y} to retrieve.  @xref{Yanking}.@refill

  @kbd{M-@key{DEL}} is often useful even when you have typed only a few
characters wrong, if you know you are confused in your typing and aren't
sure exactly what you typed.  At such a time, you cannot correct with
@key{DEL} except by looking at the screen to see what you did.  It requires
less thought to kill the whole word and start over.

@node Transpose, Fixing Case, Kill Errors, Fixit
@section Transposing Text

@table @kbd
@item C-t
Transpose two characters (@code{transpose-chars}).
@item M-t
Transpose two words (@code{transpose-words}).
@item C-M-t
Transpose two balanced expressions (@code{transpose-sexps}).
@item C-x C-t
Transpose two lines (@code{transpose-lines}).
@end table

@cindex transposition
@kindex C-t
@findex transpose-chars
  The common error of transposing two adjacent characters can be fixed
with the @kbd{C-t} command (@code{transpose-chars}).  Normally,
@kbd{C-t} transposes the two characters on either side of point.  When
given at the end of a line, @kbd{C-t} transposes the last two characters
on the line, rather than transposing the last character of the line with
the newline, which would be useless.  If you catch a
transposition error right away, you can fix it with just @kbd{C-t}.
If you catch the error later,  move the cursor back to between
the two transposed characters.  If you transposed a space with the last
character of the word before it, the word motion commands are a good way
of getting there.  Otherwise, a reverse search (@kbd{C-r}) is often the
best way.  @xref{Search}.

@kindex C-x C-t
@findex transpose-lines
@kindex M-t
@findex transpose-words
@kindex C-M-t
@findex transpose-sexps
  @kbd{Meta-t} (@code{transpose-words}) transposes the word before point
with the word after point.  It moves point forward over a word, dragging
the word preceding or containing point forward as well.  The punctuation
characters between the words do not move.  For example, @w{@samp{FOO, BAR}}
transposes into @w{@samp{BAR, FOO}} rather than @samp{@w{BAR FOO,}}.

  @kbd{C-M-t} (@code{transpose-sexps}) is a similar command for transposing
two expressions (@pxref{Lists}), and @kbd{C-x C-t} (@code{transpose-lines})
exchanges lines.  It works like @kbd{M-t} but in determines the
division of the text into syntactic units differently.

  A numeric argument to a transpose command serves as a repeat count: it
tells the transpose command to move the character (word, sexp, line) before
or containing point across several other characters (words, sexps, lines).
For example, @kbd{C-u 3 C-t} moves the character before point forward
across three other characters.  This is equivalent to repeating @kbd{C-t}
three times.  @kbd{C-u - 4 M-t} moves the word before point backward across
four words.  @kbd{C-u - C-M-t} would cancel the effect of plain
@kbd{C-M-t}.@refill

  A numeric argument of zero transposes the character (word, sexp, line)
ending after point with the one ending after the mark (otherwise a
command with a repeat count of zero would do nothing).

@node Fixing Case, Spelling, Transpose, Fixit
@section Case Conversion

@table @kbd
@item M-- M-l
Convert last word to lower case.  Note that @kbd{Meta--} is ``Meta-minus.''
@item M-- M-u
Convert last word to all upper case.
@item M-- M-c
Convert last word to lower case with capital initial.
@end table

@findex downcase-word
@findex upcase-word
@findex capitalize-word
@kindex M-@t{-} M-l
@kindex M-@t{-} M-u
@kindex M-@t{-} M-c
@cindex case conversion
@cindex words
  A  common error is to type words in the wrong case.  Because of this,
the word case-conversion commands @kbd{M-l}, @kbd{M-u}, and @kbd{M-c} do
not move the cursor when used with a negative argument.
As soon as you see you have mistyped the last word, you can simply
case-convert it and continue typing.  @xref{Case}.@refill

@node Spelling,, Fixing Case, Fixit
@section Checking and Correcting Spelling
@cindex spelling

@c doublewidecommands
@table @kbd
@item M-$
Check and correct spelling of word (@code{spell-word}).
@item M-x spell-buffer
Check and correct spelling of each word in the buffer.
@item M-x spell-region
Check and correct spelling of each word in the region.
@item M-x spell-string
Check spelling of specified word.
@end table

@kindex M-$
@findex spell-word
  To check the spelling of the word before point, and optionally correct
it, use the command @kbd{M-$} (@code{spell-word}).  This command runs an
inferior process containing the @code{spell} program to see whether the
word is correct English.  If it is not, it asks you to edit the word (in
the minibuffer) into a corrected spelling, and then performs a
@code{query-replace} to substitute the corrected spelling for the old
one throughout the buffer.

  If you exit the minibuffer without altering the original spelling, it
means you do not want to do anything to that word.  In that case, the
@code{query-replace} is not done.

@findex spell-buffer
  @kbd{M-x spell-buffer} checks each word in the buffer the same way that
@code{spell-word} does, doing a @code{query-replace} for
every incorrect word if appropriate.@refill

@findex spell-region
  @kbd{M-x spell-region} is similar to @code{spell-buffer} but operates
only on the region, not the entire buffer.

@findex spell-string
  @kbd{M-x spell-string} reads a string as an argument and checks
whether that is a correctly spelled English word.  It prints a message
giving the answer in the echo area.