From 54af5c2bc4957a9efe6cdeb38d4098fb50097b08 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 2 Sep 2021 17:08:19 -0500 Subject: Add functions and shit --- lisp/acdw.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lisp/acdw.el') diff --git a/lisp/acdw.el b/lisp/acdw.el index 414b892..b7cf4f0 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -66,6 +66,11 @@ ARG). When called with multiple arguments or a list, it returns file nil))) +;; Why isn't this a thing??? +(defmacro fbound-and-true-p (func) + "Return the value of function FUNC if it is bound, else nil." + `(and (fboundp ,func) ,func)) + (defun kill-region-or-backward-word (arg) "Kill region if active, or backward word if not." (interactive "p") @@ -509,6 +514,11 @@ It's called 'require-private' for historical reasons." "A mode for reading." :init-value nil :lighter " Read" + :keymap (let ((map (make-sparse-keymap))) + (when-let ((link-cmd (or (fbound-and-true-p #'ace-link) + (fbound-and-true-p #'link-hint-open-link)))) + (define-key map (kbd "o") link-cmd)) + map) (if acdw/reading-mode (progn ;; turn on ;; settings @@ -592,5 +602,13 @@ It's called 'require-private' for historical reasons." secret)) (message "Password not found for %S" params)))) + +;;; Paren annoyances +(defun acdw/stop-paren-annoyances (&optional buffer) + "Locally turn off paren-checking functions in BUFFER." + (with-current-buffer (or buffer (current-buffer)) + (setq-local blink-matching-paren nil + show-paren-mode nil))) + (provide 'acdw) ;;; acdw.el ends here -- cgit 1.4.1-21-gabe81