[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emacs] tabs, spaces, and indentation

From: Nerius Landys
Subject: Re: [emacs] tabs, spaces, and indentation
Date: Mon, 11 Oct 2010 15:14:53 -0700

> However, there is still one thing needed to make it behave just
> like Notepad.  Let's say my cursor is positioned immediately following a tab
> character.  When I hit Backspace (I believe that causes a function
> "backward-delete-char" to be called), it converts that tab character into a
> bunch of spaces, then deletes the last space.  I would really like Backspace
> to just delete the tab character.  Is there any way to do this?  I suppose
> I'd have to rebind Backspace to a function other than backward-delete-char,
> but I'm not sure which function.

Is it bound to backward-delete-char?  Or is it bound to
backward-delete-char-untabify?  I believe the former does what you

Woohoo!  My final .emacs file does just what I want.

(defun my-c-mode-common-hook ()
  (c-toggle-electric-state -1)
  (setq tab-width 8
        c-basic-offset 8
        indent-tabs-mode t
        backward-delete-char-untabify-method nil)
  (define-key c-mode-base-map (kbd "TAB") 'self-insert-command))
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]