home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / gnu / emacs / help / 3447 < prev    next >
Encoding:
Text File  |  1992-07-22  |  1.6 KB  |  37 lines

  1. Newsgroups: gnu.emacs.help
  2. Path: sparky!uunet!stanford.edu!ames!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!uw-beaver!news.u.washington.edu!news.u.washington.edu!ethanb
  3. From: ethanb@ptolemy.astro.washington.edu (Ethan Bradford)
  4. Subject: Re: TAB key in (C Fill) mode
  5. In-Reply-To: gs4t@virginia.edu's message of Wed, 22 Jul 1992 18:06:40 GMT
  6. To: gs4t@virginia.edu, abz@controls.ccd.harris.com
  7. Message-ID: <ETHANB.92Jul22140006@ptolemy.astro.washington.edu>
  8. Lines: 20
  9. Sender: news@u.washington.edu (USENET News System)
  10. Organization: U. of Washington
  11. References: <1992Jul22.163405.12632@ccd.harris.com>
  12.     <1992Jul22.180640.5161@murdoch.acc.Virginia.EDU>
  13. Date: Wed, 22 Jul 1992 22:00:06 GMT
  14.  
  15. In article <1992Jul22.180640.5161@murdoch.acc.Virginia.EDU> gs4t@virginia.edu (Gnanasekaran  Swaminathan) writes:
  16.    abz@controls.ccd.harris.com (Andrew B. Ziffer) writes:
  17.    > I am sick of typing ctrl-Q TAB to get a simple tab in my C code every time
  18.    > I want to indent something.  How can I change this so the TAB key alone will
  19.    > print a single TAB in (C Fill) mode.
  20.  
  21.    Add the following line to your .emacs file.
  22.  
  23.    (setq indent-tabs-mode     t)
  24.  
  25. That's not quite right.  Indent-tabs-mode just controls whether tabs
  26. or spaces are used to move over to the goal column; it doesn't keep
  27. it from using fancy logic to select a goal column.
  28.  
  29. To make a tab just insert itself, you will have to create a
  30. c-mode-hook which overrides the default definition of the tab key.
  31. The following code (in your .emacs file) should do what you want:
  32.  
  33. (setq c-mode-hook
  34.  (function (lambda () (local-set-key "\t" 'self-insert-command))))
  35. --
  36. -- Ethan (ethanb@u.washington.edu)
  37.