* bug#12756: 24.2; woman.el vs adaptive-fill-mode hanging indent
@ 2012-10-28 21:44 Kevin Ryde
2012-10-30 2:53 ` Stefan Monnier
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Ryde @ 2012-10-28 21:44 UTC (permalink / raw)
To: 12756
[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]
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@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.
[-- Attachment #2: percent.1 --]
[-- Type: text/plain, Size: 127 bytes --]
.TH FOO 1
.SH NAME
%%%%Some percents one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: woman.el.adaptive-fill.diff --]
[-- Type: text/x-diff, Size: 472 bytes --]
--- woman.el.orig 2012-10-27 16:21:40.000000000 +1100
+++ woman.el 2012-10-27 16:25:06.000000000 +1100
@@ -2228,6 +2228,7 @@
;; it were it would need to be a marker rather than a position!
;; First force the correct environment:
(let ((case-fold-search nil) ; This is necessary!
+ (adaptive-fill-mode nil) ; No special "%" "#" etc filling.
(woman-string-alist woman-string-alist)
(woman-fill-column woman-fill-column)
woman-negative-vertical-space)
[-- Attachment #4: Type: text/plain, Size: 1234 bytes --]
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#12756: 24.2; woman.el vs adaptive-fill-mode hanging indent
2012-10-28 21:44 bug#12756: 24.2; woman.el vs adaptive-fill-mode hanging indent Kevin Ryde
@ 2012-10-30 2:53 ` Stefan Monnier
2012-11-03 20:31 ` Kevin Ryde
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2012-10-30 2:53 UTC (permalink / raw)
To: Kevin Ryde; +Cc: 12756
> 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)
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#12756: 24.2; woman.el vs adaptive-fill-mode hanging indent
2012-10-30 2:53 ` Stefan Monnier
@ 2012-11-03 20:31 ` Kevin Ryde
2012-11-04 12:29 ` Stefan Monnier
2012-11-06 1:50 ` Stefan Monnier
0 siblings, 2 replies; 5+ messages in thread
From: Kevin Ryde @ 2012-11-03 20:31 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 12756
Stefan Monnier <monnier@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.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-11-06 1:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-28 21:44 bug#12756: 24.2; woman.el vs adaptive-fill-mode hanging indent Kevin Ryde
2012-10-30 2:53 ` Stefan Monnier
2012-11-03 20:31 ` Kevin Ryde
2012-11-04 12:29 ` Stefan Monnier
2012-11-06 1:50 ` Stefan Monnier
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).