Emacs: Move stuff from text/misc to text/common.

This commit is contained in:
tastytea 2020-10-14 21:40:05 +02:00
parent 97ead8c8e6
commit af01f30679
2 changed files with 22 additions and 20 deletions

View File

@ -1,6 +1,6 @@
;;; common.el --- Common settings for text files. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-08-24T01:19:01+0200>
;; Time-stamp: <2020-10-14T21:39:33+0200>
;;; Commentary:
@ -284,8 +284,28 @@
(text-mode . my/ws-load-local-vars-first)
(before-save . my/ws-maybe-cleanup)))
;; ripgrep.
(use-package rg
:bind ("C-c s" . rg-menu))
;; Insert pseudo latin text.
(use-package lorem-ipsum)
;; Translate ANSI escape color codes.
(use-package ansi-color
:config (progn
(defun my/apply-ansi-colors-on-buffer ()
"Apply ANSI colors in the current buffer."
(interactive)
(let ((inhibit-read-only t))
(ansi-color-apply-on-region (point-min) (point-max))))
(defun my/apply-ansi-colors-compilation ()
"Apply ANSI colors in the compilation window."
(let ((inhibit-read-only t))
(ansi-color-apply-on-region compilation-filter-start (point)))))
:mode ("\\.log$" . my/apply-ansi-colors-on-buffer)
:hook (compilation-filter . my/apply-ansi-colors-compilation))
(provide 'text/common)
;;; common.el ends here

View File

@ -1,6 +1,6 @@
;;; misc.el --- Miscellaneous file formats. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-10-14T21:06:39+0200>
;; Time-stamp: <2020-10-14T21:38:52+0200>
;;; Commentary:
@ -100,9 +100,6 @@
("\\.markdown$" . gfm-mode))
:hook (markdown-mode . auto-fill-mode)) ; Wrap at fill-column.
;; Insert pseudo latin text.
(use-package lorem-ipsum)
;; Document editing, formatting, and organizing mode.
(use-package org
:straight nil ; Use built-in version.
@ -191,21 +188,6 @@
:repo "https://anongit.gentoo.org/git/proj/ebuild-mode.git")))
:hook (ebuild-mode . (lambda () (set-fill-column 80))))
;; Translate ANSI escape color codes.
(use-package ansi-color
:config (progn
(defun my/apply-ansi-colors-on-buffer ()
"Apply ANSI colors in the current buffer."
(interactive)
(let ((inhibit-read-only t))
(ansi-color-apply-on-region (point-min) (point-max))))
(defun my/apply-ansi-colors-compilation ()
"Apply ANSI colors in the compilation window."
(let ((inhibit-read-only t))
(ansi-color-apply-on-region compilation-filter-start (point)))))
:mode ("\\.log$" . my/apply-ansi-colors-on-buffer)
:hook (compilation-filter . my/apply-ansi-colors-compilation))
;; Syntax-highlighting mode for text/gemini.
(use-package gemini-mode
:hook (gemini-mode . (lambda() (auto-fill-mode -1))))