summaryrefslogtreecommitdiff
path: root/basic.el
diff options
context:
space:
mode:
Diffstat (limited to 'basic.el')
-rw-r--r--basic.el50
1 files changed, 50 insertions, 0 deletions
diff --git a/basic.el b/basic.el
index fcc6ed1..97b5345 100644
--- a/basic.el
+++ b/basic.el
@@ -148,6 +148,56 @@ window, then also delete the selected window."
;;;###autoload
(setq set-mark-command-repeat-pop t)
+;;; I prefer going to the top first.
+
+;; But I don't really like always going to the top. I am still
+;; thinking about solutions.
+
+(setq recenter-positions (list 'middle 'top 'bottom))
+
+;;; Pulse the current line
+
+;;;###autoload
+(defface prot-pulse-line
+ '((default :extend t)
+ (((class color) (min-colors 88) (background light))
+ :background "#8eecf4")
+ (((class color) (min-colors 88) (background dark))
+ :background "#004065")
+ (t :inverse-video t))
+ "Default face for `durand-pulse-pulse-line'.
+I stole from Protesilaos' dotemacs.")
+
+(require 'pulse)
+
+;;;###autoload
+(defun durand-pulse-pulse-line (&optional face)
+ "Temporarily highlight the current line with optional FACE."
+ (interactive)
+ (let ((start (cond
+ ((= (point) (point-max))
+ (save-excursion
+ (forward-line -1)
+ (point)))
+ ((save-excursion
+ (forward-line 0)
+ (point)))))
+ (end (save-excursion
+ (forward-line 1)
+ (point)))
+ (pulse-delay .04)
+ (face (or face 'prot-pulse-line)))
+ (pulse-momentary-highlight-region start end face)))
+
+(define-key global-map (vector 's-escape) #'durand-pulse-pulse-line)
+
+;;;###autoload
+(defun durand-pulse-recenter-top ()
+ "Recenter to the top and pulse the line."
+ (interactive)
+ (recenter 0)
+ (durand-pulse-pulse-line))
+
;;; auto-fill for texts
(set 'adaptive-fill-mode t)