[sawfish] user.jl: cleanups.



commit ebb2a5e9825ae0adbdfca4bb91991844863ef0d7
Author: Teika kazura <teika lavabit com>
Date:   Wed Sep 15 22:11:58 2010 +0900

    user.jl: cleanups.
    
    * Deleted fake support of ~/.sawfish/rc{,.jl,.jlc}. A file with a suffix was
      never read, but the code was in the guise of supporting them.
    * Renaming of "sawmill" is not done when batch-mode. The code is pushed
      into a function.
    * Deleted (require 'sawfish.wm.ext.error-handler) from `defaults.jl'. It is
      now meaningless because it's already opened by user.jl.

 lisp/sawfish/wm/defaults.jl |    3 --
 lisp/sawfish/wm/user.jl     |   65 ++++++++++++++++++++----------------------
 2 files changed, 31 insertions(+), 37 deletions(-)
---
diff --git a/lisp/sawfish/wm/defaults.jl b/lisp/sawfish/wm/defaults.jl
index 103fc73..ca17308 100644
--- a/lisp/sawfish/wm/defaults.jl
+++ b/lisp/sawfish/wm/defaults.jl
@@ -44,6 +44,3 @@
 ;; extra XFCE integration module
   (if (get-x-property 'root '_DT_SAVE_MODE)
       (require 'sawfish.wm.integration.xfce)))))
-
-;; save errors to aid debugging
-(require 'sawfish.wm.ext.error-handler)
diff --git a/lisp/sawfish/wm/user.jl b/lisp/sawfish/wm/user.jl
index 30a3dc9..b7d0e44 100644
--- a/lisp/sawfish/wm/user.jl
+++ b/lisp/sawfish/wm/user.jl
@@ -69,23 +69,24 @@
       (error
        (error-handler-function (car data) (cdr data)))))
 
-  ;; they're probably not going to leave us in an unusable state
+  (define (rename-old-stuff)
+    (when (and (file-directory-p "~/.sawmill")
+	       (not (file-exists-p "~/.sawfish")))
+      (rename-file "~/.sawmill" "~/.sawfish")
+      (message "Renamed directory ~/.sawmill -> ~/.sawfish")
+      (make-symlink "~/.sawmill" ".sawfish")
+      (message "Created .sawmill symlink (delete if unwanted)"))
+
+    (when (and (file-exists-p "~/.sawmillrc")
+	       (not (file-exists-p "~/.sawfishrc")))
+      (rename-file "~/.sawmillrc" "~/.sawfishrc")
+      (message "Renamed file ~/.sawmillrc -> ~/.sawfishrc"))
+    )
+
+;;; From here, executed at startup.
   (unless (get-command-line-option "--no-rc")
     (condition-case error-data
 	(progn
-	  ;; try to rename ~/.sawmill to ~/.sawfish
-	  (when (and (file-directory-p "~/.sawmill")
-		     (not (file-exists-p "~/.sawfish")))
-	    (rename-file "~/.sawmill" "~/.sawfish")
-	    (message "Renamed directory ~/.sawmill -> ~/.sawfish")
-	    (make-symlink "~/.sawmill" ".sawfish")
-	    (message "Created .sawmill symlink (delete if unwanted)"))
-
-	  (when (and (file-exists-p "~/.sawmillrc")
-	             (not (file-exists-p "~/.sawfishrc")))
-	    (rename-file "~/.sawmillrc" "~/.sawfishrc")
-	    (message "Renamed file ~/.sawmillrc -> ~/.sawfishrc"))
-
 	  ;; First the site-wide stuff
 	  (load-all "site-init" (lambda (f) (safe-load f nil t)))
 
@@ -94,25 +95,22 @@
 	      (safe-load "rep-defaults" t))
 
 	  (unless batch-mode
-	    (let ((rc-file-exists-p (lambda (f)
-				      (or (file-exists-p f)
-					  (file-exists-p (concat f ".jl"))
-					  (file-exists-p (concat f ".jlc"))))))
-	      ;; load these before customized settings
-	      (load "sawfish/wm/defaults" t)
-
-	      ;; then the customized options
-	      (condition-case data
-		  (custom-load-user-file)
-		(error
-		 (format (stderr-file) "error in custom file--> %S\n" data)))
-
-	      ;; then the sawfish specific user configuration
-	      (let loop ((rest rc-files))
-                   (when rest
-                     (if (rc-file-exists-p (car rest))
-                         (safe-load (car rest) t t t)
-                       (loop (cdr rest))))))))
+	    (rename-old-stuff)
+	    ;; load these before customized settings
+	    (load "sawfish/wm/defaults" t)
+
+	    ;; then the customized options
+	    (condition-case data
+		(custom-load-user-file)
+	      (error
+	       (format (stderr-file) "error in custom file--> %S\n" data)))
+
+	    ;; then the sawfish specific user configuration
+	    (let loop ((rest rc-files))
+		 (when rest
+		   (if (file-exists-p (car rest))
+		       (safe-load (car rest) t t t)
+		     (loop (cdr rest)))))))
       (error
        (format (stderr-file) "error in local config--> %S\n" error-data))))
 
@@ -134,7 +132,6 @@
   (unless (and (boundp 'window-menu) window-menu)
     (require 'sawfish.wm.ext.beos-window-menu))
 
-  ;; load the new WM-spec code by default now
   (load-module 'sawfish.wm.state.wm-spec)
 
   ;; Use all arguments which are left.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]