From ef0b630ae290be240d72765522addae9872e0c5f Mon Sep 17 00:00:00 2001 From: Blake DeMarcy Date: Thu, 2 Mar 2017 19:20:11 -0600 Subject: [PATCH] fuck emacs 24 --- bbj.el | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/bbj.el b/bbj.el index 152723a..191fd8e 100644 --- a/bbj.el +++ b/bbj.el @@ -48,6 +48,31 @@ (ignore-errors (evil-set-initial-state 'bbj-mode 'emacs)) +;;;; shit to put up with outdated emacs on the tilde ;;;; + +(when (eq emacs-major-version 24) + + (defun alist-get (key alist &optional default remove) + (ignore remove) ;;Silence byte-compiler. + (let ((x (assq key alist))) + (if x (cdr x) default))) + + (defsubst string-trim-left (string) + "Remove leading whitespace from STRING." + (if (string-match "\\`[ \t\n\r]+" string) + (replace-match "" t t string) + string)) + + (defsubst string-trim-right (string) + "Remove trailing whitespace from STRING." + (if (string-match "[ \t\n\r]+\\'" string) + (replace-match "" t t string) + string)) + + (defsubst string-trim (string) + "Remove leading and trailing whitespace from STRING." + (string-trim-left (string-trim-right string)))) + ;;;; network shit ;;;; (defun bbj:descend (alist &rest keys)