unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: 12822@debbugs.gnu.org
Subject: bug#12822: python.el, python-indent-guess-indent-offset
Date: Wed, 07 Nov 2012 12:05:13 +0100	[thread overview]
Message-ID: <509A4069.5060409@easy-emacs.de> (raw)

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





             reply	other threads:[~2012-11-07 11:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07 11:05 Andreas Röhler [this message]
2013-01-24  1:40 ` bug#12822: (no subject) Fabián Ezequiel Gallina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=509A4069.5060409@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=12822@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).