--- 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)))