all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#11552: 23.4; woman.el bold \e
@ 2012-05-24  1:32 Kevin Ryde
  2012-07-07 10:07 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2012-05-24  1:32 UTC (permalink / raw)
  To: 11552

[-- 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''

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#11552: 23.4; woman.el bold \e
  2012-05-24  1:32 bug#11552: 23.4; woman.el bold \e Kevin Ryde
@ 2012-07-07 10:07 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2012-07-07 10:07 UTC (permalink / raw)
  To: Kevin Ryde; +Cc: 11552

Kevin Ryde <user42@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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-07 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24  1:32 bug#11552: 23.4; woman.el bold \e Kevin Ryde
2012-07-07 10:07 ` Chong Yidong

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.