From 99f720964dea03651890ee1e2cddff3ab186b962 Mon Sep 17 00:00:00 2001 From: Alexander Griffith Date: Sat, 13 May 2017 11:00:50 -0400 Subject: Added face customization closes #124 --- lisp/mastodon-tl.el | 19 +++++++++++-------- lisp/mastodon.el | 26 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 8 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index b3550c6..c48ca2d 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -109,10 +109,11 @@ Optionally start from POS." (concat (when mastodon-media-show-avatars-p (mastodon-media--get-avatar-rendering avatar-url)) - (propertize name 'face 'warning) - " (@" - handle - ")"))) + (propertize name 'face 'mastodon-display-name-face) + (propertize (concat " (@" + handle + ")") + 'face 'mastodon-handle-face)))) (defun mastodon-tl--byline-boosted (toot) "Add byline for boosted data from TOOT." @@ -120,7 +121,7 @@ Optionally start from POS." (when reblog (concat " " - (propertize "Boosted" 'face 'highlight) + (propertize "Boosted" 'face 'mastodon-boosted-face) " " (mastodon-tl--byline-author reblog))))) @@ -140,9 +141,11 @@ Return value from boosted content if available." (propertize (concat (propertize "\n | " 'face 'default) (when boosted - (format "(%s) " (propertize "B" 'face 'success))) + (format "(%s) " + (propertize "B" 'face 'mastodon-boost-fave-face))) (when faved - (format "(%s) " (propertize "F" 'face 'success))) + (format "(%s) " + (propertize "F" 'face 'mastodon-boost-fave-face))) (mastodon-tl--byline-author toot) (mastodon-tl--byline-boosted toot) " " @@ -172,7 +175,7 @@ also render the html" (message (concat "\n ---------------" "\n Content Warning" "\n ---------------\n")) - (cw (mastodon-tl--set-face message 'success nil))) + (cw (mastodon-tl--set-face message 'mastodon-cw-face nil))) (if (> (length string) 0) (replace-regexp-in-string "\n\n\n ---------------" "\n ---------------" (concat string cw)) diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 0dd7f10..92220dc 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -82,6 +82,32 @@ Use. e.g. \"%c\" for your locale's date and time format." :options '(provide-discover-context-menu) :group 'mastodon) +(defcustom mastodon-mode-hook nil + "Hook run when entering Mastodon mode." + :type 'hook + :options '(provide-discover-context-menu) + :group 'mastodon) + +(defface mastodon-handle-face + '((t :inherit default)) + "Face used for user display names.") + +(defface mastodon-display-name-face + '((t :inherit warning)) + "Face used for user display names.") + +(defface mastodon-boosted-face + '((t :inherit highlight :weight bold)) + "Face to indicate that a toot is boosted.") + +(defface mastodon-boost-fave-face + '((t :inherit success)) + "Face to indicate that you have boosted or favourited a toot.") + +(defface mastodon-cw-face + '((t :inherit success)) + "Face used for content warning.") + (defun mastodon-version () "Message package version." (interactive) -- cgit v1.2.3 From 58e88a3c1389546e4eac3be9e3de6ed1060175f2 Mon Sep 17 00:00:00 2001 From: Alexander Griffith Date: Sat, 13 May 2017 11:03:34 -0400 Subject: removed accidentally duplicated mastodon-mode-hook --- lisp/mastodon.el | 6 ------ 1 file changed, 6 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 92220dc..d17eba4 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -76,12 +76,6 @@ Use. e.g. \"%c\" for your locale's date and time format." (defvar mastodon--api-version "v1") -(defcustom mastodon-mode-hook nil - "Hook run when entering Mastodon mode." - :type 'hook - :options '(provide-discover-context-menu) - :group 'mastodon) - (defcustom mastodon-mode-hook nil "Hook run when entering Mastodon mode." :type 'hook -- cgit v1.2.3 From 2f4dc17ac2732e266bbf333132da20e9223cccd8 Mon Sep 17 00:00:00 2001 From: Johnson Denen Date: Mon, 15 May 2017 09:15:54 -0400 Subject: Close #76 * Delete version variable and function * Use package-file --- Cask | 2 +- lisp/mastodon.el | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'lisp') diff --git a/Cask b/Cask index 263998e..599efa2 100644 --- a/Cask +++ b/Cask @@ -1,7 +1,7 @@ (source gnu) (source melpa) -(package "mastodon" "0.6.2" "Emacs client for Mastodon") +(package-file "lisp/mastodon.el") (files "lisp/*.el") (development diff --git a/lisp/mastodon.el b/lisp/mastodon.el index d17eba4..b41405e 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -38,9 +38,6 @@ :prefix "mastodon-" :group 'external) -(defconst mastodon-version "0.6.2" - "Current `mastodon' package version.") - (defcustom mastodon-instance-url "https://mastodon.social" "Base URL for the Masto instance from which you toot." :group 'mastodon @@ -102,11 +99,6 @@ Use. e.g. \"%c\" for your locale's date and time format." '((t :inherit success)) "Face used for content warning.") -(defun mastodon-version () - "Message package version." - (interactive) - (message "Mastodon version %s" mastodon-version)) - ;;;###autoload (defun mastodon () "Connect Mastodon client to `mastodon-instance-url' instance." @@ -121,7 +113,7 @@ Use. e.g. \"%c\" for your locale's date and time format." If USER is non-nil, insert after @ symbol to begin new toot. If REPLY-TO-ID is non-nil, attach new toot to a conversation." (interactive) - (require 'mastodon-toot nil t) + (require 'mastodon-toot nil t) (mastodon-toot--compose-buffer user reply-to-id)) ;;;###autoload -- cgit v1.2.3