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

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!apple!apple!amdahl!sde!lfk
  2. From: lfk@kerbit.uts.amdahl.com (Lynn Kerby)
  3. Newsgroups: gnu.emacs.help
  4. Subject: Re: TAB key in (C Fill) mode
  5. Message-ID: <LFK.92Jul24223655@kerbit.uts.amdahl.com>
  6. Date: 25 Jul 92 05:36:55 GMT
  7. References: <1992Jul22.163405.12632@ccd.harris.com>
  8.     <1992Jul22.180640.5161@murdoch.acc.Virginia.EDU>
  9.     <ETHANB.92Jul22140006@ptolemy.astro.washington.edu>
  10. Sender: netnews@uts.amdahl.com
  11. Reply-To: lfk@uts.amdahl.com
  12. Organization: Amdahl Corporation, Sunnyvale, CA
  13. Lines: 35
  14. In-reply-to: ethanb@ptolemy.astro.washington.edu's message of 22 Jul 92 22:00:06 GMT
  15.  
  16. In article <ETHANB.92Jul22140006@ptolemy.astro.washington.edu> ethanb@ptolemy.astro.washington.edu (Ethan Bradford) writes:
  17. >
  18. >   That's not quite right.  Indent-tabs-mode just controls whether tabs
  19. >   or spaces are used to move over to the goal column; it doesn't keep
  20. >   it from using fancy logic to select a goal column.
  21. >
  22. >   To make a tab just insert itself, you will have to create a
  23. >   c-mode-hook which overrides the default definition of the tab key.
  24. >   The following code (in your .emacs file) should do what you want:
  25. >
  26. >   (setq c-mode-hook
  27. >    (function (lambda () (local-set-key "\t" 'self-insert-command))))
  28. >   --
  29. >   -- Ethan (ethanb@u.washington.edu)
  30.  
  31. It isn't necessary to put it into a hook, and as other posters have
  32. mentioned, you will loose the *useful* indent function.  I have the
  33. following settings in my .emacs:
  34.  
  35. (setq c-tab-always-indent t)
  36. (define-key c-mode-map "\M-\C-i" 'c-indent-command)
  37. (define-key c-mode-map "\C-i" 'self-insert-command)
  38.  
  39. Which pretty much does the same thing, without a mode hook, and allows
  40. Meta-TAB to perform indentation when desired.
  41. --
  42.      Lynn Kerby  -  Amdahl Corporation
  43.                     Sunnyvale, CA
  44.                     ...amdahl!lfk
  45.             lfk@uts.amdahl.com
  46.  
  47. Disclaimer: Any and all opinions expressed herein are my own and do not
  48.             necessarily represent the views of anyone, especially my
  49.             employer.
  50.  
  51.