Patch: (lang-order/(s/boundp/variable-customized-p)

By the way: find-lang-string does not work on my system (LANG =
de_DE.UTF8 -> should result in de, but menu-entries are en, I know I can
set it manually, but out-of-the-box would be better)

diff --git a/lisp/sawfish/wm.jl b/lisp/sawfish/wm.jl
index b549a54..f52abc9 100644
--- a/lisp/sawfish/wm.jl
+++ b/lisp/sawfish/wm.jl
@@ -40,8 +40,8 @@
 ;; load i18n support when necessary
 
 (unless batch-mode
-  (let ((lang (or (getenv "LANGUAGE") (getenv "LC_ALL")
-                 (getenv "LC_MESSAGES") (getenv "LANG")))
+  (let ((lang (or (getenv "LANG") (getenv "LANGUAGE")
+                 (getenv "LC_MESSAGES") (getenv "LC_ALL")))
        (disable-nls (get-command-line-option "--disable-nls")))
 
     (when (and lang (not disable-nls) (not (string= lang "C")))
diff --git a/lisp/sawfish/wm/ext/fdo-menu.jl
b/lisp/sawfish/wm/ext/fdo-menu.jl
index 67c3187..74f1d68 100644
--- a/lisp/sawfish/wm/ext/fdo-menu.jl
+++ b/lisp/sawfish/wm/ext/fdo-menu.jl
@@ -116,33 +116,35 @@ Make sure the mk-saw-menu.jl is in your load path
                       (flatten (cdr input))))))
 
     (defun find-lang-string ()
-      (if (getenv "LANG")
-         (if (> (length (getenv "LANG")) 2)
-             (substring (getenv "LANG") 0 5)
-           (substring (getenv "LANG") 0 2))
-       '()))
+      (unless batch-mode
+       (let ((language (or (getenv "LANG") (getenv "LANGUAGE")
+                           (getenv "LC_MESSAGE") (getenv "LC_ALL"))))
+        (if (> (length language) 2)
+              (substring language 0 5)
+           (substring language 0 2))
+       '())))
 
     ;; Variables that can be set in .sawfish[/]rc    
-    (if (not (boundp 'desktop-directory))
+    (unless (variable-customized-p 'desktop-directory)
        (defvar desktop-directory '("/usr/share/applications")))
 
-    (if (not (boundp 'my-lang-string))
+    (unless (variable-customized-p 'my-lang-string)
        (defvar my-lang-string (find-lang-string)))
     
     (if my-lang-string
        (define name-string "Name[")
       (defvar name-string "Name="))
     
-    (if (not (boundp 'ignore-no-display))
+    (unless (variable-customized-p 'ignore-no-display)
        (defvar ignore-no-display '()))
     
-    (if (not (boundp 'want-alphabetize))
+    (unless (variable-customized-p 'want-alphabetize)
        (defvar want-alphabetize 't))
     
-    (if (not (boundp 'my-term-string))
+    (unless (variable-customized-p 'my-term-string)
        (defvar my-term-string "xterm -e "))
     
-    (if (not (boundp 'use-fdo-menu))
+    (unless (variable-customized-p 'use-fdo-menu)
        (defvar use-fdo-menu 't))
     
     ;; The Master Category List
@@ -339,4 +341,4 @@ Make sure the mk-saw-menu.jl is in your load path
          (setq apps-menu (fix-cats menu-cat-alist)))))
        
     (define-command 'update-saw-menu update-saw-menu)
-))
\ No newline at end of file
+))

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Reply via email to