unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#12822: python.el, python-indent-guess-indent-offset
@ 2012-11-07 11:05 Andreas Röhler
  2013-01-24  1:40 ` bug#12822: (no subject) Fabián Ezequiel Gallina
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Röhler @ 2012-11-07 11:05 UTC (permalink / raw)
  To: 12822

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-24  1:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-07 11:05 bug#12822: python.el, python-indent-guess-indent-offset Andreas Röhler
2013-01-24  1:40 ` bug#12822: (no subject) Fabián Ezequiel Gallina

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).