GNU bug report logs - #11552
23.4; woman.el bold \e

Previous Next

Package: emacs;

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

Date: Thu, 24 May 2012 01:40:01 UTC

Severity: minor

Tags: patch

Found in version 23.4

Done: Chong Yidong <cyd <at> gnu.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 11552 in the body.
You can then email your comments to 11552 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#11552; Package emacs. (Thu, 24 May 2012 01:40: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. (Thu, 24 May 2012 01:40: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: 23.4; woman.el bold \e
Date: Thu, 24 May 2012 11:32:54 +1000
[Message part 1 (text/plain, inline)]
With the esc-face.1 below,

    (woman-find-file "esc-face.1")

produces

     bold \ backslash

with the "\" not in bold, where I expected it would be (man-db+groff
makes it bold).

I think woman.el.esc-face.diff below could correct this.

2012-05-24  Kevin Ryde  <user42 <at> zip.com.au>

	* woman.el (woman-decode-region): Replace escaped-escapes using
	`subst-char-in-region' so bold or underline on \e is preserved.


I struck this in some perl pod2man output.  It uses \e for backslashes
in "verbatim" output paragraphs (bits of sample code usually).  Those
parts are in ".ft CW" font, which comes out of woman.el as woman-unknown
face (which is red).  But the face wasn't on the backslashes.


[esc-face.1 (text/plain, inline)]
.TH FOO 1
.SH NAME
.B
bold \e backslash
[woman.el.esc-face.diff (text/x-diff, inline)]
--- woman.el.orig	2012-05-19 12:08:35.000000000 +1000
+++ woman.el	2012-05-24 07:09:48.000000000 +1000
@@ -2394,17 +2394,20 @@
 	(woman-negative-vertical-space from))
 
     (if woman-preserve-ascii
-	;; Re-instate escaped escapes to just `\' and unpaddable
-	;; spaces to just `space', without inheriting any text
-	;; properties.  This is not necessary, UNLESS the buffer is to
-	;; be saved as ASCII.
+	;; Re-instate escaped escapes to just `\' and unpaddable spaces to
+	;; just `space'.  This is not necessary for display since there's
+	;; display table entries for the escaped chars, but it is necessary
+	;; if the buffer might be saved as ASCII.
+	;;
+	;; `subst-char-in-region' preserves text properties on the
+	;; characters, which is necessary for bold, underline, etc on \e.
+	;; There's usually no face on spaces, but if there is then it's good
+	;; to keep that too.
 	(progn
-	  (goto-char from)
-	  (while (search-forward woman-escaped-escape-string nil t)
-	    (delete-char -1) (insert ?\\))
-	  (goto-char from)
-	  (while (search-forward woman-unpadded-space-string nil t)
-	    (delete-char -1) (insert ?\ ))))
+          (subst-char-in-region from (point-max)
+                                woman-escaped-escape-char ?\\)
+          (subst-char-in-region from (point-max)
+                                woman-unpadded-space-char ?\ )))
 
     ;; Must return the new end of file if used in format-alist.
     (point-max)))
[Message part 4 (text/plain, inline)]



In GNU Emacs 23.4.1 (i486-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2012-04-08 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/emacs23:/etc/emacs:/usr/local/share/emacs/23.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.4/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 -Wformat-security -Werror=format-security -Wall -DDEBIAN -O2' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11552; Package emacs. (Sat, 07 Jul 2012 10:13:02 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> gnu.org>
To: Kevin Ryde <user42 <at> zip.com.au>
Cc: 11552 <at> debbugs.gnu.org
Subject: Re: bug#11552: 23.4; woman.el bold \e
Date: Sat, 07 Jul 2012 18:07:36 +0800
Kevin Ryde <user42 <at> zip.com.au> writes:

> With the esc-face.1 below,
>
>     (woman-find-file "esc-face.1")
>
> produces
>
>      bold \ backslash
>
> with the "\" not in bold, where I expected it would be (man-db+groff
> makes it bold).
>
> I think woman.el.esc-face.diff below could correct this.

Committed, thanks.




bug closed, send any further explanations to 11552 <at> debbugs.gnu.org and Kevin Ryde <user42 <at> zip.com.au> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 07 Jul 2012 10:13:03 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. (Sat, 04 Aug 2012 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 39 days ago.

Previous Next


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