GNU bug report logs - #12822
python.el, python-indent-guess-indent-offset

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> easy-emacs.de>

Date: Wed, 7 Nov 2012 11:06:01 UTC

Severity: minor

Tags: wontfix

Done: Fabián Ezequiel Gallina <fabian <at> anue.biz>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Subject: python.el, python-indent-guess-indent-offset
Date: Wed, 07 Nov 2012 12:05:13 +0100
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




This bug report was last modified 12 years and 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.