changeset 19943:23ada3fdbc8b

(tit-process-header): Convert argument of KEYPROMPT if it contains an escape. (tit-process-body): Handle trailing whitespace and multiple spaces between phrases.
author Richard M. Stallman <rms@gnu.org>
date Tue, 16 Sep 1997 01:57:52 +0000
parents b960ef5a1ecc
children e274dc2d61f1
files lisp/international/titdic-cnv.el
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/titdic-cnv.el	Mon Sep 15 23:21:03 1997 +0000
+++ b/lisp/international/titdic-cnv.el	Tue Sep 16 01:57:52 1997 +0000
@@ -176,6 +176,10 @@
 	       (cond ((looking-at "KEYPROMPT(\\(.*\\)):[ \t]*")
 		      (let ((key-char (match-string 1)))
 			(goto-char (match-end 0))
+			(if (string-match "\\\\[0-9]+" key-char)
+			    (setq key-char
+				  (car (read-from-string (format "\"%s\""
+								 key-char)))))
 			(setq tit-keyprompt
 			      (cons (cons key-char (tit-read-key-value))
 				    tit-keyprompt))))))))
@@ -320,17 +324,18 @@
 	  (if tit-phrase
 	      (progn
 		;; PHRASE1 PHRASE2 ... => ["PHRASE1" "PHRASE2" ...]
-		(insert "[\"")
-		(skip-chars-forward "^ \t\n")
+		(insert "[")
+		(skip-chars-forward " \t")
 		(while (not (eolp))
 		  (insert "\"")
-		  (forward-char 1)
+		  (skip-chars-forward "^ \t\n")
 		  (insert "\"")
-		  (skip-chars-forward "^ \t\n"))
-		(insert "\"])"))
+		  (skip-chars-forward " \t"))
+		(insert "])"))
 	    ;; TRANSLATIONS => "TRANSLATIONS"
 	    (insert "\"")
 	    (end-of-line)
+	    (skip-chars-backward " \t")
 	    (insert "\")"))
 	  (forward-line 1))))
     (insert ")\n")))