diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2022-11-20 00:13:55 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2022-11-20 00:17:39 +0100 |
| commit | 9516643986f40a9423a437592aa58c04aa50b3b3 (patch) | |
| tree | 0290d110ede9c4de5e9185ef6f3958e0e033a079 | |
| parent | aac4dea7862ee3662f1a832217fa605db34d12da (diff) | |
| download | dotfiles-9516643986f40a9423a437592aa58c04aa50b3b3.tar.xz | |
Make .emacs outline-compliant
| -rw-r--r-- | .emacs | 66 |
1 files changed, 33 insertions, 33 deletions
@@ -1,6 +1,6 @@ -;; -*- lexical-binding: t -*- +;;; -*- lexical-binding: t -*- -;; Packages and Custom initialization +;;; Packages and Custom initialization. ;; Letting Custom run *before* initializing packages seems to result ;; in packages resetting some of their variables, eg page-break-lines @@ -27,7 +27,7 @@ (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) -;; Theming +;;; Theming. (when (>= emacs-major-version 28) (setq modus-themes-bold-constructs t @@ -46,7 +46,7 @@ modus-themes-variable-pitch-ui t) (load-theme 'modus-vivendi)) -;; Key bindings +;;; Key bindings. ;; C-h is a special snowflake in many situations; this is the most ;; reliable way I found to consistently get C-h to do what DEL does. @@ -299,9 +299,8 @@ ;; What's life without a little risk? (setq disabled-command-function nil) - -;; Window management +;;; Window management. ;; Bindings ala Terminator (when window-system @@ -314,9 +313,8 @@ (global-set-key (kbd "C-S-<down>") 'shrink-window) (global-set-key (kbd "C-S-<right>") 'enlarge-window-horizontally) (global-set-key (kbd "C-S-<left>") 'shrink-window-horizontally)) - -;; Lighters +;;; Lighters. (defun my/symbol-as-icon (c) ;; By default, Emacs 28 uses color fonts for characters from (1) the @@ -381,7 +379,7 @@ (setq flymake-mode-line-lighter indicator) (delight 'flymake-mode indicator 'flymake)))) -;; Version control. +;;; Version control. (add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh) (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh) @@ -410,7 +408,7 @@ (format "git show --no-patch --date=short --format='%s' %s" "%cd \"%s\" (%h)" rev))))) -;; Major modes configuration +;;; Major modes configuration. (defun my/c-modes-hook () (c-set-style "bsd") @@ -485,10 +483,10 @@ '(when (version< org-version "9.4") (define-key org-mode-map (kbd "C-j") 'org-return) (define-key org-mode-map (kbd "RET") 'org-return-indent))) - -;; Helper functions and miscellaneous settings. +;;; Helper functions and miscellaneous settings. +;;;; French quick toggle. (defun my/froggify () (ispell-change-dictionary "fr") (setq-local colon-double-space nil) @@ -511,7 +509,7 @@ (my/unfroggify) (my/froggify))) -;; Utilities for mailing lists. +;;;; Mailing lists utilities. (defun my/kill-message-id () (interactive) (my/kill (mail-header-message-id (gnus-summary-article-header)))) @@ -563,7 +561,7 @@ (let ((id (xml-substitute-numeric-entities (match-string 1)))) (my/describe-message id url)))) -;; Font stuff 🤷🤦. +;;;; Font stuff 🤷🤦. (when (= emacs-major-version 27) ;; Emacs 27 added support for color fonts, but the default fontset ;; did not use any such font for emoji. @@ -572,6 +570,7 @@ ;; For Emacs 28, prefer VS-16: ⚠️⚙️. (setq use-default-font-for-symbols nil)) +;;;; Frame title. (defun my/project-root () (when-let ((project (project-current))) (car (project-roots project)))) @@ -603,24 +602,7 @@ (setq frame-title-format '(:eval (my/frame-title-format))) -(setq-default paragraph-start (concat "[ ]*- \\|" paragraph-start)) - -(setq completion-ignore-case t - read-buffer-completion-ignore-case t - read-file-name-completion-ignore-case t) - -(defun my/screenshot (output) - (interactive - (list - (let ((default (format-time-string "/tmp/Emacs-Screenshot-%F-%T.pdf"))) - (read-file-name (format-prompt "Output?" default) nil default)))) - (let ((data (x-export-frames)) - (buf (find-file output))) - (insert data) - (save-buffer) - (kill-buffer buf))) - -;; Clipboard interaction. +;;;; Clipboard interaction. (defun my/kill-as-html (text markup) (interactive (list (buffer-substring (region-beginning) (region-end)) @@ -659,5 +641,23 @@ (funcall 'string-join `(,markup ,@disabled-markup-extensions) "-"))) (call-process-region html nil "pandoc" nil t t "--from" html-spec "--to" markup-spec))) + +;;;; Miscellany. +(setq-default paragraph-start (concat "[ ]*- \\|" paragraph-start)) + +(setq completion-ignore-case t + read-buffer-completion-ignore-case t + read-file-name-completion-ignore-case t) + +(defun my/screenshot (output) + (interactive + (list + (let ((default (format-time-string "/tmp/Emacs-Screenshot-%F-%T.pdf"))) + (read-file-name (format-prompt "Output?" default) nil default)))) + (let ((data (x-export-frames)) + (buf (find-file output))) + (insert data) + (save-buffer) + (kill-buffer buf))) -;; TODO: decruftify mode-line (e.g. remove superflous parens) +;;; TODO: decruftify mode-line (e.g. remove superflous parens). |
