From 35c88720df50aba03b5630fa3c5c9271a216c6fe Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 12 Apr 2022 22:39:44 -0500 Subject: Fix requires --- lisp/+ispell.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/+ispell.el b/lisp/+ispell.el index 697233f..fbfc0f0 100644 --- a/lisp/+ispell.el +++ b/lisp/+ispell.el @@ -4,7 +4,8 @@ ;;; Code: -(require 'cl) +(require 'cl-lib) +(require 'seq) ;; Utility function TODO: move elsewhere (defun +ispell-append-removing-duplicates (&rest lists) -- cgit 1.4.1-21-gabe81 From 4d837621919eb0c464b1bfc8fc29df578e6394e2 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 12 Apr 2022 22:39:52 -0500 Subject: Rebind M-u --- init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/init.el b/init.el index 6f8004b..d926f6b 100644 --- a/init.el +++ b/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) -- cgit 1.4.1-21-gabe81 From a27eb917b87b0d1cf58a5b5712dc69f808161571 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 12 Apr 2022 22:40:00 -0500 Subject: Use ispell or aspell --- init.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.el b/init.el index d926f6b..e492abb 100644 --- a/init.el +++ b/init.el @@ -445,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)) -- cgit 1.4.1-21-gabe81 From f93e8df8cffb2ad9673efa794761d52b84f9b51d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 12 Apr 2022 22:40:11 -0500 Subject: Bind org-store-link --- init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index e492abb..ab74e0b 100644 --- a/init.el +++ b/init.el @@ -615,7 +615,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) -- cgit 1.4.1-21-gabe81 From b868fa30e8603e93cee823e245298548a85652dc Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 12 Apr 2022 22:40:28 -0500 Subject: Configure undoes --- init.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index ab74e0b..0a5a4fa 100644 --- a/init.el +++ b/init.el @@ -2164,6 +2164,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)) @@ -2171,9 +2172,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) -- cgit 1.4.1-21-gabe81 From ca1823d2b29227c6e83fe951d7fe7699cf84d6f5 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 12 Apr 2022 22:40:37 -0500 Subject: Add shr-heading from oantolin --- init.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 0a5a4fa..b38e4e8 100644 --- a/init.el +++ b/init.el @@ -780,8 +780,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) -- cgit 1.4.1-21-gabe81 From 3970a88dd9dd72c41bf1350fe2aae21da2ec432a Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 12 Apr 2022 22:40:48 -0500 Subject: Remove unused w3m setup form --- init.el | 7 ------- 1 file changed, 7 deletions(-) diff --git a/init.el b/init.el index b38e4e8..bc1016f 100644 --- a/init.el +++ b/init.el @@ -2263,13 +2263,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" -- cgit 1.4.1-21-gabe81 From bb756ce658f2e1a4bf904ce19392fed3015d2463 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 12 Apr 2022 22:41:03 -0500 Subject: Dang ol +shr.el file --- lisp/+shr.el | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 lisp/+shr.el diff --git a/lisp/+shr.el b/lisp/+shr.el new file mode 100644 index 0000000..af4bf5b --- /dev/null +++ b/lisp/+shr.el @@ -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 -- cgit 1.4.1-21-gabe81