summary refs log tree commit diff stats
path: root/lisp/+pulse.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/+pulse.el')
-rw-r--r--lisp/+pulse.el52
1 files changed, 0 insertions, 52 deletions
diff --git a/lisp/+pulse.el b/lisp/+pulse.el deleted file mode 100644 index eefdd83..0000000 --- a/lisp/+pulse.el +++ /dev/null
@@ -1,52 +0,0 @@
1;;; +pulse.el -*- lexical-binding: t; -*-
2
3;;; Code:
4
5(require 'pulse)
6
7(defgroup +pulse nil
8 "Extra customizations for `pulse'."
9 :group 'pulse
10 :prefix "+pulse-")
11
12(defcustom +pulse-location-commands '(scroll-up-command
13 scroll-down-command
14 recenter-top-bottom
15 other-window
16 switch-to-buffer
17 redraw-frame)
18 "Commands to pulse the current line after.
19Good for finding location."
20 :type '(repeat function))
21
22(defcustom +pulse-location-function '+pulse-line-current-window
23 "What function to call after `+pulse-location-commands'."
24 :type 'function)
25
26;; XXX: this doesn't work yet. I only want to pulse the line in the
27;; active window, so when I have the same buffer viewed in multiple
28;; windows I can still see where my cursor is. To see the issue, C-x
29;; 2 then C-x o a few times.
30(defun +pulse-line-current-window (&rest _)
31 "Pulse the current line, but only if this window is active."
32 (pulse-momentary-highlight-one-line
33 (window-point (selected-window))))
34
35(defun +pulse--advice-remove (symbol where function &optional props)
36 "Remove advice SYMBOL from FUNCTION.
37This uses the same args as `advice-add' for easy toggling.
38WHERE and PROPS are discarded."
39 (ignore where props)
40 (advice-remove symbol function))
41
42(define-minor-mode +pulse-location-mode
43 "After moving locations, pulse where we are."
44 :global t
45 :keymap nil
46 (dolist (command +pulse-location-commands)
47 (funcall
48 (if +pulse-location-mode 'advice-add '+pulse--advice-remove)
49 command :after +pulse-location-function)))
50
51(provide '+pulse)
52;;; +pulse.el ends here