Merge branch 'main' of tildegit.org:acdw/emacs
This commit is contained in:
commit
d26bfd92e1
32
init.el
32
init.el
|
@ -22,6 +22,7 @@
|
|||
(require (or (car-safe feature) feature) (cdr-safe feature) :noerror)))
|
||||
|
||||
(setup (:require +casing)
|
||||
(:global "M-u" #'universal-argument)
|
||||
(+casing-mode +1))
|
||||
|
||||
(setup (:require +emacs)
|
||||
|
@ -444,6 +445,8 @@
|
|||
|
||||
(setup ispell
|
||||
(:also-load +ispell)
|
||||
(:option ispell-program-name (or (executable-find "ispell")
|
||||
(executable-find "aspell")))
|
||||
(put 'ispell-buffer-session-localwords
|
||||
'safe-local-variable #'+ispell-safe-local-p)
|
||||
(add-hook 'user-save-hook #'+ispell-move-buffer-words-to-dir-locals-hook))
|
||||
|
@ -614,7 +617,8 @@
|
|||
"`" #'+org-insert-tilde
|
||||
"~" #'+org-insert-backtick)
|
||||
(:global [f8] #'org-clock-in
|
||||
[f9] #'org-clock-out)
|
||||
[f9] #'org-clock-out
|
||||
"C-c l" #'org-store-link)
|
||||
(:hook #'variable-pitch-mode
|
||||
#'turn-off-auto-fill
|
||||
#'org-indent-mode)
|
||||
|
@ -782,8 +786,12 @@
|
|||
(add-hook 'kill-buffer-query-functions #'+scratch-immortal))
|
||||
|
||||
(setup shr
|
||||
(:also-load +shr)
|
||||
(:option shr-width (- fill-column 5) ; pad out for wide letters
|
||||
shr-use-fonts t))
|
||||
shr-use-fonts t)
|
||||
(dolist (mode '(eww-mode
|
||||
elfeed-show-mode))
|
||||
(add-hook (intern (format "%s-hook" mode)) #'+shr-heading-setup-imenu)))
|
||||
|
||||
(setup tab-bar
|
||||
(:require +tab-bar)
|
||||
|
@ -2166,6 +2174,7 @@ See also `crux-reopen-as-root-mode'."
|
|||
(:option trashed-action-confirmer #'y-or-n-p))
|
||||
|
||||
(setup (:straight undo-fu)
|
||||
(:option undo-fu-allow-undo-in-region t)
|
||||
(:global "C-/" #'undo-fu-only-undo
|
||||
"C-?" #'undo-fu-only-redo))
|
||||
|
||||
|
@ -2173,9 +2182,19 @@ See also `crux-reopen-as-root-mode'."
|
|||
(:option undo-fu-session-incompatible-files '("/COMMIT_EDITMSG\\'"
|
||||
"/git-rebase-todo\\'")
|
||||
undo-fu-session-directory (.etc "undo/" t)
|
||||
undo-fu-session-compression (executable-find "gzip"))
|
||||
undo-fu-session-compression (cond
|
||||
((executable-find "gzip") 'gz)
|
||||
((executable-find "bzip2") 'bz2)
|
||||
((executable-find "xz") 'xz)
|
||||
(t nil)))
|
||||
(global-undo-fu-session-mode +1))
|
||||
|
||||
(setup (:straight (undo-hl
|
||||
:host github
|
||||
:repo "casouri/undo-hl"))
|
||||
(:require)
|
||||
(:hook-into text-mode prog-mode))
|
||||
|
||||
(setup (:straight unfill))
|
||||
|
||||
(setup (:straight valign)
|
||||
|
@ -2250,13 +2269,6 @@ See also `crux-reopen-as-root-mode'."
|
|||
;; (advice-add 'counsel-yank-pop-action :around
|
||||
;; #'+vterm-counsel-yank-pop-action))
|
||||
|
||||
(setup (:straight-when w3m
|
||||
(executable-find "w3m"))
|
||||
;; (+with-ensure-after-init
|
||||
;; (:option browse-url-browser-function #'w3m-browse-url
|
||||
;; +browse-url-browser-function browse-url-browser-function))
|
||||
)
|
||||
|
||||
(setup (:straight web-mode)
|
||||
(setf (alist-get (rx "." (or "htm" "html" "phtml" "tpl.php"
|
||||
"asp" "gsp" "jsp" "ascx" "aspx"
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(require 'cl)
|
||||
(require 'cl-lib)
|
||||
(require 'seq)
|
||||
|
||||
;; Utility function TODO: move elsewhere
|
||||
(defun +ispell-append-removing-duplicates (&rest lists)
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
;;; +shr.el --- SHR extras -*- lexical-binding: t; -*-
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;;; Code:
|
||||
|
||||
;;; [[https://github.com/oantolin/emacs-config/blob/master/my-lisp/shr-heading.el][shr-heading]], by oantolin
|
||||
|
||||
(defun +shr-heading-next (&optional arg)
|
||||
"Move forward by ARG headings (any h1-h4).
|
||||
If ARG is negative move backwards, ARG defaults to 1."
|
||||
(interactive "p")
|
||||
(unless arg (setq arg 1))
|
||||
(catch 'return
|
||||
(dotimes (_ (abs arg))
|
||||
(when (> arg 0) (end-of-line))
|
||||
(if-let ((match
|
||||
(funcall (if (> arg 0)
|
||||
#'text-property-search-forward
|
||||
#'text-property-search-backward)
|
||||
'face '(shr-h1 shr-h2 shr-h3 shr-h4)
|
||||
(lambda (tags face)
|
||||
(cl-loop for x in (if (consp face) face (list face))
|
||||
thereis (memq x tags))))))
|
||||
(goto-char
|
||||
(if (> arg 0) (prop-match-beginning match) (prop-match-end match)))
|
||||
(throw 'return nil))
|
||||
(when (< arg 0) (beginning-of-line)))
|
||||
(beginning-of-line)
|
||||
(point)))
|
||||
|
||||
(defun +shr-heading-previous (&optional arg)
|
||||
"Move backward by ARG headings (any h1-h4).
|
||||
If ARG is negative move forwards instead, ARG defaults to 1."
|
||||
(interactive "p")
|
||||
(+shr-heading-next (- (or arg 1))))
|
||||
|
||||
(defun +shr-heading--line-at-point ()
|
||||
"Return the current line."
|
||||
(buffer-substring (line-beginning-position) (line-end-position)))
|
||||
|
||||
(defun +shr-heading-setup-imenu ()
|
||||
"Setup imenu for h1-h4 headings in eww buffer.
|
||||
Add this function to appropriate major mode hooks such as
|
||||
`eww-mode-hook' or `elfeed-show-mode-hook'."
|
||||
(setq-local
|
||||
imenu-prev-index-position-function #'+shr-heading-previous
|
||||
imenu-extract-index-name-function #'+shr-heading--line-at-point))
|
||||
|
||||
(provide '+shr)
|
||||
;;; +shr.el ends here
|
Loading…
Reference in New Issue