From 4bb3dfbefa2a90c9b2e21fd68c2d69c3cd1e5149 Mon Sep 17 00:00:00 2001 From: David Botton Date: Thu, 7 Mar 2024 15:20:50 -0500 Subject: [PATCH] Support for preferences.lisp and *open-external* default parameter --- tools/clog-builder-projects.lisp | 2 ++ tools/clog-builder-settings.lisp | 7 ++++++- tools/clog-builder.lisp | 9 ++++++++- tools/preferences.lisp.sample | 15 +++++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 tools/preferences.lisp.sample diff --git a/tools/clog-builder-projects.lisp b/tools/clog-builder-projects.lisp index 4fcc43c..b71246f 100644 --- a/tools/clog-builder-projects.lisp +++ b/tools/clog-builder-projects.lisp @@ -11,6 +11,8 @@ (defun projects-setup (panel) (let* ((app (connection-data-item panel "builder-app-data"))) + (when *open-external* + (setf (checkedp (open-ext panel)) t)) (when (uiop:directory-exists-p #P"~/common-lisp/") (pushnew #P"~/common-lisp/" (symbol-value (read-from-string "ql:*local-project-directories*")) diff --git a/tools/clog-builder-settings.lisp b/tools/clog-builder-settings.lisp index 25d4077..50972c7 100644 --- a/tools/clog-builder-settings.lisp +++ b/tools/clog-builder-settings.lisp @@ -1,12 +1,17 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG Builder - UI Design tool for CLOG ;;;; -;;;; (c) 2020-2022 David Botton ;;;; +;;;; (c) 2020-2024 David Botton ;;;; ;;;; License BSD 3 Clause ;;;; ;;;; ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :clog-tools) +;; These are defaults, if the file preferences.lisp exists +;; they will be used instead + +;; Open panels and files in new browser tabs by default +(defparameter *open-external* nil) ;; Best Light Theme for Lisp (defparameter *editor-theme* "ace/theme/iplastic") ;; Best Dark Theme for Lisp diff --git a/tools/clog-builder.lisp b/tools/clog-builder.lisp index c74181a..6e03413 100644 --- a/tools/clog-builder.lisp +++ b/tools/clog-builder.lisp @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG Builder - UI Design tool for CLOG ;;;; -;;;; (c) 2020-2022 David Botton ;;;; +;;;; (c) 2020-2024 David Botton ;;;; ;;;; License BSD 3 Clause ;;;; ;;;; ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -2924,6 +2924,8 @@ It parse the string TEXT without using READ functions." :client-movement *client-side-movement*)) (d (create-dir-view (window-content win)))) (set-geometry d :units "%" :width 100 :height 100) + (when *open-external* + (setf (checkedp (open-file-ext d)) t)) (when dir (populate-dir-win d dir)))) @@ -3053,6 +3055,11 @@ must specific default project :PROJECT and it will be batch rerendered and shutdown application. You can set the specific STATIC-ROOT or set SYSTEM to use that asdf system's static root. if DIR then the directory window instead of the project window will be displayed." + (load (format nil "~A/preferences.lisp" + (merge-pathnames "./tools/" + (asdf:system-source-directory :clog))) + :if-does-not-exist nil + :verbose t) (if project (setf *start-project* (string-downcase (format nil "~A" project))) (setf *start-project* nil)) diff --git a/tools/preferences.lisp.sample b/tools/preferences.lisp.sample new file mode 100644 index 0000000..6b4101e --- /dev/null +++ b/tools/preferences.lisp.sample @@ -0,0 +1,15 @@ +(in-package :clog-tools) + +(setf *open-external* t) +(setf *editor-theme* "ace/theme/terminal") +(setf *editor-keybinding* "ace/keyboard/emacs") +(setf *editor-renderer-options* +"fontSize : 16, + showInvisibles : false, + displayIndentGuides : true, + printMarginColumn : 80, + showPrintMargin : true, + showLineNumbers : true, + showGutter : true, + enableBasicAutocompletion: true, + enableLiveAutocompletion : true")