emacs-devel
[Top][All Lists]
Advanced

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

Re: dedent in Python-mode


From: Markus Triska
Subject: Re: dedent in Python-mode
Date: Mon, 25 Jun 2007 01:44:32 +0200

Paul Pogonyshev <address@hidden> writes:

> Can it then behave like TAB, but if this doesn't change indentation
> at all, then start dedenting from what TAB proposes as default?

Put this in your .emacs:

(defun python-personal-dedent ()
  (interactive)
  (let ((cyclic 'python-indent-line-backward)
        (old (current-indentation)))
    (setq this-command cyclic)
    (python-indent-line-backward)
    (setq last-command cyclic)
    (when (and (> python-indent-list-length 1)
               (= old (current-indentation)))
      (python-indent-line-backward))))

(add-hook 'python-mode-hook
          (lambda ()
            (local-set-key [backtab] 'python-personal-dedent)))




reply via email to

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