GNU bug report logs - #13179
24.2.90; fill-paragraph in Makefiles

Previous Next

Package: emacs;

Reported by: Thomas Christensen <christensenthomas <at> gmail.com>

Date: Fri, 14 Dec 2012 04:23:02 UTC

Severity: normal

Merged with 13180

Found in version 24.2.90

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

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 13179 in the body.
You can then email your comments to 13179 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#13179; Package emacs. (Fri, 14 Dec 2012 04:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Christensen <christensenthomas <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 14 Dec 2012 04:23:02 GMT) Full text and rfc822 format available.

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

From: Thomas Christensen <christensenthomas <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2.90; fill-paragraph
Date: Fri, 14 Dec 2012 11:03:34 +0700
This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

Put this in a file named Makefile.am (notice the 4 space indent):

lib_LTLIBRARIES = libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
    libfoobar.la libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
    libfoobar.la libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
    libfoobar.la

Hit M-q (fill-paragraph)

It will not look like this (notice the 5 space indent):

lib_LTLIBRARIES = libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
     libfoobar.la libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
     libfoobar.la libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
     libfoobar.la

Hit M-q once more, and it will look like this:

lib_LTLIBRARIES = libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
      libfoobar.la libfoobar.la libfoobar.la libfoobar.la		\
     libfoobar.la libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
     libfoobar.la libfoobar.la

The expected behavior would be to keep looking like the first case with
4 space indentation.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/usr/local/share/emacs/24.2.90/etc/DEBUG.


In GNU Emacs 24.2.90.4 (i686-pc-linux-gnu, GTK+ Version 3.6.0)
 of 2012-12-08 on incubator_62c5ede2
