From 82d3a1fcc5c36a48b2a404536f89e1d80c48d999 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Sun, 17 Jan 2021 21:38:38 +0800 Subject: Tweak more things. * basic.el (recenter-positions): In effect nothing changed. (prot-pulse-line): Puling the line. (pulse): Useful built-in library. (durand-pulse-pulse-line): My own tweak. (durand-pulse-recenter-top): Recenter and pulse. * init.el (prepare-in-hook-once): Make it interactive. (global-map): Add Org-mode bindings. ("durand-chercher-pdf"): Search PDFs quickly. * modeline.el (modeline-format-left): Remove the vertical bar. * org-conf.el (org-adapt-indentation) (org-modules) (org-hide-emphasis-markers) (org-hide-macro-markers) (org-hide-leading-stars): Steal some configurations from Protesilaos. (global-map) (org-mode-map): Add Org-mode bindings. (durand-pulse-pulse-line): (org-follow-link-hook): Pulse and recenter when following the link. --- basic.el | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'basic.el') 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) -- cgit v1.2.3-18-g5258