From e66b59c9c965eef4038cd276d9cc9aadc5662dc1 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 17 Oct 2022 18:26:02 -0700 Subject: ref(edit): reorganize the module Change-Id: I62d5734643113e51a5b1ddaf59b4773a9c06598a --- emacs/custom/my-edit.el | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'emacs') diff --git a/emacs/custom/my-edit.el b/emacs/custom/my-edit.el index bff7e04..6a9911c 100644 --- a/emacs/custom/my-edit.el +++ b/emacs/custom/my-edit.el @@ -3,18 +3,13 @@ ;;; Commentary: ;;; Code: +(require 'autorevert) -(customize-set-variable 'global-auto-revert-non-file-buffers t) -(customize-set-variable 'auto-revert-verbose nil) -(global-auto-revert-mode t) - -(defun my/whitespace-setup () - "Configure whitespace mode." - (setq-local show-trailing-whitespace t)) +;;; settings +(setq global-auto-revert-non-file-buffers t) +(setq auto-revert-verbose nil) -;; turn on my configuration for white spaces on a few modes -(dolist (hook '(prog-mode-hook text-mode-hook conf-mode-hook outline-mode-hook)) - (add-hook hook 'my/whitespace-setup)) +(global-auto-revert-mode t) (setq show-paren-delay 0 show-paren-highlight-openparen t @@ -22,8 +17,6 @@ show-paren-when-point-in-periphery t) (show-paren-mode 1) -(global-set-key (kbd "M-j") 'join-line) - ;; don't assume that sentences should have two spaces after period. (setq sentence-end-double-space nil) @@ -31,5 +24,17 @@ ;; switched to it using C-x C-q). (setq view-read-only t) +;;; bindings +(global-set-key (kbd "M-j") 'join-line) + +;;; hooks +(defun my/whitespace-setup () + "Configure whitespace mode." + (setq-local show-trailing-whitespace t)) + +;; turn on my configuration for white spaces on a few modes +(dolist (hook '(prog-mode-hook text-mode-hook conf-mode-hook outline-mode-hook)) + (add-hook hook 'my/whitespace-setup)) + (provide 'my-edit) ;;; my-edit.el ends here -- cgit 1.4.1