about summary refs log tree commit diff stats
path: root/lisp/acdw.el
diff options
context:
space:
mode:
authorCase Duckworth2021-09-14 16:56:56 -0500
committerCase Duckworth2021-09-14 16:56:56 -0500
commit4c9d8ea075657b1c35d3b7352043725b59525a82 (patch)
tree0534d2f30c690dbe824a34474241d6b5b44bb72f /lisp/acdw.el
parentAdd fat-finger-exit (diff)
downloademacs-4c9d8ea075657b1c35d3b7352043725b59525a82.tar.gz
emacs-4c9d8ea075657b1c35d3b7352043725b59525a82.zip
~mehehheheh
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r--lisp/acdw.el33
1 files changed, 26 insertions, 7 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index b8a1906..0790f2e 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -54,6 +54,16 @@ ARG). When called with multiple arguments or a list, it returns
54;; I don't prefix these because ... reasons. Honestly I probably should prefix 54;; I don't prefix these because ... reasons. Honestly I probably should prefix
55;; them. 55;; them.
56 56
57(defun truncate-string (len str &optional ellipsis)
58 "If STR is longer than LEN, cut it down and add ELLIPSIS to the end.
59When not specified, ELLIPSIS defaults to '...'."
60 (declare (pure t) (side-effect-free t))
61 (unless ellipsis
62 (setq ellipsis "..."))
63 (if (> (length str) len)
64 (format "%s%s" (substring str 0 (- len (length ellipsis))) ellipsis)
65 str))
66
57;; Why isn't this a thing??? 67;; Why isn't this a thing???
58(defmacro fbound-and-true-p (func) 68(defmacro fbound-and-true-p (func)
59 "Return the value of function FUNC if it is bound, else nil." 69 "Return the value of function FUNC if it is bound, else nil."
@@ -366,10 +376,15 @@ first."
366 (goto-char (point-min)) 376 (goto-char (point-min))
367 (kill-line) 377 (kill-line)
368 (insert extracted-heading)) 378 (insert extracted-heading))
369 (replace-regexp org-property-drawer-re "") ;Delete properties 379 ;; Delete property drawers
370 (replace-regexp org-logbook-drawer-re "") ;Delete logbook 380 (replace-regexp org-property-drawer-re "")
381 ;; Delete logbook drawers
382 (replace-regexp org-logbook-drawer-re "")
383 ;; Replace list items with their contents, paragraphed
371 (replace-regexp org-list-full-item-re " 384 (replace-regexp org-list-full-item-re "
372\4") 385\4")
386 ;; Delete comment lines
387 (replace-regexp (concat org-comment-regexp ".*$") "")
373 ;; Re-fill text for clipboard 388 ;; Re-fill text for clipboard
374 (unfill-region (point-min) (point-max)) 389 (unfill-region (point-min) (point-max))
375 (flush-lines "^$" (point-min) (point-max))) 390 (flush-lines "^$" (point-min) (point-max)))
@@ -626,12 +641,16 @@ This function is internal. Use `acdw/make-password-fetcher' instead."
626 (setq-local blink-matching-paren nil 641 (setq-local blink-matching-paren nil
627 show-paren-mode nil))) 642 show-paren-mode nil)))
628 643
629;;; uh 644
630(defun 💩 (n) 645;;; 💩
631 "💩 x N" 646(defun 💩 (&optional n)
647 "💩 x N."
632 (interactive "p") 648 (interactive "p")
633 (dotimes (or n 1) 649 (let ((n (or n 1)))
634 (insert "💩"))) 650 (while (> n 0)
651 (insert "💩")
652 (setq n (1- n)))))
653
635 654
636;;; Fat finger solutions 655;;; Fat finger solutions
637(defun acdw/fat-finger-exit (&optional prefix) 656(defun acdw/fat-finger-exit (&optional prefix)