diff options
author | Barry Warsaw <barry@python.org> | 1996-12-17 22:05:07 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1996-12-17 22:05:07 (GMT) |
commit | b05399373cdd9938142f74d1891a2c3d7964e153 (patch) | |
tree | 8fa4d31e4b444caa951583c6ab919eb69423d77e /Misc/python-mode.el | |
parent | 5c8bef1888076e5f15ba4f637dd86946edc04d53 (diff) | |
download | cpython-b05399373cdd9938142f74d1891a2c3d7964e153.zip cpython-b05399373cdd9938142f74d1891a2c3d7964e153.tar.gz cpython-b05399373cdd9938142f74d1891a2c3d7964e153.tar.bz2 |
(py-delete-function): new variable
(py-delete-char): funcall py-delete-function.
Diffstat (limited to 'Misc/python-mode.el')
-rw-r--r-- | Misc/python-mode.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el index 545d893..99f51d6 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -275,6 +275,9 @@ Currently-active file is at the head of the list.") (and (fboundp 'make-obsolete-variable) (make-obsolete-variable 'py-mode-hook 'python-mode-hook)) +(defvar py-delete-function 'backward-delete-char-untabify + "*Function called by `py-delete-char' when deleting characters.") + (defvar py-mode-map () "Keymap used in `python-mode' buffers.") @@ -992,7 +995,10 @@ See the `\\[py-execute-region]' docs for an account of some subtleties." ;; Functions for Python style indentation (defun py-delete-char (count) "Reduce indentation or delete character. + If point is at the leftmost column, deletes the preceding newline. +Deletion is performed by calling the function in `py-delete-function' +with a single argument (the number of characters to delete). Else if point is at the leftmost non-blank character of a line that is neither a continuation line nor a non-indenting comment line, or if @@ -1011,7 +1017,7 @@ argument delets that many characters." (py-continuation-line-p) (not py-honor-comment-indentation) (looking-at "#[^ \t\n]")) ; non-indenting # - (backward-delete-char-untabify count) + (funcall py-delete-function count) ;; else indent the same as the colon line that opened the block ;; force non-blank so py-goto-block-up doesn't ignore it |