@@ -676,15 +676,6 @@ better alternative for finding the index.")
676676(defvar imenu-example--python-generic-parens nil )
677677
678678
679- ;;;### autoload
680- (eval-when-compile
681- ; ; Imenu isn't used in XEmacs, so just ignore load errors
682- (condition-case ()
683- (progn
684- (require 'cl )
685- (require 'imenu ))
686- (error nil )))
687-
688679(defun imenu-example--create-python-index ()
689680 " Python interface function for imenu package.
690681Finds all python classes and functions/methods. Calls function
@@ -898,13 +889,16 @@ py-beep-if-tab-change\t\tring the bell if tab-width is changed"
898889 (goto-char start))
899890
900891 ; ; install imenu
901- (make-variable-buffer-local 'imenu-create-index-function )
902- (setq imenu-create-index-function
903- (function imenu-example--create-python-index))
904- (setq imenu-generic-expression
905- imenu-example--generic-python-expression)
906- (if (fboundp 'imenu-add-to-menubar )
907- (imenu-add-to-menubar (format " %s -%s " " IM" mode-name)))
892+ (if (py-safe (require 'imenu ))
893+ (progn
894+ (make-variable-buffer-local 'imenu-create-index-function )
895+ (setq imenu-create-index-function
896+ (function imenu-example--create-python-index))
897+ (setq imenu-generic-expression
898+ imenu-example--generic-python-expression)
899+ (if (fboundp 'imenu-add-to-menubar )
900+ (imenu-add-to-menubar (format " %s -%s " " IM" mode-name)))
901+ ))
908902
909903 ; ; run the mode hook. py-mode-hook use is deprecated
910904 (if python-mode-hook
@@ -2249,7 +2243,7 @@ of some continuation line.
22492243Primarily for entering new code:
22502244\t \\ [indent-for-tab-command]\t indent line appropriately
22512245\t \\ [py-newline-and-indent]\t insert newline, then indent
2252- \t \\ [py-delete-char ]\t reduce indentation, or delete single character
2246+ \t \\ [py-electric-backspace ]\t reduce indentation, or delete single character
22532247
22542248Primarily for reindenting existing code:
22552249\t \\ [py-guess-indent-offset]\t guess py-indent-offset from file content; change locally
@@ -2288,7 +2282,7 @@ indentation of the (closest code or indenting-comment) preceding
22882282statement, or adds an extra py-indent-offset blanks if the preceding
22892283statement has `:' as its last significant (non-whitespace and non-
22902284comment) character. If the suggested indentation is too much, use
2291- \\ [py-delete-char ] to reduce it.
2285+ \\ [py-electric-backspace ] to reduce it.
22922286
22932287Continuation lines are given extra indentation. If you don't like the
22942288suggested indentation, change it to something you do like, and Python-
@@ -2317,7 +2311,7 @@ repeatedly, and as explained above, \\[indent-for-tab-command] can't guess the b
23172311structure you intend.
23182312%c:indent-for-tab-command
23192313%c:py-newline-and-indent
2320- %c:py-delete-char
2314+ %c:py-electric-backspace
23212315
23222316
23232317The next function may be handy when editing code you didn't write:
0 commit comments