mirror of
https://codeberg.org/cage/tinmop/
synced 2025-03-12 11:20:05 +01:00
- added 'eval-command';
- added docstrings for scroll lock related functions.
This commit is contained in:
parent
f9f5a868b3
commit
76676f2d2f
@ -173,9 +173,11 @@
|
|||||||
|
|
||||||
(define-key "M-up" #'pass-focus-on-top)
|
(define-key "M-up" #'pass-focus-on-top)
|
||||||
|
|
||||||
(define-key "M-l" #'message-window-lock-scrolling)
|
(define-key "M-s l" #'message-window-lock-scrolling)
|
||||||
|
|
||||||
(define-key "M-u" #'message-window-unlock-scrolling)
|
(define-key "M-s u" #'message-window-unlock-scrolling)
|
||||||
|
|
||||||
|
(define-key "M-e" #'eval-command)
|
||||||
|
|
||||||
;; focus
|
;; focus
|
||||||
|
|
||||||
|
@ -2705,7 +2705,8 @@
|
|||||||
:gempub-library-window-close
|
:gempub-library-window-close
|
||||||
:gempub-open-file
|
:gempub-open-file
|
||||||
:message-window-lock-scrolling
|
:message-window-lock-scrolling
|
||||||
:message-window-unlock-scrolling))
|
:message-window-unlock-scrolling
|
||||||
|
:eval-command))
|
||||||
|
|
||||||
(defpackage :scheduled-events
|
(defpackage :scheduled-events
|
||||||
(:use
|
(:use
|
||||||
|
@ -2276,9 +2276,29 @@ gemini page the program is rendering."
|
|||||||
(gemini-viewer:load-gemini-url iri-to-open :give-focus-to-message-window t)))
|
(gemini-viewer:load-gemini-url iri-to-open :give-focus-to-message-window t)))
|
||||||
|
|
||||||
(defun message-window-lock-scrolling ()
|
(defun message-window-lock-scrolling ()
|
||||||
|
"Lock automatic scrolling of message window"
|
||||||
(setf (message-window:adjust-rows-strategy specials:*message-window*)
|
(setf (message-window:adjust-rows-strategy specials:*message-window*)
|
||||||
#'line-oriented-window:adjust-rows-noop))
|
#'line-oriented-window:adjust-rows-noop)
|
||||||
|
(info-message (_ "Message window scrolling locked")))
|
||||||
|
|
||||||
(defun message-window-unlock-scrolling ()
|
(defun message-window-unlock-scrolling ()
|
||||||
|
"Allow automatic scrolling of the message window to always show the
|
||||||
|
last line (the one on the bottom of the text; useful for chats, for
|
||||||
|
example)."
|
||||||
(setf (message-window:adjust-rows-strategy specials:*message-window*)
|
(setf (message-window:adjust-rows-strategy specials:*message-window*)
|
||||||
#'line-oriented-window:adjust-rows-select-last))
|
#'line-oriented-window:adjust-rows-select-last)
|
||||||
|
(info-message (_ "Message window scrolling unlocked")))
|
||||||
|
|
||||||
|
(defun eval-command ()
|
||||||
|
"Eval (execute) a lisp form. (e.g '(ui:notify \"foo\")' )"
|
||||||
|
(flet ((on-input-completed (query)
|
||||||
|
(push-event (make-instance 'function-event
|
||||||
|
:payload
|
||||||
|
(lambda ()
|
||||||
|
(tui:with-notify-errors
|
||||||
|
(db-utils:with-ready-database (:connect nil)
|
||||||
|
(with-input-from-string (stream query)
|
||||||
|
(funcall (compile nil
|
||||||
|
`(lambda () ,(read stream))))))))))))
|
||||||
|
(ui:ask-string-input #'on-input-completed
|
||||||
|
:prompt (format nil (_ "eval: ")))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user