mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-17 08:10:36 +01:00
- ensured, when program starts, that the init file in the user's home is loaded (if such init file exists).
This commit is contained in:
parent
9005e9ec55
commit
c924e8f636
@ -122,13 +122,15 @@ etc.) happened"
|
|||||||
(shared-init)
|
(shared-init)
|
||||||
(db-utils:with-ready-database (:connect nil)
|
(db-utils:with-ready-database (:connect nil)
|
||||||
(complete:initialize-complete-username-cache)
|
(complete:initialize-complete-username-cache)
|
||||||
(handler-case
|
(let ((system-config-file-found-p (modules:load-sys-module +starting-init-file+
|
||||||
(or (ignore-errors (modules:load-sys-module +starting-init-file+))
|
:not-found-signal-error nil)))
|
||||||
(modules:load-module +starting-init-file+))
|
(multiple-value-bind (home-config-file-found-p error-message)
|
||||||
(error (e)
|
(modules:load-module +starting-init-file+ :not-found-signal-error nil)
|
||||||
|
(when (not (or system-config-file-found-p
|
||||||
|
home-config-file-found-p))
|
||||||
(croatoan:end-screen)
|
(croatoan:end-screen)
|
||||||
(format *error-output* "~a~%" e)
|
(format *error-output* "~a~%" error-message)
|
||||||
(os-utils:exit-program 1)))
|
(os-utils:exit-program 1))))
|
||||||
;; init main window for first...
|
;; init main window for first...
|
||||||
(main-window:init)
|
(main-window:init)
|
||||||
(keybindings-window:init)
|
(keybindings-window:init)
|
||||||
|
@ -17,11 +17,13 @@
|
|||||||
|
|
||||||
(in-package :modules)
|
(in-package :modules)
|
||||||
|
|
||||||
(defun load-sys-module (path)
|
(defun load-sys-module (path &key (not-found-signal-error t))
|
||||||
(let ((file (get-sys-config-file path)))
|
(when-let ((file (if not-found-signal-error
|
||||||
|
(get-sys-config-file path)
|
||||||
|
(ignore-errors (get-sys-config-file path)))))
|
||||||
(load file :verbose nil :print nil)))
|
(load file :verbose nil :print nil)))
|
||||||
|
|
||||||
(defun load-module (path)
|
(defun load-module (path &key (not-found-signal-error t))
|
||||||
(flet ((%load (file)
|
(flet ((%load (file)
|
||||||
(load file :verbose nil :print nil)))
|
(load file :verbose nil :print nil)))
|
||||||
(let ((config-file (conditions:with-default-on-error (nil)
|
(let ((config-file (conditions:with-default-on-error (nil)
|
||||||
@ -34,10 +36,13 @@
|
|||||||
(data-file
|
(data-file
|
||||||
(%load data-file))
|
(%load data-file))
|
||||||
(t
|
(t
|
||||||
(error (format nil
|
(let ((error-message (format nil
|
||||||
(_ "Unrecoverable error: file ~a not found in any of the directory ~a ~a ~a ~a")
|
(_ "Unrecoverable error: file ~a not found in any of the directory ~a ~a ~a ~a")
|
||||||
path
|
path
|
||||||
+sys-data-dir+
|
+sys-data-dir+
|
||||||
+sys-conf-dir+
|
+sys-conf-dir+
|
||||||
(home-datadir)
|
(home-datadir)
|
||||||
(home-confdir))))))))
|
(home-confdir))))
|
||||||
|
(if not-found-signal-error
|
||||||
|
(error error-message)
|
||||||
|
(values nil error-message))))))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user