diff options
-rw-r--r-- | lisp/acdw.el | 18 |
1 files changed, 18 insertions, 0 deletions
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 | |||
66 | file | 66 | file |
67 | nil))) | 67 | nil))) |
68 | 68 | ||
69 | ;; Why isn't this a thing??? | ||
70 | (defmacro fbound-and-true-p (func) | ||
71 | "Return the value of function FUNC if it is bound, else nil." | ||
72 | `(and (fboundp ,func) ,func)) | ||
73 | |||
69 | (defun kill-region-or-backward-word (arg) | 74 | (defun kill-region-or-backward-word (arg) |
70 | "Kill region if active, or backward word if not." | 75 | "Kill region if active, or backward word if not." |
71 | (interactive "p") | 76 | (interactive "p") |
@@ -509,6 +514,11 @@ It's called 'require-private' for historical reasons." | |||
509 | "A mode for reading." | 514 | "A mode for reading." |
510 | :init-value nil | 515 | :init-value nil |
511 | :lighter " Read" | 516 | :lighter " Read" |
517 | :keymap (let ((map (make-sparse-keymap))) | ||
518 | (when-let ((link-cmd (or (fbound-and-true-p #'ace-link) | ||
519 | (fbound-and-true-p #'link-hint-open-link)))) | ||
520 | (define-key map (kbd "o") link-cmd)) | ||
521 | map) | ||
512 | (if acdw/reading-mode | 522 | (if acdw/reading-mode |
513 | (progn ;; turn on | 523 | (progn ;; turn on |
514 | ;; settings | 524 | ;; settings |
@@ -592,5 +602,13 @@ It's called 'require-private' for historical reasons." | |||
592 | secret)) | 602 | secret)) |
593 | (message "Password not found for %S" params)))) | 603 | (message "Password not found for %S" params)))) |
594 | 604 | ||
605 | |||
606 | ;;; Paren annoyances | ||
607 | (defun acdw/stop-paren-annoyances (&optional buffer) | ||
608 | "Locally turn off paren-checking functions in BUFFER." | ||
609 | (with-current-buffer (or buffer (current-buffer)) | ||
610 | (setq-local blink-matching-paren nil | ||
611 | show-paren-mode nil))) | ||
612 | |||
595 | (provide 'acdw) | 613 | (provide 'acdw) |
596 | ;;; acdw.el ends here | 614 | ;;; acdw.el ends here |