(python-mode): Removed vi vi vi hack for setting the tab width from a

magic comment.  Now Guido only has to worry about the northern
Wisconsin Braces Freedom Fighter Militia.
This commit is contained in:
Barry Warsaw 1998-03-13 18:53:15 +00:00
parent 55f0aabe88
commit 9e9968859e
1 changed files with 0 additions and 25 deletions

View File

@ -938,31 +938,6 @@ py-beep-if-tab-change\t\tring the bell if tab-width is changed"
;; Emacs 19 requires this
(if (boundp 'comment-multi-line)
(setq comment-multi-line nil))
;; hack to allow overriding the tabsize in the file (see tokenizer.c)
;;
;; not sure where the magic comment has to be; to save time
;; searching for a rarity, we give up if it's not found prior to the
;; first executable statement.
;;
;; BAW - on first glance, this seems like complete hackery. Why was
;; this necessary, and is it still necessary?
(let ((case-fold-search nil)
(start (point))
new-tab-width)
(if (re-search-forward
"^[ \t]*#[ \t]*vi:set[ \t]+tabsize=\\([0-9]+\\):"
(prog2 (py-next-statement 1) (point) (goto-char 1))
t)
(progn
(setq new-tab-width
(string-to-int
(buffer-substring (match-beginning 1) (match-end 1))))
(if (= tab-width new-tab-width)
nil
(setq tab-width new-tab-width)
(message "Caution: tab-width changed to %d" new-tab-width)
(if py-beep-if-tab-change (beep)))))
(goto-char start))
;; Install Imenu, only works for Emacs.
(when (py-safe (require 'imenu))
(make-variable-buffer-local 'imenu-create-index-function)