Support for preferences.lisp and *open-external* default parameter

This commit is contained in:
David Botton 2024-03-07 15:20:50 -05:00
parent 2a2ef18c11
commit 4bb3dfbefa
4 changed files with 31 additions and 2 deletions

View file

@ -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*"))

View file

@ -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

View file

@ -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))

15
tools/preferences.lisp.sample vendored Normal file
View file

@ -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")