Windowing system distributor `The X.Org Foundation', version 11.0.11300000
System Description:	Ubuntu 12.10

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Makefile.am

Minor modes in effect:
  iswitchb-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<return> l i C-x C-f f t / s r <tab> M a k <tab> . 
a <tab> <return> <down> <down> <next> <down> <next> 
<next> <down> <down> <down> C-SPC <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> w C-_ <S-up> <S-up> <S-up> <S-up> <S-up> 
<S-up> <S-up> <S-up> <S-up> <S-up> <S-up> <S-up> <S-up> 
M-w C-x b <return> <backspace> <backspace> C-y <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <C-right> <C-right> <C-right> <C-left> 
C-SPC <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> C-w 
l i b f o o b a r . l a <C-left> <C-left> C-e SPC <C-left> 
<C-left> C-e <backspace> <C-left> <C-left> <left> C-k 
C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y 
C-y C-y C-x C-s M-q <up> <up> C-x C-s <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> SPC SPC SPC SPC <down> <left> <left> 
<left> <left> SPC SPC SPC SPC <down> <up> M-q <up> 
<left> C-d <down> C-d <down> C-d C-x C-s <up> <up> 
<up> C-a M-x b u g <tab> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> s <backspace> m a k e <tab> - b u <tab> 
<tab> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> b u g <tab> <tab> 
<tab> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
s e n d <tab> <tab> <backspace> <backspace> <backspace> 
<backspace> r e p o <tab> r <tab> <return> C-g C-g 
C-x C-g C-g C-h C-g C-g C-g C-h k M-q <down> <right> 
<right> <right> <right> <up> C-a C-SPC <down> <down> 
<down> <down> M-w M-x r e p o r <tab> <return>

Recent messages:
Mark set [15 times]
Saving file /home/thomasc/Makefile.am...
Wrote /home/thomasc/Makefile.am
Saving file /home/thomasc/Makefile.am...
Wrote /home/thomasc/Makefile.am
Saving file /home/thomasc/Makefile.am...
Wrote /home/thomasc/Makefile.am
Making completion list... [4 times]
Quit [5 times]
Type C-x 1 to delete the help window, C-M-v to scroll help.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr help-fns emacsbug message format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils help-mode easymenu vc-git make-mode
iswitchb cus-start cus-load time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)





Merged 13179 13180. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 14 Dec 2012 04:24:01 GMT) Full text and rfc822 format available.

Changed bug title to '24.2.90; fill-paragraph in Makefiles' from '24.2.90; fill-paragraph' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 03 Jan 2013 08:25:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13179; Package emacs. (Thu, 03 Jan 2013 08:27:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Thomas Christensen <christensenthomas <at> gmail.com>
Cc: 13179 <at> debbugs.gnu.org
Subject: Re: bug#13179: 24.2.90; fill-paragraph
Date: Thu, 03 Jan 2013 03:26:34 -0500
Thomas Christensen wrote:

> Put this in a file named Makefile.am (notice the 4 space indent):
>
> lib_LTLIBRARIES = libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
>     libfoobar.la libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
>     libfoobar.la libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
>     libfoobar.la
>
> Hit M-q (fill-paragraph)
>
> It will now look like this (notice the 5 space indent):
>
> lib_LTLIBRARIES = libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
>      libfoobar.la libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
>      libfoobar.la libfoobar.la libfoobar.la libfoobar.la libfoobar.la	\
>      libfoobar.la

This is annoying...
AFAICS, this issue appeared in 24.1, but does not go away on loading
fill.el and make-mode.el from 23.4. But it does go away under edebug.
Grr.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13179; Package emacs. (Tue, 29 Jan 2013 06:58:02 GMT) Full text and rfc822 format available.

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

From: Thomas Christensen <christensenthomas <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 13179 <at> debbugs.gnu.org
Subject: Re: bug#13179: 24.2.90; fill-paragraph
Date: Tue, 29 Jan 2013 13:56:35 +0700
[Message part 1 (text/plain, inline)]
Glenn Morris <rgm <at> gnu.org> writes:

> This is annoying...
> AFAICS, this issue appeared in 24.1, but does not go away on loading
> fill.el and make-mode.el from 23.4. But it does go away under edebug.
> Grr.

I have bisected the problem (with git) to this commit:

Author: Stefan Monnier <monnier <at> iro.umontreal.ca>
Date:   Wed Sep 8 18:21:23 2010 +0200

    Misc cleanups and simplifications.

I have attached the full commit that introduced the bug.

Sincerly
Thomas Christensen

[emacs_bug_13179_commit.patch (text/x-diff, attachment)]

Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Wed, 30 Jan 2013 20:44:02 GMT) Full text and rfc822 format available.

Notification sent to Thomas Christensen <christensenthomas <at> gmail.com>:
bug acknowledged by developer. (Wed, 30 Jan 2013 20:44:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Thomas Christensen <christensenthomas <at> gmail.com>
Cc: 13179-done <at> debbugs.gnu.org
Subject: Re: bug#13179: 24.2.90; fill-paragraph
Date: Wed, 30 Jan 2013 15:41:59 -0500
> The expected behavior would be to keep looking like the first case with
> 4 space indentation.

Indeed.

> I have bisected the problem (with git) to this commit:
> Author: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date:   Wed Sep 8 18:21:23 2010 +0200
>     Misc cleanups and simplifications.

The problem was kind of nasty (disappears when you step through the
code, because it gets fixed by font-lock), but even now that
I understand clearly what was the problem, I don't see how it is related
to the above changes (maybe by setting parse-sexp-lookup-properties).

In any case, I've installed the patch below which should fix the problem
(maybe it should be fixed more generally in fill.el or in
back-to-indentation).


        Stefan


--- lisp/progmodes/make-mode.el	2013-01-01 09:11:05 +0000
+++ lisp/progmodes/make-mode.el	2013-01-30 20:38:09 +0000
@@ -1307,6 +1307,12 @@
 	(save-restriction
 	  (narrow-to-region beginning end)
 	  (makefile-backslash-region (point-min) (point-max) t)
+	  ;; Backslashed newlines are marked as puncutations, so when
+	  ;; fill-delete-newlines turns the LF into SPC, we end up with spaces
+	  ;; which back-to-indentation (called via fill-newline ->
+	  ;; fill-indent-to-left-margin -> indent-line-to) thinks are real code
+	  ;; (bug#13179).
+	  (remove-text-properties (point-min) (point-max) '(syntax-table))
 	  (let ((fill-paragraph-function nil)
                 ;; Adjust fill-column to allow space for the backslash.
                 (fill-column (- fill-column 1)))





Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Wed, 30 Jan 2013 20:44:02 GMT) Full text and rfc822 format available.

Notification sent to Thomas Christensen <christensenthomas <at> gmail.com>:
bug acknowledged by developer. (Wed, 30 Jan 2013 20:44:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 12 years and 117 days ago.

Previous Next


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