From 9572f2a917be2b4b68843824d08adf3548b7d0ba Mon Sep 17 00:00:00 2001 From: cage Date: Mon, 5 Apr 2021 17:33:16 +0200 Subject: [PATCH] - changed 'source-text' to 'support-text'. --- modules/rewrite-message-urls.lisp | 8 ++++---- src/gemini-viewer.lisp | 2 +- src/message-window.lisp | 22 +++++++++++----------- src/package.lisp | 4 ++-- src/program-events.lisp | 2 +- src/thread-window.lisp | 2 +- src/ui-goodies.lisp | 4 ++-- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/modules/rewrite-message-urls.lisp b/modules/rewrite-message-urls.lisp index e8f96fd..78e2b36 100644 --- a/modules/rewrite-message-urls.lisp +++ b/modules/rewrite-message-urls.lisp @@ -57,12 +57,12 @@ So the whole list is like: '((\"foo\" \"bar\") (\"old\" \"new\") ...)") (cdr mapping))) (defun rewriting-link-message-hook-fn (message-window) - (with-accessors ((source-text message-window:source-text)) message-window - (let* ((all-links (text-utils:collect-links source-text)) + (with-accessors ((support-text message-window:support-text)) message-window + (let* ((all-links (text-utils:collect-links support-text)) (links-mapping (rewriting-link-messages-links-rules all-links))) (loop for mapping in links-mapping do - (setf source-text - (rewriting-link-replace-mapping mapping source-text)))))) + (setf support-text + (rewriting-link-replace-mapping mapping support-text)))))) (defun rewriting-link-links-window-hook-fn (all-links) (let ((links-mapping (rewriting-link-messages-links-rules all-links)) diff --git a/src/gemini-viewer.lisp b/src/gemini-viewer.lisp index e310532..12a2483 100644 --- a/src/gemini-viewer.lisp +++ b/src/gemini-viewer.lisp @@ -689,7 +689,7 @@ (when-let* ((metadata (message-window:metadata window)) (source (gemini-metadata-source-file metadata)) (last (misc:safe-last-elt (gemini-metadata-history metadata)))) - (setf (message-window:source-text window) source) + (setf (message-window:support-text window) source) (draw window) (ui:info-message (format nil (_ "Viewing source of: ~a") last)))) diff --git a/src/message-window.lisp b/src/message-window.lisp index 7546452..480dbc8 100644 --- a/src/message-window.lisp +++ b/src/message-window.lisp @@ -20,10 +20,10 @@ row-oriented-widget focus-marked-window title-window) - ((source-text + ((support-text :initform nil - :initarg :source-text - :reader source-text) + :initarg :support-text + :reader support-text) (line-position-mark :initform (make-tui-string "0") :initarg :line-position-mark @@ -50,8 +50,8 @@ (setf (keybindings window) keybindings:*message-keymap*))) -(defmethod (setf source-text) (new-text (object message-window)) - (setf (slot-value object 'source-text) new-text) +(defmethod (setf support-text) (new-text (object message-window)) + (setf (slot-value object 'support-text) new-text) (handler-bind ((conditions:out-of-bounds (lambda (e) (invoke-restart 'ignore-selecting-action e)))) @@ -119,7 +119,7 @@ (defgeneric prepare-for-rendering (object &key (jump-to-first-row))) -(defgeneric append-source-text (object text +(defgeneric append-support-text (object text &key prepare-for-rendering jump-to-first-row)) (defgeneric scroll-down (object &optional amount)) @@ -200,21 +200,21 @@ :normal-text "")) (defmethod prepare-for-rendering ((object message-window) &key (jump-to-first-row t)) - (with-accessors ((source-text source-text)) object + (with-accessors ((support-text support-text)) object (when hooks:*before-prepare-for-rendering-message* (hooks:run-hook 'hooks:*before-prepare-for-rendering-message* object)) (setf (rows object) - (text->rendered-lines-rows object source-text)) + (text->rendered-lines-rows object support-text)) (when jump-to-first-row (select-row object 0)) object)) -(defmethod append-source-text ((object message-window) text +(defmethod append-support-text ((object message-window) text &key (prepare-for-rendering nil) (jump-to-first-row nil)) - (with-slots (source-text) object - (setf source-text (strcat source-text text)) + (with-slots (support-text) object + (setf support-text (strcat support-text text)) (when prepare-for-rendering (prepare-for-rendering object :jump-to-first-row jump-to-first-row)))) diff --git a/src/package.lisp b/src/package.lisp index 85dc5a2..af24350 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -1912,14 +1912,14 @@ (:shadowing-import-from :misc :random-elt :shuffle) (:export :message-window - :source-text + :support-text :metadata :gemini-window-p :display-gemini-text-p :display-chat-p :text->rendered-lines-rows :prepare-for-display-status-mode - :append-source-text + :append-support-text :scroll-down :scroll-up :scroll-end diff --git a/src/program-events.lisp b/src/program-events.lisp index 95ca900..d413e76 100644 --- a/src/program-events.lisp +++ b/src/program-events.lisp @@ -1361,7 +1361,7 @@ (db:mark-all-chat-messages-read chat-id) (setf (windows:keybindings specials:*message-window*) keybindings:*chat-message-keymap*) - (setf (message-window:source-text specials:*message-window*) + (setf (message-window:support-text specials:*message-window*) (chats-list-window:chat->text chat)) (message-window:scroll-end specials:*message-window*) (setf (message-window:metadata specials:*message-window*) diff --git a/src/thread-window.lisp b/src/thread-window.lisp index 1cdc86b..f18f42a 100644 --- a/src/thread-window.lisp +++ b/src/thread-window.lisp @@ -815,7 +815,7 @@ db:renumber-timeline-message-index." (actual-attachments (if (string= attachments reblogged-status-attachments) attachments (strcat reblogged-status-attachments attachments)))) - (setf (message-window:source-text *message-window*) + (setf (message-window:support-text *message-window*) (strcat header actual-body poll-text diff --git a/src/ui-goodies.lisp b/src/ui-goodies.lisp index cd1fbc1..135ba80 100644 --- a/src/ui-goodies.lisp +++ b/src/ui-goodies.lisp @@ -42,7 +42,7 @@ (temporary-files-count (length fs:*temporary-files-created*))) (if (> temporary-files-count 0) (progn - (setf (message-window:source-text *message-window*) temporary-text) + (setf (message-window:support-text *message-window*) temporary-text) (windows:draw *message-window*) (ask-string-input #'on-input-complete :prompt (format nil @@ -1877,7 +1877,7 @@ gemini://gemini.circumlunar.space/docs/companion/subscription.gmi "Send contents of window to a command" (flet ((on-input-complete (command) (when (string-not-empty-p command) - (when-let ((data (message-window:source-text *message-window*))) + (when-let ((data (message-window:support-text *message-window*))) (push-event (make-instance 'send-to-pipe-event :data data :command command))