GNU bug report logs - #16461
24.3.50; electric eats too much

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Thu, 16 Jan 2014 08:10:01 UTC

Severity: normal

Found in version 24.3.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16461 in the body.
You can then email your comments to 16461 AT debbugs.gnu.org in the normal way.

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

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


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16461; Package emacs. (Thu, 16 Jan 2014 08:10:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 16 Jan 2014 08:10:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> jurta.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; electric eats too much
Date: Thu, 16 Jan 2014 09:51:47 +0200
In Text mode typing RET on a formfeed character ^L deletes it.
The presence of ^L means it's here on purpose, so RET should keep it.

electric-indent-post-self-insert-function calls indent-according-to-mode
that uses special casing for indent-relative (that is the default
indent-line-function in text-mode).  I don't understand why it
calls ^L-eating indent-line-to instead of indent-relative
but without this special casing, indent-relative works fine
and doesn't eat ^L.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16461; Package emacs. (Thu, 16 Jan 2014 14:04:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: 16461 <at> debbugs.gnu.org
Subject: Re: bug#16461: 24.3.50; electric eats too much
Date: Thu, 16 Jan 2014 09:02:59 -0500
> I don't understand why it calls ^L-eating indent-line-to instead of
> indent-relative but without this special casing, indent-relative works
> fine and doesn't eat ^L.

If we can get the same behavior using indent-relative, I'm perfectly
fine with it.  But I also think that indent-line-to should *not* eat ^L.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16461; Package emacs. (Fri, 17 Jan 2014 08:07:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 16461 <at> debbugs.gnu.org
Subject: Re: bug#16461: 24.3.50; electric eats too much
Date: Fri, 17 Jan 2014 10:05:17 +0200
> But I also think that indent-line-to should *not* eat ^L.

This patch fixes the problem and doesn't eat ^L:

=== modified file 'lisp/indent.el'
--- lisp/indent.el	2014-01-15 08:22:41 +0000
+++ lisp/indent.el	2014-01-17 08:05:10 +0000
@@ -265,7 +265,7 @@ (defun indent-line-to (column)
   "Indent current line to COLUMN.
 This function removes or adds spaces and tabs at beginning of line
 only if necessary.  It leaves point at end of indentation."
-  (back-to-indentation)
+  (backward-to-indentation 0)
   (let ((cur-col (current-column)))
     (cond ((< cur-col column)
 	   (if (>= (- column (* (/ cur-col tab-width) tab-width)) tab-width)
@@ -274,7 +274,7 @@ (defun indent-line-to (column)
 	   (indent-to column))
 	  ((> cur-col column) ; too far right (after tab?)
 	   (delete-region (progn (move-to-column column t) (point))
-			  (progn (back-to-indentation) (point)))))))
+			  (progn (backward-to-indentation 0) (point)))))))
 
 (defun current-left-margin ()
   "Return the left margin to use for this line.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16461; Package emacs. (Fri, 17 Jan 2014 14:41:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: 16461 <at> debbugs.gnu.org
Subject: Re: bug#16461: 24.3.50; electric eats too much
Date: Fri, 17 Jan 2014 09:40:33 -0500
>> But I also think that indent-line-to should *not* eat ^L.
> This patch fixes the problem and doesn't eat ^L:

Looks OK, thanks.  This difference between back-to-indentation and
backward-to-indentation is really obscure.


        Stefan




Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Mon, 20 Jan 2014 08:57:02 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> jurta.org>:
bug acknowledged by developer. (Mon, 20 Jan 2014 08:57:04 GMT) Full text and rfc822 format available.

Message #19 received at 16461-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 16461-done <at> debbugs.gnu.org
Subject: Re: bug#16461: 24.3.50; electric eats too much
Date: Mon, 20 Jan 2014 10:47:10 +0200
>>> But I also think that indent-line-to should *not* eat ^L.
>> This patch fixes the problem and doesn't eat ^L:
>
> Looks OK, thanks.  This difference between back-to-indentation and
> backward-to-indentation is really obscure.

Perhaps a new function with more descriptive name could be added later.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16461; Package emacs. (Mon, 20 Jan 2014 14:13:01 GMT) Full text and rfc822 format available.

Message #22 received at 16461-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: 16461-done <at> debbugs.gnu.org
Subject: Re: bug#16461: 24.3.50; electric eats too much
Date: Mon, 20 Jan 2014 09:12:24 -0500
>> Looks OK, thanks.  This difference between back-to-indentation and
>> backward-to-indentation is really obscure.
> Perhaps a new function with more descriptive name could be added later.

I think back-to-indentation should use the same " \t" pattern rather
than rely on syntax tables.


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 18 Feb 2014 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 92 days ago.

Previous Next


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