--- sawfish-xgettext-orig Wed Feb 14 20:49:33 2001 +++ sawfish-xgettext Sat Feb 24 01:12:56 2001 @@ -33,10 +33,25 @@ (define (get-key key args) (and (listp args) (memq key args))) +;; used for extracting of strings used in tabs of "Window Matchers" window +;; - shamelessly copied from the sawfish/ui/widgets/match-window.jl + (define (beautify-symbol-name symbol) + (cond ((stringp symbol) symbol) + ((not (symbolp symbol)) (format "%s" symbol)) + (t + (let ((name (copy-sequence (symbol-name symbol)))) + (while (string-match "[-:]" name) + (setq name (concat (substring name 0 (match-start)) + ? (substring name (match-end))))) + (aset name 0 (char-upcase (aref name 0))) + name)))) + + (define (helper form) (case (car form) ((defcustom) (let ((doc (nth 3 form)) + (customname (nth 1 form)) (keys (nthcdr 4 form))) (let ((tooltip (cadr (get-key ':tooltip keys)))) (when tooltip @@ -44,9 +59,56 @@ (let ((type* (cadr (get-key ':type* keys)))) (when type* (scan type*))) + (let ((options (cadr (get-key ':options keys)))) + (when (listp options) + (mapc (lambda (s) (if s + ( register (symbol-name s)))) options))) + (let ((type (cadr (get-key ':type keys)))) + (when (and (listp type) + (symbolp (car type)) + (equal (car type) 'choice)) + (mapc (lambda (s) + (if (symbolp s) (register (symbol-name s)))) (cdr type))) + ;; extract names of all keymaps + (when (and (symbolp type) + (equal type 'keymap)) + (let ((name (symbol-name customname))) + (when (string-match "-keymap" name) + (setq name (substring name 0 (match-start)))) + (while (string-match "[-:]" name) + (setq name (concat (substring name 0 (match-start)) + ? (substring name (match-end))))) + (aset name 0 (char-upcase (aref name 0))) + (setq doc name)))) (when (stringp doc) (register doc)))) - + ((define-window-animator define-focus-mode define-placement-mode) + (let ((name (nth 1 form))) + (if (not (symbolp name)) (register (symbol-name (nth 1 name)))))) + ((define-match-window-property) + (let ((name (nth 1 form))) + (if (not (symbolp name)) (register (beautify-symbol-name (nth 1 name)))))) + ((i18ncardefvar) + (let ((varname (nth 1 form))) + (case varname + ((match-window-properties) + (let ((props (nth 2 form))) + (mapc (lambda (x) ( + mapc (lambda (y) (register + (beautify-symbol-name (car y)))) (cddr x) + )) (nth 1 props)) + (mapc (lambda (x) ( + mapc (lambda (y) (register (cadr y))) (cadr x) + )) (nth 1 props)) + ) + ) + ((match-window-x-properties) + (let ((props (nth 2 form))) + (mapc (lambda (x) (register + (cdr x)) ) (nth 1 props)) + ) + ) + ))) ((defgroup) (let ((real-name (nth 2 form))) (when (stringp real-name) @@ -69,7 +131,9 @@ (register doc)))))) (let ((type (car (cdr (get-key #:type keys))))) (when type - (scan type))))) + (scan type))) + (if (symbolp (cadr name)) (register (beautify-symbol-name (nth 1 name)))) + )) (t (scan-list form))))