]> granicus.if.org Git - python/commitdiff
(python-mode): Removed vi vi vi hack for setting the tab width from a
authorBarry Warsaw <barry@python.org>
Fri, 13 Mar 1998 18:53:15 +0000 (18:53 +0000)
committerBarry Warsaw <barry@python.org>
Fri, 13 Mar 1998 18:53:15 +0000 (18:53 +0000)
magic comment.  Now Guido only has to worry about the northern
Wisconsin Braces Freedom Fighter Militia.

Misc/python-mode.el

index c09daa93237b15cdb701b043f671fb05e8d60539..8bd2b1f044ed02b5387b7d25933ecc0a1e335158 100644 (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)