diff --git a/core/tabs.lisp b/core/tabs.lisp index 7d0dbe4..b5daeb9 100644 --- a/core/tabs.lisp +++ b/core/tabs.lisp @@ -35,14 +35,14 @@ (setf (getf *hooks* :switch-page) (list #'(lambda (browser) - (ui-update browser :history t) - (ui-update browser :progress t) - (ui-update browser :scroll-indicator t) - (ui-update browser :link-hover "") - (ui-update browser - :tabs-update-title (current-tab browser)) - (ui-update browser :current-tab t) - (ui-update browser :uri t)))) + (ui-updates browser + :history t + :progress t + :scroll-indicator t + :link-hover "" + :tabs-update-title (current-tab browser) + :current-tab t + :uri t)))) (defcallback notebook-switch-page :void ((notebook pobject) diff --git a/core/ui-update.lisp b/core/ui-update.lisp index 3f4e483..e088a80 100644 --- a/core/ui-update.lisp +++ b/core/ui-update.lisp @@ -22,6 +22,11 @@ (defgeneric ui-update (browser symbol value)) +(defmacro ui-updates (browser &rest plist) + (append '(progn) + (loop for item in (pair-plist plist) + collect `(ui-update ,browser ,@item)))) + (defun escape-single-quote (str) (ppcre:regex-replace-all "'" str "\\\\'")) diff --git a/site/ui/status/status.lisp b/site/ui/status/status.lisp index 0177210..6a38dd9 100644 --- a/site/ui/status/status.lisp +++ b/site/ui/status/status.lisp @@ -23,12 +23,12 @@ (run-hook :prompt-leave b)) (defexport statusbar-init (b) - (ui-update b :uri t) - (ui-update b :scroll-indicator t) - (ui-update b :progress t) - (ui-update b :history t) - (ui-update b :keymode t) - (ui-update b :current-tab t)) + (ui-updates b :uri t + :scroll-indicator t + :progress t + :history t + :keymode t + :current-tab t)) (defexport quit () (sb-ext:exit :abort t)) diff --git a/site/ui/tabs/tabs.lisp b/site/ui/tabs/tabs.lisp index 7728b7f..e1f4e01 100644 --- a/site/ui/tabs/tabs.lisp +++ b/site/ui/tabs/tabs.lisp @@ -11,8 +11,8 @@ `(-1 ,height)))))) (defexport tabs-init (b) - (ui-update b :tabs-reset-list t) - (ui-update b :current-tab t)) + (ui-updates b :tabs-reset-list t + :current-tab t)) (defscript (ui-symbol-to-uri 'tabs) :exports (tabbar-request-height