GNU bug report logs - #12756
24.2; woman.el vs adaptive-fill-mode hanging indent

Previous Next

Package: emacs;

Reported by: Kevin Ryde <user42 <at> zip.com.au>

Date: Sun, 28 Oct 2012 22:14:01 UTC

Severity: normal

Found in version 24.2

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 12756 in the body.
You can then email your comments to 12756 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#12756; Package emacs. (Sun, 28 Oct 2012 22:14:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kevin Ryde <user42 <at> zip.com.au>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 28 Oct 2012 22:14:01 GMT) Full text and rfc822 format available.

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

From: Kevin Ryde <user42 <at> zip.com.au>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2; woman.el vs adaptive-fill-mode hanging indent
Date: Mon, 29 Oct 2012 08:44:26 +1100
[Message part 1 (text/plain, inline)]
With the file percent.1 below and an 80-column screen the file percent.1
below processed with

    M-x woman-find-file percent.1

gives

    %%%%Some percents  one two three  four five six  seven eight
        nine ten eleven twelve thirteen fourteen fifteen.

Where I expected

    %%%%Some percents  one two three  four five six  seven eight
    nine ten eleven twelve thirteen fourteen fifteen.

It seems woman.el uses fill-region-as-paragraph and that
adaptive-fill-mode, which is t by default, causes the "%"s in the input
to become a fill prefix.  I think that shouldn't be done, that instead
woman.el should control all indentation.

It seems this only affects roff source where the paragraph flowed is a
single line of the input.  You can make a very long input line to see
multiple hanging lines in the output.  Various other prefix characters
in adaptive-fill-regexp are affected similarly, eg "#" instead of "%".

I get some joy from forcing adaptive-fill-mode off in
woman-decode-region.

2012-10-27  Kevin Ryde	<user42 <at> zip.com.au>

	* woman.el (woman-decode-region): Let-bind adaptive-fill-mode nil so a
	paragraph consisting of a single long input line "%%Foo ..." doesn't
	have "%" treated as a hanging indent.

[percent.1 (text/plain, attachment)]
[woman.el.adaptive-fill.diff (text/x-diff, attachment)]
[Message part 4 (text/plain, inline)]


In GNU Emacs 24.2.1 (i486-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2012-09-10 on biber, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Configured using:
 `configure '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.2/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/i386-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars'
 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_AU
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12756; Package emacs. (Tue, 30 Oct 2012 02:57:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Kevin Ryde <user42 <at> zip.com.au>
Cc: 12756 <at> debbugs.gnu.org
Subject: Re: bug#12756: 24.2; woman.el vs adaptive-fill-mode hanging indent
Date: Mon, 29 Oct 2012 22:53:36 -0400
> With the file percent.1 below and an 80-column screen the file percent.1
> below processed with
>     M-x woman-find-file percent.1
> gives
>     %%%%Some percents  one two three  four five six  seven eight
>         nine ten eleven twelve thirteen fourteen fifteen.

Does the patch below work as well for you?


        Stefan


=== modified file 'lisp/woman.el'
--- lisp/woman.el	2012-10-29 10:30:11 +0000
+++ lisp/woman.el	2012-10-30 02:51:34 +0000
@@ -2253,6 +2253,8 @@
 	 (set-face-font 'woman-symbol woman-symbol-font
 			(and (frame-live-p woman-frame) woman-frame)))
 
+    (setq-local adaptive-fill-mode nil) ; No special "%" "#" etc filling.
+
     ;; Set syntax and display tables:
     (set-syntax-table woman-syntax-table)
     (woman-set-buffer-display-table)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12756; Package emacs. (Sat, 03 Nov 2012 20:35:02 GMT) Full text and rfc822 format available.

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

From: Kevin Ryde <user42 <at> zip.com.au>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 12756 <at> debbugs.gnu.org
Subject: Re: bug#12756: 24.2; woman.el vs adaptive-fill-mode hanging indent
Date: Sun, 04 Nov 2012 07:31:24 +1100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
> Does the patch below work as well for you?

Yes, but I would do it just as a let since the setting is only needed
for the formatting operation.  Better not to have a buffer-local
override the user's global preference if you don't have to.

Not that normally there would be any subsequent filling to make a
difference, since the buffer is read-only after formatting, but just in
case.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12756; Package emacs. (Sun, 04 Nov 2012 12:33:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Kevin Ryde <user42 <at> zip.com.au>
Cc: 12756 <at> debbugs.gnu.org
Subject: Re: bug#12756: 24.2; woman.el vs adaptive-fill-mode hanging indent
Date: Sun, 04 Nov 2012 07:29:19 -0500
>> Does the patch below work as well for you?
> Yes, but I would do it just as a let since the setting is only needed
> for the formatting operation.  Better not to have a buffer-local
> override the user's global preference if you don't have to.

But a let-binding impacts every fill that happens during the lifetime of
the let, including in completely unrelated buffers.


        Stefan




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Tue, 06 Nov 2012 01:54:01 GMT) Full text and rfc822 format available.

Notification sent to Kevin Ryde <user42 <at> zip.com.au>:
bug acknowledged by developer. (Tue, 06 Nov 2012 01:54:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Kevin Ryde <user42 <at> zip.com.au>
Cc: 12756-done <at> debbugs.gnu.org
Subject: Re: bug#12756: 24.2; woman.el vs adaptive-fill-mode hanging indent
Date: Mon, 05 Nov 2012 20:50:11 -0500
>> Does the patch below work as well for you?
> Yes,

Thanks, installed,


        Stefan




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

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

Previous Next


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