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. --- init.el | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'init.el') diff --git a/init.el b/init.el index f0cbc5b..1b4c8e5 100644 --- a/init.el +++ b/init.el @@ -36,6 +36,7 @@ "Define a function called ENTRY-NAME that loads FILE in HOOK once." `(progn (defun ,entry-name () + (interactive) (remove-hook ',hook ',entry-name) (load-config ,file)) (add-hook ',hook ',entry-name))) @@ -45,7 +46,9 @@ "Load FILE-PATH after FUNCTION-NAME. After loading, execute DEF. Finally if REDEFINE-P is non-nil, -then FUNCTION-NAME will be defined as DEF after loading." +then FUNCTION-NAME will be defined as DEF after loading. + +If FUNCTION-NAME is already a valid function, this won't do anything." (cond ((fboundp function-name)) (t @@ -82,6 +85,12 @@ then FUNCTION-NAME will be defined as DEF after loading." (prepare-in-hook-once prepare-org org-mode-hook "org-conf.el") +(add-hook 'org-mode-hook #'prepare-org) + +(define-key global-map (vector 3 97) #'prepare-org) +(define-key global-map (vector 3 99) #'prepare-org) +(define-key global-map (vector 3 ?l) #'prepare-org) + ;;;###autoload (load-after-function durand-mu4e "mail.el" "Open mu4e." t (mu4e)) @@ -97,6 +106,20 @@ then FUNCTION-NAME will be defined as DEF after loading." (load-after-function bongo "bongo.el" "Listen to music in Emacs." nil (bongo)) +;;; My PDF facilities + +(use-package "durand-chercher-pdf" 'durand-chercher-pdf + (define-key durand-pdf-mode-map (vector ?q) 'quit-window) + (define-key durand-pdf-mode-map (vector ?N) 'forward-line) + (define-key durand-pdf-mode-map (vector ?n) 'durand-pdf-next-pdf-line) + (define-key durand-pdf-mode-map (vector ?P) (lambda () (interactive) (forward-line -1))) + (define-key durand-pdf-mode-map (vector ?p) 'durand-pdf-previous-pdf-line) + (define-key durand-pdf-mode-map (vector 'return) 'durand-pdf-open-pdf) + (define-key durand-pdf-mode-map (vector 32) 'durand-pdf-open-or-scroll-up) + (define-key durand-pdf-mode-map (vector 'backspace) 'durand-pdf-open-or-scroll-down) + (define-key durand-pdf-mode-map (vector ?o) 'kill-other-buffer-window) + (define-key durand-pdf-mode-map (vector ?k) 'kill-current-buffer)) + ;;; gnus (load-config "gnus-conf.el") @@ -160,4 +183,10 @@ then FUNCTION-NAME will be defined as DEF after loading." (define-key global-map (vector ?\s-q) #'window-toggle-side-windows) +;;; server + +;; (cond +;; ((bound-and-true-p server-process)) +;; ((server-start))) + (setq gc-cons-threshold (* 2 1024 1024)) -- cgit v1.2.3-18-g5258