From: nuxdoors@cegetel.net
To: rms@gnu.org, monnier@IRO.UMontreal.CA
Cc: bug-gnu-emacs@gnu.org
Subject: Re: reindent-then-newline-and-indent doesn't indent properly in emacs 22.1
Date: Fri, 19 Oct 2007 03:07:17 +0200 [thread overview]
Message-ID: <47180345.70401@cegetel.net> (raw)
In-Reply-To: <E1Ii13p-0002HF-Q4@fencepost.gnu.org>
Here is a concrete example to illustrate my previous remark with respect
to the need of removing spaces around point when calling
delete-horizontal-space.
Tested with GNU Emacs 23.0.50.1 (with the new
reindent-then-newline-and-indent)
Let's create indentation_test.txt like this :
cat > indentation_test.txt <<EOF
First line.
Second line.
1234 -- columns
EOF
emacs was called like this :
emacs -Q -nw indentation_test.txt
"_" represents a space, "|" represents cursor position.
Place the cursor on the fourth column ( on the space preceding "S" ),
like this :
____First line.
___|Second line.
1234 -- columns
Then do a reindent-then-newline-and-indent, you will get this :
____First line.
_
____|Second line.
1234 -- columns
With the previous version of reindent-then-newline-and-indent you would
get this :
____First line.
____|Second line.
1234 -- columns
The patch to restore previous behavior that works for me :
*** lisp/simple.el.orig Thu Oct 18 06:52:06 2007
--- lisp/simple.el Fri Oct 19 02:41:22 2007
***************
*** 636,642 ****
;; Usually indent-according-to-mode should "preserve" point, but
it is
;; not guaranteed; e.g. indent-to-left-margin doesn't.
(save-excursion (indent-according-to-mode))
! (delete-horizontal-space t))
(indent-according-to-mode)))
(defun quoted-insert (arg)
--- 636,644 ----
;; Usually indent-according-to-mode should "preserve" point, but
it is
;; not guaranteed; e.g. indent-to-left-margin doesn't.
(save-excursion (indent-according-to-mode))
! ;; Delete forward too in case reindent-then-newline-and-indent
! ;; was called while point was within the line indentation.
! (delete-horizontal-space))
(indent-according-to-mode)))
(defun quoted-insert (arg)
next prev parent reply other threads:[~2007-10-19 1:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-12 23:02 reindent-then-newline-and-indent doesn't indent properly in emacs 22.1 nuxdoors
2007-10-13 8:40 ` martin rudalics
2007-10-13 22:24 ` nuxdoors
2007-10-14 13:23 ` nuxdoors
2007-10-14 18:26 ` martin rudalics
2007-10-15 1:37 ` Richard Stallman
2007-10-16 0:07 ` nuxdoors
2007-10-16 19:09 ` Richard Stallman
2007-10-16 20:39 ` nuxdoors
[not found] ` <E1Ii13p-0002HF-Q4@fencepost.gnu.org>
2007-10-19 1:07 ` nuxdoors [this message]
[not found] ` <mailman.2040.1192368226.18990.bug-gnu-emacs@gnu.org>
2007-10-14 19:48 ` Stefan Monnier
2007-10-16 15:19 ` Stefan Monnier
2007-10-14 12:46 ` nuxdoors
2007-10-15 1:37 ` Richard Stallman
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=47180345.70401@cegetel.net \
--to=nuxdoors@cegetel.net \
--cc=bug-gnu-emacs@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
--cc=rms@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).