Mercurial > cpython-lru_cache-weakref
diff Misc/python-mode.el @ 4764:88714fbf9a06 legacy-trunk
(py-delete-function): new variable
(py-delete-char): funcall py-delete-function.
| author | Barry Warsaw <barry@python.org> |
|---|---|
| date | Tue, 17 Dec 1996 22:05:07 +0000 |
| parents | 38689aceae7b |
| children | e21f1d2595de |
line wrap: on
line diff
--- a/Misc/python-mode.el Tue Dec 17 21:56:10 1996 +0000 +++ b/Misc/python-mode.el Tue Dec 17 22:05:07 1996 +0000 @@ -275,6 +275,9 @@ (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 @@ ;; 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 @@ (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
