From: Kevin Ryde <user42@zip.com.au>
To: 11552@debbugs.gnu.org
Subject: bug#11552: 23.4; woman.el bold \e
Date: Thu, 24 May 2012 11:32:54 +1000 [thread overview]
Message-ID: <87y5oi4b3t.fsf@blah.blah> (raw)
[-- Attachment #1: Type: text/plain, Size: 696 bytes --]
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@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.
[-- Attachment #2: esc-face.1 --]
[-- Type: text/plain, Size: 40 bytes --]
.TH FOO 1
.SH NAME
.B
bold \e backslash
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: woman.el.esc-face.diff --]
[-- Type: text/x-diff, Size: 1450 bytes --]
--- 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)))
[-- Attachment #4: Type: text/plain, Size: 912 bytes --]
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''
next reply other threads:[~2012-05-24 1:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-24 1:32 Kevin Ryde [this message]
2012-07-07 10:07 ` bug#11552: 23.4; woman.el bold \e Chong Yidong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y5oi4b3t.fsf@blah.blah \
--to=user42@zip.com.au \
--cc=11552@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.