From a2657993bad828af6743c68931a0e848bfcdec53 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 21 Nov 2021 23:57:41 -0600 Subject: I DECLARE BANKRUPTCY ... 8 Didn't think to do this till pretty .. written, so here we are. --- lisp/acdw-irc.el | 72 -------------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 lisp/acdw-irc.el (limited to 'lisp/acdw-irc.el') diff --git a/lisp/acdw-irc.el b/lisp/acdw-irc.el deleted file mode 100644 index 4427a4d..0000000 --- a/lisp/acdw-irc.el +++ /dev/null @@ -1,72 +0,0 @@ -;;; acdw-irc.el -*- lexical-binding: t; coding: utf-8-unix -*- - -(require 's nil :noerror) - -(defgroup acdw-irc nil - "Customizations for IRC." - :group 'applications) - -(defcustom acdw-irc/left-margin 16 - "The size of the margin for nicks, etc. on the left." - :type 'integer) - -(defcustom acdw-irc/pre-nick "" - "What to show before a nick." - :type 'string) - -(defcustom acdw-irc/post-nick " | " - "What to show after a nick." - :type 'string) - -(defcustom acdw-irc/pre-my-nick "-" - "What to show before the current user's nick." - :type 'string) - -(defcustom acdw-irc/post-my-nick "-> " - "What to show after the current user's nick." - :type 'string) - -(defcustom acdw-irc/ellipsis "~" - "The ellipsis for when a string is too long." - :type 'string) - - -;;; Convenience functions (I don't want to /depend/ on s.el) - -(if (fboundp 's-repeat) - (defalias 'repeat-string 's-repeat) - (defun repeat-string (num s) - "Make a string of STR repeated NUM times. -Stolen from s.el." - (declare (pure t) (side-effect-free t)) - (let (ss) - (while (> num 0) - (setq ss (cons s ss)) - (setq num (1- num))) - (apply 'concat ss)))) - - -;;; IRC stuff - -(defun acdw-irc/margin-format (str &optional before after alignment) - "Print STR to fit in `acdw-irc/left-margin'. -Optional arguments BEFORE and AFTER specify strings to go -... before and after the string. ALIGNMENT aligns left on nil -and right on t." - (let* ((before (or before "")) - (after (or after "")) - (str-length (length str)) - (before-length (length before)) - (after-length (length after)) - (max-length (- acdw-irc/left-margin 1 (+ before-length after-length))) - (left-over (max 0 (- max-length str-length)))) - (format "%s%s%s%s%s" - before - (if alignment (repeat-string left-over " ") "") - (truncate-string max-length str acdw-irc/ellipsis) - (if alignment "" (repeat-string left-over " ")) - after))) - - -(provide 'acdw-irc) -;;; acdw-irc.el ends here -- cgit 1.4.1-21-gabe81