On Sat, Nov 09, 2002 at 08:35:44PM +0000, Jerry Asher wrote:
> Tom Jackson writes:
>
> >I'm trying to configure Xemacs to use spaces instead of tabs when auto
> >indenting source files. The advice given in
> >http://aolserver.com/docs/devel/tech/standards.html#overall was to add

> Try setting indent-tabs-mode to nil. That works for me in emacs and
> for c. I haven't tried it with tcl.

That reminds me, if anyone knows how to force auto-fill-mode to
always, ALWAYS default to OFF, no matter what damn mode Emacs is in,
please let me know.  I despise auto-fill mode, especially for things
like composing this email, where I may want to paste in long lines of
code.

Anyway, on the tabs thing.  For GNU Emacs, I put the somewhat kludgy
code below into my "~/.emacs".  That definitely worked for Tcl.  I
believe the same could should also work for Xemacs, but I don't use it
there as one of my co-workers set up something slicker (which I
believe also uses indent-tabs-mode nil) in our site Xemacs config.

  ; TODO: There's a really simple one line command to set the default
  ; for ALL modes to indent-tabs-mode nil (and it works for sql-mode!)
  ; but I forget what it is!

  ;(add-hook 'tcl-mode-hook (lambda () (setq indent-tabs-mode nil)))
  (defun kill-indent-tabs () (setq indent-tabs-mode nil))
  (add-hook 'emacs-lisp-mode-hook 'kill-indent-tabs)
  (add-hook 'lisp-mode-hook       'kill-indent-tabs)
  (add-hook 'tcl-mode-hook        'kill-indent-tabs)
  (add-hook 'html-mode-hook       'kill-indent-tabs)
  (add-hook 'sh-mode-hook         'kill-indent-tabs)
  (add-hook 'c-mode-hook          'kill-indent-tabs)
  (add-hook '+c++-mode-hook       'kill-indent-tabs)
  (add-hook 'fortran-mode-hook    'kill-indent-tabs)
  ; This isn't sufficient for sql-mode :
  ;(add-hook 'sql-mode-hook        'kill-indent-tabs)

Hm, this is part of that Xemacs site config I mentioned, I think the
setq-default might just be the thing my comment above was saying I
forgot about:

  (setq-default indent-tabs-mode nil)   ;; disable tabs on indent lines
  (defun kill-indent-tabs () (setq indent-tabs-mode nil))
  (dolist (hook '(emacs-lisp-mode-hook lisp-mode-hook c-mode-hook c++-mode-hook 
tcl-mode-hook
                  sh-mode-hook fortran-mode-hook))
    (add-hook hook 'kill-indent-tabs))
  (defalias 'lush-lines 'flush-lines)
  (defalias 'rh 'dictionary-search)

--
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com

Reply via email to