aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Ryde2012-07-07 18:06:38 +0800
committerChong Yidong2012-07-07 18:06:38 +0800
commitf0ecdfeaae605c0dfa115925a38f285641a69230 (patch)
tree3fc4167d0ae51f7a6ce803e818a6bb7a6bce19e3
parentab4c47d38224bc57201e45fa0918ca708bcf7054 (diff)
downloademacs-f0ecdfeaae605c0dfa115925a38f285641a69230.tar.gz
emacs-f0ecdfeaae605c0dfa115925a38f285641a69230.zip
* woman.el (woman-strings): Fix double-quote handling.
(woman-decode-region): Replace escaped-escapes without destroying bold or underline. Fixes: debbugs:1151
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/woman.el49
2 files changed, 32 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6491025648f..1dc857d134a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12012-07-07 Kevin Ryde <user42@zip.com.au>
2
3 * woman.el (woman-strings): Fix double-quote handling (Bug#1151).
4 (woman-decode-region): Replace escaped-escapes without destroying
5 bold or underline (Bug#11552).
6
12012-07-07 Chong Yidong <cyd@gnu.org> 72012-07-07 Chong Yidong <cyd@gnu.org>
2 8
3 * simple.el (yank-pop-change-selection): Doc fix (Bug#11361). 9 * simple.el (yank-pop-change-selection): Doc fix (Bug#11361).
diff --git a/lisp/woman.el b/lisp/woman.el
index e220cd8062c..4767b062335 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -2385,20 +2385,20 @@ Currently set only from '\" t in the first line of the source file.")
2385 (if woman-negative-vertical-space 2385 (if woman-negative-vertical-space
2386 (woman-negative-vertical-space from)) 2386 (woman-negative-vertical-space from))
2387 2387
2388 (if woman-preserve-ascii 2388 (when woman-preserve-ascii
2389 ;; Re-instate escaped escapes to just `\' and unpaddable 2389 ;; Re-instate escaped escapes to just `\' and unpaddable spaces
2390 ;; spaces to just `space', without inheriting any text 2390 ;; to just `space'. This is not necessary for display since
2391 ;; properties. This is not necessary, UNLESS the buffer is to 2391 ;; there are display table entries for the escaped chars, but it
2392 ;; be saved as ASCII. 2392 ;; is necessary if the buffer might be saved as ASCII.
2393 (progn 2393 ;;
2394 (goto-char from) 2394 ;; `subst-char-in-region' preserves text properties on the
2395 (while (search-forward woman-escaped-escape-string nil t) 2395 ;; characters, which is necessary for bold, underline, etc on
2396 (delete-char -1) 2396 ;; \e. There's usually no face on spaces, but if there is then
2397 (insert ?\\)) 2397 ;; it's good to keep that too.
2398 (goto-char from) 2398 (subst-char-in-region from (point-max)
2399 (while (search-forward woman-unpadded-space-string nil t) 2399 woman-escaped-escape-char ?\\)
2400 (delete-char -1) 2400 (subst-char-in-region from (point-max)
2401 (insert ?\s)))) 2401 woman-unpadded-space-char ?\s))
2402 2402
2403 ;; Must return the new end of file if used in format-alist. 2403 ;; Must return the new end of file if used in format-alist.
2404 (point-max))) 2404 (point-max)))
@@ -2865,15 +2865,18 @@ interpolated by `\*x' and `\*(xx' escapes."
2865 (re-search-forward "[^ \t\n]+") 2865 (re-search-forward "[^ \t\n]+")
2866 (let ((string (match-string 0))) 2866 (let ((string (match-string 0)))
2867 (skip-chars-forward " \t") 2867 (skip-chars-forward " \t")
2868; (setq string 2868 (if (= ?\" (following-char))
2869; (cons string 2869 ;; Double-quote starts a string, eg.
2870; ;; hack (?) for CGI.man! 2870 ;; .ds foo "blah...
2871; (cond ((looking-at "\"\"") "\"") 2871 ;; is value blah... through to newline. There's no
2872; ((looking-at ".*") (match-string 0))) 2872 ;; closing " (per the groff manual), but rather any
2873; )) 2873 ;; further " is included literally in the string. Eg.
2874 ;; Above hack causes trouble in arguments! 2874 ;; .ds foo ""
2875 (looking-at ".*") 2875 ;; sets foo to a single " character.
2876 (setq string (cons string (match-string 0))) 2876 (forward-char))
2877 (setq string (cons string
2878 (buffer-substring (point)
2879 (line-end-position))))
2877 ;; This should be an update, but consing a new string 2880 ;; This should be an update, but consing a new string
2878 ;; onto the front of the alist has the same effect: 2881 ;; onto the front of the alist has the same effect:
2879 (setq woman-string-alist (cons string woman-string-alist)) 2882 (setq woman-string-alist (cons string woman-string-alist))