GNU bug report logs - #8515
M-x indent-region should skip everything between <pre>-tags.

Previous Next

Package: emacs;

Reported by: Rob Browning <rlb <at> defaultvalue.org>

Date: Sun, 17 Apr 2011 18:58:02 UTC

Severity: wishlist

To reply to this bug, email your comments to 8515 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8515; Package emacs. (Sun, 17 Apr 2011 18:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Rob Browning <rlb <at> defaultvalue.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 17 Apr 2011 18:58:02 GMT) Full text and rfc822 format available.

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

From: Rob Browning <rlb <at> defaultvalue.org>
To: bug-gnu-emacs <at> gnu.org
Cc: 448563-forwarded <at> bugs.debian.org, Juhapekka Tolvanen <juhtolv <at> iki.fi>
Subject: Re: M-x indent-region should skip everything between <pre>-tags.
Date: Sun, 17 Apr 2011 13:57:48 -0500
(If possible, please preserve the 448563-forwarded address in any replies.)

The following bug report (or perhaps feature request) was filed with the
Debian tracker, and I wanted to ask your opinion about the issue.

Thanks

Juhapekka Tolvanen writes:

> You reproduce this bug this way:

> 1) Download this HTML-file:

> http://iki.fi/juhtolv/mswordmail.html

> or this:

> http://iki.fi/juhtolv/pelle.html

> 2) Open it with GNU Emacs. nXML-mode should be the major mode.

> 3) Check out, how text between <pre> -tags is not indented.

> 4) Paint whole buffer with key: Ctrl-x h

> 5) Give line-command called indent-region.

> 6) See, how everything between <pre> -tags became indented although it
> is not supposed to.

> Maybe this should be configurable option. Normal Tab-key pressing
> in the beginning of some line between <pre>-tags should cause some kind
> of indentation according to Tabs-vs-Spaces-settings.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8515; Package emacs. (Tue, 19 Apr 2011 13:00:03 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Rob Browning <rlb <at> defaultvalue.org>
Cc: 8515 <at> debbugs.gnu.org, Juhapekka Tolvanen <juhtolv <at> iki.fi>,
	448563-forwarded <at> bugs.debian.org
Subject: Re: bug#8515: M-x indent-region should skip everything between
	<pre>-tags.
Date: Tue, 19 Apr 2011 09:59:13 -0300
> The following bug report (or perhaps feature request) was filed with the
> Debian tracker, and I wanted to ask your opinion about the issue.

The behavior of auto-indentation within things like <pre>...</pre> (or
here-docs in sh scripts, or strings in other languages, ...) is indeed
not perfect, is inconsistent between major modes, and moreover it's
always clear what is the best behavior.

I think what should happen is:
- indent-region should not modify those lines.
- indent-according-to-mode should not modify those lines either.
- indent-for-tab-command should behave as if in text-mode (i.e. call
  something like indent-relative).

Ideally, this should be recognized and treated as a case of "multiple
major modes" and you should even be able to specify what major mode
to use within the <pre>...</pre> region, so that the indentation there
can be better than text-mode's.
  

        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8515; Package emacs. (Tue, 19 Apr 2011 13:46:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Rob Browning <rlb <at> defaultvalue.org>
Cc: 8515 <at> debbugs.gnu.org, Juhapekka Tolvanen <juhtolv <at> iki.fi>,
	448563-forwarded <at> bugs.debian.org
Subject: Re: bug#8515: M-x indent-region should skip everything between
	<pre>-tags.
Date: Tue, 19 Apr 2011 10:45:36 -0300
> The behavior of auto-indentation within things like <pre>...</pre> (or
> here-docs in sh scripts, or strings in other languages, ...) is indeed
> not perfect, is inconsistent between major modes, and moreover it's
> always clear what is the best behavior.
^^^
not


        Stefan




This bug report was last modified 14 years and 58 days ago.

Previous Next


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