Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug#12822: python.el, python-indent-guess-indent-offset

2 views
Skip to first unread message

Andreas Röhler

unread,
Nov 7, 2012, 6:05:13 AM11/7/12
to 12...@debbugs.gnu.org
Hi,

with current python.el

python-indent-guess-indent-offset proceeds:

(defun python-indent-guess-indent-offset ()
"Guess and set `python-indent-offset' for the current buffer."
(interactive)
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(let ((block-end))
(while (and (not block-end)
(re-search-forward
(python-rx line-start block-start) nil t))
[...]


IIUC it fetches the first beginning of block in buffer.
As in Python every block might have it's own ideas WRT
volume of indent-step, this must fail when
indent-offset is set differently in current block.

Guessing must not take the first block from BOB, but
the next beginning of block from point upward.

IMO as it's just a guess, where the default-value might
be delivered, it also should not call `widen'.

Best,

Andreas



0 new messages