]> code.delx.au - gnu-emacs/commitdiff
(tit-process-header): Convert argument of KEYPROMPT if it contains an escape.
authorRichard M. Stallman <rms@gnu.org>
Tue, 16 Sep 1997 01:57:52 +0000 (01:57 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 16 Sep 1997 01:57:52 +0000 (01:57 +0000)
(tit-process-body): Handle trailing whitespace and multiple spaces
between phrases.

lisp/international/titdic-cnv.el

index f80925325cd4d2b091a97d7a3d818a87a3459ccd..9a4f6ddfbcc7574d70ea3f43e2e3da127b053af0 100644 (file)
               (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))))))))
          (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")))