From 8d83fda905355281e504c24db1970f6791b90c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=E1=BA=A5n-Anh=20Nguy=E1=BB=85n?= Date: Wed, 24 Apr 2019 19:03:46 +0700 Subject: [PATCH] Switch to `use-package' for `ublt-communication' --- config/ublt-communication.el | 85 +++++++++++++++++------------------- init.el | 3 +- 2 files changed, 42 insertions(+), 46 deletions(-) diff --git a/config/ublt-communication.el b/config/ublt-communication.el index 396b7f4..226926f 100644 --- a/config/ublt-communication.el +++ b/config/ublt-communication.el @@ -2,7 +2,17 @@ ;;; Twitter -(ublt/set-up 'twittering-mode +(use-package twittering-mode + :custom ((twittering-status-format + "%i %s%RT{%FACE[ublt-twitter-meta-face]{ ♽ }%FACE[ublt-twitter-meta-retweet]{%s}}%FACE[ublt-twitter-meta-reply]{%r}%FACE[ublt-twitter-meta-face]{ %@}%FACE[ublt-twitter-meta-location]{ from %f%L}\n %t") + (twittering-url-show-status nil) + (twittering-timer-interval 600) + (twittering-use-master-password t) + (twittering-use-icon-storage t) + (twittering-display-remaining t) + (twittering-use-native-retweet t) + (twittering-number-of-tweets-on-retrieval 100)) + :config (twittering-icon-mode +1) (defgroup ubolonton nil "" @@ -21,59 +31,46 @@ '((t (:inherit ublt-twitter-meta-face))) "") - (setq twittering-status-format - "%i %s%RT{%FACE[ublt-twitter-meta-face]{ ♽ }%FACE[ublt-twitter-meta-retweet]{%s}}%FACE[ublt-twitter-meta-reply]{%r}%FACE[ublt-twitter-meta-face]{ %@}%FACE[ublt-twitter-meta-location]{ from %f%L}\n %t" - ;; "%i %s %FACE[ublt-twitter-meta-face]{%@ from %f%L%r}%FACE[shadow]{%R}\n\t%t" - ;; "%i %s: %t\n\t%FACE[ublt-twitter-meta-face]{%@ from %f%L%r%R}" - twittering-url-show-status nil - twittering-timer-interval 600 - twittering-use-master-password t - twittering-use-icon-storage t - twittering-display-remaining t - twittering-use-native-retweet t - twittering-number-of-tweets-on-retrieval 100 - ) (add-hook 'twittering-mode-hook (ublt/on-fn 'hl-line-mode)) (add-hook 'twittering-mode-hook (ublt/on-fn 'adaptive-wrap-prefix-mode)) (add-hook 'twittering-edit-mode-hook (ublt/off-fn 'auto-fill-mode)) - (add-hook 'twittering-edit-mode-hook (ublt/on-fn 'visual-line-mode)) - ) + (add-hook 'twittering-edit-mode-hook (ublt/on-fn 'visual-line-mode))) ;;; ERC -(ublt/set-up 'erc - (setq erc-autojoin-channels-alist - '(("freenode.net" "#emacs" "#conkeror" "#clojure" "#concatenative" "#flink")) +(use-package erc + :straight nil + :custom ((erc-autojoin-channels-alist + '(("freenode.net" "#emacs" "#conkeror" "#clojure" "#concatenative" "#flink"))) - erc-server "irc.freenode.net" - erc-port 6667 - erc-nick "ubolonton" - erc-try-new-nick-p nil + (erc-server "irc.freenode.net") + (erc-port 6667) + (erc-nick "ubolonton") + (erc-try-new-nick-p nil) - erc-hide-list '("JOIN" "PART" "QUIT" "NICK") - erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE" - "324" "329" "332" "333" "353" "477") + (erc-hide-list '("JOIN" "PART" "QUIT" "NICK")) + (erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE" + "324" "329" "332" "333" "353" "477")) - erc-auto-query 'buffer + (erc-auto-query 'buffer) - erc-log-channels-directory "~/erc_logs/" - erc-save-buffer-on-part t - erc-save-queries-on-quit t - erc-log-write-after-send t - erc-log-write-after-insert t) - (defun ublt/erc () - (interactive) - (erc :server "irc.freenode.net" :port 6667 :nick "ubolonton" - :password (read-passwd "Password on freenode: ")))) + (erc-log-channels-directory "~/erc_logs/") + (erc-save-buffer-on-part t) + (erc-save-queries-on-quit t) + (erc-log-write-after-send t) + (erc-log-write-after-insert t)) + :config (defun ublt/erc () + (interactive) + (erc :server "irc.freenode.net" :port 6667 :nick "ubolonton" + :password (read-passwd "Password on freenode: ")))) -;;; scpaste -(ublt/set-up 'scpaste - (setq scpaste-scp-destination "ubolonton@ubolonton.org:/home/ubolonton/paste" - scpaste-http-destination "https://ubolonton.org/paste" - scpaste-footer (concat "

Generated by " - user-full-name - " using scpaste at %s. " - (cadr (current-time-zone)) ". (original)

"))) - +;;; Publish highlighted code fragments. +(use-package scpaste + :custom ((scpaste-scp-destination "ubolonton@ubolonton.org:/home/ubolonton/paste") + (scpaste-http-destination "https://ubolonton.org/paste") + (scpaste-footer (concat "

Generated by " + user-full-name + " using scpaste at %s. " + (cadr (current-time-zone)) ". (original)

")))) (provide 'ublt-communication) diff --git a/init.el b/init.el index a50117c..9cdb6f1 100644 --- a/init.el +++ b/init.el @@ -17,7 +17,7 @@ yasnippet yasnippet-snippets textmate undo-tree whole-line-or-region - avy twittering-mode keyfreq + avy keyfreq ag expand-region popwin ; make unimportant windows transient @@ -29,7 +29,6 @@ projectile ; Project management emms ; Music paredit ; Structural editing with ()[]{} - scpaste ; Publish highlighted code fragments exec-path-from-shell ; Uhm, f*ck shell pabbrev ; TODO: Find better alternative ;; Vim emulation