From 3a8d4b661c5fe2e14bac3b4bed8e4cbeb1d2ef81 Mon Sep 17 00:00:00 2001 From: Miguel de la Cruz Date: Wed, 1 Jun 2022 11:49:54 +0200 Subject: [PATCH] Forbid inserting text in between channel characters --- mattermost.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mattermost.el b/mattermost.el index b7552c5..9e35814 100644 --- a/mattermost.el +++ b/mattermost.el @@ -169,14 +169,18 @@ if the user is not present" (channel-id (plist-get channel :id))) (message "button action! %s" channel-id))) - 'channel channel))) + 'channel channel + 'read-only t + 'rear-sticky t + 'front-sticky t))) -(defun show-root () +(defun mattermost-show-root () "Populates the Mattermost Root buffer and changes to it" (interactive) (let ((rootb (get-buffer-create "*Mattermost Root*"))) (with-current-buffer rootb - (let ((teams (mattermost-get-teams))) + (let ((inhibit-read-only t) + (teams (mattermost-get-teams))) (erase-buffer) (dolist (team teams) (let* ((team-id (plist-get team :id)) @@ -194,7 +198,7 @@ if the user is not present" (define-key map (kbd "n") #'next-line) (define-key map (kbd "p") #'previous-line) (define-key map (kbd "q") #'bury-buffer) - (define-key map (kbd "g") #'show-root) + (define-key map (kbd "g") #'mattermost-show-root) map) "The keymap for mattermost-root-mode") @@ -214,7 +218,7 @@ user to check their status and select between them") (mattermost-close) (let ((password (mattermost-read-password))) (mattermost-login mattermost-login-id password)) - (show-root)) + (mattermost-show-root)) (defun mattermost-close () "Closes the connection with the Mattermost server"